From ba63532c12aeb30927c7d7abfc239eecf490bb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 11 Mar 2023 22:20:04 +0100 Subject: [PATCH] cleaning --- conf/amd64.src | 6 ------ conf/arm64.src | 6 ------ conf/armhf.src | 6 ------ manifest.toml | 17 +++++++++++++++++ scripts/backup | 22 ---------------------- scripts/install | 22 ++++++---------------- scripts/remove | 10 ---------- scripts/restore | 18 ------------------ scripts/upgrade | 13 +------------ 9 files changed, 24 insertions(+), 96 deletions(-) delete mode 100644 conf/amd64.src delete mode 100644 conf/arm64.src delete mode 100644 conf/armhf.src diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index 0006e39..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/documize/community/releases/download/v5.5.0/documize-community-linux-amd64 -SOURCE_SUM=906ddd69c94a58d743f2818169670aa46ff9101d6270ea671556dabccc157f25 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=documize -SOURCE_EXTRACT=false diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 7146293..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/documize/community/releases/download/v5.5.0/documize-community-linux-arm64 -SOURCE_SUM=0c9efb78a85f6cbce35abae2356ab91498f8ec3f6786d69cf82ff25ef71cdcd8 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=documize -SOURCE_EXTRACT=false diff --git a/conf/armhf.src b/conf/armhf.src deleted file mode 100644 index b98f994..0000000 --- a/conf/armhf.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/documize/community/releases/download/v5.5.0/documize-community-linux-arm -SOURCE_SUM=6d78614742147f8eeb13db7baf5f7c654c457974e351752ac12942d2d138688f -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=documize -SOURCE_EXTRACT=false diff --git a/manifest.toml b/manifest.toml index 6055bce..611abac 100644 --- a/manifest.toml +++ b/manifest.toml @@ -36,6 +36,23 @@ ram.runtime = "50M" default = "visitors" [resources] + + [resources.sources] + + [resources.sources.main] + amd64.url = "https://github.com/documize/community/releases/download/v5.5.0/documize-community-linux-amd64" + amd64.sha256 = "906ddd69c94a58d743f2818169670aa46ff9101d6270ea671556dabccc157f25" + + arm64.url = "https://github.com/documize/community/releases/download/v5.5.0/documize-community-linux-arm64" + arm64.sha256 = "0c9efb78a85f6cbce35abae2356ab91498f8ec3f6786d69cf82ff25ef71cdcd8" + + armhf.url = "https://github.com/documize/community/releases/download/v5.5.0/documize-community-linux-arm" + armhf.sha256 = "6d78614742147f8eeb13db7baf5f7c654c457974e351752ac12942d2d138688f" + + extract = false + in_subdir = false + rename = "documize" + [resources.system_user] [resources.install_dir] diff --git a/scripts/backup b/scripts/backup index 0653990..d487780 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,28 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index be6e143..2efedf0 100755 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ salt=$(ynh_string_random --length=16) ynh_script_progression --message="Setting up source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH +ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -35,6 +35,11 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Internal & external docs" --log="/var/log/$app/$app.log" + #================================================= # ADD A CONFIGURATION #================================================= @@ -45,21 +50,6 @@ ynh_add_config --template="../conf/documize.conf" --destination="$install_dir/do chmod 400 "$install_dir/documize.conf" chown $app:$app "$install_dir/documize.conf" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Internal & external docs" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 94672c7..57324bf 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,19 +22,9 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 405c811..1583ae3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/documize" @@ -29,19 +28,9 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 - yunohost service add $app --description="Internal & external docs" --log="/var/log/$app/$app.log" #================================================= @@ -51,13 +40,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 58e7eaf..7e82e0f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,10 +33,9 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH --keep="documize.conf" + ynh_setup_source --dest_dir="$install_dir" --keep="documize.conf" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/documize" @@ -49,19 +48,9 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=3 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Internal & external docs" --log="/var/log/$app/$app.log" #=================================================