Files
FreshRSS/cli/access-permissions.sh
Alexandre Alapetite e899e4edd9 More robust application of access permissions (#5062)
* More robust application of access permissions
We were in particular missing directory traversal `+X` in our current recommendations.
Extracted to own shell script so it can easily be invoked.
Update access permissions in Docker to account to be more robust.
#fix https://github.com/FreshRSS/FreshRSS/discussions/5037

* Minor simplification

* Restrict mkdir permissions
Default mkdir permissions are 0777, which is not good for security, so downgrade to 0770.
2023-02-06 15:42:53 +01:00

20 lines
430 B
Bash
Executable File

#!/bin/sh
# Apply access permissions
if [ ! -f './constants.php' ] || [ ! -d './cli/' ]; then
echo >&2 '⛔ It does not look like a FreshRSS directory; exiting!'
exit 2
fi
if [ "$(id -u)" -ne 0 ]; then
echo >&2 '⛔ Applying access permissions require running as root or sudo!'
exit 3
fi
# Based on group access
chown -R :www-data .
# Read files, and directory traversal
chmod -R g+rX .
# Write access
chmod -R g+w ./data/