1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00

Fix rights

This commit is contained in:
yalh76 2021-04-11 20:55:26 +02:00
parent 19acfac547
commit 32784cd514
4 changed files with 15 additions and 15 deletions

View file

@ -126,7 +126,7 @@ ynh_setup_source --dest_dir="$final_path/$app" --source_id=$architecture
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R root:$app "$final_path" chown -R $app:$app "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -156,20 +156,17 @@ ynh_script_progression --message="Creating the data directory..."
# Define app's data directory # Define app's data directory
datadir="/home/yunohost.app/${app}" datadir="/home/yunohost.app/${app}"
ynh_app_setting_set --app=$app --key=datadir --value="$datadir"
# Create app folders # Create app folders
mkdir -p "$datadir/" mkdir -p "$datadir/"
mkdir -p "$datadir/uploads/" mkdir -p "$datadir/uploads/"
mkdir -p "$datadir/static/" mkdir -p "$datadir/static/"
mkdir -p "$datadir/static/emoji/" mkdir -p "$datadir/static/emoji/"
# Give permission to the datadir
chown -R "$app":"$app" "$datadir"
ynh_app_setting_set --app=$app --key=datadir --value="$datadir"
chmod 750 "$datadir" chmod 750 "$datadir"
chmod -R o-rwx "$datadir" chmod -R o-rwx "$datadir"
chown -R root:$app "$datadir" chown -R $app:$app "$datadir"
#================================================= #=================================================
# CREATE THE CONFIG DIRECTORY # CREATE THE CONFIG DIRECTORY

View file

@ -21,7 +21,6 @@ port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE

View file

@ -78,7 +78,7 @@ ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R root:$app "$final_path" chown -R $app:$app "$final_path"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -98,7 +98,7 @@ mkdir -p "$datadir/static/emoji/"
chmod 750 "$datadir" chmod 750 "$datadir"
chmod -R o-rwx "$datadir" chmod -R o-rwx "$datadir"
chown -R root:$app "$datadir" chown -R $app:$app "$datadir"
#================================================= #=================================================
# RESTORE THE CONFIG FILE # RESTORE THE CONFIG FILE

View file

@ -189,6 +189,10 @@ then
ynh_setup_source --dest_dir="$final_path/$app" --source_id=$architecture ynh_setup_source --dest_dir="$final_path/$app" --source_id=$architecture
fi fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -218,9 +222,9 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# MODIFY A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Updating a config file..."
config="/etc/$app/config.exs" config="/etc/$app/config.exs"
@ -231,9 +235,6 @@ ynh_backup_if_checksum_is_different --file="$config"
#================================================= #=================================================
ynh_script_progression --message="Making upgrade..." ynh_script_progression --message="Making upgrade..."
# Give permission to the final_path
chown -R "$app":"$app" "$final_path"
pushd $final_path/$app pushd $final_path/$app
su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl migrate" su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl migrate"
popd popd
@ -246,6 +247,9 @@ ynh_script_progression --message="Storing the config file checksum..."
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config" ynh_store_file_checksum --file="$config"
chmod 400 "$config"
chown $app:$app "$config"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================