Repo build logic now runs as the unprivileged docsbuild user with a scrubbed environment; the Cloudron token lives only in a root-owned publish script that executes no repository code.
45 lines
1.8 KiB
Desktop File
45 lines
1.8 KiB
Desktop File
# systemd unit for the docs auto-deploy poller (agent host).
|
|
#
|
|
# docs-deploy-poll.service ALWAYS ON. Polls Gitea every 60s; deploys on
|
|
# any change to main.
|
|
#
|
|
# docs-deploy-webhook.service INSTALLED, INACTIVE. It predates the
|
|
# build/publish split, loads the agent's env
|
|
# file, and runs repo scripts with the Cloudron
|
|
# token. Do not enable it until it is ported to
|
|
# the same split.
|
|
#
|
|
# Install:
|
|
# sudo install -o root -g root -m 0644 publishing/docs-deploy-poll.service \
|
|
# /etc/systemd/system/docs-deploy-poll.service
|
|
# sudo systemctl daemon-reload
|
|
# sudo systemctl enable --now docs-deploy-poll
|
|
#
|
|
# The unit runs a HOST-OWNED script, /usr/local/sbin/docs-poll, which is not
|
|
# copied from this repository. That script:
|
|
# * builds as the unprivileged `docsbuild` user from its own checkout at
|
|
# /var/lib/docs-publisher/repo (a scrubbed environment, no read access to
|
|
# /home/ubuntu, so repo code cannot see any co-op credential);
|
|
# * publishes with /usr/local/sbin/docs-publish, a root-owned script that
|
|
# runs no repository code and reads the Cloudron token from
|
|
# /etc/docs-deploy.env (root-only, mode 0600).
|
|
#
|
|
# Repo code (build.sh, hooks.py) therefore never executes with a credential.
|
|
# See publishing/README.md.
|
|
|
|
[Unit]
|
|
Description=Inference docs: poll Gitea main, build unprivileged, publish without repo code
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
User=root
|
|
Environment=DOCS_REPO_DIR=/var/lib/docs-publisher/repo
|
|
Environment=DOCS_DEPLOY_LOG=/var/log/docs-deploy.log
|
|
ExecStart=/usr/local/sbin/docs-poll
|
|
Restart=on-failure
|
|
RestartSec=10
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|