mirror of
https://github.com/YunoHost-Apps/etherpad_ynh.git
synced 2024-09-03 18:36:10 +02:00
Set PostgreSQL password
This commit is contained in:
parent
e356bdb7e3
commit
b2283c55d0
3 changed files with 7 additions and 21 deletions
|
@ -81,14 +81,11 @@ ynh_install_nodejs --nodejs_version=$nodejs_version
|
|||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=5
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
db_pwd=$(ynh_string_random --length=30)
|
||||
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||
|
||||
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_name --db_name=$db_name
|
||||
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -183,7 +180,7 @@ yunohost service add $app --description="Collaborative editor." --log="/var/log/
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=6
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is" --timeout="60"
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
@ -193,8 +190,6 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1
|
|||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]
|
||||
then
|
||||
# Everyone can access the app.
|
||||
# The "main" permission is automatically created before the install script.
|
||||
ynh_permission_update --permission "main" --add "visitors"
|
||||
fi
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
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=psqlpwd)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF ETHERPAD CAN BE RESTORED
|
||||
|
|
|
@ -25,7 +25,7 @@ language=$(ynh_app_setting_get --app=$app --key=language)
|
|||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -38,15 +38,6 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
|
||||
|
||||
# Fix is_public as a boolean value
|
||||
if [ "$is_public" = "Yes" ]; then
|
||||
ynh_app_setting_set --app=$app --key=is_public --value=1
|
||||
is_public=1
|
||||
elif [ "$is_public" = "No" ]; then
|
||||
ynh_app_setting_set --app=$app --key=is_public --value=0
|
||||
is_public=0
|
||||
fi
|
||||
|
||||
# If db_name doesn't exist, create it
|
||||
if [ -z "$db_name" ]; then
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
|
@ -178,7 +169,7 @@ yunohost service add $app --description="Collaborative editor." --log="/var/log/
|
|||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=6
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is" --timeout="60"
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
Loading…
Reference in a new issue