From 5558b7a6792cd95177371cc1219cd6759a1ab9ab Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 1 Mar 2022 23:49:53 +0100 Subject: [PATCH] add metabase --- README.MD | 21 +++++++++- ressources/metabase/metabase | 40 +++++++++++++++++++ ressources/metabase/rootfs/DEBIAN/changelog | 0 ressources/metabase/rootfs/DEBIAN/control | 7 ++++ ressources/metabase/rootfs/DEBIAN/postinst | 5 +++ .../etc/systemd/system/metabase.service | 14 +++++++ .../rootfs/usr/share/metabase/.gitkeep | 0 .../metabase/rootfs/var/lib/metabase/.gitkeep | 0 8 files changed, 86 insertions(+), 1 deletion(-) create mode 100755 ressources/metabase/metabase create mode 100644 ressources/metabase/rootfs/DEBIAN/changelog create mode 100644 ressources/metabase/rootfs/DEBIAN/control create mode 100755 ressources/metabase/rootfs/DEBIAN/postinst create mode 100644 ressources/metabase/rootfs/etc/systemd/system/metabase.service create mode 100644 ressources/metabase/rootfs/usr/share/metabase/.gitkeep create mode 100644 ressources/metabase/rootfs/var/lib/metabase/.gitkeep diff --git a/README.MD b/README.MD index 985548b..c736356 100644 --- a/README.MD +++ b/README.MD @@ -13,6 +13,14 @@ debmaker_run ``` This commande create joplin and joplin-server packages +### Debug + +To enter in temporary filesystem + +```bash +debmaker_chroot cache/joplin +``` + ### packages available in shared repository - [adguardhome](#adguardhome) ([site](https://adguard.com/fr/adguard-home/overview.html)) @@ -20,9 +28,10 @@ This commande create joplin and joplin-server packages - [element-web](#element-web) ([site](https://element.io/)) - [gotify](#gotify) ([site](https://gotify.net/)) - [grocy](#grocy) ([site](https://grocy.info/)) - - [joplin](#joplin) desktop ([site](https://joplinapp.org/)) + - [joplin desktop](#joplin) ([site](https://joplinapp.org/)) - [joplin-server](#joplin-server) ([site](https://joplinapp.org/)) - [mautrix-syncproxy and mautrix-wsproxy](#mautrix-syncproxy-and-mautrix-wsproxy) ([site](https://docs.mau.fi/bridges/go/imessage/android/setup.html)) + - [metabase](#metabase) ([site](https://www.metabase.com/)) - [rss-bridge](#rss-bridge) ([site](https://github.com/rss-bridge/rss-bridge)) - [tt-rss](#tt-rss) ([site](https://tt-rss.org/)) - [vaultwarden and vaultwarden-web](#vaultwarden-and-vaultwarden-web) ([site](https://github.com/dani-garcia/vaultwarden)) @@ -137,6 +146,16 @@ apt-get install -y mautrix-syncproxy mautrix-wsproxy systemctl enable --now mautrix-wsproxy mautrix-syncproxy ``` +#### metabase + +```bash +apt install -y python wget ca-certificates +wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update +apt-get install -y metabase openjdk-17-jre + +systemctl enable --now metabase +``` #### rss-bridge diff --git a/ressources/metabase/metabase b/ressources/metabase/metabase new file mode 100755 index 0000000..45fb72f --- /dev/null +++ b/ressources/metabase/metabase @@ -0,0 +1,40 @@ +#!/bin/bash + +[ -e ./lib/function.sh ] && source ./lib/function.sh + +APP=metabase +VERSION=0.42.2 +GIT_VERSION=v$VERSION +DEB_VERSION=$VERSION-1 +DEBIAN_VERSION_CODENAME=bullseye +IMAGE_SIZE=10 + +STEP="envinit prebuild build makedeb" + +envinit() { + apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot openjdk-17-jdk curl + wget -qO - https://deb.nodesource.com/setup_16.x | bash + wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y nodejs yarn + curl https://download.clojure.org/install/linux-install-1.10.3.1087.sh | bash +} + +prebuild(){ + git clone --depth 1 -b ${GIT_VERSION} https://github.com/metabase/metabase.git /tmp/metabase +} + +build() { + cd /tmp/metabase/ + PATH=$PATH:/usr/local/bin + ./bin/build +} + +makedeb(){ + PATH_DEB=/tmp/src/rootfs + + cp /tmp/metabase/target/uberjar/metabase.jar ${PATH_DEB}/usr/share/metabase/ + sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control + fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist +} diff --git a/ressources/metabase/rootfs/DEBIAN/changelog b/ressources/metabase/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/metabase/rootfs/DEBIAN/control b/ressources/metabase/rootfs/DEBIAN/control new file mode 100644 index 0000000..037f797 --- /dev/null +++ b/ressources/metabase/rootfs/DEBIAN/control @@ -0,0 +1,7 @@ +Package: metabase +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Maintainer: Thomas Legay +Description: metabase diff --git a/ressources/metabase/rootfs/DEBIAN/postinst b/ressources/metabase/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..428c488 --- /dev/null +++ b/ressources/metabase/rootfs/DEBIAN/postinst @@ -0,0 +1,5 @@ +#!/bin/bash + +id metabase &> /dev/null || useradd metabase -r -s /bin/false -d /var/lib/metabase + +chown -R www-data:www-data /var/lib/metabase diff --git a/ressources/metabase/rootfs/etc/systemd/system/metabase.service b/ressources/metabase/rootfs/etc/systemd/system/metabase.service new file mode 100644 index 0000000..8b23e88 --- /dev/null +++ b/ressources/metabase/rootfs/etc/systemd/system/metabase.service @@ -0,0 +1,14 @@ +[Unit] +Description=metabase + +[Service] +Type=exec +User=metabase +WorkingDirectory=/var/share/metabase +ExecStart=/usr/bin/java -jar /usr/share/metabase/metabase.jar +Restart=on-failure +RestartSec=30s +ReadWritePaths=/var/share/metabase + +[Install] +WantedBy=multi-user.target diff --git a/ressources/metabase/rootfs/usr/share/metabase/.gitkeep b/ressources/metabase/rootfs/usr/share/metabase/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/metabase/rootfs/var/lib/metabase/.gitkeep b/ressources/metabase/rootfs/var/lib/metabase/.gitkeep new file mode 100644 index 0000000..e69de29