1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/outline_ynh.git synced 2024-09-03 19:56:12 +02:00

Merge pull request #39 from Limezy/ci-compatible

Ci compatible
This commit is contained in:
Limezy 2022-04-02 20:18:42 +07:00 committed by GitHub
commit 7dc000bdf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 197 additions and 146 deletions

View file

@ -1,14 +1,16 @@
;; Test complet ;; Test complet
; pre-install
sudo yunohost domain add dex.domain.tld
sudo yunohost domain add minio.domain.tld
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
path="/"
language="fr"
is_public=1 is_public=1
password="1Strong-Password" language="fr"
port="666" dex_domain="dex.domain.tld"
slack_key="slack" dex_path="/example"
slack_secret="secret" minio_domain="minio.domain.tld"
minio_domain="sub.domain.tld" minio_admin="package_checker"
minio_password="1Strong-Password"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1
@ -16,7 +18,7 @@
setup_nourl=0 setup_nourl=0
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=0 upgrade=1
#upgrade=1 from_commit=CommitHash #upgrade=1 from_commit=CommitHash
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0

View file

@ -77,9 +77,9 @@ AZURE_RESOURCE_APP_ID=
# Redirect URI is https://<URL>/auth/oidc.callback # Redirect URI is https://<URL>/auth/oidc.callback
OIDC_CLIENT_ID=__OIDC_NAME__ OIDC_CLIENT_ID=__OIDC_NAME__
OIDC_CLIENT_SECRET=__OIDC_SECRET__ OIDC_CLIENT_SECRET=__OIDC_SECRET__
OIDC_AUTH_URI=https://__DEX_DOMAIN____DEX_PATH__auth OIDC_AUTH_URI=__DEX_AUTH_URI__
OIDC_TOKEN_URI=https://__DEX_DOMAIN____DEX_PATH__token OIDC_TOKEN_URI=__DEX_TOKEN_URI__
OIDC_USERINFO_URI=https://__DEX_DOMAIN____DEX_PATH__userinfo OIDC_USERINFO_URI=__DEX_USER_URI__
# Specify which claims to derive user information from # Specify which claims to derive user information from
# Supports any valid JSON path with the JWT payload # Supports any valid JSON path with the JWT payload

View file

@ -1,10 +1,4 @@
location / { location / {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:__PORT__; proxy_pass http://127.0.0.1:__PORT__;
proxy_redirect off; proxy_redirect off;
proxy_set_header Host $host; proxy_set_header Host $host;

View file

@ -31,9 +31,7 @@
"install" : [ "install" : [
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"example": "wiki.domain.tld",
"ask": "Domain for Outline app. This will be the main domain to access the wiki. Outline has to be installed at the root"
}, },
{ {
"name": "is_public", "name": "is_public",
@ -53,19 +51,17 @@
{ {
"name": "dex_domain", "name": "dex_domain",
"type": "domain", "type": "domain",
"example": "auth.domain.tld",
"ask": "Domain for authentification. It can't be the same domain as above. Dex app will be installed and used for the authentification mechanism" "ask": "Domain for authentification. It can't be the same domain as above. Dex app will be installed and used for the authentification mechanism"
}, },
{ {
"name": "dex_path", "name": "dex_path",
"type": "path", "type": "path",
"example": "/example", "default": "/",
"default": "/example" "ask": "Path for authentification url. Please don't use 'auth' as it will break Nginx configuration"
}, },
{ {
"name": "minio_domain", "name": "minio_domain",
"type": "domain", "type": "domain",
"example": "docs.domain.tld",
"ask": "Domain for MinIO app, used for images and attachements storage. If not yet installed, it will automatically be. Minio has to be installed at the root" "ask": "Domain for MinIO app, used for images and attachements storage. If not yet installed, it will automatically be. Minio has to be installed at the root"
}, },
{ {
@ -76,7 +72,6 @@
{ {
"name": "minio_password", "name": "minio_password",
"type": "password", "type": "password",
"example": "docs.domain.tld",
"ask": "Domain for MinIO app, used for images and attachements storage. Please note that if MinIO is already installed, that setting won't be used" "ask": "Domain for MinIO app, used for images and attachements storage. Please note that if MinIO is already installed, that setting won't be used"
} }
] ]

View file

@ -36,16 +36,19 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
language_key=$(ynh_app_setting_get --app=$app --key=language_key) language_key=$(ynh_app_setting_get --app=$app --key=language_key)
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_domain=$(ynh_app_setting_get --app=$app --key=minio_domain)
minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) minio_admin=$(ynh_app_setting_get --app=$app --key=minio_admin)
minio_password=$(ynh_app_setting_get --app="minio" --key=password) minio_password=$(ynh_app_setting_get --app=$app --key=minio_password)
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) mc_path=$(ynh_app_setting_get --app=$app --key=mc_path)
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) dex_app=$(ynh_app_setting_get --app=$app --key=dex_app)
dex_domain=$(ynh_app_setting_get --app="minio" --key=dex_domain) dex_domain=$(ynh_app_setting_get --app=$app --key=dex_domain)
dex_path=$(ynh_app_setting_get --app="minio" --key=dex_path) dex_path=$(ynh_app_setting_get --app=$app --key=dex_path)
oidc_secret=$(ynh_app_setting_get --app="minio" --key=oidc_secret) oidc_secret=$(ynh_app_setting_get --app=$app --key=oidc_secret)
oidc_name=$(ynh_app_setting_get --app="minio" --key=oidc_name) oidc_name=$(ynh_app_setting_get --app=$app --key=oidc_name)
oidc_callback=$(ynh_app_setting_get --app="minio" --key=oidc_callback) oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback)
dex_auth_uri=$(ynh_app_setting_get --app=$app --key=dex_auth_uri)
dex_token_uri=$(ynh_app_setting_get --app=$app --key=dex_token_uri)
dex_user_uri=$(ynh_app_setting_get --app=$app --key=dex_user_uri)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP

View file

@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config" # Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
@ -35,21 +35,24 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
language_key=$(ynh_app_setting_get --app=$app --key=language_key) language_key=$(ynh_app_setting_get --app=$app --key=language_key)
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_domain=$(ynh_app_setting_get --app=$app --key=minio_domain)
minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) minio_admin=$(ynh_app_setting_get --app=$app --key=minio_admin)
minio_password=$(ynh_app_setting_get --app="minio" --key=password) minio_password=$(ynh_app_setting_get --app=$app --key=minio_password)
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) mc_path=$(ynh_app_setting_get --app=$app --key=mc_path)
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) dex_app=$(ynh_app_setting_get --app=$app --key=dex_app)
dex_domain=$(ynh_app_setting_get --app="minio" --key=dex_domain) dex_domain=$(ynh_app_setting_get --app=$app --key=dex_domain)
dex_path=$(ynh_app_setting_get --app="minio" --key=dex_path) dex_path=$(ynh_app_setting_get --app=$app --key=dex_path)
oidc_secret=$(ynh_app_setting_get --app="minio" --key=oidc_secret) oidc_secret=$(ynh_app_setting_get --app=$app --key=oidc_secret)
oidc_name=$(ynh_app_setting_get --app="minio" --key=oidc_name) oidc_name=$(ynh_app_setting_get --app=$app --key=oidc_name)
oidc_callback=$(ynh_app_setting_get --app="minio" --key=oidc_callback) oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback)
dex_auth_uri=$(ynh_app_setting_get --app=$app --key=dex_auth_uri)
dex_token_uri=$(ynh_app_setting_get --app=$app --key=dex_token_uri)
dex_user_uri=$(ynh_app_setting_get --app=$app --key=dex_user_uri)
#================================================= #=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -84,14 +87,14 @@ fi
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
@ -112,7 +115,7 @@ fi
domain=$new_domain domain=$new_domain
ynh_secure_remove --file="$final_path/.env" ynh_secure_remove --file="$final_path/.env"
ynh_script_progression --message="Updating the configuration file..." --time --weight=1 ynh_script_progression --message="Updating the configuration file..." --weight=1
ynh_add_config --template="../conf/.env" --destination="$final_path/.env" ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
@ -134,14 +137,14 @@ popd
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -155,4 +158,4 @@ ynh_print_info --message="Don't forget to add a new redirction url in your Slack
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" --time --last ynh_script_progression --message="Change of URL completed for $app" --last

View file

@ -60,7 +60,6 @@ fi
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) minio_admin=$(ynh_app_setting_get --app="minio" --key=admin)
minio_password=$(ynh_app_setting_get --app="minio" --key=password) minio_password=$(ynh_app_setting_get --app="minio" --key=password)
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
#================================================= #=================================================
@ -74,18 +73,32 @@ oidc_secret=$(ynh_hex_32_random)
oidc_name="Outline" oidc_name="Outline"
oidc_callback="$domain/auth/oidc.callback" oidc_callback="$domain/auth/oidc.callback"
if yunohost app list | grep -q "$YNH_APP_ARG_DEX_DOMAIN"; then if yunohost app list | grep -q "$YNH_APP_ARG_DEX_DOMAIN$YNH_APP_ARG_DEX_PATH"; then
ynh_die "The domain provided for Dex is already used by another app. Please chose another one !" ynh_die "The domain provided for Dex is already used by another app. Please chose another one !"
fi fi
yunohost app install https://github.com/YunoHost-Apps/dex_ynh --force --args "domain=$dex_domain&path=$dex_path&OIDC_name=$oidc_name&OIDC_secret=$oidc_secret&OIDC_callback=$oidc_callback" yunohost app install https://github.com/YunoHost-Apps/dex_ynh --force --args "domain=$dex_domain&path=$dex_path&OIDC_name=$oidc_name&OIDC_secret=$oidc_secret&OIDC_callback=$oidc_callback" 2>&1 | tee dexlog.txt
dex_app=$(gawk 'match($0, /Installation of (.+) completed/, app) {print app[1]}' dexlog.txt)
rm dexlog.txt
# Create Dex URIs
if [ $dex_path = "/" ]
then
dex_auth_uri="https://$dex_domain/auth"
dex_token_uri="https://$dex_domain/token"
dex_user_uri="https://$dex_domain/userinfo"
else
dex_auth_uri="https://$dex_domain$dex_path/auth"
dex_token_uri="https://$dex_domain$dex_path/token"
dex_user_uri="https://$dex_domain$dex_path/userinfo"
fi
#=================================================== #===================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================== #===================================================
ynh_script_progression --message="Validating installation parameters..." --weight=1 ynh_script_progression --message="Validating installation parameters..." --weight=1
final_path=/opt/yunohost/$app final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder" test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path # Register (book) web path
@ -102,11 +115,19 @@ ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key
ynh_app_setting_set --app=$app --key=utils_secret --value=$utils_secret ynh_app_setting_set --app=$app --key=utils_secret --value=$utils_secret
ynh_app_setting_set --app=$app --key=language_key --value=$language_key ynh_app_setting_set --app=$app --key=language_key --value=$language_key
ynh_app_setting_set --app=$app --key=minio_domain --value=$minio_domain
ynh_app_setting_set --app=$app --key=minio_admin --value=$minio_admin
ynh_app_setting_set --app=$app --key=minio_password --value=$minio_password
ynh_app_setting_set --app=$app --key=mc_path --value=$mc_path
ynh_app_setting_set --app=$app --key=dex_app --value=$dex_app
ynh_app_setting_set --app=$app --key=dex_domain --value=$dex_domain ynh_app_setting_set --app=$app --key=dex_domain --value=$dex_domain
ynh_app_setting_set --app=$app --key=dex_path --value=$dex_path ynh_app_setting_set --app=$app --key=dex_path --value=$dex_path
ynh_app_setting_set --app=$app --key=oidc_name --value=$oidc_name ynh_app_setting_set --app=$app --key=oidc_name --value=$oidc_name
ynh_app_setting_set --app=$app --key=oidc_secret --value=$oidc_secret ynh_app_setting_set --app=$app --key=oidc_secret --value=$oidc_secret
ynh_app_setting_set --app=$app --key=oidc_callback --value=$oidc_callback ynh_app_setting_set --app=$app --key=oidc_callback --value=$oidc_callback
ynh_app_setting_set --app=$app --key=dex_auth_uri --value=$dex_auth_uri
ynh_app_setting_set --app=$app --key=dex_token_uri --value=$dex_token_uri
ynh_app_setting_set --app=$app --key=dex_user_uri --value=$dex_user_uri
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -125,12 +146,12 @@ ynh_app_setting_set --app=$app --key=port --value=$port
ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_script_progression --message="Installing dependencies..." --weight=1
# Install nodejs # Install nodejs
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION 2>&1
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies 2>&1
# Install Yarn # Install Yarn
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" 2>&1
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -228,8 +249,6 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config

View file

@ -12,27 +12,31 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path_url) path_url=$(ynh_app_setting_get --app=$app --key=path_url)
port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
language_key=$(ynh_app_setting_get --app=$app --key=language_key) language_key=$(ynh_app_setting_get --app=$app --key=language_key)
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_domain=$(ynh_app_setting_get --app=$app --key=minio_domain)
minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) minio_admin=$(ynh_app_setting_get --app=$app --key=minio_admin)
minio_password=$(ynh_app_setting_get --app="minio" --key=password) minio_password=$(ynh_app_setting_get --app=$app --key=minio_password)
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) mc_path=$(ynh_app_setting_get --app=$app --key=mc_path)
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) dex_app=$(ynh_app_setting_get --app=$app --key=dex_app)
dex_domain=$(ynh_app_setting_get --app="minio" --key=dex_domain) dex_domain=$(ynh_app_setting_get --app=$app --key=dex_domain)
dex_path=$(ynh_app_setting_get --app="minio" --key=dex_path) dex_path=$(ynh_app_setting_get --app=$app --key=dex_path)
oidc_secret=$(ynh_app_setting_get --app="minio" --key=oidc_secret) oidc_secret=$(ynh_app_setting_get --app=$app --key=oidc_secret)
oidc_name=$(ynh_app_setting_get --app="minio" --key=oidc_name) oidc_name=$(ynh_app_setting_get --app=$app --key=oidc_name)
oidc_callback=$(ynh_app_setting_get --app="minio" --key=oidc_callback) oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback)
dex_auth_uri=$(ynh_app_setting_get --app=$app --key=dex_auth_uri)
dex_token_uri=$(ynh_app_setting_get --app=$app --key=dex_token_uri)
dex_user_uri=$(ynh_app_setting_get --app=$app --key=dex_user_uri)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -43,14 +47,14 @@ oidc_callback=$(ynh_app_setting_get --app="minio" --key=oidc_callback)
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
ynh_script_progression --message="Removing $app service integration..." --time --weight=1 ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app yunohost service remove $app
fi fi
#================================================= #=================================================
# STOP AND REMOVE SERVICE # STOP AND REMOVE SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --time --weight=1 ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config ynh_remove_systemd_config
@ -58,7 +62,7 @@ ynh_remove_systemd_config
#================================================= #=================================================
# REMOVE LOGROTATE CONFIGURATION # REMOVE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config # Remove the app-specific logrotate config
ynh_remove_logrotate ynh_remove_logrotate
@ -74,7 +78,7 @@ ynh_psql_remove_db --db_user=$db_name --db_name=$db_name
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Removing dependencies..." --time --weight=1 ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies
@ -83,15 +87,22 @@ ynh_remove_nodejs
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing app main directory..." --time --weight=1 ynh_script_progression --message="Removing app main directory..." --weight=1
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE DEX APP
#=================================================
ynh_script_progression --message="Removing Dex app used for Outline auth..." --weight=1
yunohost app remove $dex_app
#================================================= #=================================================
# REMOVE MINIO BUCKET # REMOVE MINIO BUCKET
#================================================= #=================================================
ynh_script_progression --message="Removing Outline MinIO bucket..." --time --weight=1 ynh_script_progression --message="Removing Outline MinIO bucket..." --weight=1
pushd "$mc_path" pushd "$mc_path"
ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage --force ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage --force
@ -100,7 +111,7 @@ popd
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --time --weight=1 ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
@ -110,7 +121,7 @@ ynh_remove_nginx_config
#================================================= #=================================================
# REMOVE DEDICATED USER # REMOVE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 ynh_script_progression --message="Removing the dedicated system user..." --weight=1
# Delete a system user # Delete a system user
ynh_system_user_delete --username=$app ynh_system_user_delete --username=$app
@ -120,5 +131,4 @@ ynh_system_user_delete --username=$app
#================================================= #=================================================
ynh_script_progression --message="If you don't need it anymore, don't forget to remove the MinIO app !" ynh_script_progression --message="If you don't need it anymore, don't forget to remove the MinIO app !"
ynh_script_progression --message="If you don't need it anymore, don't forget to remove the Dex app !" ynh_script_progression --message="Removal of $app completed" --last
ynh_script_progression --message="Removal of $app completed" --time --last

View file

@ -21,19 +21,10 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# CHECK IF MINIO IS INSTALLED, IF NOT WARN USER
#=================================================
ynh_script_progression --message="Checking if MinIO is installed..." --time --weight=1
if ! yunohost app list | grep -q "id: minio"; then
ynh_die --message="We can't restore because MinIO is not installed ! Please install MinIO first"
fi
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -45,38 +36,69 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
language_key=$(ynh_app_setting_get --app=$app --key=language_key) language_key=$(ynh_app_setting_get --app=$app --key=language_key)
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_domain=$(ynh_app_setting_get --app=$app --key=minio_domain)
minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) minio_admin=$(ynh_app_setting_get --app=$app --key=minio_admin)
minio_password=$(ynh_app_setting_get --app="minio" --key=password) minio_password=$(ynh_app_setting_get --app=$app --key=minio_password)
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) mc_path=$(ynh_app_setting_get --app=$app --key=mc_path)
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) dex_app=$(ynh_app_setting_get --app=$app --key=dex_app)
dex_domain=$(ynh_app_setting_get --app="minio" --key=dex_domain) dex_domain=$(ynh_app_setting_get --app=$app --key=dex_domain)
dex_path=$(ynh_app_setting_get --app="minio" --key=dex_path) dex_path=$(ynh_app_setting_get --app=$app --key=dex_path)
oidc_secret=$(ynh_app_setting_get --app="minio" --key=oidc_secret) oidc_secret=$(ynh_app_setting_get --app=$app --key=oidc_secret)
oidc_name=$(ynh_app_setting_get --app="minio" --key=oidc_name) oidc_name=$(ynh_app_setting_get --app=$app --key=oidc_name)
oidc_callback=$(ynh_app_setting_get --app="minio" --key=oidc_callback) oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback)
dex_auth_uri=$(ynh_app_setting_get --app=$app --key=dex_auth_uri)
dex_token_uri=$(ynh_app_setting_get --app=$app --key=dex_token_uri)
dex_user_uri=$(ynh_app_setting_get --app=$app --key=dex_user_uri)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 ynh_script_progression --message="Validating restoration parameters..." --weight=1
test ! -d $final_path \ test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path" || ynh_die --message="There is already a directory: $final_path"
#=================================================
# CHECK IF DEX IS INSTALLED, IF NOT INSTALL IT
#=================================================
ynh_script_progression --message="Installing Dex if needed..." --weight=18
if ! yunohost app list | grep -q "id: $dex_app"; then
echo "Dex is not installed. Installing... "
yunohost tools update
if yunohost app list | grep -q "$dex_domain$dex_path"; then
ynh_die "The domain provided for Dex is already used by another app. Please chose another one !"
fi
yunohost app install https://github.com/YunoHost-Apps/dex_ynh --force --args "domain=$dex_domain&path=$dex_path&OIDC_name=$oidc_name&OIDC_secret=$oidc_secret&OIDC_callback=$oidc_callback"
fi
#=================================================
# CHECK IF MINIO IS INSTALLED, IF NOT INSTALL IT
#=================================================
ynh_script_progression --message="Installing MinIO if needed..." --weight=18
if ! yunohost app list | grep -q "id: minio"; then
echo "MinIO is not installed. Installing... "
yunohost tools update
if yunohost app list | grep -q "$minio_domain"; then
ynh_die "The domain provided for MinIO is already used by another app. Please chose another one !"
fi
yunohost app install https://github.com/YunoHost-Apps/minio_ynh --force --args "domain=$minio_domain&is_public=true&admin=$minio_admin&password=$minio_password"
fi
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the NGINX configuration..." --time --weight=1 ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path"
@ -84,7 +106,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
@ -110,7 +132,7 @@ ynh_secure_remove --file="$mc_path/outlinestorage"
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Install nodejs # Install nodejs
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
@ -134,7 +156,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#================================================= #=================================================
ynh_secure_remove --file="$final_path/.env" ynh_secure_remove --file="$final_path/.env"
ynh_script_progression --message="Updating the configuration file..." --time --weight=1 ynh_script_progression --message="Updating the configuration file..." --weight=1
ynh_add_config --template="../conf/.env" --destination="$final_path/.env" ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
@ -144,7 +166,7 @@ chown $app:$app "$final_path/.env"
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --time --weight=1 ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
@ -152,28 +174,28 @@ systemctl enable $app.service --quiet
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --time --weight=1 ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# RESTORE THE LOGS # RESTORE THE LOGS
#================================================= #=================================================
ynh_script_progression --message="Restoring the logs..." --time --weight=1 ynh_script_progression --message="Restoring the logs..." --weight=1
ynh_restore_file --origin_path="/var/log/$app/$app.log" ynh_restore_file --origin_path="/var/log/$app/$app.log"
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Outline server" --log="/var/log/$app/$app.log" yunohost service add $app --description="Outline server" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
@ -182,7 +204,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -190,4 +212,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --time --last ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -24,16 +24,19 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
language_key=$(ynh_app_setting_get --app=$app --key=language_key) language_key=$(ynh_app_setting_get --app=$app --key=language_key)
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_domain=$(ynh_app_setting_get --app=$app --key=minio_domain)
minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) minio_admin=$(ynh_app_setting_get --app=$app --key=minio_admin)
minio_password=$(ynh_app_setting_get --app="minio" --key=password) minio_password=$(ynh_app_setting_get --app=$app --key=minio_password)
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) mc_path=$(ynh_app_setting_get --app=$app --key=mc_path)
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) dex_app=$(ynh_app_setting_get --app=$app --key=dex_app)
dex_domain=$(ynh_app_setting_get --app="minio" --key=dex_domain) dex_domain=$(ynh_app_setting_get --app=$app --key=dex_domain)
dex_path=$(ynh_app_setting_get --app="minio" --key=dex_path) dex_path=$(ynh_app_setting_get --app=$app --key=dex_path)
oidc_secret=$(ynh_app_setting_get --app="minio" --key=oidc_secret) oidc_secret=$(ynh_app_setting_get --app=$app --key=oidc_secret)
oidc_name=$(ynh_app_setting_get --app="minio" --key=oidc_name) oidc_name=$(ynh_app_setting_get --app=$app --key=oidc_name)
oidc_callback=$(ynh_app_setting_get --app="minio" --key=oidc_callback) oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback)
dex_auth_uri=$(ynh_app_setting_get --app=$app --key=dex_auth_uri)
dex_token_uri=$(ynh_app_setting_get --app=$app --key=dex_token_uri)
dex_user_uri=$(ynh_app_setting_get --app=$app --key=dex_user_uri)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -44,7 +47,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -60,14 +63,14 @@ ynh_abort_if_errors
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path"
@ -78,7 +81,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --time --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
@ -91,7 +94,7 @@ chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
@ -99,7 +102,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
@ -112,26 +115,26 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
#================================================= #=================================================
# UPGRADE YARN DEPENDENCIES # UPGRADE YARN DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Building Yarn dependencies... This can be very long, be patient !" --time --weight=10 ynh_script_progression --message="Building Yarn dependencies... This can be very long, be patient !" --weight=10
pushd "$final_path" pushd "$final_path"
ynh_use_nodejs ynh_use_nodejs
ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --time --weight=5 ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=5
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --no-optional --frozen-lockfile 2>&1 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --no-optional --frozen-lockfile 2>&1
ynh_script_progression --message="Cleaning cache... " --time --weight=1 ynh_script_progression --message="Cleaning cache... " --weight=1
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean 2>&1 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean 2>&1
ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --time --weight=5 ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=5
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn build 2>&1 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn build 2>&1
ynh_script_progression --message="Fetching Yarn production dependencies... This can be very long, be patient !" --time --weight=5 ynh_script_progression --message="Fetching Yarn production dependencies... This can be very long, be patient !" --weight=5
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production=true --frozen-lockfile 2>&1 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production=true --frozen-lockfile 2>&1
ynh_script_progression --message="Cleaning cache... " --time --weight=1 ynh_script_progression --message="Cleaning cache... " --weight=1
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean 2>&1 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean 2>&1
popd popd
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --time --weight=1 ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/.env" --destination="$final_path/.env" ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
@ -151,7 +154,7 @@ popd
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
@ -161,7 +164,7 @@ ynh_add_systemd_config
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1 ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append ynh_use_logrotate --non-append
@ -169,21 +172,21 @@ ynh_use_logrotate --non-append
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Outline server" --log="/var/log/$app/$app.log" yunohost service add $app --description="Outline server" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -191,4 +194,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --time --last ynh_script_progression --message="Upgrade of $app completed" --last