diff options
author | Kirill Isakov | 2025-03-06 19:55:40 +0500 |
---|---|---|
committer | Kirill Isakov | 2025-03-06 19:55:40 +0500 |
commit | e992e00f4642ccd7e98995d0987c90f7d6c4b452 (patch) | |
tree | 6e335fed54a31ee736d0db98ee39fa95438b93cf /silverbullet.sh | |
parent | 974ab98203a250c4ce1afc47547ea9afd03a8780 (diff) | |
download | aur-silverbullet.tar.gz |
silverbullet: support for per-user service
Diffstat (limited to 'silverbullet.sh')
-rw-r--r-- | silverbullet.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/silverbullet.sh b/silverbullet.sh new file mode 100644 index 000000000000..89c707cf95d8 --- /dev/null +++ b/silverbullet.sh @@ -0,0 +1,34 @@ +#!/usr/bin/sh + +set -eu + +HOST=${HOST:-localhost} +PORT=${PORT:-3000} +echo >&2 "listening on $HOST:$PORT" + +if [ $# -gt 1 ]; then + echo >&2 "usage: $0 optional_path" + exit 1 +fi + +if [ $# = 1 ]; then + echo >&2 "overriding $DOCS with $1" + DOCS=$1 +fi + +if [ -z "${DOCS:-}" ]; then + echo >&2 'root directory not set in $DOCS' + exit 1 +fi + +echo >&2 "using root directory $DOCS" +mkdir -p "$DOCS" + +exec /usr/bin/deno run \ + --allow-all \ + --unstable-kv \ + --unstable-worker-options \ + /usr/lib/silverbullet/silverbullet.js \ + --hostname "$HOST" \ + --port "$PORT" \ + "$DOCS" |