Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit acbded4

Browse files
bpamiriclaude
andcommitted
security: Remove secrets from repo and migrate to GitHub Secrets
Remove all .env files containing database credentials, SMTP passwords, Sentry DSN, and other secrets. The CI workflow now generates .env at build time from GitHub repository secrets instead of copying committed files. Also redacts infrastructure details from the deployment guide and replaces hardcoded test DB passwords with configurable defaults. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a25ebcf commit acbded4

10 files changed

Lines changed: 84 additions & 190 deletions

File tree

.github/workflows/swarm-deploy.yml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,63 @@ jobs:
1818
- name: Checkout repository
1919
uses: actions/checkout@v4
2020

21-
- name: Copy swarm config files to root
21+
- name: Generate .env from secrets
22+
env:
23+
RELOAD_PASSWORD: ${{ secrets.RELOAD_PASSWORD }}
24+
CFCONFIG_ADMIN_PASSWORD: ${{ secrets.CFCONFIG_ADMIN_PASSWORD }}
25+
WHEELSDEV_HOST: ${{ secrets.WHEELSDEV_HOST }}
26+
WHEELSDEV_PORT: ${{ secrets.WHEELSDEV_PORT }}
27+
WHEELSDEV_DATABASENAME: ${{ secrets.WHEELSDEV_DATABASENAME }}
28+
WHEELSDEV_USERNAME: ${{ secrets.WHEELSDEV_USERNAME }}
29+
WHEELSDEV_PASSWORD: ${{ secrets.WHEELSDEV_PASSWORD }}
30+
SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }}
31+
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
32+
WHEELS_ID_SALT: ${{ secrets.WHEELS_ID_SALT }}
33+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
34+
run: |
35+
cat > .env << ENVEOF
36+
LUCEE_EXTENSIONS=BEC20D47-3268-1B354-C0E8E70B5CBC15A1;name=PostgreSQL;version=42.7.4
37+
38+
environment=production
39+
reloadPassword=${RELOAD_PASSWORD}
40+
41+
cfconfig_adminPassword=${CFCONFIG_ADMIN_PASSWORD}
42+
43+
application_host=https://wheels.dev
44+
datasource=wheels.dev
45+
46+
wheelsdev_host=${WHEELSDEV_HOST}
47+
wheelsdev_port=${WHEELSDEV_PORT}
48+
wheelsdev_databasename=${WHEELSDEV_DATABASENAME}
49+
wheelsdev_username=${WHEELSDEV_USERNAME}
50+
wheelsdev_password=${WHEELSDEV_PASSWORD}
51+
wheelsdev_clob=true
52+
wheelsdev_connectionlimit=100
53+
wheelsdev_storage=true
54+
55+
wheelsdev_storage=true
56+
sessionStorage=wheels.dev
57+
sessionCluster=true
58+
59+
test_case=false
60+
mail_from=noreply@wheels.dev
61+
62+
smtp_host=smtp.postmarkapp.com
63+
smtp_port=587
64+
smtp_username=${SMTP_USERNAME}
65+
smtp_password=${SMTP_PASSWORD}
66+
smtp_ssl=false
67+
smtp_tls=true
68+
69+
wheels_id_salt=${WHEELS_ID_SALT}
70+
71+
SENTRY_DSN=${SENTRY_DSN}
72+
SENTRY_ENVIRONMENT=production
73+
ENVEOF
74+
sed -i 's/^ //' .env
75+
76+
- name: Copy swarm Dockerfile to root
2277
run: |
23-
cp ./deploy/swarm/.env ./
2478
cp ./deploy/swarm/dockerfile ./
2579
2680
- name: Install CommandBox

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ settings.xml
3131
!public/files/
3232
!/public/files/json/
3333
!/public/files/json/**
34-
/.env
34+
# Environment files (may contain secrets)
35+
.env
36+
.env.*
37+
!.env.example
38+
3539
/server.json
3640
public/images/Headshot.jpg

deploy/dev/.env

Lines changed: 0 additions & 40 deletions
This file was deleted.

deploy/prod/.env

Lines changed: 0 additions & 40 deletions
This file was deleted.

deploy/stage/.env

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
LUCEE_EXTENSIONS=BEC20D47-3268-1B354-C0E8E70B5CBC15A1;name=PostgreSQL;version=42.7.4
22

33
environment=development
4-
reloadPassword=w4u6r7daKHAYMDLZXDgUcwn99RReNium
4+
reloadPassword=CHANGE_ME
55

6-
cfconfig_adminPassword=commandbox
6+
cfconfig_adminPassword=CHANGE_ME
77

88
application_host=https://wheels.dev
99
datasource=wheels.dev
1010

11-
wheelsdev_host=10.100.10.230
11+
wheelsdev_host=CHANGE_ME
1212
wheelsdev_port=26257
1313
wheelsdev_databasename=wheels_db
14-
wheelsdev_username=wheels_user
15-
wheelsdev_password=x5N6kR62ArF58zetwMSZ
14+
wheelsdev_username=CHANGE_ME
15+
wheelsdev_password=CHANGE_ME
1616
wheelsdev_clob=true
1717
wheelsdev_connectionlimit=100
1818
wheelsdev_storage=true
@@ -26,15 +26,15 @@ mail_from=noreply@wheels.dev
2626

2727
smtp_host=smtp.postmarkapp.com
2828
smtp_port=587
29-
smtp_username=PM-T-outbound-OnVp1i-oZ0q8mz15PGdx3W
30-
smtp_password=Tav_B5Y2mPUczTzdwFl3Mx7DGqb1FRpip0jX
29+
smtp_username=CHANGE_ME
30+
smtp_password=CHANGE_ME
3131
smtp_ssl=false
3232
smtp_tls=true
3333

3434
# ID Obfuscation Salt
35-
wheels_id_salt=w4u6r7daKHAYMDLZXDgUcwn99RReNium
35+
wheels_id_salt=CHANGE_ME
3636

3737
# Sentry Error Reporting
3838
# DSN format: https://<public_key>@<host>/<project_id>
39-
SENTRY_DSN=https://ce106d4b62c07150550f1fa56dee0c7b@o4510302287888384.ingest.us.sentry.io/4510693409816576
39+
SENTRY_DSN=CHANGE_ME
4040
SENTRY_ENVIRONMENT=production

deploy/swarm/DEPLOYMENT-GUIDE.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Internet → Cloudflare (SSL termination) → cloudflared tunnel → Traefik (po
1717

1818
| Method | Details |
1919
|--------|---------|
20-
| SSH | `ssh petera@10.100.10.234` (key-based auth; see vault for key) |
21-
| Docker context | `docker context create swarm --docker "host=ssh://petera@10.100.10.234"` |
22-
| Portainer | `https://portainer.apps.paiindustries.com` |
20+
| SSH | `ssh <username>@<manager-ip>` (key-based auth; see vault for key and credentials) |
21+
| Docker context | `docker context create swarm --docker "host=ssh://<username>@<manager-ip>"` |
22+
| Portainer | See vault for URL |
2323

2424
Only key-based SSH access is available. Deploy commands run on any **manager node** (swarm-01, swarm-02, or swarm-03).
2525

@@ -156,14 +156,10 @@ volumes:
156156
Applications can connect to the CockroachDB cluster via the VIP:
157157

158158
```
159-
postgresql://username:password@10.100.10.230:26257/database?sslmode=disable
159+
postgresql://username:password@<cockroachdb-vip>:26257/database?sslmode=disable
160160
```
161161

162-
| Database | User | Password |
163-
|----------|------|----------|
164-
| titan_sessiondb | titan_sessions | (see vault) |
165-
| paiman_db | paiman_user | (see vault) |
166-
| wheels_db | wheels_user | (see vault) |
162+
Database names, users, and passwords are stored in the vault. Contact the cluster admin for access.
167163

168164
To request a new database/user, ask the cluster admin.
169165

@@ -281,13 +277,7 @@ networks:
281277

282278
## Swarm Nodes
283279

284-
| Hostname | IP | Role | Notes |
285-
|----------|----|------|-------|
286-
| swarm-01 | 10.100.10.234 | Manager (Leader) | Deploy here |
287-
| swarm-02 | 10.100.10.235 | Manager | |
288-
| swarm-03 | 10.100.10.245 | Manager | |
289-
| swarm-04 | 10.100.10.251 | Worker | |
290-
| VIP | 10.100.10.252 | Keepalived | Floats between nodes |
280+
Node hostnames, IPs, and roles are documented in the vault. The swarm consists of 3 manager nodes and 1 worker node with a Keepalived VIP.
291281

292282
Each node: 16 vCPU, 64GB RAM, 200GB disk, CephFS at `/mnt/cephfs`.
293283

@@ -307,10 +297,10 @@ Each node: 16 vCPU, 64GB RAM, 200GB disk, CephFS at `/mnt/cephfs`.
307297

308298
| Tool | URL |
309299
|------|-----|
310-
| Portainer | `https://portainer.apps.paiindustries.com` |
311-
| Grafana | `https://grafana.apps.paiindustries.com` (see vault for credentials) |
312-
| Prometheus | `https://prometheus.apps.paiindustries.com` |
313-
| Traefik Dashboard | `http://10.100.10.234:8080` |
300+
| Portainer | See vault for URL |
301+
| Grafana | See vault for URL and credentials |
302+
| Prometheus | See vault for URL |
303+
| Traefik Dashboard | `http://<manager-ip>:8080` |
314304

315305
Logs for any service: `docker service logs <service-name> --tail 100 -f`
316306

deploy/tests/.env

Lines changed: 0 additions & 35 deletions
This file was deleted.

deploy/tests/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
DB_PORT: 1433
1212
DB_DATABASE: wheels_dev
1313
DB_USERNAME: sa
14-
DB_PASSWORD: "@bjs0016"
14+
DB_PASSWORD: "${MSSQL_SA_PASSWORD:-TestPassword123!}"
1515
ports:
1616
- "60151:60151" # change if your app uses a different port
1717
networks:
@@ -26,7 +26,7 @@ services:
2626
environment:
2727
ACCEPT_EULA: "Y"
2828
MSSQL_PID: "Express"
29-
MSSQL_SA_PASSWORD: "@bjs0016"
29+
MSSQL_SA_PASSWORD: "${MSSQL_SA_PASSWORD:-TestPassword123!}"
3030
ports:
3131
- "1433:1433"
3232
networks:

deploy/tests/dockerfile_db

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ LABEL maintainer "Wheels Core Team"
66
USER root
77

88
# Set environment variables
9-
ENV MSSQL_SA_PASSWORD="@bjs0016"
9+
ARG MSSQL_SA_PASSWORD=TestPassword123!
10+
ENV MSSQL_SA_PASSWORD=${MSSQL_SA_PASSWORD}
1011
ENV ACCEPT_EULA="Y"
1112
ENV MSSQL_PID="Express"
1213

0 commit comments

Comments
 (0)