Commit Graph

30 Commits (18d5ff7fe409c7abc3d9d226774fd36ebefe1cf7)

Author SHA1 Message Date
Konrad Fröhlich 18d5ff7fe4
ci(deploy): refuse to publish an empty or truncated page build (#18)
`wrangler pages deploy .vercel/output/static` replaces the whole live
site, and nothing between the build and that upload ever looked inside
the directory. next-on-pages is fail-closed against its own crash, not
against exiting 0 with an empty or half-written output — that would have
been published as-is and blanked status.openshopgraph.org through a
fully green run. A status page that is silently empty is the one outage
nothing else here reports.

scripts/verify-pages-output.sh asserts the worker entrypoint, the routes
manifest, at least one client chunk, and a floor of 20 files (a correct
build of main measures 49). deploy.yml runs it directly after the build,
so a broken build stops the job before `terraform apply` — production is
never touched.

Co-authored-by: OSG Agent <agent@openshopgraph.org>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 17:56:55 +02:00
Konrad Fröhlich f9aaded756
ci(deploy): bind production deploy job to main-only environment (#17)
workflow_dispatch on deploy.yml accepts any ref. The `main-protection`
ruleset governs pushes to main, not workflow runs, so a dispatch from any
side branch ran terraform apply + wrangler pages deploy against production
with CLOUDFLARE_API_TOKEN — unreviewed, no status check, no approval.

Binds the job to the `production` environment (deployment_branch_policy:
`main` only, no required reviewers, so pushes to main deploy exactly as
before). A job bound to it is refused before its first step.

Verhaltensbeweis in diesem Repo, beide Richtungen, ohne echten Deploy
(Probe-Branch trug eine entkernte deploy.yml — faellt die Sperre aus,
deployt sie NICHTS):
  A) policy=[main]              -> run 30597988048 failure, 0 Steps,
     'Branch "probe/env-gate" is not allowed to deploy to production
      due to environment protection rules.'
  B) policy=[main,probe/env-gate] -> run 30598014821 success, 3 Steps,
     'PROBE_RAN ref=refs/heads/probe/env-gate'
Policy danach auf [main] zurueckgesetzt, Probe-Branch geloescht.

Co-authored-by: k55f97 <konradefroehlich@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 04:08:58 +02:00
Test User 3d05dfa81d fix(status): merge alert channel, probe-drift detection and least-privilege CI
Three independently developed changes, merged and re-verified rather than
taken on trust.

1) Alert channel (Pushover, worker/src/pushover.ts). The fork's only built-in
   channel reads its credentials from the committed config, which is unusable
   in a PUBLIC repo, so outages notified nobody. Sent as a second channel from
   inside formatAndNotify, so skipNotificationIds, maintenance windows and
   gracePeriod gate it exactly as they gated the webhook. Fail-closed AND loud:
   without the secrets every dropped alert logs [ALERT-CHANNEL-BROKEN].

2) Probe drift (worker/src/probe.ts). checkProxyFallback silently degrades a
   two-region page to a one-region page: the fallback keeps checkLocation at
   the local colo, up stays true, nothing is reported. doMonitor now returns
   fromConfiguredRegion and a finding is raised after 15 runs without an answer
   from the configured region.

3) Least privilege (.github/workflows/deploy.yml). The job carries
   CLOUDFLARE_API_TOKEN and runs terraform apply while its GITHUB_TOKEN scope
   was inherited from a repo setting. Pinned to contents: read, top-level.

MERGE RESOLUTION — the only real conflict was semantic, not textual: (2) could
only send its finding over notification.webhook, and (1) establishes that this
webhook stays unset for good because its credentials would have to be
committed. Combined unchanged, the drift finding would have reached nobody. The
finding is therefore sent over the same Pushover channel, but labelled as
neither UP nor DOWN and at normal priority — a moved vantage point is an
operations fact, not a user-visible outage, and must not bypass quiet hours.

No user-visible change to the public status page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:53:33 +02:00
Claude f77adf8091 feat(status): wire the alert channel — outages now actually notify someone
`notification.webhook` was commented out, so no monitor — including the
newly added second check region — reported an outage anywhere. The status
page watched production while its own failure was visible to nobody unless
a human happened to look.

The fork ships exactly ONE notification path, `notification.webhook`
(worker/src/util.ts:83 `webhookNotify`), and it reads its credentials from
the COMMITTED config object. This repository is public, so a Pushover app
token cannot live there — which is why the block stayed commented out.

This adds a second dispatch inside the same `formatAndNotify`, sending the
identical formatted message to Pushover with credentials from Worker SECRET
bindings (worker/src/pushover.ts). Same account and endpoint the Mac mini
already alerts through, so no new account and no new vendor.

Gating is unchanged: skipNotificationIds, maintenance windows and the
3-minute grace period gate Pushover exactly as they gated the webhook.

FAIL-CLOSED, not silent: without the secrets every dropped alert logs
`[ALERT-CHANNEL-BROKEN] … missing Worker secret(s) …` as an error naming
what is missing and how to fix it, so an unnotifiable outage is itself
visible in Workers Logs.

Secrets are bound in deploy.tf, not via `wrangler secret put`: the
`bindings` list is authoritative and would drop anything not declared there
on the next apply. deploy.yml passes them as TF_VAR_*; when the repository
secrets are unset the apply still succeeds with the bindings omitted.

OWNER ACTION REQUIRED: set repository secrets PUSHOVER_TOKEN and
PUSHOVER_USER on k55f97/osg-status. Until then the channel is wired but
loud-broken by design.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:43:44 +02:00
Konrad Fröhlich 82562e7f99
chore(security): Actions auf Commit-SHA pinnen, Uebersetzungs-Bot entfernen (#14)
Lieferkette: alle acht `uses:`-Referenzen im Repo standen auf VERSCHIEBBAREN
Tags. Ein Tag ist keine Zusage — wer ihn umhaengt, fuehrt Code in unserem Lauf
aus. Beleg, dass das kein Theoriefall ist: `actions/checkout@v3` wurde am
2026-07-16 auf einen neuen Commit umgehaengt (v3.7.0), zwei Wochen vor diesem
Commit. Derselbe Hebel gilt fuer jeden anderen Tag hier.

Gewicht je Workflow:
  * deploy.yml — laeuft auf `push: main` und traegt CLOUDFLARE_API_TOKEN im
    Lauf. Hier holt eine untergeschobene Action den Cloudflare-Token.
  * ci.yml — laeuft auf `pull_request`, Token `contents: read`, keine Secrets.
    Geringerer Schaden, gleiche Massnahme.
  * issue_translate.yml — siehe unten, entfernt.

Alle SHAs gegen das jeweilige Upstream-Repo aufgeloest (`gh api
repos/<r>/git/ref/tags/<tag>`), nicht abgeschrieben; der Kommentar nennt die
exakte Version, auf die der SHA zeigt (nicht nur die Major-Linie):
  actions/checkout        v4      -> 11d5960a  (v4.4.0)
  actions/checkout        v3      -> a37ce912  (v3.7.0)
  actions/setup-node      v4      -> 49933ea5  (v4.4.0)
  actions/setup-node      v3      -> 3235b876  (v3.9.1)
  hashicorp/setup-terraform v2.0.3 -> 633666f6 (v2.0.3)

ENTFERNT statt gepinnt: .github/workflows/issue_translate.yml
Der Workflow zog die Fremd-Action usthe/issues-translate-action@v2.7
(-> b41f55dd, letzter Commit 2022-10-18, seit ueber drei Jahren unbewegt).
Ausloeser waren `issues: opened` und `issue_comment: created`. Zwei Befunde:
  1. Issues sind in diesem Repo ABGESCHALTET (has_issues=false) — der
     `issues`-Ausloeser kann gar nicht feuern.
  2. `issue_comment` feuert auch auf PR-Kommentaren. Das Repo ist OEFFENTLICH,
     also konnte JEDER GitHub-Nutzer mit einem Kommentar einen Lauf starten,
     der diese Fremd-Action an einem beweglichen Tag nachlaedt.
Nutzen dem gegenueber: null. Die Statusseite ist ausschliesslich englisch und
hat einen einzigen Mitarbeiter — es gibt nichts zu uebersetzen. Ein Bot, der
nur Angriffsflaeche und keinen Nutzen hat, wird nicht gepinnt, sondern
abgeschaltet.

Verhalten sonst unveraendert: keine Versionsspruenge (v3 bleibt v3), die
Job-Namen `build` und `lint` — die Pflichtchecks des Regelwerks — bleiben
gleich. Beide Workflows nach der Aenderung als YAML geparst.

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 00:54:46 +02:00
Konrad Fröhlich 82d9054280
chore(ci): Upstream-Sync-Workflow entfernen — er wuerde 27 OSG-eigene Dateien ueberschreiben (#12) 2026-07-31 00:29:10 +02:00
Konrad Fröhlich 60a726ff25
ci(status): PR-Gate — Build + Lint vor dem Merge, nicht erst beim Deploy (#11)
Bisher gab es in diesem Repo KEINE Pull-Request-CI: deploy.yml laeuft nur
'on push: main'. Ein kaputter Build fiel damit erstmals auf, waehrend er
schon nach status.openshopgraph.org deployte.

Neu: .github/workflows/ci.yml mit zwei Jobs auf jedem PR und jedem
main-Push:
  build — npm ci, next build, plus wrangler --dry-run fuer worker/
  lint  — next lint

Runner: ubuntu-latest, bewusst anders als openshopgraph/openshopgraph2.
Dieses Repo ist OEFFENTLICH (Fork von lyc8503/UptimeFlare); ein
self-hosted Runner wuerde ungepruefte Fork-PR-Befehle auf dem Mac mini
ausfuehren. Der Kostengrund fuer self-hosted entfaellt hier, weil
Actions-Minuten fuer oeffentliche Repos kostenlos sind.

prettier --check ist absichtlich NICHT im Gate: 14 Dateien in main sind
unformatiert, der Check waere sofort rot und wuerde jeden PR blockieren.

Co-authored-by: k55f97 <konradefroehlich@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 23:52:33 +02:00
Konrad Fröhlich 3dca962be3
fix(deploy): only run DO migration on initial worker creation (#1)
The DO migration (new_tag=v1) may only be applied once. The old
durable-object-namespace detection wrongly reported 'migration needed'
even though the namespace already existed at tag v1, so Terraform
re-sent the v1 migration on an already-migrated worker and Cloudflare
rejected the apply with 412 / code 10079. Gate migration on
worker-script existence instead.

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 14:59:58 +02:00
lyc8503 a5670e51cb
chore: update FUNDING to ko-fi 2026-06-01 23:10:21 +08:00
Etgpao 73473462fb
sync: fallback to PAT_TOKEN secret when override-token is empty (#181)
* Update token usage in sync workflow

* sync: fallback to PAT_TOKEN secret when override-token is empty

Explain briefly:
UI input field doesn’t evaluate ${{ secrets.* }}, users may paste it and it becomes a literal string.
Add fallback to secrets.PAT_TOKEN to make workflow_dispatch easier and safer.

* More detailed desc

---------

Co-authored-by: lyc8503 <me@lyc8503.net>
2026-01-31 00:59:50 +08:00
lyc8503 d42f03ddc5 chore: setup funding, close #178 2026-01-31 00:39:50 +08:00
lyc8503 e2ff649ebd fix: avoid multiple deployment processes when PAT is specified 2026-01-03 23:59:31 +08:00
lyc8503 3de3640d17 feat: D1 upgrade: deployment and migration process DONE! 2026-01-03 23:06:32 +08:00
lyc8503 45d86424b2 [WIP] terraform cloudflare provider v5 works! more performance/migration/deployment work todo 2025-12-30 23:19:18 +08:00
lyc8503 c2ea95050a fix: improve deploy error handling, try to create missing resources 2025-11-06 20:35:16 +08:00
lyc8503 50be44b54a fix: this workaround SMH doesn't work, add note in docs instead 2025-11-06 02:29:01 +08:00
lyc8503 4bcf4173ea misc: run prettier 2025-04-19 21:50:43 +08:00
lyc8503 1b764b5f11 fix: terraform cloudflare provider crash 2025-04-14 02:12:06 +08:00
lyc8503 cda263f645 feat: DurableObject checker, add actions 2025-04-14 02:12:06 +08:00
lyc8503 a293f98185 misc: terraform import state 2025-04-13 21:09:54 +08:00
lyc8503 07618a5638
Create issue_translate.yml 2024-11-18 10:45:35 +08:00
lyc8503 d576251057 add workflow trigger to auto deploy 2024-07-01 01:27:14 +08:00
lyc8503 6f7df0a37a
Fix permission problem when upgrading 2024-06-30 20:20:03 +08:00
lyc8503 3bae92df7c
Update sync.yaml 2024-06-30 17:19:38 +08:00
Biliko eeadbc3822
Create sync.yaml 2024-05-21 00:51:55 +08:00
lyc8503 d827a7059e fix #13: create worker subdomain during deployment 2024-05-19 21:46:07 +08:00
Eric Wang 4963a4815a fix: duplicate account_id in actions, typo fix 2024-03-18 08:26:20 +08:00
Eric Wang 0c6556eda9 feat: add notify telegram & bark, and some minor fixes 2024-03-18 00:06:31 +08:00
lyc8503 54ffad7baa fix: worker didn't get updated 2023-11-19 14:39:55 +08:00
lyc8503 4f18b3fd66 use terraform & github actions 2023-11-18 22:20:35 +08:00