updates 33.2 112

This commit is contained in:
2026-08-11 07:30:27 -03:00
parent 910927993e
commit 2d9bc9289c
17 changed files with 1287 additions and 109 deletions

View File

@@ -41,6 +41,14 @@ if [ "$SYNC_ONLY" = true ]; then
fi
echo "Restarting soleprint on server..."
ssh "$SERVER" "cd $REMOTE_DIR && docker compose up -d --build"
# The compose file runs the container as ${UID:-1000}:${GID:-1000} and bind-mounts
# the deployed tree at /app. Those have to be the ids that OWN the tree, and they
# are not 1000 on every host — mcrn.ar's user is 1001. Without this the container
# starts fine and then 500s on the first file it reads, which reads as an app bug
# rather than a permissions one.
#
# `env` rather than a prefix assignment: UID is readonly in bash, so
# `UID=$(id -u) docker ...` fails outright.
ssh "$SERVER" "cd $REMOTE_DIR && env UID=\$(id -u) GID=\$(id -g) docker compose up -d --build"
echo "Deploy complete"

31
ctrl/dist.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Compile the plexus UIs to distributable files — this repo's `vite build`.
#
# Usage:
# ./ctrl/dist.sh # standalone
# ./ctrl/dist.sh sample # a named room
#
# A plexus is a UI that gets EXPORTED, not served. The output is a single
# index.html carrying its theme, its data and its diagrams inline, so it opens
# from a double-click on a machine with no server, no node and no network — the
# state a regulated Windows box is usually in.
#
# `make build` runs this as one of its steps. This exists for the loop where the
# UI is what you are working on: rebuilding a whole room to see a CSS change is
# a slow way to iterate.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
cd "$ROOT_DIR"
PYTHON="${PYTHON:-python3}"
ROOM="${1:-standalone}"
if [[ ! -d "cfg/$ROOM" ]]; then
echo "No such room: cfg/$ROOM" >&2
echo "Available: $(find cfg -mindepth 1 -maxdepth 1 -type d -not -name '.*' -printf '%f ')" >&2
exit 1
fi
exec "$PYTHON" build.py --plexuses --cfg "$ROOM"

47
ctrl/docs.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Documentation: serve the pages, and re-render the diagrams.
#
# Usage: docs.sh serve [port] | graphs [theme]
#
# The docs are a static SPA — index.html plus data/*.md read at runtime — so
# they need a server only because fetch() refuses file:// origins. Any static
# server does; python is already a hard dependency here (build.py is python), so
# there is no reason to reach for docker the way rig does.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
DOCS_DIR="$ROOT_DIR/docs"
PYTHON="${PYTHON:-python3}"
PORT="${DOCS_PORT:-8080}"
serve() {
[ -n "${1:-}" ] && PORT="$1"
if [ ! -f "$DOCS_DIR/index.html" ]; then
echo "no docs/index.html" >&2
exit 1
fi
echo "docs on http://localhost:${PORT}/"
echo " (ctrl-c to stop; nothing is installed and nothing persists)"
cd "$DOCS_DIR"
exec "$PYTHON" -m http.server "$PORT"
}
# Re-render docs/graphs/*.dot through every theme. The sources carry structure;
# the palette lives in docs/graphs/themes/*.gvpr. See docs/graphs/README.md.
graphs() {
if [ ! -x "$DOCS_DIR/graphs/render.sh" ]; then
echo "no docs/graphs/render.sh" >&2
exit 1
fi
exec bash "$DOCS_DIR/graphs/render.sh" "$@"
}
case "${1:-serve}" in
serve) shift || true; serve "$@" ;;
graphs) shift || true; graphs "$@" ;;
# `make docs 8090` is the obvious thing to type, so take it.
''|*[!0-9]*) echo "usage: $0 [serve [port]|graphs [theme]]" >&2; exit 1 ;;
*) serve "$1" ;;
esac