commit
Maybe this
diff --git a/.gitignore b/.gitignore
index 2d7ec5c..b19e0d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.env
node_modules/
+*/supervise/
\ No newline at end of file
diff --git a/deno.json b/deno.json
index 144be56..0784c91 100644
--- a/deno.json
+++ b/deno.json
@@ -1,7 +1,7 @@
{
"nodeModulesDir": "auto",
"tasks": {
- "dev": "deno run --watch --allow-net --allow-env --allow-read --env-file=.env src/main.ts"
+ "start": "deno run --watch --allow-net --allow-env --allow-read --env-file=.env src/main.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
diff --git a/deploy/log/run b/deploy/log/run
new file mode 100755
index 0000000..177a969
--- /dev/null
+++ b/deploy/log/run
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+LOG_DIR=/var/log/proxyBot
+
+mkdir -p "$LOG_DIR"
+exec svlogd -tt "$LOG_DIR"
\ No newline at end of file
diff --git a/deploy/run b/deploy/run
new file mode 100755
index 0000000..dab89d8
--- /dev/null
+++ b/deploy/run
@@ -0,0 +1,11 @@
+#!/bin/sh
+exec 2>&1
+
+cd /srv/bot/proxyBot || exit 1
+
+# Run as clove rather than root. chpst doesn't change HOME, so set it for Deno's cache
+export HOME=/home/clove
+
+# Secrets (SSO client, session secret, guestbook key) live in /srv/clove/web/.env,
+# which Deno skips if it's missing. Reads are limited to this folder
+exec chpst -u clove /usr/bin/deno task start
\ No newline at end of file