1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/focalboard_ynh.git synced 2024-09-03 18:36:19 +02:00
This commit is contained in:
ericgaspar 2021-05-27 09:31:10 +02:00
parent f08de1ef65
commit 2f027238ce
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 32 additions and 36 deletions

View file

@ -95,8 +95,9 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
ynh_setup_source --dest_dir="$final_path"
# Set permissions to app files
chown -R $app:$app $final_path
chmod -R 755 $files_path
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# CREATE DIRECTORIES
@ -104,8 +105,8 @@ chmod -R 755 $files_path
files_path=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=files_path --value=$files_path
mkdir -p $files_path/files
chmod -R 755 $files_path
#=================================================
# NGINX CONFIGURATION

View file

@ -53,13 +53,6 @@ test ! -d $final_path \
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_restore_file --origin_path="$final_path"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@ -69,13 +62,15 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE USER RIGHTS
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1
# Restore permissions on app files
chown -R $app:$app $final_path
#chmod -R o-rwx $final_path
chmod 600 $final_path/config.json
ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# SPECIFIC RESTORATION

View file

@ -34,6 +34,14 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If final_path doesn't exist, create it
if [ -z "$files_path" ]; then
files_path=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=files_path --value=$files_path
mkdir -p $files_path/files
chmod -R 755 $files_path
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
@ -64,6 +72,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=3
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -76,6 +92,11 @@ then
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.json"
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod 600 $final_path/config.json
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -91,14 +112,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=2
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=3
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# SETUP SYSTEMD
#=================================================
@ -107,19 +120,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R $app:$app $final_path
chown -R $app:$app $files_path
#chmod -R o-rwx "$final_path"
chmod -R 755 $files_path
chmod 600 $final_path/config.json
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================