You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: load deployment config from .env (gitignored)
- bin/app.ts reads DOMAIN_* and TELEGRAM_GROUPS from process.env,
falling back to cdk.json placeholders when unset.
- deploy.sh sources .env so CDK picks up real values.
- .env.example added as a public template.
- .gitignore: allow !.env.example through the .env.* glob.
- README Quick Start rewritten around the .env flow.
cdk.json keeps the original placeholder content so a fresh clone
still synthesizes; .env overrides at deploy time.
# Telegram groups — JSON array. One entry per group.
11
+
# secretName must already exist in AWS Secrets Manager and hold the bot token.
12
+
TELEGRAM_GROUPS=[{"groupId":"my-team","chatId":"-1001234567890","name":"My Team Photo Wall","secretName":"telegram/bot-token/my-team","botUsername":"my_photo_wall_bot"}]
The repo ships with `.env.example` (placeholder values). Copy it to `.env` (gitignored) and fill in your real domain + Telegram groups. `deploy.sh` sources `.env` and exposes the values to the CDK app, where they override the `domain` and `telegramGroups` placeholders in `cdk.json`.
531
+
532
+
```bash
533
+
cp .env.example .env
534
+
# then edit .env with your real values
544
535
```
545
536
537
+
`.env` schema:
538
+
539
+
| Variable | Required? | Description |
540
+
|---|---|---|
541
+
|`DOMAIN_NAME`| optional | Custom subdomain, e.g. `wall.example.com`. Omit to use the CloudFront default URL. |
542
+
|`DOMAIN_HOSTED_ZONE_ID`| with domain | Route53 Hosted Zone ID for the parent zone |
543
+
|`DOMAIN_HOSTED_ZONE_NAME`| with domain | Parent zone name, e.g. `example.com`|
544
+
|`DOMAIN_CERTIFICATE_ARN`| with domain | ACM cert ARN — **must be in `us-east-1`** for CloudFront |
545
+
|`TELEGRAM_GROUPS`| required | JSON array, **wrap in single quotes** so bash preserves the inner double quotes |
546
+
547
+
Each group in `TELEGRAM_GROUPS` has:
548
+
546
549
| Field | Description | Example |
547
550
|---|---|---|
548
551
|`groupId`| URL slug for the wall |`my-team`|
549
552
|`chatId`| Telegram group Chat ID |`-1001234567890`|
550
553
|`name`| Display name on the wall |`My Team Photo Wall`|
551
-
|`secretName`| Secrets Manager secret name |`telegram/bot-token/my-team`|
|`secretName`| Secrets Manager secret name (must already exist, see Step 1) |`telegram/bot-token/my-team`|
555
+
|`botUsername`| Bot's @username (only @mentions are shown) |`my_photo_wall_bot`|
568
556
569
557
> ACM certificate **must** be requested in `us-east-1` for CloudFront. CDK automatically creates the Route53 A record alias.
570
558
571
-
### Step 4 — Deploy
559
+
### Step 3 — Deploy
572
560
573
561
```bash
574
562
./deploy.sh
575
563
```
576
564
565
+
`deploy.sh` automatically loads `.env`, runs `npm install`, builds the frontend, and `cdk deploys` to the region from `AWS_DEFAULT_REGION` (defaults to `us-east-1`).
566
+
577
567
Or manually:
578
568
579
569
```bash
570
+
set -a &&source .env &&set +a
580
571
npm install
581
572
cd photo-wall && npm install && npm run build &&cd ..
0 commit comments