Something went wrong. Try again.
deployment templates for lichen
Something went wrong. Try again.
1.5 kB · 44 lines
Shell
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445#!/bin/shset -e
# disable bubblewrap sandbox — not supported inside Dockerrm -f /usr/bin/bwrap
# install runtime dependenciesapk add --no-cache bash git-daemon openssh-keygen > /dev/null 2>&1 || true
# set git identity for auto-commitif command -v git > /dev/null 2>&1; then git config --global user.email "lichen@${LM_DASHBOARD_DOMAIN:-localhost}" git config --global user.name "lichen"fi
# write lichen.toml if it doesn't exist yetif [ ! -f /data/lichen.toml ]; then TOML_PROVIDERS=$(echo "${AUTH_PROVIDERS:-file,atproto}" | sed 's/[^,][^,]*/\"&\"/g') echo "auth_providers = [$TOML_PROVIDERS]" > /data/lichen.toml if [ -n "$DEFAULT_STORAGE_LIMIT" ]; then echo "default_storage_limit = \"$DEFAULT_STORAGE_LIMIT\"" >> /data/lichen.toml fifi
# choose one executable for both administration and servingLICHEN_BIN=lichenif [ -x /opt/lichen-bin/lichen ]; then LICHEN_BIN=/opt/lichen-bin/lichen echo "++ using custom binary from $LICHEN_BIN"fi
# create or update admin user on every startupif [ -n "$ADMIN_PASSWORD" ]; then if [ -f "/data/users/${ADMIN_USER:-admin}.toml" ]; then "$LICHEN_BIN" server --multi users set-password "${ADMIN_USER:-admin}" \ --password "$ADMIN_PASSWORD" --root-dir /data else "$LICHEN_BIN" server --multi users add "${ADMIN_USER:-admin}" \ --password "$ADMIN_PASSWORD" --root-dir /data fifi
# start hosted mode explicitly; the bare server command is the local managerexec "$LICHEN_BIN" server --multi --root-dir /data run