Payments: deploy the billing service #496

Öppen
öppnade 2026-09-24 13:03:35 +00:00 av supernaut · 8 kommentarer
Ägare

Problem

Paid checkout on production is dark until the billing service runs with a live Mollie key and billing_payments_enabled: true.

State

The service runs on production (v0.11.2) with billing_enabled: true and billing_payments_enabled: false. Its Postgres database and role, the Quadlet unit, the Caddy webhook route, the backup and drill, and the Keycloak bitborg-billing client (which grants tier_pro through the reconciler, ADR 0017 and ADR 0040) are all in place. Complimentary grants work on production. A test-mode payment granted the paid tier end to end on staging (#579).

Scope

  • Lift the two live-key refusals in one release: isTestKey in the service and the billing role assert. Update the README "Before live keys" list and the runbook (#693).
  • Put the live key in the vault, set billing_payments_enabled: true, apply --tags billing,web.
  • One real card payment and one withdrawal refund on production. Optionally one Swish year and its withdrawal.
  • Back-out path: billing_payments_enabled: false, apply --tags billing,web.

Done when

A real payment grants the paid tier and a real withdrawal refunds it, both visible in the Mollie dashboard, with the alerts in #692 live.

Epic: bitborg/bitborg-docs#5

## Problem Paid checkout on production is dark until the billing service runs with a live Mollie key and `billing_payments_enabled: true`. ## State The service runs on production (v0.11.2) with `billing_enabled: true` and `billing_payments_enabled: false`. Its Postgres database and role, the Quadlet unit, the Caddy webhook route, the backup and drill, and the Keycloak `bitborg-billing` client (which grants `tier_pro` through the reconciler, ADR 0017 and ADR 0040) are all in place. Complimentary grants work on production. A test-mode payment granted the paid tier end to end on staging (#579). ## Scope - Lift the two live-key refusals in one release: `isTestKey` in the service and the billing role assert. Update the README "Before live keys" list and the runbook (#693). - Put the live key in the vault, set `billing_payments_enabled: true`, apply `--tags billing,web`. - One real card payment and one withdrawal refund on production. Optionally one Swish year and its withdrawal. - Back-out path: `billing_payments_enabled: false`, apply `--tags billing,web`. ## Done when A real payment grants the paid tier and a real withdrawal refunds it, both visible in the Mollie dashboard, with the alerts in #692 live. Epic: bitborg/bitborg-docs#5
Upphovsperson
Ägare

Status 2026-10-01: the role is merged (#507), pinned to the first published image v0.2.1 (#508) and applied. Production runs it disabled: billing_enabled: false. A second --check gave changed=0.

No webhook secret: Mollie does not sign webhooks, so the service re-fetches each payment by id.

Left before this closes, in order (runbook "Billing service"):

  1. Create the bitborg-billing Kanidm service account and a read-write API token.
  2. Add vault_payments_mollie_api_key_test, vault_billing_db_password, vault_billing_api_token, vault_kanidm_billing_token.
  3. Set billing_enabled: true, dry-run, apply. Verify, including that entry_managed_by on an account grants member write on tier_pro.
  4. Set billing_payments_enabled: true, run a test payment, confirm the paid tier reaches Forgejo.
  5. Take a backup and let the drill restore the billing database.
Status 2026-10-01: the role is merged (#507), pinned to the first published image `v0.2.1` (#508) and applied. Production runs it disabled: `billing_enabled: false`. A second `--check` gave `changed=0`. No webhook secret: Mollie does not sign webhooks, so the service re-fetches each payment by id. Left before this closes, in order (runbook "Billing service"): 1. Create the `bitborg-billing` Kanidm service account and a read-write API token. 2. Add `vault_payments_mollie_api_key_test`, `vault_billing_db_password`, `vault_billing_api_token`, `vault_kanidm_billing_token`. 3. Set `billing_enabled: true`, dry-run, apply. Verify, including that `entry_managed_by` on an account grants member write on `tier_pro`. 4. Set `billing_payments_enabled: true`, run a test payment, confirm the paid tier reaches Forgejo. 5. Take a backup and let the drill restore the billing database.
Upphovsperson
Ägare

One more step for the enable checklist, from #510: after billing_enabled: true is applied and the bitborg-billing container logs to Loki, confirm the BillingReconcileManualReview alert fires on one matching line. For example, log [reconcile] test is paid at the provider with no settled local charge; needs manual review from inside the container to stdout, then check Alertmanager. The rule needs the monitoring tag applied first.

One more step for the enable checklist, from #510: after `billing_enabled: true` is applied and the `bitborg-billing` container logs to Loki, confirm the `BillingReconcileManualReview` alert fires on one matching line. For example, log `[reconcile] test is paid at the provider with no settled local charge; needs manual review` from inside the container to stdout, then check Alertmanager. The rule needs the `monitoring` tag applied first.
supernaut refererade till detta ärende från en incheckning 2026-10-01 21:45:18 +00:00
supernaut refererade till detta ärende från en incheckning 2026-10-02 17:56:58 +00:00
supernaut refererade till detta ärende från en incheckning 2026-10-02 20:09:05 +00:00
Upphovsperson
Ägare

Retarget: Kanidm is being replaced by Keycloak before launch (bitborg/bitborg-docs#127). The billing service account becomes the Keycloak bitborg-billing client. Left: enable in prod at go-live, after the staging payment test run.

Retarget: Kanidm is being replaced by Keycloak before launch (bitborg/bitborg-docs#127). The billing service account becomes the Keycloak `bitborg-billing` client. Left: enable in prod at go-live, after the staging payment test run.
Upphovsperson
Ägare

State 2026-10-12: prod runs billing v0.11.1 with billing_enabled: true and billing_payments_enabled: false (#678, #686, #690, #691). The admin client is the Keycloak bitborg-billing client, not a Kanidm service account. Webhooks carry no secret: the handler re-fetches the payment. Live switch steps and blockers: the operator guide, and #693.

State 2026-10-12: prod runs billing v0.11.1 with `billing_enabled: true` and `billing_payments_enabled: false` (#678, #686, #690, #691). The admin client is the Keycloak `bitborg-billing` client, not a Kanidm service account. Webhooks carry no secret: the handler re-fetches the payment. Live switch steps and blockers: the operator guide, and #693.
Upphovsperson
Ägare

Added prerequisite for the live switch: signed data processing agreements with the hosting provider and the mail provider are on file.

Added prerequisite for the live switch: signed data processing agreements with the hosting provider and the mail provider are on file.
supernaut refererade till detta ärende från en incheckning 2026-10-14 11:18:02 +00:00
Upphovsperson
Ägare

Blocked 2026-10-17. The live switch waits on the signed processor agreements, the accountant's VAT sign-off and the legal answer on the early-renewal withdrawal window (bitborg-payment#150). Move back to Todo with ready-for-implementation once those are in.

Blocked 2026-10-17. The live switch waits on the signed processor agreements, the accountant's VAT sign-off and the legal answer on the early-renewal withdrawal window (bitborg-payment#150). Move back to Todo with ready-for-implementation once those are in.
Upphovsperson
Ägare

Status 2026-10-24: the VAT sign-off is done for Sweden. Launch sells to Sweden only, and the payment README "Before live keys" VAT item is ticked (bitborg/bitborg-payment#192). Prod runs billing v0.20.0 (#841).

Still blocking: the processor agreements, and counsel's answer on the withdrawal window (bitborg/bitborg-payment#150).

Status 2026-10-24: the VAT sign-off is done for Sweden. Launch sells to Sweden only, and the payment README "Before live keys" VAT item is ticked (bitborg/bitborg-payment#192). Prod runs billing v0.20.0 (#841). Still blocking: the processor agreements, and counsel's answer on the withdrawal window (bitborg/bitborg-payment#150).
Upphovsperson
Ägare

State on 2026-11-15. The issue body above is older than this.

  • Prod pins billing v0.20.0 with billing_enabled: true and billing_payments_enabled: false.
  • The service accepts a live_ key since bitborg-payment#182. No new billing release is needed for the switch.
  • The only code-level refusal left is the role assert in ansible/roles/billing/tasks/main.yml (lines 17 and 18). Draft #741 lifts it. Its branch is stale and needs a refresh on main before it can merge.
  • The "Before live keys" list in the bitborg-payment README still has three open boxes.
  • #579 step 8: the Mollie side passed on 2026-11-13. The staging database check is pending.

The switch itself is then: live key into the vault, billing_payments_enabled: true, apply with --tags billing,web, one real payment and one withdrawal refund.

State on 2026-11-15. The issue body above is older than this. - Prod pins billing `v0.20.0` with `billing_enabled: true` and `billing_payments_enabled: false`. - The service accepts a `live_` key since bitborg-payment#182. No new billing release is needed for the switch. - The only code-level refusal left is the role assert in `ansible/roles/billing/tasks/main.yml` (lines 17 and 18). Draft #741 lifts it. Its branch is stale and needs a refresh on `main` before it can merge. - The "Before live keys" list in the bitborg-payment README still has three open boxes. - #579 step 8: the Mollie side passed on 2026-11-13. The staging database check is pending. The switch itself is then: live key into the vault, `billing_payments_enabled: true`, apply with `--tags billing,web`, one real payment and one withdrawal refund.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra#496
Ingen beskrivning angiven.