@zigordev/stack 1.6.0 → 1.7.1

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/README.md CHANGED
@@ -172,14 +172,13 @@ KAFKA_SETUP: |
172
172
  allow notes-api Read group notes-api. prefixed
173
173
  ```
174
174
 
175
- On the laptop the job also needs `KAFKA_PASSWORD_NOTES_API`, a throwaway password in `compose.local.yaml`. The app reaches the broker with three settings, which `@zigordev/events` reads: `KAFKA_BROKERS: kafka:9092`, `KAFKA_USERNAME: notes-api` and `KAFKA_PASSWORD`, the same password. In production an app's password lives once, at its own `/<product>/KAFKA_PASSWORD` in Parameter Store, as the owner chose on 2026-11-25.
175
+ On the laptop the job also needs `KAFKA_PASSWORD_NOTES_API`, a throwaway password in `compose.local.yaml`. The app reaches the broker with three settings, which `@zigordev/events` reads: `KAFKA_BROKERS: kafka:9092`, `KAFKA_USERNAME: notes-api` and `KAFKA_PASSWORD`, the same password. In production an app's password lives once, at its own `/<product>/KAFKA_PASSWORD` in Parameter Store. A line of `.env.production.example` names it, such as `KAFKA_PASSWORD_NOTIFICATIONS_API=/notifications/KAFKA_PASSWORD`, and the host's deploy reads it from there. [Record 0028](../docs/adr/0028-the-shared-services-read-each-apps-kafka-password-from-the-apps-own-parameter.md) says why.
176
176
 
177
- On the laptop the job reads a second list after `KAFKA_SETUP`: `KAFKA_SETUP_LAPTOP`, in `compose.local.yaml`, for users that only a laptop needs. Production never sets it. It holds two users today, each with the throwaway password `local-only-<user>`:
177
+ `KAFKA_SETUP` holds one user today, `notifications-api`, the notifications service. It reads every app's requests and writes every app's answers, through three prefixed rules that never change when an app joins. On the laptop its password is `local-only-notifications-api`.
178
178
 
179
- | User | Why only on the laptop |
180
- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
181
- | `notifications-api` | The notifications service reads every app's requests and writes every app's answers. It moves to `KAFKA_SETUP` before its first deploy |
182
- | `template-api` | The product template's API, which sends its emails through the service. The template never deploys |
179
+ `KAFKA_SETUP` also holds the four topics of every app that sends email, the template's too, and the service's right to set a bad request aside on each app's requests' dead-letter topic. The notifications service reads the requests topic of every app in its producer list, which ships in its image, wherever it runs. One missing topic stops it reading any, so every producer's topics exist on every broker.
180
+
181
+ On the laptop the job reads a second list after `KAFKA_SETUP`: `KAFKA_SETUP_LAPTOP`, in `compose.local.yaml`, for users that only a laptop needs. Production never sets it. It holds one user today, `template-api`, the product template's API, which sends its emails through the notifications service and never deploys. Its topics are in `KAFKA_SETUP`, so in production nobody can write to them. Its throwaway password is `local-only-template-api`.
183
182
 
184
183
  The broker formats its own storage before the image starts it, and makes the users `admin` and `setup` there, because image 4.4.0 ignores the setting that would do that. [Record 0027](../docs/adr/0027-the-broker-formats-its-own-storage-and-one-list-holds-its-topics-users-and-rules.md) says why.
185
184
 
@@ -46,20 +46,11 @@ services:
46
46
  environment:
47
47
  KAFKA_SETUP_PASSWORD: local-only-setup
48
48
  KAFKA_SETUP_LAPTOP: |
49
- user notifications-api
50
- allow notifications-api Read topic notifications.requests. prefixed
51
- allow notifications-api Write topic notifications.outcomes. prefixed
52
- allow notifications-api Read group notifications-api. prefixed
53
49
  user template-api
54
- topic notifications.requests.template-api 1
55
- topic notifications.requests.template-api.dead-letter 1
56
- topic notifications.outcomes.template-api 1
57
- topic notifications.outcomes.template-api.dead-letter 1
58
50
  allow template-api Write topic notifications.requests.template-api
59
51
  allow template-api Read topic notifications.outcomes.template-api
60
52
  allow template-api Write topic notifications.outcomes.template-api.dead-letter
61
53
  allow template-api Read group template-api. prefixed
62
- allow notifications-api Write topic notifications.requests.template-api.dead-letter
63
54
  KAFKA_PASSWORD_NOTIFICATIONS_API: local-only-notifications-api
64
55
  KAFKA_PASSWORD_TEMPLATE_API: local-only-template-api
65
56
 
package/compose.yaml CHANGED
@@ -411,7 +411,16 @@ services:
411
411
  cpus: 0.5
412
412
  environment:
413
413
  KAFKA_HEAP_OPTS: -Xms128m -Xmx256m
414
- KAFKA_SETUP: ""
414
+ KAFKA_SETUP: |
415
+ user notifications-api
416
+ allow notifications-api Read topic notifications.requests. prefixed
417
+ allow notifications-api Write topic notifications.outcomes. prefixed
418
+ allow notifications-api Read group notifications-api. prefixed
419
+ topic notifications.requests.template-api 1
420
+ topic notifications.requests.template-api.dead-letter 1
421
+ topic notifications.outcomes.template-api 1
422
+ topic notifications.outcomes.template-api.dead-letter 1
423
+ allow notifications-api Write topic notifications.requests.template-api.dead-letter
415
424
  tmpfs:
416
425
  - /tmp
417
426
  - /opt/kafka/logs:uid=1000,gid=1000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zigordev/stack",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "description": "The shared services of the zigordev platform for a laptop: the ingress, the telemetry agent, a local Grafana and a mail catcher, as compose files with one command that starts them",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",