1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

fix legacy parameter admin_user and base url in reconfigure

This commit is contained in:
Clément 2019-05-23 12:48:48 +02:00
parent 73cb1b5b64
commit 9436601b6f
3 changed files with 26 additions and 10 deletions

View file

@ -33,10 +33,19 @@ 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)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
admin=$(ynh_app_setting_get --app=$app --key=admin)
language=$(ynh_app_setting_get --app=$app --key=language)
if [ -z $admin ]; then
admin=$(ynh_app_setting_get $app admin_user)
if [ -z $admin ]; then
ynh_die --message="no admin user found"
fi;
ynh_app_setting_delete $app admin_user
ynh_app_setting_set $app admin $admin
fi
#=================================================
# CHECK PATHS SYNTAX
@ -96,7 +105,7 @@ fi
# SPECIFIC MODIFICATIONS
#=================================================
$final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url $domain/$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
$final_path/cli/reconfigure.php --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
#=================================================

View file

@ -152,7 +152,7 @@ ynh_add_fpm_config
# SPECIFIC SETUP
#=================================================
ynh_print_info "FreshRSS setup script..."
$final_path/cli/do-install.php --default_user $admin --auth_type http_auth --environment production --base_url $domain/$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
$final_path/cli/do-install.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
# Add users
ynh_print_info "Creating users..."
@ -196,8 +196,8 @@ chown -R $app: $final_path/extensions/
ynh_print_info "Configuring SSOwat..."
#skip api directory
ynh_app_setting_set "$app" unprotected_uris "/api/"
ynh_app_setting_set "$app" unprotected_regex "^\/api\/.*|\/scripts\/api.js$"
ynh_app_setting_delete "$app" unprotected_uris
#=================================================
# RELOAD NGINX

View file

@ -22,7 +22,7 @@ admin=$(ynh_app_setting_get $app admin)
final_path=$(ynh_app_setting_get $app final_path)
language=$(ynh_app_setting_get $app language)
db_name=$(ynh_app_setting_get $app db_name)
db_pwd=$(ynh_app_setting_get $app db_pwd)
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
@ -35,6 +35,15 @@ if [ -z $db_name ]; then
ynh_app_setting_set $app db_name $db_name
fi
if [ -z $admin ]; then
admin=$(ynh_app_setting_get $app admin_user)
if [ -z $admin ]; then
ynh_die --message="no admin user found"
fi;
ynh_app_setting_delete $app admin_user
ynh_app_setting_set $app admin $admin
fi
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
final_path=/var/www/$app
@ -145,15 +154,13 @@ chown -R $app: $final_path/data/
chown -R $app: $final_path/extensions/
# reconfigure application with latest parameters
$final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url $domain/$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
$final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
#=================================================
# SETUP SSOWAT
#=================================================
ynh_print_info "Upgrading SSOwat configuration..."
ynh_app_setting_set "$app" unprotected_uris "/api/"
ynh_app_setting_set "$app" unprotected_regex "^\/api\/.*|\/scripts\/api.js$"
#=================================================
# RELOAD NGINX