docs(ci): flag NAS deploy secrets risk and .env.production breakage
Build & Deploy / build (push) Failing after 4s
Build & Deploy / docker (push) Skipped

Untracking .env.production (commit 3cc189c) breaks the 'cat .env.production'
step in this pipeline, since the job clones a fresh copy of the repo. This
is intentional: the file contained plaintext secrets and should never have
been committed. Documented inline:
- the deploy step will fail until secrets are migrated to Gitea Actions
  secrets and the .env file is generated at deploy time
- the sshpass/sudo -S pattern for NASPASS should be replaced with a
  dedicated SSH key and scoped passwordless sudo

Not changing the workflow itself: no access to the NAS to reconfigure
SSH/sudo or verify a fix end-to-end from this environment.
This commit is contained in:
Kevin L'Hereec committed 2026-07-23 11:28:01 +02:00
1 parent 562cea39de
commit b88871879c
1 file changed
+29
+29
View File
@@ -41,6 +41,35 @@ jobs:
docker push ${IMAGE}:latest
docker push ${IMAGE}:${{ github.sha }}
# ---------------------------------------------------------------------
# ⚠️ SECURITY REVIEW NOTES (see pc_builder remediation plan, item 1.4)
# ---------------------------------------------------------------------
# This deploy step has two known issues that were flagged during a
# security review but intentionally NOT auto-fixed here (no access to
# reconfigure the NAS SSH/sudo setup from this environment):
#
# 1. `.env.production` was removed from git tracking (it contained
# plaintext APP_KEY/DB_PASSWORD and should never have been
# committed). The `cat .env.production` line below now reads a
# file that will NOT exist in a fresh `git clone` of this repo,
# since this job clones the repo from scratch at the top of the
# `docker` job. This step WILL fail until the deployment secrets
# are migrated to Gitea Actions secrets and the `.env` file is
# generated at deploy time instead of committed, e.g.:
# printf 'APP_KEY=%s\nDB_PASSWORD=%s\n...' \
# "${{ secrets.APP_KEY }}" "${{ secrets.DB_PASSWORD }}" | \
# sshpass ... "cat > /volume1/docker/pc_builder/.env"
# Until that migration happens, whoever runs this pipeline must
# place a non-committed `.env.production` file back in the
# repository checkout (or update this script) for deploys to work.
#
# 2. The NAS password (`secrets.NASPASS`) is passed on the command
# line via `sshpass -p` and `sudo -S`, which can leak through
# process listings and CI logs. Recommended remediation: switch to
# a dedicated SSH key stored as a Gitea secret, and configure a
# scoped passwordless `sudo` (NOPASSWD) on the NAS limited to the
# exact commands below (setup-db.sh, docker compose, docker exec),
# rather than transiting the interactive user's password.
- name: Deploy on NAS
run: |
apk add --no-cache openssh-client sshpass