mirror of
https://github.com/YunoHost-Apps/outline_ynh.git
synced 2024-09-03 19:56:12 +02:00
83 lines
3.2 KiB
Bash
83 lines
3.2 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
|
|
#REMOVEME? utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
|
#REMOVEME? dex_app=$(ynh_app_setting_get --app=$app --key=dex_app)
|
|
#REMOVEME? dex_domain=$(ynh_app_setting_get --app=$app --key=dex_domain)
|
|
#REMOVEME? dex_path=$(ynh_app_setting_get --app=$app --key=dex_path)
|
|
#REMOVEME? oidc_secret=$(ynh_app_setting_get --app=$app --key=oidc_secret)
|
|
#REMOVEME? oidc_name=$(ynh_app_setting_get --app=$app --key=oidc_name)
|
|
#REMOVEME? oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback)
|
|
#REMOVEME? dex_auth_uri=$(ynh_app_setting_get --app=$app --key=dex_auth_uri)
|
|
#REMOVEME? dex_token_uri=$(ynh_app_setting_get --app=$app --key=dex_token_uri)
|
|
#REMOVEME? dex_user_uri=$(ynh_app_setting_get --app=$app --key=dex_user_uri)
|
|
|
|
#=================================================
|
|
# STANDARD MODIFICATIONS
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# UPDATING A CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Updating the configuration file..." --weight=1
|
|
|
|
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
|
|
|
|
chmod 400 "$install_dir/.env"
|
|
chown $app:$app "$install_dir/.env"
|
|
|
|
#=================================================
|
|
# RUN DB MIGRATION
|
|
#=================================================
|
|
ynh_script_progression --message="Running DB initial migration..." --weight=3
|
|
|
|
pushd "$install_dir"
|
|
ynh_use_nodejs
|
|
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate
|
|
popd
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# SLACK WARNING
|
|
#=================================================
|
|
ynh_print_info --message="Don't forget to add a new redirction url in your Slack app settings !"
|
|
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|