mirror of
https://github.com/YunoHost-Apps/firefly-iii_ynh.git
synced 2024-09-03 18:36:13 +02:00
Set rights
This commit is contained in:
parent
9fde417d53
commit
c3101ca39c
4 changed files with 13 additions and 38 deletions
|
@ -28,11 +28,6 @@ ynh_script_progression --message="Loading installation settings..."
|
|||
|
||||
# Needed for helper "ynh_add_nginx_config"
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
|
||||
# Add settings here as needed by your application
|
||||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
#db_user=$db_name
|
||||
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -86,6 +86,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|||
|
||||
git clone -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -120,7 +124,7 @@ ynh_script_progression --message="Modifying a config file..."
|
|||
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
|
||||
|
||||
chmod 400 "$final_path/.env"
|
||||
chown $app:$app "$final_path/.env"
|
||||
chown $app "$final_path/.env"
|
||||
|
||||
#=================================================
|
||||
# DEPLOY
|
||||
|
@ -133,17 +137,6 @@ pushd "$final_path"
|
|||
php$phpversion artisan passport:install
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Securing files and directories..."
|
||||
|
||||
# Set right permissions
|
||||
chown -R $app: $final_path
|
||||
chmod -R 775 $final_path/storage
|
||||
|
||||
#=================================================
|
||||
# SETUP A CRON
|
||||
#=================================================
|
||||
|
|
|
@ -65,13 +65,9 @@ ynh_script_progression --message="Restoring the app main directory..."
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring user rights..."
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
|
|
|
@ -140,6 +140,10 @@ then
|
|||
fi
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -171,8 +175,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Updating PHP dependencies..."
|
||||
|
||||
chown -R $app: $final_path
|
||||
|
||||
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
|
||||
|
||||
#=================================================
|
||||
|
@ -183,7 +185,7 @@ ynh_script_progression --message="Modifying a config file..."
|
|||
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
|
||||
|
||||
chmod 400 "$final_path/.env"
|
||||
chown $app:$app "$final_path/.env"
|
||||
chown $app "$final_path/.env"
|
||||
|
||||
#=================================================
|
||||
# DEPLOYMENT
|
||||
|
@ -207,17 +209,6 @@ ynh_script_progression --message="Upgrading logrotate configuration..."
|
|||
# Use logrotate to manage app-specific logfile(s)
|
||||
ynh_use_logrotate --non-append
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Securing files and directories..."
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod -R 775 $final_path/storage
|
||||
|
||||
#=================================================
|
||||
# SETUP A CRON
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue