@factiii/stack 0.1.200 → 0.1.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +403 -403
- package/bin/stack +334 -334
- package/dist/cli/dev-sync.js +16 -16
- package/dist/plugins/addons/auth/index.js +7 -7
- package/dist/plugins/addons/vercel/index.js +9 -9
- package/dist/plugins/addons/vercel/scanfix/config.js +10 -10
- package/dist/plugins/addons/vercel/scanfix/token.js +15 -15
- package/dist/plugins/approved.json +13 -13
- package/dist/plugins/pipelines/aws/index.js +12 -12
- package/dist/plugins/pipelines/aws/policies/bootstrap-policy.json +135 -135
- package/dist/plugins/pipelines/aws/prod.js +1 -1
- package/dist/plugins/pipelines/factiii/index.d.ts.map +1 -1
- package/dist/plugins/pipelines/factiii/index.js +2 -14
- package/dist/plugins/pipelines/factiii/index.js.map +1 -1
- package/dist/plugins/pipelines/factiii/prod.js +21 -21
- package/dist/plugins/pipelines/factiii/scanfix/port-convention.d.ts.map +1 -1
- package/dist/plugins/pipelines/factiii/scanfix/port-convention.js +2 -4
- package/dist/plugins/pipelines/factiii/scanfix/port-convention.js.map +1 -1
- package/dist/plugins/pipelines/factiii/staging.js +23 -23
- package/dist/plugins/pipelines/factiii/workflows/stack-ci.yml +75 -75
- package/dist/plugins/pipelines/factiii/workflows/stack-cicd-prod.yml +73 -73
- package/dist/plugins/servers/amazon-linux/index.js +16 -16
- package/dist/plugins/servers/mac/index.js +12 -12
- package/dist/plugins/servers/mac/staging.js +2 -2
- package/dist/plugins/servers/ubuntu/index.js +23 -23
- package/dist/plugins/servers/windows/index.js +15 -15
- package/dist/scanfix/commands/mac.d.ts.map +1 -1
- package/dist/scanfix/commands/mac.js +5 -4
- package/dist/scanfix/commands/mac.js.map +1 -1
- package/dist/scanfix/fixes/certbot.d.ts.map +1 -1
- package/dist/scanfix/fixes/certbot.js +4 -18
- package/dist/scanfix/fixes/certbot.js.map +1 -1
- package/dist/scanfix/fixes/docker.d.ts.map +1 -1
- package/dist/scanfix/fixes/docker.js +5 -14
- package/dist/scanfix/fixes/docker.js.map +1 -1
- package/dist/scanfix/ssl-cert-helper.d.ts.map +1 -1
- package/dist/scanfix/ssl-cert-helper.js +18 -4
- package/dist/scanfix/ssl-cert-helper.js.map +1 -1
- package/dist/scripts/generate-all.js +73 -73
- package/dist/utils/deployment-report.js +2 -2
- package/dist/utils/secret-prompts.js +34 -34
- package/dist/utils/template-generator.js +74 -74
- package/package.json +100 -114
- package/dist/plugins/pipelines/factiii/scanfix/docker.d.ts +0 -20
- package/dist/plugins/pipelines/factiii/scanfix/docker.d.ts.map +0 -1
- package/dist/plugins/pipelines/factiii/scanfix/docker.js +0 -131
- package/dist/plugins/pipelines/factiii/scanfix/docker.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssl-cert-helper.js","sourceRoot":"","sources":["../../src/scanfix/ssl-cert-helper.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBH,
|
|
1
|
+
{"version":3,"file":"ssl-cert-helper.js","sourceRoot":"","sources":["../../src/scanfix/ssl-cert-helper.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBH,4CA6FC;AAOD,wCASC;AA9HD,iDAAyC;AACzC,uCAAyB;AASzB;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,MAAc,EAAE,WAAmB,CAAC;IACnE,MAAM,QAAQ,GAAG,wBAAwB,GAAG,MAAM,GAAG,gBAAgB,CAAC;IAEtE,kEAAkE;IAClE,IAAI,WAAW,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAE1C,mEAAmE;IACnE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,IAAI,CAAC;YACH,IAAA,wBAAQ,EAAC,gBAAgB,GAAG,QAAQ,GAAG,GAA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AAM,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YACxD,IAAI,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClC,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5C,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAChC,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAC5D,CAAC;gBACF,OAAO;oBACL,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,KAAK;oBACZ,aAAa,EAAE,eAAe;oBAC9B,KAAK,EAAE,0BAA0B,GAAG,eAAe,GAAG,OAAO;iBAC9D,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,sBAAsB;QACxB,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,sCAAsC,EAAE,CAAC;IACvF,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,cAAc;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,6DAA6D,EAAE;YACrF,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,eAAe,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -271,31 +271,31 @@ function generateNginx(allConfigs) {
|
|
|
271
271
|
return 0;
|
|
272
272
|
}
|
|
273
273
|
// Generate nginx config
|
|
274
|
-
let nginxConf = `# Auto-generated nginx configuration
|
|
275
|
-
# Generated by: npx stack (generate-all)
|
|
276
|
-
# Do not edit directly - modify stack.yml files and run: npx stack deploy
|
|
277
|
-
|
|
278
|
-
events {
|
|
279
|
-
worker_connections 1024;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
http {
|
|
283
|
-
include /etc/nginx/mime.types;
|
|
284
|
-
default_type application/octet-stream;
|
|
285
|
-
|
|
286
|
-
sendfile on;
|
|
287
|
-
keepalive_timeout 65;
|
|
288
|
-
client_max_body_size 100M;
|
|
289
|
-
|
|
290
|
-
# Logging
|
|
291
|
-
access_log /var/log/nginx/access.log;
|
|
292
|
-
error_log /var/log/nginx/error.log;
|
|
293
|
-
|
|
294
|
-
# Gzip
|
|
295
|
-
gzip on;
|
|
296
|
-
gzip_vary on;
|
|
297
|
-
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
298
|
-
|
|
274
|
+
let nginxConf = `# Auto-generated nginx configuration
|
|
275
|
+
# Generated by: npx stack (generate-all)
|
|
276
|
+
# Do not edit directly - modify stack.yml files and run: npx stack deploy
|
|
277
|
+
|
|
278
|
+
events {
|
|
279
|
+
worker_connections 1024;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
http {
|
|
283
|
+
include /etc/nginx/mime.types;
|
|
284
|
+
default_type application/octet-stream;
|
|
285
|
+
|
|
286
|
+
sendfile on;
|
|
287
|
+
keepalive_timeout 65;
|
|
288
|
+
client_max_body_size 100M;
|
|
289
|
+
|
|
290
|
+
# Logging
|
|
291
|
+
access_log /var/log/nginx/access.log;
|
|
292
|
+
error_log /var/log/nginx/error.log;
|
|
293
|
+
|
|
294
|
+
# Gzip
|
|
295
|
+
gzip on;
|
|
296
|
+
gzip_vary on;
|
|
297
|
+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
298
|
+
|
|
299
299
|
`;
|
|
300
300
|
// ============================================================
|
|
301
301
|
// CRITICAL: HTTPS Certificate Paths
|
|
@@ -308,54 +308,54 @@ http {
|
|
|
308
308
|
for (const { domain, service, port } of routes) {
|
|
309
309
|
// Always generate HTTPS-capable config
|
|
310
310
|
// Certificates must exist before nginx can start (obtained via: npx stack fix --staging/--prod)
|
|
311
|
-
nginxConf += `
|
|
312
|
-
# ${service} - ${domain}
|
|
313
|
-
|
|
314
|
-
# HTTP - ACME challenge + redirect to HTTPS
|
|
315
|
-
server {
|
|
316
|
-
listen 80;
|
|
317
|
-
server_name ${domain};
|
|
318
|
-
|
|
319
|
-
# Allow certbot ACME challenge (for renewals)
|
|
320
|
-
location /.well-known/acme-challenge/ {
|
|
321
|
-
root /var/www/certbot;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
# Redirect all other traffic to HTTPS
|
|
325
|
-
location / {
|
|
326
|
-
return 301 https://$server_name$request_uri;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
# HTTPS - main server block
|
|
331
|
-
server {
|
|
332
|
-
listen 443 ssl;
|
|
333
|
-
http2 on;
|
|
334
|
-
server_name ${domain};
|
|
335
|
-
|
|
336
|
-
# SSL certificate paths (Let's Encrypt)
|
|
337
|
-
ssl_certificate /etc/letsencrypt/live/${domain}/fullchain.pem;
|
|
338
|
-
ssl_certificate_key /etc/letsencrypt/live/${domain}/privkey.pem;
|
|
339
|
-
|
|
340
|
-
# SSL security settings
|
|
341
|
-
ssl_protocols TLSv1.2 TLSv1.3;
|
|
342
|
-
ssl_prefer_server_ciphers on;
|
|
343
|
-
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
|
|
344
|
-
ssl_session_cache shared:SSL:10m;
|
|
345
|
-
ssl_session_timeout 10m;
|
|
346
|
-
|
|
347
|
-
location / {
|
|
348
|
-
proxy_pass http://${service}:${port};
|
|
349
|
-
proxy_http_version 1.1;
|
|
350
|
-
proxy_set_header Upgrade $http_upgrade;
|
|
351
|
-
proxy_set_header Connection 'upgrade';
|
|
352
|
-
proxy_set_header Host $host;
|
|
353
|
-
proxy_cache_bypass $http_upgrade;
|
|
354
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
355
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
356
|
-
proxy_set_header X-Forwarded-Proto $scheme;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
311
|
+
nginxConf += `
|
|
312
|
+
# ${service} - ${domain}
|
|
313
|
+
|
|
314
|
+
# HTTP - ACME challenge + redirect to HTTPS
|
|
315
|
+
server {
|
|
316
|
+
listen 80;
|
|
317
|
+
server_name ${domain};
|
|
318
|
+
|
|
319
|
+
# Allow certbot ACME challenge (for renewals)
|
|
320
|
+
location /.well-known/acme-challenge/ {
|
|
321
|
+
root /var/www/certbot;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
# Redirect all other traffic to HTTPS
|
|
325
|
+
location / {
|
|
326
|
+
return 301 https://$server_name$request_uri;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
# HTTPS - main server block
|
|
331
|
+
server {
|
|
332
|
+
listen 443 ssl;
|
|
333
|
+
http2 on;
|
|
334
|
+
server_name ${domain};
|
|
335
|
+
|
|
336
|
+
# SSL certificate paths (Let's Encrypt)
|
|
337
|
+
ssl_certificate /etc/letsencrypt/live/${domain}/fullchain.pem;
|
|
338
|
+
ssl_certificate_key /etc/letsencrypt/live/${domain}/privkey.pem;
|
|
339
|
+
|
|
340
|
+
# SSL security settings
|
|
341
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
|
342
|
+
ssl_prefer_server_ciphers on;
|
|
343
|
+
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
|
|
344
|
+
ssl_session_cache shared:SSL:10m;
|
|
345
|
+
ssl_session_timeout 10m;
|
|
346
|
+
|
|
347
|
+
location / {
|
|
348
|
+
proxy_pass http://${service}:${port};
|
|
349
|
+
proxy_http_version 1.1;
|
|
350
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
351
|
+
proxy_set_header Connection 'upgrade';
|
|
352
|
+
proxy_set_header Host $host;
|
|
353
|
+
proxy_cache_bypass $http_upgrade;
|
|
354
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
355
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
356
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
359
|
`;
|
|
360
360
|
}
|
|
361
361
|
nginxConf += `}\n`;
|
|
@@ -154,8 +154,8 @@ function formatDeploymentReport(data) {
|
|
|
154
154
|
function formatWorkflowSummary(data) {
|
|
155
155
|
const report = formatDeploymentReport(data);
|
|
156
156
|
// Workflow summaries support markdown, so we can enhance it
|
|
157
|
-
return `\`\`\`
|
|
158
|
-
${report}
|
|
157
|
+
return `\`\`\`
|
|
158
|
+
${report}
|
|
159
159
|
\`\`\``;
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
@@ -64,16 +64,16 @@ const SECRET_METADATA = {
|
|
|
64
64
|
STAGING_SSH: {
|
|
65
65
|
type: 'ssh_key',
|
|
66
66
|
description: 'SSH private key for accessing staging server',
|
|
67
|
-
helpText: `
|
|
68
|
-
Step 1: Generate a new SSH key pair:
|
|
69
|
-
ssh-keygen -t ed25519 -C "staging-deploy" -f ~/.ssh/staging_deploy
|
|
70
|
-
|
|
71
|
-
Step 2: Add PUBLIC key to your staging server:
|
|
72
|
-
ssh-copy-id -i ~/.ssh/staging_deploy.pub ubuntu@YOUR_HOST
|
|
73
|
-
|
|
74
|
-
(HOST is configured in stack.yml → environments.staging.host)
|
|
75
|
-
|
|
76
|
-
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
67
|
+
helpText: `
|
|
68
|
+
Step 1: Generate a new SSH key pair:
|
|
69
|
+
ssh-keygen -t ed25519 -C "staging-deploy" -f ~/.ssh/staging_deploy
|
|
70
|
+
|
|
71
|
+
Step 2: Add PUBLIC key to your staging server:
|
|
72
|
+
ssh-copy-id -i ~/.ssh/staging_deploy.pub ubuntu@YOUR_HOST
|
|
73
|
+
|
|
74
|
+
(HOST is configured in stack.yml → environments.staging.host)
|
|
75
|
+
|
|
76
|
+
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
77
77
|
cat ~/.ssh/staging_deploy`,
|
|
78
78
|
validation: (value) => {
|
|
79
79
|
if (!value || value.trim().length === 0) {
|
|
@@ -91,16 +91,16 @@ const SECRET_METADATA = {
|
|
|
91
91
|
PROD_SSH: {
|
|
92
92
|
type: 'ssh_key',
|
|
93
93
|
description: 'SSH private key for accessing production server',
|
|
94
|
-
helpText: `
|
|
95
|
-
Step 1: Generate a new SSH key pair:
|
|
96
|
-
ssh-keygen -t ed25519 -C "production-deploy" -f ~/.ssh/prod_deploy
|
|
97
|
-
|
|
98
|
-
Step 2: Add PUBLIC key to your production server:
|
|
99
|
-
ssh-copy-id -i ~/.ssh/prod_deploy.pub ubuntu@YOUR_HOST
|
|
100
|
-
|
|
101
|
-
(HOST is configured in stack.yml → environments.production.host)
|
|
102
|
-
|
|
103
|
-
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
94
|
+
helpText: `
|
|
95
|
+
Step 1: Generate a new SSH key pair:
|
|
96
|
+
ssh-keygen -t ed25519 -C "production-deploy" -f ~/.ssh/prod_deploy
|
|
97
|
+
|
|
98
|
+
Step 2: Add PUBLIC key to your production server:
|
|
99
|
+
ssh-copy-id -i ~/.ssh/prod_deploy.pub ubuntu@YOUR_HOST
|
|
100
|
+
|
|
101
|
+
(HOST is configured in stack.yml → environments.production.host)
|
|
102
|
+
|
|
103
|
+
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
104
104
|
cat ~/.ssh/prod_deploy`,
|
|
105
105
|
validation: (value) => {
|
|
106
106
|
if (!value || value.trim().length === 0) {
|
|
@@ -118,14 +118,14 @@ const SECRET_METADATA = {
|
|
|
118
118
|
AWS_SECRET_ACCESS_KEY: {
|
|
119
119
|
type: 'aws_secret',
|
|
120
120
|
description: 'AWS Secret Access Key (the only secret AWS value)',
|
|
121
|
-
helpText: `
|
|
122
|
-
Get from AWS Console: IAM → Users → Security credentials
|
|
123
|
-
|
|
124
|
-
This is shown only once when you create the key.
|
|
125
|
-
If lost, you must create a new key pair.
|
|
126
|
-
|
|
127
|
-
Note: AWS_ACCESS_KEY_ID and AWS_REGION go in stack.yml (not secrets)
|
|
128
|
-
|
|
121
|
+
helpText: `
|
|
122
|
+
Get from AWS Console: IAM → Users → Security credentials
|
|
123
|
+
|
|
124
|
+
This is shown only once when you create the key.
|
|
125
|
+
If lost, you must create a new key pair.
|
|
126
|
+
|
|
127
|
+
Note: AWS_ACCESS_KEY_ID and AWS_REGION go in stack.yml (not secrets)
|
|
128
|
+
|
|
129
129
|
Enter AWS Secret Access Key:`,
|
|
130
130
|
validation: (value) => {
|
|
131
131
|
if (!value || value.trim().length === 0) {
|
|
@@ -143,12 +143,12 @@ const SECRET_METADATA = {
|
|
|
143
143
|
VERCEL_TOKEN: {
|
|
144
144
|
type: 'api_token',
|
|
145
145
|
description: 'Vercel API Token for deployments',
|
|
146
|
-
helpText: `
|
|
147
|
-
Get your token from: https://vercel.com/account/tokens
|
|
148
|
-
Create a new token with:
|
|
149
|
-
- Scope: Full Account (or specific team)
|
|
150
|
-
- Expiration: No Expiration (or custom)
|
|
151
|
-
|
|
146
|
+
helpText: `
|
|
147
|
+
Get your token from: https://vercel.com/account/tokens
|
|
148
|
+
Create a new token with:
|
|
149
|
+
- Scope: Full Account (or specific team)
|
|
150
|
+
- Expiration: No Expiration (or custom)
|
|
151
|
+
|
|
152
152
|
Enter Vercel API Token:`,
|
|
153
153
|
validation: (value) => {
|
|
154
154
|
if (!value || value.trim().length === 0) {
|
|
@@ -51,50 +51,50 @@ const env_validator_js_1 = require("./env-validator.js");
|
|
|
51
51
|
*/
|
|
52
52
|
function generateEnvExampleTemplate(config) {
|
|
53
53
|
const repoName = config.name ?? 'myapp';
|
|
54
|
-
const template = `# .env.example - Environment variable template
|
|
55
|
-
# This file defines all required environment variables across environments.
|
|
56
|
-
# Values are descriptive examples - replace with real values in .env.staging and .env.prod
|
|
57
|
-
# This file is committed to git as a template.
|
|
58
|
-
|
|
59
|
-
# === Application Settings ===
|
|
60
|
-
NODE_ENV=development
|
|
61
|
-
# Slot number (1-5). Client=3000+PORT, Server=5000+PORT
|
|
62
|
-
# Example: PORT=1 → client:3001, server:5001
|
|
63
|
-
PORT=1
|
|
64
|
-
|
|
65
|
-
# === Database ===
|
|
66
|
-
# PostgreSQL connection string format
|
|
67
|
-
DATABASE_URL=postgresql://EXAMPLE_user:EXAMPLE_password@localhost:5432/EXAMPLE_${repoName}-dev
|
|
68
|
-
|
|
69
|
-
# === Authentication ===
|
|
70
|
-
# 256-bit secret key for JWT signing
|
|
71
|
-
JWT_SECRET=EXAMPLE_your-256-bit-secret-key-here
|
|
72
|
-
JWT_EXPIRES_IN=7d
|
|
73
|
-
|
|
74
|
-
# === External APIs (if needed) ===
|
|
75
|
-
# OPENAI_API_KEY=EXAMPLE_sk-proj-abc123xyz789
|
|
76
|
-
# STRIPE_SECRET_KEY=EXAMPLE_sk_test_51ABC123xyz
|
|
77
|
-
# STRIPE_PUBLISHABLE_KEY=EXAMPLE_pk_test_51ABC123xyz
|
|
78
|
-
|
|
79
|
-
# === AWS Configuration (if using S3, SES, etc) ===
|
|
80
|
-
# AWS_ACCESS_KEY_ID=EXAMPLE_AKIAIOSFODNN7EXAMPLE
|
|
81
|
-
# AWS_SECRET_ACCESS_KEY=EXAMPLE_wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
|
82
|
-
# AWS_REGION=EXAMPLE_us-east-1
|
|
83
|
-
# AWS_BUCKET_NAME=EXAMPLE_${repoName}-assets
|
|
84
|
-
|
|
85
|
-
# === Email Configuration (if using SMTP) ===
|
|
86
|
-
# SMTP_HOST=EXAMPLE_smtp.gmail.com
|
|
87
|
-
# SMTP_PORT=587
|
|
88
|
-
# SMTP_USER=EXAMPLE_noreply@yourdomain.com
|
|
89
|
-
# SMTP_PASSWORD=EXAMPLE_your-app-password
|
|
90
|
-
|
|
91
|
-
# === Application URLs ===
|
|
92
|
-
# Replace YOUR_IP with your local network IP (start.sh does this automatically)
|
|
93
|
-
# FRONTEND_URL=http://YOUR_IP:3001
|
|
94
|
-
# API_URL=http://YOUR_IP:5001
|
|
95
|
-
|
|
96
|
-
# === Application-specific settings ===
|
|
97
|
-
# Add your custom environment variables below
|
|
54
|
+
const template = `# .env.example - Environment variable template
|
|
55
|
+
# This file defines all required environment variables across environments.
|
|
56
|
+
# Values are descriptive examples - replace with real values in .env.staging and .env.prod
|
|
57
|
+
# This file is committed to git as a template.
|
|
58
|
+
|
|
59
|
+
# === Application Settings ===
|
|
60
|
+
NODE_ENV=development
|
|
61
|
+
# Slot number (1-5). Client=3000+PORT, Server=5000+PORT
|
|
62
|
+
# Example: PORT=1 → client:3001, server:5001
|
|
63
|
+
PORT=1
|
|
64
|
+
|
|
65
|
+
# === Database ===
|
|
66
|
+
# PostgreSQL connection string format
|
|
67
|
+
DATABASE_URL=postgresql://EXAMPLE_user:EXAMPLE_password@localhost:5432/EXAMPLE_${repoName}-dev
|
|
68
|
+
|
|
69
|
+
# === Authentication ===
|
|
70
|
+
# 256-bit secret key for JWT signing
|
|
71
|
+
JWT_SECRET=EXAMPLE_your-256-bit-secret-key-here
|
|
72
|
+
JWT_EXPIRES_IN=7d
|
|
73
|
+
|
|
74
|
+
# === External APIs (if needed) ===
|
|
75
|
+
# OPENAI_API_KEY=EXAMPLE_sk-proj-abc123xyz789
|
|
76
|
+
# STRIPE_SECRET_KEY=EXAMPLE_sk_test_51ABC123xyz
|
|
77
|
+
# STRIPE_PUBLISHABLE_KEY=EXAMPLE_pk_test_51ABC123xyz
|
|
78
|
+
|
|
79
|
+
# === AWS Configuration (if using S3, SES, etc) ===
|
|
80
|
+
# AWS_ACCESS_KEY_ID=EXAMPLE_AKIAIOSFODNN7EXAMPLE
|
|
81
|
+
# AWS_SECRET_ACCESS_KEY=EXAMPLE_wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
|
82
|
+
# AWS_REGION=EXAMPLE_us-east-1
|
|
83
|
+
# AWS_BUCKET_NAME=EXAMPLE_${repoName}-assets
|
|
84
|
+
|
|
85
|
+
# === Email Configuration (if using SMTP) ===
|
|
86
|
+
# SMTP_HOST=EXAMPLE_smtp.gmail.com
|
|
87
|
+
# SMTP_PORT=587
|
|
88
|
+
# SMTP_USER=EXAMPLE_noreply@yourdomain.com
|
|
89
|
+
# SMTP_PASSWORD=EXAMPLE_your-app-password
|
|
90
|
+
|
|
91
|
+
# === Application URLs ===
|
|
92
|
+
# Replace YOUR_IP with your local network IP (start.sh does this automatically)
|
|
93
|
+
# FRONTEND_URL=http://YOUR_IP:3001
|
|
94
|
+
# API_URL=http://YOUR_IP:5001
|
|
95
|
+
|
|
96
|
+
# === Application-specific settings ===
|
|
97
|
+
# Add your custom environment variables below
|
|
98
98
|
`;
|
|
99
99
|
return template;
|
|
100
100
|
}
|
|
@@ -106,10 +106,10 @@ JWT_EXPIRES_IN=7d
|
|
|
106
106
|
*/
|
|
107
107
|
function generateEnvTemplate(environment, devEnv) {
|
|
108
108
|
const envUpper = environment.toUpperCase();
|
|
109
|
-
let template = `# .env.${environment} - ${envUpper} environment variables
|
|
110
|
-
# Fill in all values below. Keys must match .env.example
|
|
111
|
-
# This file should ${environment === 'prod' ? 'ALWAYS' : 'optionally'} be in .gitignore
|
|
112
|
-
|
|
109
|
+
let template = `# .env.${environment} - ${envUpper} environment variables
|
|
110
|
+
# Fill in all values below. Keys must match .env.example
|
|
111
|
+
# This file should ${environment === 'prod' ? 'ALWAYS' : 'optionally'} be in .gitignore
|
|
112
|
+
|
|
113
113
|
`;
|
|
114
114
|
// Copy keys from .env.example with placeholder values
|
|
115
115
|
for (const key of Object.keys(devEnv)) {
|
|
@@ -123,11 +123,11 @@ function generateEnvTemplate(environment, devEnv) {
|
|
|
123
123
|
template += `${key}=<FILL_IN>\n`;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
template += `
|
|
127
|
-
# Instructions:
|
|
128
|
-
# 1. Replace all <FILL_IN> values with real ${environment} values
|
|
129
|
-
# 2. Ensure all keys match .env.example
|
|
130
|
-
# 3. Run: npx stack (to validate)
|
|
126
|
+
template += `
|
|
127
|
+
# Instructions:
|
|
128
|
+
# 1. Replace all <FILL_IN> values with real ${environment} values
|
|
129
|
+
# 2. Ensure all keys match .env.example
|
|
130
|
+
# 3. Run: npx stack (to validate)
|
|
131
131
|
`;
|
|
132
132
|
return template;
|
|
133
133
|
}
|
|
@@ -200,27 +200,27 @@ function createEnvTemplates(rootDir, config) {
|
|
|
200
200
|
* Generate secrets checklist for display
|
|
201
201
|
*/
|
|
202
202
|
function generateSecretsChecklist() {
|
|
203
|
-
return `
|
|
204
|
-
REQUIRED GitHub Secrets (minimal):
|
|
205
|
-
───────────────────────────────────────────────────────
|
|
206
|
-
□ STAGING_SSH - SSH private key for staging
|
|
207
|
-
□ PROD_SSH - SSH private key for production
|
|
208
|
-
□ AWS_SECRET_ACCESS_KEY - AWS secret key (only secret AWS value)
|
|
209
|
-
|
|
210
|
-
OPTIONAL GitHub Secrets:
|
|
211
|
-
───────────────────────────────────────────────────────
|
|
212
|
-
□ STAGING_ENVS - Environment vars from .env.staging
|
|
213
|
-
□ PROD_ENVS - Environment vars from .env.prod
|
|
214
|
-
|
|
215
|
-
NOT SECRETS (in stack.yml):
|
|
216
|
-
───────────────────────────────────────────────────────
|
|
217
|
-
✓ environments.{env}.host - Server IP/hostname
|
|
218
|
-
✓ aws.access_key_id - AWS access key ID
|
|
219
|
-
✓ aws.region - AWS region (e.g., us-east-1)
|
|
220
|
-
|
|
221
|
-
NOT SECRETS (in factiiiAuto.yml):
|
|
222
|
-
───────────────────────────────────────────────────────
|
|
223
|
-
✓ ssh_user - Defaults to ubuntu
|
|
203
|
+
return `
|
|
204
|
+
REQUIRED GitHub Secrets (minimal):
|
|
205
|
+
───────────────────────────────────────────────────────
|
|
206
|
+
□ STAGING_SSH - SSH private key for staging
|
|
207
|
+
□ PROD_SSH - SSH private key for production
|
|
208
|
+
□ AWS_SECRET_ACCESS_KEY - AWS secret key (only secret AWS value)
|
|
209
|
+
|
|
210
|
+
OPTIONAL GitHub Secrets:
|
|
211
|
+
───────────────────────────────────────────────────────
|
|
212
|
+
□ STAGING_ENVS - Environment vars from .env.staging
|
|
213
|
+
□ PROD_ENVS - Environment vars from .env.prod
|
|
214
|
+
|
|
215
|
+
NOT SECRETS (in stack.yml):
|
|
216
|
+
───────────────────────────────────────────────────────
|
|
217
|
+
✓ environments.{env}.host - Server IP/hostname
|
|
218
|
+
✓ aws.access_key_id - AWS access key ID
|
|
219
|
+
✓ aws.region - AWS region (e.g., us-east-1)
|
|
220
|
+
|
|
221
|
+
NOT SECRETS (in factiiiAuto.yml):
|
|
222
|
+
───────────────────────────────────────────────────────
|
|
223
|
+
✓ ssh_user - Defaults to ubuntu
|
|
224
224
|
`.trim();
|
|
225
225
|
}
|
|
226
226
|
//# sourceMappingURL=template-generator.js.map
|