mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-02-06 11:31:08 -05:00
* 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.
20 lines
430 B
Bash
Executable File
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/
|