From b53336ced596e0731242633314e2c600cdbfb7d7 Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Sat, 23 Nov 2024 12:26:34 -0500 Subject: [PATCH] nov 2024 sync --- lech/docker/.gitignore | 1 + lech/docker/caddy.sh | 2 + lech/docker/immich.sh | 4 +- lech/docker/mesh.sh | 82 +++++++++++++++++++++++++++++++++++++++ lech/docker/meshmap.sh | 49 +++++++++++++++++++++++ lech/docker/open-webui.sh | 24 ++++++++++++ lech/docker/photoview.sh | 46 ---------------------- lech/docker/seafile.sh | 53 +++++++++++++++++++++++++ 8 files changed, 213 insertions(+), 48 deletions(-) create mode 100755 lech/docker/mesh.sh create mode 100755 lech/docker/meshmap.sh create mode 100755 lech/docker/open-webui.sh delete mode 100755 lech/docker/photoview.sh create mode 100755 lech/docker/seafile.sh diff --git a/lech/docker/.gitignore b/lech/docker/.gitignore index 296e7ff..41f5cc6 100644 --- a/lech/docker/.gitignore +++ b/lech/docker/.gitignore @@ -1,2 +1,3 @@ CaverEveryHour/ +meshtastic-map/ *.env diff --git a/lech/docker/caddy.sh b/lech/docker/caddy.sh index f2d003b..e108ad7 100755 --- a/lech/docker/caddy.sh +++ b/lech/docker/caddy.sh @@ -32,6 +32,8 @@ up () { --volume /mammoth/caddy/logs:/logs:rw \ --publish 443:443 \ --publish 443:443/udp \ + --publish [$(tailscale ip -6)]:8443:8443 \ + --publish [$(tailscale ip -6)]:8443:8443/udp \ --network pew-net \ customcaddy:latest } diff --git a/lech/docker/immich.sh b/lech/docker/immich.sh index 6bcd160..d12cf41 100755 --- a/lech/docker/immich.sh +++ b/lech/docker/immich.sh @@ -18,7 +18,7 @@ up () { --volume /mammoth/photos:/external_library/photos:ro \ --volume /etc/localtime:/etc/localtime:ro \ --network pew-net \ - ghcr.io/immich-app/immich-server:v1.116.2 + ghcr.io/immich-app/immich-server:v1.120.2 docker run \ --detach \ @@ -32,7 +32,7 @@ up () { --env REDIS_HOSTNAME=immich-redis \ --volume /mammoth/immich/cache:/cache:rw \ --network pew-net \ - ghcr.io/immich-app/immich-machine-learning:v1.116.2 + ghcr.io/immich-app/immich-machine-learning:v1.120.2 docker run \ --detach \ diff --git a/lech/docker/mesh.sh b/lech/docker/mesh.sh new file mode 100755 index 0000000..ed79473 --- /dev/null +++ b/lech/docker/mesh.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +set -e + +sudo sysctl -w vm.max_map_count=262144 +up () { +# docker run \ +# --detach \ +# --name mesh-mq \ +# --volume /mammoth/mesh/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro \ +# --volume /mammoth/mesh/mosquitto/passwd:/mosquitto/config/passwd:ro \ +# --publish 1883:1883 \ +# eclipse-mosquitto:2 +# +# docker run \ +# --detach \ +# --name mesh-es \ +# --env discovery.type=single-node \ +# --env http.host=0.0.0.0 \ +# --env xpack.security.enabled=false \ +# --volume /mammoth/mesh/elasticsearch/data:/usr/share/elasticsearch/data:rw \ +# --network pew-net \ +# docker.elastic.co/elasticsearch/elasticsearch:8.15.2 +# +# docker run \ +# --detach \ +# --name mesh-kb \ +# --env SERVER_PUBLICBASEURL=https://kibana.caving.dev:8443 \ +# --env ELASTICSEARCH_HOST='["http://mesh-es:9200"]' \ +# --volume /mammoth/mesh/kibana/data:/usr/share/kibana/data:rw \ +# --network pew-net \ +# docker.elastic.co/kibana/kibana:8.15.2 +# +# docker run \ +# --detach \ +# --name mesh-mc \ +# --network pew-net \ +# memcached:1.6 + + docker run \ + --detach \ + --name mesh-fb \ + --volume /mammoth/mesh/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro \ + --network pew-net \ + docker.elastic.co/beats/filebeat:8.15.2 +# +# docker run \ +# --detach \ +# --name mesh-lg \ +# --volume /mammoth/mesh/logstash/pipeline:/usr/share/logstash/pipeline:ro \ +# --network pew-net \ +# docker.elastic.co/logstash/logstash-oss:8.15.2 +# +# docker run \ +# --detach \ +# --name mesh-gf \ +# --user 1000 \ +# --env GF_DOMAIN=mesh.caving.dev \ +# --env GF_SERVER_ROOT_URL=https://mesh.caving.dev \ +# --volume /mammoth/mesh/grafana/grafana:/var/lib/grafana:rw \ +# --network pew-net \ +# grafana/grafana-oss:11.2.1 +} + +down () { +# docker stop mesh-mq || true +# docker rm mesh-mq || true +# docker stop mesh-es || true +# docker rm mesh-es || true +# docker stop mesh-kb || true +# docker rm mesh-kb || true +# docker stop mesh-mc || true +# docker rm mesh-mc || true + docker stop mesh-fb || true + docker rm mesh-fb || true +# docker stop mesh-lg || true +# docker rm mesh-lg || true +# docker stop mesh-gf || true +# docker rm mesh-gf || true +} + +$@ diff --git a/lech/docker/meshmap.sh b/lech/docker/meshmap.sh new file mode 100755 index 0000000..e0884e3 --- /dev/null +++ b/lech/docker/meshmap.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e + +pushd meshtastic-map &>/dev/null +docker build -t meshtastic-map:latest . +popd &>/dev/null + +up () { + docker run \ + --detach \ + --name meshmap-db \ + --env MARIADB_DATABASE=meshtastic-map_db \ + --env MARIADB_ROOT_PASSWORD=meshtastic-map_pw \ + --volume /mammoth/meshmap/db/mariadb:/bitnami/mariadb:rw \ + --network pew-net \ + bitnami/mariadb + + echo 'Waiting 10 seconds for mariadb to start up...' + sleep 10 + + docker run \ + --detach \ + --name meshmap-mqtt \ + --env-file $HOME/scripts-private/lech/meshmap.env \ + --env DATABASE_URL="mysql://root:meshtastic-map_pw@meshmap-db:3306/meshtastic-map_db?connection_limit=100" \ + --network pew-net \ + meshtastic-map:latest /app/docker/mqtt.sh + + # 8080 on pew-net + docker run \ + --detach \ + --name meshmap-map \ + --env DATABASE_URL="mysql://root:meshtastic-map_pw@meshmap-db:3306/meshtastic-map_db?connection_limit=100" \ + --network pew-net \ + meshtastic-map:latest /app/docker/map.sh +} + +down () { + docker stop meshmap-db || true + docker rm meshmap-db || true + docker stop meshmap-mqtt || true + docker rm meshmap-mqtt || true + docker stop meshmap-map || true + docker rm meshmap-map || true +} + + +$@ diff --git a/lech/docker/open-webui.sh b/lech/docker/open-webui.sh new file mode 100755 index 0000000..4134603 --- /dev/null +++ b/lech/docker/open-webui.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +up () { + docker network create pew-net || true + + # Exposed on port 8080 on pew-net + docker run \ + --detach \ + --name open-webui \ + --restart unless-stopped \ + --volume /mammoth/open-webui/data:/app/backend/data:rw \ + --volume /mammoth/open-webui/ollama:/root/.ollama:rw \ + --network pew-net \ + ghcr.io/open-webui/open-webui:ollama +} + +down () { + docker stop open-webui || true + docker rm open-webui || true +} + +$@ diff --git a/lech/docker/photoview.sh b/lech/docker/photoview.sh deleted file mode 100755 index ce21ca9..0000000 --- a/lech/docker/photoview.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -set -e - -up () { - # Exposed on port 80 in pew-net - docker run \ - --detach \ - --name photoview \ - --restart unless-stopped \ - --env PHOTOVIEW_DATABASE_DRIVER=mysql \ - --env PHOTOVIEW_MYSQL_URL=photoview:photoview@tcp\(pv-mariadb\)/photoview \ - --env PHOTOVIEW_LISTEN_IP=photoview \ - --env PHOTOVIEW_LISTEN_PORT=80 \ - --env PHOTOVIEW_MEDIA_CACHE=/app/cache \ - --volume /mammoth/photoview/cache:/cache:rw \ - --volume /mammoth/photos:/photos:ro \ - --network pew-net \ - viktorstrate/photoview:2 - - docker run \ - --detach \ - --name pv-mariadb \ - --restart unless-stopped \ - --env MYSQL_DATABASE=photoview \ - --env MYSQL_USER=photoview \ - --env MYSQL_PASSWORD=photoview \ - --env MYSQL_RANDOM_ROOT_PASSWORD=1 \ - --volume /mammoth/photoview/mysql:/var/lib/mysql:rw \ - --network pew-net \ - mariadb:10.5 -} - -down () { - docker stop photoview || true - docker stop pv-mariadb || true - docker rm photoview || true - docker rm pv-mariadb || true -} - -logs () { - docker logs --follow photoview - docker logs --follow pv-mariadb -} - -$@ diff --git a/lech/docker/seafile.sh b/lech/docker/seafile.sh new file mode 100755 index 0000000..d2bb21c --- /dev/null +++ b/lech/docker/seafile.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +set -e + +up () { + docker run \ + --detach \ + --name seafile-db \ + --restart unless-stopped \ + --env MYSQL_ROOT_PASSWORD=seafile_pw \ + --env MYSQL_LOG_CONSOLE=true \ + --env MARIADB_AUTO_UPGRADE=1 \ + --volume /mammoth/seafile/mariadb/mysql:/var/lib/mysql:rw \ + --network pew-net \ + mariadb:10.11 + + docker run \ + --detach \ + --name seafile-mc \ + --restart unless-stopped \ + --network pew-net \ + memcached:1.6.18 /bin/bash -c "memcached -m 256" + + echo 'Waiting 5 seconds for mariadb to start up...' + sleep 5 + + # Exposed on port 80 in pew-net + docker run \ + --detach \ + --name seafile \ + --restart unless-stopped \ + --env DB_HOST=seafile-db \ + --env DB_ROOT_PASSWD=seafile_pw \ + --env TIME_ZONE=America/New_York \ + --env SEAFILE_ADMIN_EMAIL=paul@bigcavemaps.com \ + --env SEAFILE_SERVER_LETSENCRYPT=false \ + --env SEAFILE_SERVER_HOSTNAME=https://docs.bigcavemaps.com \ + --volume /mammoth/seafile/seafile/shared:/shared:rw \ + --network pew-net \ + seafileltd/seafile-mc:11.0-latest +} + +down () { + docker stop seafile || true + docker rm seafile || true + docker stop seafile-db || true + docker rm seafile-db || true + docker stop seafile-mc || true + docker rm seafile-mc || true +} + + +$@