This commit is contained in:
yalh76
2025-03-17 02:06:33 +01:00
parent 99979a7aa6
commit abed61dbf5
8 changed files with 83 additions and 34 deletions
+2
View File
@@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2 packaging_format = 2
id = "invoiceninja5" id = "invoiceninja5"
+13 -2
View File
@@ -1,5 +1,10 @@
#!/bin/bash #!/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 ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@@ -12,12 +17,18 @@ ynh_print_info "Declaring files to be backed up..."
ynh_backup "$install_dir" 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/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" ynh_backup "/etc/cron.d/$app"
+5
View File
@@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@@ -8,6 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression "Updating NGINX web server configuration..." ynh_script_progression "Updating NGINX web server configuration..."
# this will most likely adjust NGINX config correctly
ynh_config_change_url_nginx ynh_config_change_url_nginx
#================================================= #=================================================
+15 -13
View File
@@ -1,10 +1,14 @@
#!/bin/bash #!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# GENERATE KEYS AND RETRIEVE ADMIN USER INFO # INITIALIZE AND STORE SETTINGS
#================================================= #=================================================
api_secret="$(ynh_string_random --length=32)" 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_fullname="$(ynh_user_get_info --username=$admin --key=fullname)"
email="$(ynh_user_get_info --username=$admin --key=mail)" 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=api_secret --value=$api_secret
ynh_app_setting_set --key=app_key --value=$app_key ynh_app_setting_set --key=app_key --value=$app_key
ynh_app_setting_set --key=phantomjs_key --value=$phantomjs_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..." 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" 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 # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression "Adding system configurations related to $app..." 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 ynh_config_add_phpfpm
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_config_add_nginx 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 # BUILD THE APPLICATION
#================================================= #=================================================
+4
View File
@@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
+13 -3
View File
@@ -1,5 +1,10 @@
#!/bin/bash #!/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 ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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" ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_restore "/etc/cron.d/$app" 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 ynh_systemctl --service=nginx --action=reload
#================================================= #=================================================
+14 -9
View File
@@ -1,12 +1,16 @@
#!/bin/bash #!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # Delete deprecated `firstname`/`lastname` settings. See upstream https://github.com/YunoHost/yunohost/pull/1516
ynh_app_setting_delete --key=email_firstname 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..." 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" 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 # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
@@ -39,13 +51,6 @@ ynh_config_add_nginx
ynh_config_add --template="cron" --destination="/etc/cron.d/$app" 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 # UPGRADE DATABASE
#================================================= #=================================================
+10
View File
@@ -1,7 +1,17 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
test_format = 1.0 test_format = 1.0
[default] [default]
# ------------
# Tests to run
# ------------
# -------------------------------
# Default args to use for install
# -------------------------------
# ------------------------------- # -------------------------------
# Commits to test upgrade from # Commits to test upgrade from
# ------------------------------- # -------------------------------