Rename Basking to Nurse

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VeillaxandClaude Sonnet 5.5 committed 2026-11-01 00:06:51 -06:00
1 parent cec2702260
commit 6a4be5b2f4
24 files changed
+208 -208

No files matched your search

+4 -4
View File
@@ -1,17 +1,17 @@
#!/bin/sh
# Builds basking for every release platform and packs the archives into dist/.
# Builds nurse for every release platform and packs the archives into dist/.
#
# deploy/build.sh [version] version defaults to `git describe`
#
# Output:
# dist/basking_<version>_<os>_<arch>.tar.gz or .zip
# dist/nurse_<version>_<os>_<arch>.tar.gz or .zip
# dist/SHA256SUMS
#
# Releases are published for linux/amd64, linux/arm64 and windows/amd64. Set TARGETS="linux/arm64 darwin/arm64"
# (any GOOS/GOARCH pair Go supports) to build something else by hand.
set -eu
NAME=basking
CMDS="basking"
NAME=nurse
CMDS="nurse"
cd "$(dirname "$0")/.."
VERSION=${1:-$(git describe --tags --always 2>/dev/null || echo dev)}
TARGETS=${TARGETS:-"linux/amd64 linux/arm64 windows/amd64"}
+9 -9
View File
@@ -1,17 +1,17 @@
# Basking, a private notebook you sign in to with Authentik. Reach it through an HTTPS reverse proxy
# Nurse, a private notebook you sign in to with Authentik. Reach it through an HTTPS reverse proxy
# (or Hammerhead) that forwards to 127.0.0.1:8490, and give Authentik the redirect URI
# https://notes.example.com/auth/callback (use your own address).
services:
basking:
image: git.veillax.com/veillax/basking:latest # or: build: ..
nurse:
image: git.veillax.com/veillax/nurse:latest # or: build: ..
restart: unless-stopped
ports:
- "127.0.0.1:8490:8490"
environment:
BASKING_PUBLIC_URL: https://notes.example.com
BASKING_OIDC_ISSUER: https://auth.example.com/application/o/basking/
BASKING_OIDC_CLIENT_ID: change-me
BASKING_OIDC_CLIENT_SECRET: change-me
# BASKING_ALLOWED: you@example.com # optional: limit who may sign in
NURSE_PUBLIC_URL: https://notes.example.com
NURSE_OIDC_ISSUER: https://auth.example.com/application/o/nurse/
NURSE_OIDC_CLIENT_ID: change-me
NURSE_OIDC_CLIENT_SECRET: change-me
# NURSE_ALLOWED: you@example.com # optional: limit who may sign in
volumes:
- ./config:/config # basking.json (the signing secret) and data/ (your pages) live here
- ./config:/config # nurse.json (the signing secret) and data/ (your pages) live here
+50 -50
View File
@@ -1,31 +1,31 @@
#!/bin/sh
# Installs (or upgrades) Basking as a systemd service.
# Installs (or upgrades) Nurse as a systemd service.
#
# curl -fsSL https://git.veillax.com/Veillax/basking/raw/branch/main/deploy/install.sh | sudo sh
# curl -fsSL https://git.veillax.com/Veillax/nurse/raw/branch/main/deploy/install.sh | sudo sh
# sudo sh install.sh [--start] [--version v0.1.0] [--listen 127.0.0.1:8490] [--source]
# sudo sh install.sh --uninstall [--purge]
#
# What it does:
# 1. downloads the release archive for this machine and checks its SHA-256 (or, with --source,
# clones the repository and builds it with Go),
# 2. installs the binary to /usr/local/bin/basking,
# 3. creates a "basking" user, /etc/basking (settings) and /var/lib/basking (data),
# 4. writes /etc/basking/basking.env and the systemd service,
# 2. installs the binary to /usr/local/bin/nurse,
# 3. creates a "nurse" user, /etc/nurse (settings) and /var/lib/nurse (data),
# 4. writes /etc/nurse/nurse.env and the systemd service,
# 5. tells you what to do next: edit the env file, start the service, watch the log.
#
# Running it again upgrades the binary and keeps your settings; a service that is already running
# is restarted. Add --start to start it straight away instead of editing the env file first.
set -eu
REPO_URL=${BASKING_REPO_URL:-https://git.veillax.com/Veillax/basking}
API_URL=${BASKING_API_URL:-https://git.veillax.com/api/v1/repos/Veillax/basking}
BIN=/usr/local/bin/basking
CONF_DIR=/etc/basking
DATA_DIR=/var/lib/basking
ENV_FILE=$CONF_DIR/basking.env
CONF_FILE=$CONF_DIR/basking.json
UNIT=/etc/systemd/system/basking.service
USER_NAME=basking
REPO_URL=${NURSE_REPO_URL:-https://git.veillax.com/Veillax/nurse}
API_URL=${NURSE_API_URL:-https://git.veillax.com/api/v1/repos/Veillax/nurse}
BIN=/usr/local/bin/nurse
CONF_DIR=/etc/nurse
DATA_DIR=/var/lib/nurse
ENV_FILE=$CONF_DIR/nurse.env
CONF_FILE=$CONF_DIR/nurse.json
UNIT=/etc/systemd/system/nurse.service
USER_NAME=nurse
VERSION=""
LISTEN="127.0.0.1:8490"
@@ -58,7 +58,7 @@ HAVE_SYSTEMD=${HAVE_SYSTEMD:-1}
if [ "$UNINSTALL" -eq 1 ]; then
if [ "$HAVE_SYSTEMD" -eq 1 ]; then
systemctl disable --now basking 2>/dev/null || true
systemctl disable --now nurse 2>/dev/null || true
rm -f "$UNIT"
systemctl daemon-reload
fi
@@ -66,9 +66,9 @@ if [ "$UNINSTALL" -eq 1 ]; then
if [ "$PURGE" -eq 1 ]; then
rm -rf "$CONF_DIR" "$DATA_DIR"
userdel "$USER_NAME" 2>/dev/null || true
say "Basking removed, including its settings and data."
say "Nurse removed, including its settings and data."
else
say "Basking removed. Settings ($CONF_DIR) and data ($DATA_DIR) were kept; add --purge to delete them."
say "Nurse removed. Settings ($CONF_DIR) and data ($DATA_DIR) were kept; add --purge to delete them."
fi
exit 0
fi
@@ -88,7 +88,7 @@ if [ "$SOURCE" -eq 1 ]; then
command -v go >/dev/null 2>&1 || die "--source needs Go (https://go.dev/dl/)"
say "Cloning $REPO_URL ..."
git clone --quiet ${VERSION:+--branch "$VERSION"} --depth 1 "$REPO_URL" "$TMP/src"
(cd "$TMP/src" && CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION:-source}" -o "$TMP/basking" ./cmd/basking)
(cd "$TMP/src" && CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION:-source}" -o "$TMP/nurse" ./cmd/nurse)
else
case $(uname -m) in
x86_64|amd64) ARCH=amd64 ;;
@@ -100,8 +100,8 @@ else
VERSION=$(sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$TMP/latest.json" | head -n 1)
[ -n "$VERSION" ] || die "could not find the latest release; use --version or --source"
fi
ARCHIVE="basking_${VERSION}_linux_${ARCH}.tar.gz"
say "Downloading Basking $VERSION ($ARCH) ..."
ARCHIVE="nurse_${VERSION}_linux_${ARCH}.tar.gz"
say "Downloading Nurse $VERSION ($ARCH) ..."
fetch "$REPO_URL/releases/download/$VERSION/$ARCHIVE" "$TMP/$ARCHIVE"
fetch "$REPO_URL/releases/download/$VERSION/SHA256SUMS" "$TMP/SHA256SUMS"
want=$(grep " $ARCHIVE\$" "$TMP/SHA256SUMS" | cut -d' ' -f1)
@@ -109,14 +109,14 @@ else
got=$(sha256sum "$TMP/$ARCHIVE" | cut -d' ' -f1)
[ "$want" = "$got" ] || die "checksum mismatch for $ARCHIVE; refusing to install"
tar -xzf "$TMP/$ARCHIVE" -C "$TMP"
cp "$TMP/basking_${VERSION}_linux_${ARCH}/basking" "$TMP/basking"
cp "$TMP/nurse_${VERSION}_linux_${ARCH}/nurse" "$TMP/nurse"
fi
# ---- 2. install it ----
UPGRADE=0
[ -x "$BIN" ] && UPGRADE=1
if [ "$UPGRADE" -eq 1 ] && [ "$HAVE_SYSTEMD" -eq 1 ]; then systemctl stop basking 2>/dev/null || true; fi
install -m 0755 "$TMP/basking" "$BIN"
if [ "$UPGRADE" -eq 1 ] && [ "$HAVE_SYSTEMD" -eq 1 ]; then systemctl stop nurse 2>/dev/null || true; fi
install -m 0755 "$TMP/nurse" "$BIN"
say "Installed $("$BIN" version) to $BIN"
# ---- 3. user and folders ----
@@ -136,31 +136,31 @@ if [ ! -f "$CONF_FILE" ]; then
fi
if [ ! -f "$ENV_FILE" ]; then
cat > "$ENV_FILE" <<EOF
# Environment for the basking service. Restart it after editing: systemctl restart basking
# Environment for the nurse service. Restart it after editing: systemctl restart nurse
#
# Basking has no passwords. You sign in with Authentik, so fill in the four lines below.
# Nurse has no passwords. You sign in with Authentik, so fill in the four lines below.
# In Authentik: Applications > Providers > Create > OAuth2/OpenID Provider (client type
# Confidential, scopes openid, profile and email), allow the redirect URI
# <BASKING_PUBLIC_URL>/auth/callback
# then create an Application that uses it. Check the result with: basking check
# <NURSE_PUBLIC_URL>/auth/callback
# then create an Application that uses it. Check the result with: nurse check
# Where you open Basking in a browser, such as https://notes.example.com (no path).
BASKING_PUBLIC_URL=
# The provider's issuer, such as https://auth.example.com/application/o/basking/
BASKING_OIDC_ISSUER=
BASKING_OIDC_CLIENT_ID=
BASKING_OIDC_CLIENT_SECRET=
# Where you open Nurse in a browser, such as https://notes.example.com (no path).
NURSE_PUBLIC_URL=
# The provider's issuer, such as https://auth.example.com/application/o/nurse/
NURSE_OIDC_ISSUER=
NURSE_OIDC_CLIENT_ID=
NURSE_OIDC_CLIENT_SECRET=
# Optional. Only these people may sign in (emails or usernames, separated by commas). Left empty,
# everyone Authentik lets into the application gets a private notebook of their own.
#BASKING_ALLOWED=you@example.com
#NURSE_ALLOWED=you@example.com
# Where the settings file is (it holds the signing secret).
BASKING_CONFIG=$CONF_FILE
NURSE_CONFIG=$CONF_FILE
# Optional. These override what the settings file says.
#BASKING_LISTEN=$LISTEN
#BASKING_DATA=$DATA_DIR
#NURSE_LISTEN=$LISTEN
#NURSE_DATA=$DATA_DIR
EOF
chmod 0600 "$ENV_FILE" # systemd reads it as root, so the service user does not need access
say "Created $ENV_FILE."
@@ -175,7 +175,7 @@ fi
cat > "$UNIT" <<EOF
[Unit]
Description=Basking, a private notebook
Description=Nurse, a private notebook
After=network-online.target
Wants=network-online.target
@@ -189,7 +189,7 @@ RestartSec=5
# Settings that need fixing by hand exit with status 2; do not loop on those.
RestartPreventExitStatus=2
# Basking only needs the network and its own folders.
# Nurse only needs the network and its own folders.
NoNewPrivileges=true
ProtectSystem=strict
ReadWritePaths=$CONF_DIR $DATA_DIR
@@ -205,16 +205,16 @@ RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable basking >/dev/null 2>&1
systemctl enable nurse >/dev/null 2>&1
if [ "$START" -eq 1 ] || systemctl is-active --quiet basking; then
systemctl restart basking
if [ "$START" -eq 1 ] || systemctl is-active --quiet nurse; then
systemctl restart nurse
sleep 3
if systemctl is-active --quiet basking; then
say "Basking is running."
if systemctl is-active --quiet nurse; then
say "Nurse is running."
else
say "Basking did not start. If you have not filled in the Authentik settings in $ENV_FILE yet, that is why."
say "Look at: journalctl -u basking -n 50"
say "Nurse did not start. If you have not filled in the Authentik settings in $ENV_FILE yet, that is why."
say "Look at: journalctl -u nurse -n 50"
exit 1
fi
fi
@@ -222,8 +222,8 @@ fi
say "Installed $("$BIN" version)."
say "Next:"
say " 1. sudoedit $ENV_FILE (fill in the Authentik settings at the top)"
say " 2. systemctl start basking (or run this again with --start)"
say " 3. journalctl -u basking -f to watch it; it says at once if a setting is missing or wrong"
say " 2. systemctl start nurse (or run this again with --start)"
say " 3. journalctl -u nurse -f to watch it; it says at once if a setting is missing or wrong"
say ""
say "Basking listens on $LISTEN. Put an HTTPS reverse proxy (or Hammerhead) in front of it and open the"
say "address you set as BASKING_PUBLIC_URL; Authentik will not send people back to plain http."
say "Nurse listens on $LISTEN. Put an HTTPS reverse proxy (or Hammerhead) in front of it and open the"
say "address you set as NURSE_PUBLIC_URL; Authentik will not send people back to plain http."
+1 -1
View File
@@ -9,7 +9,7 @@ set -eu
TAG=${1:?usage: publish-release.sh <tag>}
: "${TOKEN:?set TOKEN to a Gitea access token that can write releases}"
SERVER=${GITHUB_SERVER_URL:-${GITEA_SERVER_URL:-https://git.veillax.com}}
REPO=${GITHUB_REPOSITORY:-Veillax/basking}
REPO=${GITHUB_REPOSITORY:-Veillax/nurse}
API="$SERVER/api/v1/repos/$REPO"
AUTH="Authorization: token $TOKEN"