Merge branch 'testing' into version-2

This commit is contained in:
Salamandar 2024-01-28 17:21:46 +01:00
commit d2744303c2
8 changed files with 61 additions and 51 deletions

View file

@ -9,7 +9,7 @@ description.fr = "Plateforme de partage de fichiers"
version = "4.3.1~ynh1"
maintainers = ["salamandar"]
maintainers = ["julienmalik"]
[upstream]
license = "AGPL-3.0"
@ -28,8 +28,8 @@ ldap = false
sso = false
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
ram.build = "500M"
ram.runtime = "500M"
[install]
[install.domain]
@ -77,7 +77,10 @@ ram.runtime = "50M"
grpc.default = 50052
[resources.apt]
packages = "mariadb-server"
packages = [
"acl",
"mariadb-server",
]
[resources.database]
type = "mysql"

View file

@ -25,7 +25,6 @@ ynh_backup --src_path="$install_dir"
# BACKUP THE DATA DIR
#=================================================
# Only relevant if there is a "data_dir" resource for this app
ynh_backup --src_path="$data_dir" --is_big
#=================================================

View file

@ -9,53 +9,52 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
chown -R "$app:www-data" "$install_dir"
chmod +x "$install_dir/cells"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring $app..." --weight=1
ynh_add_config --template="../conf/install-conf.yml" --destination="$install_dir/install-conf.yml"
ynh_delete_file_checksum --file="$install_dir/install-conf.yml"
pushd "$install_dir"
ynh_exec_as "$app" ./cells configure --cli --yaml "./install-conf.yml"
popd
ynh_secure_remove --file="$install_dir/install-conf.yml"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --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="File sharing platform" --log="/var/log/$app/$app.log"
#=================================================
# APP INITIAL CONFIGURATION
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring $app..." --weight=1
ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml"
pushd "$install_dir"
ynh_exec_as $app ./cells configure --cli --yaml "$install_dir/install-conf.yml"
popd
ynh_secure_remove --file="$install_dir/install-conf.yml"
ynh_delete_file_checksum --file="$install_dir/install-conf.yml"
#=================================================
# GENERIC FINALIZATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
# Start a systemd service
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done"
#=================================================
# END OF SCRIPT

View file

@ -12,19 +12,26 @@ source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
# REMOVE SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# 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; then
ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove "$app"
yunohost service remove "$app"
fi
# Remove the dedicated systemd config
ynh_remove_systemd_config
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
# ynh_script_progression --message="Removing various files..."
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -17,8 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chown -R "$app:www-data" "$install_dir"
chmod +x "$install_dir/cells"
chown -R $app:www-data "$install_dir"
#=================================================
# RESTORE THE DATA DIRECTORY
@ -45,7 +44,6 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable "$app.service" --quiet
yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log"
#=================================================
@ -55,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" --log="/var/lo
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done"
ynh_systemd_action --service_name=nginx --action=reload
#=================================================

View file

@ -9,8 +9,8 @@
source _common.sh
source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
@ -19,21 +19,24 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..."
if [ "$upgrade_type" == "UPGRADE_APP" ]; then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".config .minio"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
fi
chown -R "$app:www-data" "$install_dir"
chmod +x "$install_dir/cells"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
@ -41,8 +44,8 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log"
#=================================================
@ -50,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" --log="/var/lo
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done"
#=================================================
# END OF SCRIPT

View file

@ -4,5 +4,6 @@ test_format = 1.0
[default]
# test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4"
# test_upgrade_from.00a1a6e7.args.foo = "bar"
exclude = ["change_url"]
test_upgrade_from.5725c85c09f1d3b76d12a4dc4d367ec911cd0019.name = "Last packaging v2 version"