1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/humhub_ynh.git synced 2024-09-03 19:26:11 +02:00

Merge pull request #11 from YunoHost-Apps/remove-world-readable

Remove rwx rights to other than root, www-data or $app
This commit is contained in:
Nils Van Zuijlen 2021-04-08 14:27:24 +02:00 committed by GitHub
commit f75915b9f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -190,9 +190,13 @@ ynh_store_file_checksum --file="$final_path/protected/config/common.php"
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
# Set permissions to app files # Set permissions on app files
chown -R root: $final_path chown -R root: $final_path
# Remove permission to others than $app and www-data (nginx user)
chmod o-rwx $final_path
chown $app:www-data $final_path
chown -R $app $final_path/assets chown -R $app $final_path/assets
chown -R $app $final_path/protected/config chown -R $app $final_path/protected/config
chown -R $app $final_path/protected/modules chown -R $app $final_path/protected/modules

View file

@ -72,9 +72,13 @@ ynh_system_user_create --username=$app
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
# Restore permissions on app files # Set permissions on app files
chown -R root: $final_path chown -R root: $final_path
# Remove permission to others than $app and www-data (nginx user)
chmod o-rwx $final_path
chown $app:www-data $final_path
chown -R $app $final_path/assets chown -R $app $final_path/assets
chown -R $app $final_path/protected/config chown -R $app $final_path/protected/config
chown -R $app $final_path/protected/modules chown -R $app $final_path/protected/modules

View file

@ -144,6 +144,10 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/${app}"
# Set permissions on app files # Set permissions on app files
chown -R root: $final_path chown -R root: $final_path
# Remove permission to others than $app and www-data (nginx user)
chmod o-rwx $final_path
chown $app:www-data $final_path
chown -R $app $final_path/assets chown -R $app $final_path/assets
chown -R $app $final_path/protected/config chown -R $app $final_path/protected/config
chown -R $app $final_path/protected/modules chown -R $app $final_path/protected/modules