From c8c7b049c56f469329aaa2f03e0394a620cf5a9b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 2 Aug 2021 18:52:28 +0200 Subject: [PATCH] 0.40.1 --- check_process | 12 +++--------- conf/app.src | 4 ++-- conf/nginx.conf | 1 - manifest.json | 10 +--------- scripts/install | 33 +++++++++++++++++---------------- 5 files changed, 23 insertions(+), 37 deletions(-) diff --git a/check_process b/check_process index eb0f54f..8187647 100644 --- a/check_process +++ b/check_process @@ -1,14 +1,8 @@ -# See here for more informations -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/" (PATH) - is_public=1 (PUBLIC|public=1|private=0) - port="9980" (PORT) + domain="domain.tld" + path="/" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/conf/app.src b/conf/app.src index e7e75b0..c548c4f 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://downloads.metabase.com/v0.38.0.1/metabase.jar -SOURCE_SUM=29c050f188758a9cf3fe84d632f19fbb4d3b6731cc0cc0fb7fe26042ed4d4a2c +SOURCE_URL=https://downloads.metabase.com/v0.40.1/metabase.jar +SOURCE_SUM=972babb2ce60740729ba56323188bdf998e417dc1d9bac5642d7a429e4a793b1 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=jar SOURCE_IN_SUBDIR=false diff --git a/conf/nginx.conf b/conf/nginx.conf index 85dcbba..36dc5fd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -18,5 +18,4 @@ location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; - } diff --git a/manifest.json b/manifest.json index d98f933..9504017 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "url": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.2.0" }, "multi_instance": false, "services": [ @@ -26,19 +26,11 @@ "install": [{ "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Metabase", - "fr": "Choisissez un nom de domaine pour Metabase" - }, "example": "metabase.example.com" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public site?", - "fr": "Est-ce un site public ?" - }, "help": { "en": "If enabled, Metabase will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, Metabase sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." diff --git a/scripts/install b/scripts/install index 7eefd0e..a09859b 100755 --- a/scripts/install +++ b/scripts/install @@ -76,6 +76,14 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_name --db_name=$db_name +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=2 + +# Create a system user +ynh_system_user_create --username=$app + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -85,6 +93,11 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" +chmod +x $final_path/metabase.jar + #================================================= # NGINX CONFIGURATION #================================================= @@ -93,14 +106,6 @@ ynh_script_progression --message="Configuring NGNX web server..." --weight=3 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=2 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # SETUP SYSTEMD #================================================= @@ -111,13 +116,13 @@ ynh_add_systemd_config #================================================= # SETUP CONFIG #================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 touch /etc/default/$app -cp ../conf/metabase /etc/default/$app +ynh_add_config --template="../conf/metabase" --destination="/etc/default/$app" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="/etc/default/$app" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="/etc/default/$app" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="/etc/default/$app" +chmod 640 "/etc/default/$app" +chown $app "/etc/default/$app" #================================================= # GENERIC FINALIZATION @@ -125,12 +130,8 @@ ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --targ # SECURE FILES AND DIRECTORIES #================================================= -chmod +x $final_path/metabase.jar - -chown -R $app: $final_path touch /var/log/$app.log chown $app: /var/log/$app.log -chmod 640 /etc/default/$app #================================================= # INTEGRATE SERVICE IN YUNOHOST