From d664ee91ef6e3e7e692204384da079e93fb1bcbf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 11 Nov 2021 22:18:18 +0100 Subject: [PATCH 1/3] 0.41.2 --- conf/app.src | 4 ++-- conf/nginx.conf | 3 +++ manifest.json | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/conf/app.src b/conf/app.src index 35bf191..0c52de2 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://downloads.metabase.com/v0.40.2/metabase.jar -SOURCE_SUM=4d5cd90c7c12b459510dc7955c2d5a8db5845c0ed3bb8dcdc6f548182374e8e9 +SOURCE_URL=https://downloads.metabase.com/v0.41.2/metabase.jar +SOURCE_SUM=d2303557342f3d88437d634fd38bd4b3657b7a31e5ad891e45b001801c121bf5 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=jar SOURCE_IN_SUBDIR=false diff --git a/conf/nginx.conf b/conf/nginx.conf index 36dc5fd..43bf240 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -18,4 +18,7 @@ location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } diff --git a/manifest.json b/manifest.json index f044c5d..294b570 100644 --- a/manifest.json +++ b/manifest.json @@ -6,13 +6,12 @@ "en": "Web database management tool", "fr": "Outil web de gestion des bases de données" }, - "version": "0.40.2~ynh2", + "version": "0.41.2~ynh1", "url": "https://www.metabase.com/", "upstream": { "license": "AGPL-3.0-only", "website": "https://www.metabase.com/", "admindoc": "https://www.metabase.com/docs/latest/", - "userdoc": "https://yunohost.org/apps", "code": "https://github.com/metabase/metabase" }, "license": "AGPL-3.0-only", From 43bc4348ced586343ae747c5ca03b4795df23751 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 11 Nov 2021 21:18:24 +0000 Subject: [PATCH 2/3] Auto-update README --- README.md | 3 +-- README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 22b6980..2d69802 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Web database management tool -**Shipped version:** 0.40.2~ynh2 +**Shipped version:** 0.41.2~ynh1 @@ -28,7 +28,6 @@ Web database management tool ## Documentation and resources * Official app website: https://www.metabase.com/ -* Official user documentation: https://yunohost.org/apps * Official admin documentation: https://www.metabase.com/docs/latest/ * Upstream app code repository: https://github.com/metabase/metabase * YunoHost documentation for this app: https://yunohost.org/app_metabase diff --git a/README_fr.md b/README_fr.md index d75c444..0ec28c1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Outil web de gestion des bases de données -**Version incluse :** 0.40.2~ynh2 +**Version incluse :** 0.41.2~ynh1 @@ -24,7 +24,6 @@ Outil web de gestion des bases de données ## Documentations et ressources * Site officiel de l'app : https://www.metabase.com/ -* Documentation officielle utilisateur : https://yunohost.org/apps * Documentation officielle de l'admin : https://www.metabase.com/docs/latest/ * Dépôt de code officiel de l'app : https://github.com/metabase/metabase * Documentation YunoHost pour cette app : https://yunohost.org/app_metabase From 598888f5f14e21904486d0fdd14443ca17f86912 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Nov 2021 19:59:38 +0100 Subject: [PATCH 3/3] Fix --- check_process | 1 - conf/nginx.conf | 33 +++++++++++++----------------- manifest.json | 2 +- scripts/install | 14 +++++-------- scripts/restore | 8 ++------ scripts/upgrade | 53 ++++++++++++++++++++++++++----------------------- 6 files changed, 50 insertions(+), 61 deletions(-) diff --git a/check_process b/check_process index 8187647..c7afaca 100644 --- a/check_process +++ b/check_process @@ -13,7 +13,6 @@ upgrade=1 backup_restore=1 multi_instance=0 - port_already_use=0 change_url=0 ;;; Options Email= diff --git a/conf/nginx.conf b/conf/nginx.conf index 43bf240..15bb940 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,24 +1,19 @@ location / { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - - proxy_pass http://127.0.0.1:__PORT__; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Port $server_port; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $server_name; + proxy_pass http://127.0.0.1:__PORT__; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; - #WebSocket Support - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $http_connection; + #WebSocket Support + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } diff --git a/manifest.json b/manifest.json index 294b570..a73d001 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "url": "" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ diff --git a/scripts/install b/scripts/install index 12d6afd..dd2d520 100755 --- a/scripts/install +++ b/scripts/install @@ -81,7 +81,7 @@ ynh_psql_setup_db --db_user=$db_name --db_name=$db_name ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -126,16 +126,12 @@ chown $app "/etc/default/$app" #================================================= # GENERIC FINALIZATION #================================================= -# SECURE FILES AND DIRECTORIES +# SETUP LOGROTATE #================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 -# Create log directory -mkdir -p /var/log/$app -touch /var/log/$app/$app.log -chown -R $app /var/log/$app - -# Setup logrotate -ynh_use_logrotate --specific_user=$app/$app +# Use logrotate to manage application logfile(s) +ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/restore b/scripts/restore index 05bbb65..690df62 100755 --- a/scripts/restore +++ b/scripts/restore @@ -96,14 +96,10 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= -# HANDLE LOG FILES AND LOGROTATE +# RESTORE THE LOGROTATE CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 -mkdir -p /var/log/$app -touch /var/log/$app/$app.log -chown $app -R /var/log/$app - -# Restore logrotate configuration ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 04c8047..735d0cd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,29 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up Streama before upgrading (may take a while)..." --weight=2 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# STANDARD UPGRADE STEPS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --weight=20 + +ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -55,27 +78,12 @@ if ynh_legacy_permissions_exists; then fi #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Backing up Streama before upgrading (may take a while)..." --weight=2 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=20 - -ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -132,13 +140,8 @@ chown $app "/etc/default/$app" #================================================= ynh_script_progression --message="Configuring log rotation..." --weight=3 -# Create log directory -mkdir -p /var/log/$app -touch /var/log/$app/$app.log -chown -R $app /var/log/$app - # Setup logrotate -ynh_use_logrotate --specific_user=$app/$app +ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST