start

tcmts.deploy.registry.start · #xze3o6bz · sh file

#!/bin/sh
# Run tcm's registry from the volume: its directory (TCM_REGISTRY_DIR) holds its tables, jobs, where it got to in
# Jetstream and the codebase it mirrors libraries into; it's made the first time, and a newer tcm updates the
# registry's app in it and keeps the rest. Its default is /data/hub, where it was made while the registry was called
# the hub (moving it is moving the directory with the service stopped, then setting TCM_REGISTRY_DIR). It's at
# tcm.codes/registry (TCM_REGISTRY_BASE): tcm's server passes it what's asked there, over Railway's private network (so
# it listens on IPv6 too: ::), with the address visitors asked (Host, and x-forwarded-proto from Railway, which
# terminates TLS): the address its OAuth client document names.
set -eu
if [ -n "${TCM_ATPROTO_LOCAL:-}" ]; then
  echo "TCM_ATPROTO_LOCAL is set: it lets the registry fetch plain http and local addresses, never right for one on the internet" >&2
  exit 1
fi
exec node /app/node_modules/tcm-ts/bin/tcm.js registry --host :: --port "${PORT:-8080}" --base "${TCM_REGISTRY_BASE:-/registry}" --dir "${TCM_REGISTRY_DIR:-/data/hub}"