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

[FR] WIFI_SSID and WIFI_PWD etc. should be moved to e.g. Configuration_secrets.h #16588

Closed
felixstorm opened this issue Jan 17, 2020 · 8 comments
Labels
T: Feature Request Features requested by users.

Comments

@felixstorm
Copy link
Contributor

Description

As WiFi on the ESP32 now gets more and more functional, it feels a bit unpleasant to put my WiFi credentials inside Configuration_adv.h and then to accidentally push them to my public Marlin repo on GitHub.

My suggestion would be to put them inside a separate config file which only gets included if needed (so the file would not even have to exist for users not using WiFi etc.). Users could then either ignore it completely in Git (or mark as skip-worktree) to not accidentally publish their secrets. I did not choose the name Configuration_WiFi.h but Configuration_secrets.h as I already saw that there might be more secrets to come, e.g. website authentication credentials (luc-github/ESP3DLib@8fc6354) etc.

I will be happy to provide a corresponding PR, I just wanted to check the general opinion on this first before investing more time on it.

@vivian-ng
Copy link
Contributor

@felixstorm If you are using the ESP3DLib, I think @luc-github has made it such that you can set up the WiFi credentials over the webUI. If you compile with the default SSID and password in Configuration_adv.h, ESP3DLib should ignore them, and try to see if any credentials are stored in SPIFFs. If so, it will use those; if not, it will start up an AP. You can then connect to the AP, and configure the WiFi credentials using the webUI. @luc-github can probably share more about how it actually works.

@luc-github
Copy link
Contributor

luc-github commented Jan 17, 2020

WiFi settings can be ignored with ESP3DLib, they can be defined for convenience but they are not mandatory, WiFi credential are stored in NVS for ESP3DLib.

@boelle boelle added the T: Feature Request Features requested by users. label Jan 17, 2020
@boelle boelle changed the title [FR] Should WIFI_SSID and WIFI_PWD etc. be moved to e.g. Configuration_secrets.h? [FR] WIFI_SSID and WIFI_PWD etc. should be moved to e.g. Configuration_secrets.h Jan 17, 2020
@boelle
Copy link
Contributor

boelle commented Jan 17, 2020

i have rephrashed the title as this is a FR and the title suggested it was a question, the former is allowed on the issue list the later is not

@felixstorm
Copy link
Contributor Author

@vivian-ng, @luc-github Yes, you are right and I am aware that you do not need to use the defines in Configuration_adv.h for ESP3DLib but can set up the credentials in the AP web UI.

But I would still consider it bad practice to encourage users to potentially put secret information inside a file that may get pushed to their public GitHub repository.

@vivian-ng
Copy link
Contributor

@felixstorm Maybe the current WiFi portion can be commented to:

// To use your own WiFi SSID and password, uncomment the following line:
//#include "credentials.h"
// To set WiFi SSID and password, put the following to lines into a file called 'credentials.h',
// and replace 'Wifi SSID' and 'Wifi Password' with your own respective SSID and password.
//#define WIFI_SSID "Wifi SSID"
//#define WIFI_PWD  "Wifi Password"

Then, add credentials.h to .gitignore so that it does not get pushed.

What do you think?

@felixstorm
Copy link
Contributor Author

@vivian-ng Yes, that sounds even better than trying to provide an almost blank file to everybody - I will probably post a corresponding PR within the next few days.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests

4 participants