Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
MB_ADMIN_EMAIL={{ metabase_admin_email }}
MB_EMAIL_FROM_ADDRESS={{ metabase_from_email }}
MB_EMAIL_SMTP_HOST={{metabase_smtp_server }}
MB_EMAIL_SMTP_PORT={{ metabase_smtp_port }}
{% if metabase_smtp_user is defined and metabase_smtp_pass is defined %}
MB_EMAIL_SMTP_USERNAME={{ metabase_smtp_user }}
MB_EMAIL_SMTP_PASSWORD={{ metabase_smtp_pass }}
{% endif %}
MB_EMAIL_SMTP_SECURITY={{ metabase_smtp_starttls | ternary('starttls','none') }}
MB_ANON_TRACKING_ENABLED=false
MB_DB_DBNAME={{ metabase_db_name }}
MB_DB_HOST={{ metabase_db_server }}
MB_DB_USER={{ metabase_db_user }}
MB_DB_PASS={{ metabase_db_pass | quote }}
MB_DB_PORT={{ metabase_db_port }}
MB_DB_TYPE={{ metabase_db_engine }}
MB_ENCRYPTION_SECRET_KEY={{ metabase_encryption_key | quote }}
MB_JETTY_HOST=0.0.0.0
MB_JETTY_PORT={{ metabase_port }}
MB_PLUGINS_DIR={{ metabase_root_dir }}/plugins
MB_SITE_LOCALE={{ metabase_lang }}
MB_SITE_URL={{ metabase_public_url }}
MB_CHECK_FOR_UPDATES=false
MB_ENABLE_EMBEDDING=true
MB_ENABLE_PUBLIC_SHARING=true
MB_ENABLE_QUERY_CACHING={{ metabase_enable_cache | ternary('true', 'false') }}

View File

@@ -0,0 +1,26 @@
[Unit]
Description=Metabase opensource BI
After=syslog.target network.target
[Service]
Type=simple
User={{ metabase_user }}
WorkingDirectory={{ metabase_root_dir }}/app
EnvironmentFile={{ metabase_root_dir }}/etc/env
ExecStart=/usr/bin/java -Djava.net.preferIPv4Stack=true \
{% if system_proxy is defined and system_proxy != '' %}
-Dhttp.proxyHost={{ system_proxy | urlsplit('hostname') }} -Dhttp.proxyPort={{ system_proxy | urlsplit('port') }} \
-Dhttps.proxyHost={{ system_proxy | urlsplit('hostname') }} -Dhttps.proxyPort={{ system_proxy | urlsplit('port') }} \
{% endif %}
-jar {{ metabase_root_dir }}/app/metabase.jar
SuccessExitStatus=143
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
NoNewPrivileges=yes
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,3 @@
#!/bin/bash -e
rm -f {{ metabase_root_dir }}/backup/*

View File

@@ -0,0 +1,24 @@
#!/bin/sh
set -eo pipefail
{% if metabase_db_engine == 'mysql' %}
/usr/bin/mysqldump \
{% if metabase_db_server not in ['localhost','127.0.0.1'] %}
--user={{ metabase_db_user | quote }} \
--password={{ metabase_db_pass | quote }} \
--host={{ metabase_db_server | quote }} \
--port={{ metabase_db_port | quote }} \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ metabase_db_name | quote }} | zstd -c > {{ metabase_root_dir }}/backup/{{ metabase_db_name }}.sql.zst
{% elif metabase_db_engine == 'postgres' %}
PGPASSWORD={{ metabase_db_pass | quote }} /usr/pgsql-14/bin/pg_dump \
--clean \
--create \
--username={{ metabase_db_user }} \
--host={{ metabase_db_server }} \
{{ metabase_db_name }} | zstd -c > {{ metabase_root_dir }}/backup/{{ metabase_db_name }}.sql.zst
{% endif %}
cp {{ metabase_root_dir }}/etc/env {{ metabase_root_dir }}/backup/