From 0ec8ca459c5bb3309fa05292813e0d8982fb7aee Mon Sep 17 00:00:00 2001 From: afterlifepro Date: Sun, 23 Nov 2025 16:10:41 +0000 Subject: [PATCH] knot ssh reverse proxy + better git stuff + notifications --- commit.sh | 16 ++++++++-------- compose.yaml | 10 ++++++++++ nginx.conf | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 nginx.conf diff --git a/commit.sh b/commit.sh index a9706f5..3e21d1f 100755 --- a/commit.sh +++ b/commit.sh @@ -6,12 +6,12 @@ echo "Got new commit: $(date)" echo "---" echo -# saves current state of fs -git stash - # pull latest version -git pull -git submodule update +git fetch --all +git reset --hard origin/main + +curl -d "name=vps%20git%20updated&body=fetched%20latest%20git%20commit%20for%20vielle.dev/vps-config&key=vps/commit/git" http://compuper:6500/notify + # restart/rebuild all containers docker compose build --no-cache @@ -22,6 +22,6 @@ docker compose up -d # clear out dockerfiles to stop my drive exploding docker system prune -af -# return prev state of fs -git stash pop -exit 0 \ No newline at end of file +curl -d "name=vps%20ready&body=finished%20building%20docker&key=vps/commit/build" http://compuper:6500/notify + +exit 0 diff --git a/compose.yaml b/compose.yaml index 971ecc6..fef32d5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -31,6 +31,16 @@ services: - prs - landing + # nginx for ssh reverse proxy + # because caddy hates woke + nginx: + image: nginx + restart: unless-stopped + ports: + - 22001:2222 + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf + volumes: caddy_data: caddy_config: diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..45a196e --- /dev/null +++ b/nginx.conf @@ -0,0 +1,19 @@ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log notice; +pid /run/nginx.pid; + +events { + worker_connections 1024; +} + +stream { + upstream knot-ssh { + server pi:2222; + } + + server { + listen 2222; + proxy_pass knot-ssh; + } +} \ No newline at end of file -- 2.51.2