Skip to content

Commit 39893cf

Browse files
committed
docs: archive APNs setup (key GUFRSCY8ZV, bundle com.rescience.kickwatch)
1 parent 5d28903 commit 39893cf

2 files changed

Lines changed: 74 additions & 1 deletion

File tree

.archive/2026-02-27/apns-setup.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
date: 2026-02-27
3+
title: APNs Key Setup and CI/CD Integration
4+
category: infrastructure
5+
tags: [apns, ios, push-notifications, secrets-manager, ecs, github-actions]
6+
related: [2026-02-27/aws-infra-setup.md]
7+
---
8+
9+
# APNs Key Setup and CI/CD Integration
10+
11+
## Apple Developer Portal
12+
13+
- **Key Name**: KickWatch APNs
14+
- **Key ID**: `GUFRSCY8ZV`
15+
- **Team ID**: `7Q28CBP3S5` (same as SnapAction)
16+
- **Bundle ID**: `com.rescience.kickwatch`
17+
- **Environment**: Sandbox & Production (covers both dev and prod with one key)
18+
- **Key Restriction**: Team Scoped (All Topics)
19+
- **File**: `AuthKey_GUFRSCY8ZV.p8` — downloaded to `/Users/yilin/Downloads/`
20+
21+
## Secrets Manager (us-east-2)
22+
23+
All 4 APNs secrets set for both dev and prod prefixes:
24+
25+
| Secret | Value |
26+
|--------|-------|
27+
| `kickwatch-dev/apns-key-id` | `GUFRSCY8ZV` |
28+
| `kickwatch-dev/apns-team-id` | `7Q28CBP3S5` |
29+
| `kickwatch-dev/apns-bundle-id` | `com.rescience.kickwatch` |
30+
| `kickwatch-dev/apns-key` | Full `.p8` PEM content |
31+
| `kickwatch/apns-key-id` | `GUFRSCY8ZV` |
32+
| `kickwatch/apns-team-id` | `7Q28CBP3S5` |
33+
| `kickwatch/apns-bundle-id` | `com.rescience.kickwatch` |
34+
| `kickwatch/apns-key` | Full `.p8` PEM content |
35+
36+
## Commands Used
37+
38+
```bash
39+
KEY_ID="GUFRSCY8ZV"
40+
REGION=us-east-2
41+
42+
# Key ID
43+
aws secretsmanager put-secret-value \
44+
--secret-id kickwatch-dev/apns-key-id --region $REGION --secret-string "$KEY_ID"
45+
46+
# .p8 content
47+
aws secretsmanager put-secret-value \
48+
--secret-id kickwatch-dev/apns-key --region $REGION \
49+
--secret-string "$(cat ~/Downloads/AuthKey_GUFRSCY8ZV.p8)"
50+
```
51+
52+
## Backend Change: File Path → Env Var
53+
54+
`internal/service/apns.go` updated to read key from `APNS_KEY` env var first, falling back to `APNS_KEY_PATH` file. Avoids need to mount `.p8` file into ECS container.
55+
56+
`internal/config/config.go` added `APNSKey string` field reading `APNS_KEY`.
57+
58+
## CI Workflow Change
59+
60+
`deploy-backend.yml` — removed `APNS_KEY_PATH` env var, added `APNS_KEY` secret injected from Secrets Manager ARN.
61+
62+
## iOS Changes
63+
64+
- `project.yml`: `DEVELOPMENT_TEAM: 7Q28CBP3S5`, `PRODUCT_BUNDLE_IDENTIFIER: com.rescience.kickwatch`
65+
- `KickWatch.entitlements`: `aps-environment = development`
66+
67+
## Gotchas
68+
69+
- APNs key environment set to **Sandbox & Production** — one key works for both; do NOT create separate keys
70+
- Bundle ID must match exactly what's registered in Apple Developer Portal
71+
- `APNS_KEY` env var content is the raw PEM string including `-----BEGIN PRIVATE KEY-----` header/footer
72+
- ECS task execution role needs `secretsmanager:GetSecretValue` for `kickwatch*` ARNs (already added)

.archive/MEMORY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Archived learnings, debugging solutions, and infrastructure notes.
44
Search: `grep -ri "keyword" .archive/`
55

66
## Infrastructure & AWS
7-
- `2026-02-27/aws-infra-setup.md` — Full AWS setup: ECR (kickwatch-api/-dev), IAM OIDC deploy role, ECS clusters+services (desired=0), kickwatch-db-dev RDS (postgres 16.8, t3.micro, us-east-2), 8 Secrets Manager entries, GitHub secrets. **Pending**: fill APNs secrets, create prod RDS, set ECS desired_count=1 after first ECR push. **Gotcha**: VPN breaks local→RDS psql (same as SnapAction).
7+
- `2026-02-27/aws-infra-setup.md` — Full AWS setup: ECR (kickwatch-api/-dev), IAM OIDC deploy role, ECS clusters+services (desired=0), kickwatch-db-dev RDS (postgres 16.8, t3.micro, us-east-2), 8 Secrets Manager entries, GitHub secrets. **Pending**: create prod RDS, set ECS desired_count=1 after first ECR push. **Gotcha**: VPN breaks local→RDS psql (same as SnapAction).
8+
- `2026-02-27/apns-setup.md` — APNs key `GUFRSCY8ZV`, team `7Q28CBP3S5`, bundle `com.rescience.kickwatch`, Sandbox+Production env. All 8 secrets set. Backend reads APNS_KEY from env var (not file). CI injects via Secrets Manager.
89

910
## Release & Deploy
1011
- `2026-02-27/mvp-implementation.md` — Full MVP build: Go backend + iOS app, git workflow, CI/CD, repo published to ReScienceLab/KickWatch

0 commit comments

Comments
 (0)