Improve
This commit is contained in:
+13
-2
@@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
@@ -12,12 +17,18 @@ ynh_print_info "Declaring files to be backed up..."
|
||||
ynh_backup "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
# BACKUP SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
# Backup the PHP-FPM configuration
|
||||
ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
||||
|
||||
# Backup the NGINX configuration
|
||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
||||
#=================================================
|
||||
# BACKUP VARIOUS FILES
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/cron.d/$app"
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
@@ -8,6 +12,7 @@ source /usr/share/yunohost/helpers
|
||||
#=================================================
|
||||
ynh_script_progression "Updating NGINX web server configuration..."
|
||||
|
||||
# this will most likely adjust NGINX config correctly
|
||||
ynh_config_change_url_nginx
|
||||
|
||||
#=================================================
|
||||
|
||||
+15
-13
@@ -1,10 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# GENERATE KEYS AND RETRIEVE ADMIN USER INFO
|
||||
# INITIALIZE AND STORE SETTINGS
|
||||
#=================================================
|
||||
|
||||
api_secret="$(ynh_string_random --length=32)"
|
||||
@@ -14,11 +18,6 @@ phantomjs_key="$(ynh_string_random --length=32)"
|
||||
email_fullname="$(ynh_user_get_info --username=$admin --key=fullname)"
|
||||
email="$(ynh_user_get_info --username=$admin --key=mail)"
|
||||
|
||||
#=================================================
|
||||
# STORE KEYS TO APP SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression "Storing secrets to app settings..."
|
||||
|
||||
ynh_app_setting_set --key=api_secret --value=$api_secret
|
||||
ynh_app_setting_set --key=app_key --value=$app_key
|
||||
ynh_app_setting_set --key=phantomjs_key --value=$phantomjs_key
|
||||
@@ -28,24 +27,27 @@ ynh_app_setting_set --key=phantomjs_key --value=$phantomjs_key
|
||||
#=================================================
|
||||
ynh_script_progression "Setting up source files..."
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from manifest.toml
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
||||
#=================================================
|
||||
# APP INITIAL CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression "Adding $app's configuration files..."
|
||||
|
||||
ynh_config_add --template="default.env" --destination="$install_dir/.env"
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression "Adding system configurations related to $app..."
|
||||
|
||||
# Create a PHP-FPM config (with conf/extra_php-fpm.conf being appended to it)
|
||||
ynh_config_add_phpfpm
|
||||
|
||||
# Create a dedicated NGINX config using the conf/nginx.conf template
|
||||
ynh_config_add_nginx
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression "Updating configuration..."
|
||||
|
||||
ynh_config_add --template="default.env" --destination="$install_dir/.env"
|
||||
|
||||
#=================================================
|
||||
# BUILD THE APPLICATION
|
||||
#=================================================
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
|
||||
+13
-3
@@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
@@ -26,14 +31,19 @@ ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
||||
|
||||
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE VARIOUS FILES
|
||||
#=================================================
|
||||
|
||||
ynh_restore "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM
|
||||
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
|
||||
ynh_script_progression "Reloading NGINX web server and $app's service..."
|
||||
|
||||
ynh_systemctl --service="php$php_version-fpm" --action=reload
|
||||
|
||||
ynh_systemctl --service=php$php_version-fpm --action=reload
|
||||
ynh_systemctl --service=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
|
||||
+14
-9
@@ -1,12 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# ENSURE BACKWARD COMPATIBILITY
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression "Ensuring backward compatibility..."
|
||||
ynh_script_progression "Ensuring downward compatibility..."
|
||||
|
||||
# Delete deprecated `firstname`/`lastname` settings. See upstream https://github.com/YunoHost/yunohost/pull/1516
|
||||
ynh_app_setting_delete --key=email_firstname
|
||||
@@ -26,8 +30,16 @@ ynh_app_setting_set_default --key=phantomjs_key --value="$(ynh_string_random --l
|
||||
#=================================================
|
||||
ynh_script_progression "Upgrading source files..."
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from manifest.toml
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace --keep=".env public/storage"
|
||||
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression "Updating $app's configuration files..."
|
||||
|
||||
ynh_config_add --template="default.env" --destination="$install_dir/.env"
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
@@ -39,13 +51,6 @@ ynh_config_add_nginx
|
||||
|
||||
ynh_config_add --template="cron" --destination="/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression "Updating configuration..."
|
||||
|
||||
ynh_config_add --template="default.env" --destination="$install_dir/.env"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DATABASE
|
||||
#=================================================
|
||||
|
||||
Reference in New Issue
Block a user