From b11315c19da0660072ed8ee6e2fe5412b756a6aa Mon Sep 17 00:00:00 2001 From: bain Date: Sat, 5 Aug 2023 14:49:09 +0200 Subject: [PATCH] add flame dashboard --- scripts/flame/docker-compose.yml | 13 +++++++++++++ scripts/flame/landing.Caddyfile | 10 ++++++++++ scripts/flame/script.sh | 29 +++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 scripts/flame/docker-compose.yml create mode 100644 scripts/flame/landing.Caddyfile create mode 100644 scripts/flame/script.sh diff --git a/scripts/flame/docker-compose.yml b/scripts/flame/docker-compose.yml new file mode 100644 index 0000000..003ddf4 --- /dev/null +++ b/scripts/flame/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + flame: + image: pawelmalak/flame + container_name: flame + volumes: + - /data/flame:/app/data + ports: + - 127.0.0.1:8086:5005 + environment: + - PASSWORD=$gen_pw + restart: unless-stopped diff --git a/scripts/flame/landing.Caddyfile b/scripts/flame/landing.Caddyfile new file mode 100644 index 0000000..8509c6d --- /dev/null +++ b/scripts/flame/landing.Caddyfile @@ -0,0 +1,10 @@ +https://{$DOMAIN} { + import blocked_matcher + handle @blocked { + file_server { + root /var/www + status 403 + } + } + reverse_proxy http://localhost:8086 +} diff --git a/scripts/flame/script.sh b/scripts/flame/script.sh new file mode 100644 index 0000000..d89fdbf --- /dev/null +++ b/scripts/flame/script.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Template script not meant to be run +set -euo pipefail + +source "$HL_LIB" + +_assert_vars HL_DOMAIN; + +_ch_001-make_dirs() { + mkdir -p ~/flame /data/flame; +} + +_ch_002-copy_compose() { + export HL_GEN_PW="$(openssl rand -hex 12)"; + cp $(_fill docker-compose.yml.templ) ~/flame/docker-compose.yml; +} + +_ch_003-update_caddy() { + # overwrite the default landing page + cp landing.Caddyfile /etc/caddy/conf.d; + sudo systemctl reload caddy.service; +} + +_ch_004-run-service() { + cd ~/flame; + docker-compose up -d; +} + +_run_checkpoints;