-
Notifications
You must be signed in to change notification settings - Fork 10
Implemented compatibility layer #1
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
Conversation
… for GET (for reasons I don't understand)
…am_parsing branch merged already and HTTPRequest::getHTTPHeaders()
…ebServer.h also simply crashes when you call the methods at the wrong time
… it isn't used in the standard WebServer examples
…t previously with setContentLength()
…lso because PROGMEM key/cert are not always supported by esp32_https_server.
Everything looks alright, so if there's nothing pending on your side, I'd merge the PR. Just some notes:
To publish the library, ...
Then it should be ready to submit it to PIO and Arduino registries. Any concerns? Otherwise just give me a go and I'll merge + publish. |
Hmm, that ifdeffed out code is a bummer, because that is the code that actually implements the upload. I need to take a look and try to remember what I was actually thinking:-) I also have a completely separate issue where the https server does not seem to work (ssl layer complains) in a program where Bluetooth is also enabled, I presume a memory shortage or something. I'm going to try and fix that too (if the issue is with this repo). I will look into these and post a note here when I think it's ready for merging again. BTW: I really like your CI with the nifty conversion of .ino into main.cpp, I need to adopt that too for other projects. I'm using the |
I ran the code on hardware and expected the upload to only work for the multipart POST upload in the HelloServer example. Since I got the file size in the serial output, I just assumed that to be the intended behavior.
Bluetooth is quite hungry for memory, so that may reduce the number of parallel connections that can be used with TLS. Also, there is only one hardware accelerator for crypto, so must not be accessed by the TLS server and e.g. Bluetooth running on a different core. But I would expect the ESP-IDF to take care of that (at least, mbedtls does this). OpenSSL afair doesn't return semantic error codes, so you don't know what went wrong.
I couldn't use |
The example was still showing too much of its test code origin. Fixed. It's still not an example that will win prizes, but I guess it'll do. |
By the way, I thought of a way to allow your examples to be more convenient to use with CI for real testing, or during development using your private wifi parameters, without having to edit the ino files: if you replace the constructs
by something like
you could set the ssid/password for testing with a carefully constructed
line.... |
I'll try the example again. If there aren't any problems, I'll merge it and prepare the release. For the CI testing on hardware, I used this test repo to get familiar with different build systems. There, I had something running that copies the current password from a local hostapd-based access point into the project configuration (see here). That does pretty much what you suggest plus you don't have to sync a second password store. In that project, I separated the CI apps there from the examples, as the intention of examples is to introduce the library to a new user, so we want to show its functions in small parts, feature by feature. I know that the HTTPS server isn't really beginner-friendly anyway, but I didn't want to put too much stuff/language features in there which aren't strictly necessary. For the CI applications, the situation and goal are different: These apps should cover as much functionality as possible to be able to test it. I even had a Python helper script ready that allowed building and installing the apps on the fly and to integrate that with Python unittests so that each test suite would run only after the corresponding app was flashed and the ESP was reset after each test run. That all worked well. However, sadly, I had to make the main repository with the self-hosted runner private again, as I cannot prevent someone from sending a new GitHub Actions Workflow with a new on push trigger in a PR to the repository, which then will be executed immediately on my Pi/ESP32 setup. The same goes for most other tools that I had a look at. They assume that the tests run in a sandbox/container, where a malicious PR cannot cause harm except for consuming resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it and it seems to work. However, some small issues remain:
- The
file
param was still logged to serial output - Some (probably copy+paste) issues with closing tags in the HTML markup of the example
- I added version-based library dependencies for the examples and the project
- I updated the license in
library.json
(I missed that when creating this lib from a template)
I added suggestions to fix everything. If you're okay with that, you can create a batch commit from all of them, then I'll merge the PR, change the name and version of the lib and release it.
Co-Authored-By: Frank Hessel <[email protected]>
Co-Authored-By: Frank Hessel <[email protected]>
Co-Authored-By: Frank Hessel <[email protected]>
Co-Authored-By: Frank Hessel <[email protected]>
Co-Authored-By: Frank Hessel <[email protected]>
Co-Authored-By: Frank Hessel <[email protected]>
I'm not familiar enough with the GitHub actions. I use travis for CI/CD on GitHub, and until now I haven't done things like hardware tests on GitHub repos. I have done this on gitlab (actually a private gitlab instance), and there I used the |
Thanks for sharing the experience! I had a brief look at Travis, but it seems to be the same problem as with GitHub Actions w.r.t. code injection through PRs. I need to have a look at GitLab and see if/how it's solved there. Assigning tasks to specific runners works with GH Actions, too, but that doesn't prevent a third party from creating a new action with For this PR, I'll just put it on hardware again to run it one last time (don't expect any issues, though) and then merge and create the release. There's one thing left, which I meant to have already commented in the last batch, but I can't find it anymore: The license in library.json (MIT) differs from the one in the repo (LGPL-2.1-only, which is selected according to arduino-esp32). Do you have any concerns if I change it to LGPL? |
No problem at all. |
Hardware test was also successful. |
Added the build-examples action, submitted to PIO and to Arduino. They both require some kind of manual intervention, so it may take some days. |
PlatformIO is ready: https://platformio.org/lib/show/7221/esp32_https_server_compat |
I think the implementation is as feature-complete as it's going to get (i.e.: it works for me:-). The fhessel branch is ready for merging into your repo, as soon as the bodyparser branch has been merged into esp32_https_server.