diff --git a/conf/config.json b/conf/config.json index fad0d01..264d0c3 100644 --- a/conf/config.json +++ b/conf/config.json @@ -7,7 +7,7 @@ "useSSL": false, "webpath": "./pack", "filesdriver": "local", - "filespath": "./files", + "filespath": "__FILES_PATH__/files", "telemetry": false, "session_expire_time": 2592000, "session_refresh_time": 18000, diff --git a/scripts/install b/scripts/install index 42597ff..f012038 100755 --- a/scripts/install +++ b/scripts/install @@ -86,9 +86,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_name --db_name=$db_name +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE diff --git a/scripts/restore b/scripts/restore index 50ca3ec..09be040 100755 --- a/scripts/restore +++ b/scripts/restore @@ -41,7 +41,8 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS @@ -77,7 +78,7 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$files_path" --not_mandatory -mkdir -p files_path +mkdir -p $files_path/files chmod 755 "$files_path" chmod -R o-rwx "$files_path"