mirror of
https://github.com/YunoHost-Apps/miniflux_ynh.git
synced 2024-09-03 19:45:58 +02:00
cleaning
This commit is contained in:
parent
1cce1b2706
commit
62e8fe06f0
3 changed files with 7 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
BASE_URL=https://__DOMAIN____PATH__
|
BASE_URL=https://__DOMAIN____PATH__
|
||||||
LISTEN_ADDR=127.0.0.1:__PORT__
|
LISTEN_ADDR=127.0.0.1:__PORT__
|
||||||
DATABASE_URL=postgres://__DB_NAME__:__DB_PWD__@localhost/__DB_NAME__?sslmode=disable
|
DATABASE_URL=postgres://__DB_USER__:__DB_PWD__@localhost/__DB_NAME__?sslmode=disable
|
||||||
RUN_MIGRATIONS=1
|
RUN_MIGRATIONS=1
|
||||||
CREATE_ADMIN=1
|
CREATE_ADMIN=1
|
||||||
ADMIN_USERNAME=__ADMIN__
|
ADMIN_USERNAME=__ADMIN__
|
||||||
|
|
|
@ -81,9 +81,10 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
||||||
|
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
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_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_psql_test_if_first_run
|
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
|
||||||
|
|
||||||
ynh_psql_execute_as_root --sql="CREATE EXTENSION hstore;" --database=$db_name
|
ynh_psql_execute_as_root --sql="CREATE EXTENSION hstore;" --database=$db_name
|
||||||
|
|
||||||
|
@ -115,6 +116,7 @@ ynh_add_nginx_config
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
ynh_add_config --template="../conf/miniflux.conf" --destination="$final_path/$app.conf"
|
ynh_add_config --template="../conf/miniflux.conf" --destination="$final_path/$app.conf"
|
||||||
|
|
||||||
chmod 600 "$final_path/$app.conf"
|
chmod 600 "$final_path/$app.conf"
|
||||||
chown $app "$final_path/$app.conf"
|
chown $app "$final_path/$app.conf"
|
||||||
|
|
||||||
|
|
|
@ -28,14 +28,14 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
||||||
|
|
||||||
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
|
# STANDARD RESTORATION STEPS
|
||||||
|
@ -79,6 +79,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6
|
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6
|
||||||
|
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||||
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
||||||
|
|
Loading…
Reference in a new issue