1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/paheko_ynh.git synced 2024-09-03 19:56:22 +02:00

fix permisions on folders

This commit is contained in:
rodinux 2024-01-01 21:27:33 +01:00
parent 45daca5967
commit 58053e20ea
3 changed files with 17 additions and 7 deletions

View file

@ -20,8 +20,9 @@ ynh_script_progression --message="Setting up source files..." --weight=4
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod -R u=rX,g=X,o= "$install_dir"
chmod -R u=rX,g=rX,o= "$install_dir/www"
#=================================================
# SYSTEM CONFIGURATION
@ -51,6 +52,9 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config.
chmod 650 "$install_dir/config.local.php"
chown $app:$app "$install_dir/config.local.php"
chown -R $app:www-data "$data_dir/"
chmod -R u=rwX,g=,o= "$data_dir/"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -17,8 +17,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod -R u=rX,g=X,o= "$install_dir"
chmod -R u=rX,g=rX,o= "$install_dir/www"
#=================================================
# RESTORE THE DATA DIRECTORY
@ -27,6 +28,9 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R $app:www-data "$data_dir/"
chmod -R u=rwX,g=,o= "$data_dir/"
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================

View file

@ -70,8 +70,8 @@ then
ynh_setup_source --dest_dir="$install_dir" --keep="config.local.php data/plugins"
fi
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod 650 "$install_dir/config.local.php"
chown $app:$app "$install_dir/config.local.php"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
@ -103,6 +103,8 @@ chown $app:$app "$install_dir/config.local.php"
ynh_replace_string --match_string="//require '$data_dir/data/config.local.user.php';" --replace_string="require '$data_dir/data/config.local.user.php';" --target_file="$install_dir/config.local.php"
chmod -R u=rX,g=X,o= "$install_dir"
chmod -R u=rX,g=rX,o= "$install_dir/www"
#=================================================
# ADD A CONFIG FILE
#=================================================
@ -110,11 +112,11 @@ ynh_replace_string --match_string="//require '$data_dir/data/config.local.user.p
if [ ! -d "$data_dir/data" ]; then
ynh_script_progression --message="Adding a configuration directory..." --weight=5
mkdir "$data_dir/data"
chmod 770 "$data_dir/data"
chown -R $app:www-data "$data_dir/data"
chmod -R u=rwX,g=,o= "$data_dir/data"
else
chown -R $app:www-data "$data_dir/data/cache"
chown $app:www-data "$data_dir/data/index.html"
chown -R $app:www-data "$data_dir/data"
chmod -R u=rwX,g=,o= "$data_dir/data"
fi
if [ ! -f "$data_dir/data/config.local.user.php" ]; then