Skip to content

Commit 4eef6d9

Browse files
committed
Readme: corrected permission config with respect to more security
1 parent ddf3695 commit 4eef6d9

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,28 @@
4242
> This setup ensures that your user as well as the `www-data` user are allowed to write files to web directory (the minimum need of permissions)
4343
4444
The following configuration is the commonly recommended set-up for your web server folder:
45-
(Source: https://dev.to/phlash909/comment/ahf6)
4645

4746
1. First, make sure `www-data` group exists and add your current login:
48-
_(if you are using another distro than Raspbian/Raspberry Pi OS the username of web server can differ)_
49-
`sudo groupadd www-data`
50-
`sudo usermod -a -G www-data www-data`
47+
_(if you are using another distro than Raspbian/Raspberry Pi OS the username of web server can differ)_<br>
48+
`sudo groupadd www-data`<br>
49+
`sudo usermod -a -G www-data www-data`<br>
5150
`sudo usermod -a -G www-data <yourlogin>` (replace `<yourlogin>` with your username)
5251

53-
2. Second, give the ownership of web folder to the `www-data` group and user. The following commands ensure that group members (including your own login) are able to write/edit files:
54-
`sudo chgrp -R www-data /var/www/html`
55-
`sudo chown -R www-data /var/www/html`
56-
`sudo chmod -R 775 /var/www/html`
52+
2. Second, give the ownership of web folder to the `www-data` group and *your* user. The following commands ensure that you have _full_ access on the files and group members (www-data) are able to write/edit files _only in the dashboard folder_:<br>
53+
`sudo chown -R <yourlogin>:www-data /var/www/html` (replace `<yourlogin>` with your username)<br>
54+
`sudo chmod -R 755 /var/www/html`
5755

5856
3. Reboot your RPi (for permission changes to take effect)
5957

60-
> An erroneous permission typically results in the situation where the user responsible for web server (e.g. `www-data`) does not have rights to create/modify the local config file for saving your dashboard adjustments (your custom thresholds, password etc.). In this case, the dashboard won't work at all and throwing this error (see #22).
58+
> An erroneous permission typically results in the situation where the user responsible for web server (e.g. `www-data`) does not have rights to create/modify the local config file for saving your dashboard adjustments (your custom thresholds, password etc.). In this case, the dashboard won't work at all and throwing this error.
6159
6260
### Setup project
6361

6462
- navigate to your web folder (`cd /var/www/html`)
6563
- clone this Github repository: `git clone https://github.com/femto-code/Rasberry-Pi-Dashboard.git {your_subfolder_name}`
66-
- **DONE!** Open web browser with URL: `http://IP_OF_YOUR_RPI/{your_subfolder_name}`
67-
> Note: replace {your_subfolder_name} with your choice accordingly. You can also rename the base folder at any time afterwards.
64+
- Run `sudo chmod -R 775 /var/www/html/<your_subfolder_name>` to set correct permissions
65+
- **DONE!** Open web browser with URL: `http://IP_OF_YOUR_RPI/<your_subfolder_name>`
66+
> Note: replace <your_subfolder_name> with your choice of subfolder name accordingly. You can also rename the base folder at any time afterwards.
6867
6968
## Configuration / Help
7069

0 commit comments

Comments
 (0)