mirror of
https://github.com/YunoHost-Apps/bookwyrm_ynh.git
synced 2024-09-03 18:16:12 +02:00
Fix
This commit is contained in:
parent
2ccf0e3108
commit
b048b94efd
1 changed files with 22 additions and 31 deletions
|
@ -21,14 +21,14 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|||
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$(ynh_app_setting_get --app=$app --key=db_user)
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
#db_user=$(ynh_app_setting_get --app=$app --key=db_user)
|
||||
#db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
|
||||
admin_mail=$(ynh_user_get_info --username=$admin --key=username)
|
||||
key=$(ynh_app_setting_get --app=$app --key=key)
|
||||
#key=$(ynh_string_random --length=32)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -50,30 +50,6 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# If db_name doesn't exist, create it
|
||||
if [ -z "$db_name" ]; then
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
fi
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
final_path=/var/www/$app
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
fi
|
||||
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -109,14 +85,29 @@ chmod 750 "$final_path"
|
|||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
||||
|
||||
datadir=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
|
||||
mkdir -p $datadir
|
||||
mkdir -p $datadir/images
|
||||
|
||||
chmod 750 "$datadir"
|
||||
chmod -R o-rwx "$datadir"
|
||||
chown -R $app:www-data "$datadir"
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing service script..." --weight=1
|
||||
|
||||
ynh_add_config --template="../conf/.env.production" --destination="$final_path/.env"
|
||||
chmod 600 $final_path/.env
|
||||
chown $app:www-data "$final_path/.env"
|
||||
#ynh_add_config --template="../conf/.env.production" --destination="$final_path/.env"
|
||||
#chmod 600 $final_path/.env
|
||||
#chown $app:www-data "$final_path/.env"
|
||||
|
||||
set -a; source "$final_path/.env"; set +a
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue