Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web server to portdunio linux version so the web gui can be served. Configuration doesn't need the CLI Interface anymore for the Linux Version #3265

Closed
wants to merge 29 commits into from

Conversation

marelab
Copy link
Contributor

@marelab marelab commented Feb 22, 2024

Added a Webserver and WebService Interface to the Linux Portdunio Version. It now can deliver the web meshtastice project dist content also in the native linux version. It interfaces to the phoneapi the same way the ESP32 version does but only with Linux libs to get rid of the hardware dependencys of the ESP32 libs. For building under Linux it needs some additional libs these can be installed with bin/prepare-native.sh. To configure the web server the config.yaml got additional settings, that can be changed as needed.

Webserver:
Port: 9001 # Port for Webserver & Webservices
RootPath: /home/marc/web # Root Dir of WebServer

The webserver RootPath has to point to the web/dist diretory of the https://github.com/meshtastic/web project, after it has been build.

@CLAassistant
Copy link

CLAassistant commented Feb 22, 2024

CLA assistant check
All committers have signed the CLA.

@markbirss
Copy link
Contributor

markbirss commented Feb 22, 2024

The webserver RootPath has to point to the web/dist diretory of the https://github.com/meshtastic/web project, after it has been build.

you can use the already build tar for the web folder
[Web Folder]

wget -c https://github.com/meshtastic/web/releases/download/latest/build.tar
mkdir www
cd www
tar xvf ../build.tar
gunzip *

.gitignore Outdated Show resolved Hide resolved
.vscode/extensions.json Show resolved Hide resolved
"typeindex": "cpp",
"typeinfo": "cpp",
"variant": "cpp"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats probably ok, but i'd prefer this in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get corrected to orignal first

arch/portduino/portduino.ini Outdated Show resolved Hide resolved
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo apt -y install openssl libssl-dev libsdl2-dev libulfius-dev liborcania-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be included in the CI builder scripts on github, or the builds will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sorry didn't looked into the build pipline of Github. Then I first have to prepare a change for the build pipeline I guess. I think for native linux build the .github/actions/setup-base/action.yml would be the best place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's something we can do afterwards. i commented more like a todo item :-)

the runners are always picked up from master, you can't fix that here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding these packages to the Pi builder now.

platformio.ini Outdated Show resolved Hide resolved
src/mesh/http/ContentHandler.cpp Outdated Show resolved Hide resolved
@caveman99
Copy link
Member

Also please sign the CLA :-)

thebentern and others added 4 commits February 23, 2024 07:45
…ebServer.h, ContentHandler.cpp, rp2040.ini, nrf52.ini, ContentHelper.cpp, Dockerfile, ContentHandler.h, esp32.ini, stm32wl5e.ini
@jp-bennett
Copy link
Collaborator

It would be nice if there was still a method to compile and run native on distros that don't package libulfias and liborcania.

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo apt -y install openssl libssl-dev libsdl2-dev libulfius-dev liborcania-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's something we can do afterwards. i commented more like a todo item :-)

the runners are always picked up from master, you can't fix that here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure a straightforward way to fix this, but it would be nice if we could still compile on distros that don't package ulfius and orcania. Obviously that would mean no HTTP server support for those distros. Would the only way to pull that off be a different target for HTTP vs no HTTP support?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we can use the #if __has_include() preprocessor statements, which probably gets us most of the way there. I'll play with this more as I have time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thebentern thebentern mentioned this pull request Mar 6, 2024
@jp-bennett
Copy link
Collaborator

Reworked this, and it landed with PR #3343 and #3344

@jp-bennett jp-bennett closed this Mar 7, 2024
@meshtastic-bot
Copy link

This pull request has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/authentication-on-the-tcp-server/14740/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants