mirror of
https://github.com/YunoHost-Apps/metabase_ynh.git
synced 2024-09-03 19:46:00 +02:00
0.40.1
This commit is contained in:
parent
d05cfb06c4
commit
c8c7b049c5
5 changed files with 23 additions and 37 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -18,5 +18,4 @@ location / {
|
|||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
|
||||
}
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue