Update install

This commit is contained in:
liberodark 2019-06-28 15:18:25 +02:00 committed by GitHub
parent 77cc2d3f9d
commit a29d06db47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,18 +62,18 @@ final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
ynh_webpath_register --app="$app" --domain="$domain" --path_url="$path_url"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..." --time --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app="$app" --key=domain --value="$domain"
ynh_app_setting_set --app="$app" --key=path --value="$path_url"
ynh_app_setting_set --app="$app" --key=admin --value="$admin"
ynh_app_setting_set --app="$app" --key=is_public --value="$is_public"
ynh_app_setting_set --app="$app" --key=language --value="$language"
#=================================================
# STANDARD MODIFICATIONS
@ -90,8 +90,8 @@ ynh_script_progression --message="Configuring firewall..." --time --weight=1
# Find a free port
port=$(ynh_find_port --port=8095)
# Open this port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
ynh_app_setting_set --app=$app --key=port --value=$port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP "$port"
ynh_app_setting_set --app="$app" --key=port --value="$port"
#=================================================
# INSTALL DEPENDENCIES
@ -106,7 +106,7 @@ ynh_script_progression --message="Installing dependencies..." --time --weight=1
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
ynh_install_app_dependencies $pkg_dependencies
ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# CREATE A MYSQL DATABASE
@ -122,10 +122,10 @@ ynh_script_progression --message="Creating a MySQL database..." --time --weight=
### - Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script
### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script
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_mysql_setup_db --db_user=$db_user --db_name=$db_name
ynh_app_setting_set --app="$app" --key=db_name --value="$db_name"
ynh_mysql_setup_db --db_user="$db_user" --db_name="$db_name"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -136,7 +136,7 @@ ynh_script_progression --message="Setting up source files..." --time --weight=1
### downloaded from an upstream source, like a git repository.
### `ynh_setup_source` use the file conf/app.src
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
ynh_app_setting_set --app="$app" --key=final_path --value="$final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
@ -156,7 +156,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring system user..." --time --weight=1
# Create a system user
ynh_system_user_create --username=$app
ynh_system_user_create --username="$app"
#=================================================
# PHP-FPM CONFIGURATION
@ -212,11 +212,11 @@ ynh_add_systemd_config
### forms.
# Set right permissions for curl install
chown -R $app: $final_path
chown -R "$app": "$final_path"
# Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1
ynh_app_setting_set --app=$app --key=skipped_uris --value="/"
ynh_app_setting_set --app="$app" --key=skipped_uris --value="/"
# Reload SSOwat config
yunohost app ssowatconf
@ -228,9 +228,9 @@ ynh_script_progression --message="Finalizing installation..." --time --weight=1
ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
# Remove the public access
if [ $is_public -eq 0 ]
if [ "$is_public" -eq 0 ]
then
ynh_app_setting_delete --app=$app --key=skipped_uris
ynh_app_setting_delete --app="$app" --key=skipped_uris
fi
#=================================================
@ -264,7 +264,7 @@ ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
### that really need such authorization.
# Set permissions to app files
chown -R root: $final_path
chown -R root: "$final_path"
#=================================================
# SETUP LOGROTATE
@ -294,7 +294,7 @@ ynh_use_logrotate
### - Remove the section "REMOVE SERVICE FROM ADMIN PANEL" in the remove script
### - As well as the section "ADVERTISE SERVICE IN ADMIN PANEL" in the restore script
yunohost service add $app --log "/var/log/$app/$app.log"
yunohost service add "$app" --log "/var/log/$app/$app.log"
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
#yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/$app.log"
@ -312,7 +312,7 @@ ynh_script_progression --message="Starting a systemd service..." --time --weight
### - And the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the change_url script
# Start a systemd service
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"
#=================================================
# SETUP FAIL2BAN
@ -328,10 +328,10 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ]
if [ "$is_public" -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
ynh_app_setting_set --app="$app" --key=unprotected_uris --value="/"
fi
#=================================================