Closed devinpearson closed 2 years ago
Absolutely.
Can this be made as an option at the end of the installer where a user chooses if they want to enable a password, and set it.
The required package apache2-utils
seems to be included with apache2 or Ubuntu but it can be added to the dependencies just in case that ever changes.
This project already uses a custom /etc/apache2/sites-enabled/000-default.conf file so adding the required settings should be easy. Note the updater script would also currently overwrite the 000-default.conf file if a user updates so re-configuration could be added to the updater, or find a way to make it persistent.
Here is a simple way to get this right with just apache https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04
I'd been playing with options and think I've covered user interactions I can think of:
The method used here is clunky but functional in overwriting 000-default.conf with a file version with the required block (simply commented in/out):
<Directory "/var/www/html"> AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/apache2/.htpasswd Require valid-user </Directory>
I tried messing around with removing the comment #
tag from the desired lines with 'sed' string searches but actually got messier than just overwriting the file. As in this PR:
https://github.com/monero-ecosystem/PiNode-XMR/pull/75
Is there a better way. If it'll do the job then I'll merge it in.
Reviewing this feature request. Did some more basic testing:
From the terminal Settings Menu -> Extra network tools.
As always we can re-open this should further development be needed.
Add optional user authentication to the web console.
Suppose one uses the node on a publicly accessible network or in a shared environment. In that case, they should be able to enable basic authentication to prevent their node from being controlled.