Skip to content

v4: add standalone direct-SQLite runtime - #58

Merged
Phloraxx merged 1 commit into
mainfrom
v4/runtime
Sep 1, 2026
Merged

v4: add standalone direct-SQLite runtime#58
Phloraxx merged 1 commit into
mainfrom
v4/runtime

Conversation

@Phloraxx

@Phloraxx Phloraxx commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Scope

Sixteenth stacked PayGate v4 implementation slice. Depends on PR #57.

Implements

  • standalone cmd/paygate-v4 process with no PocketBase runtime dependency
  • fail-closed single-process lock before opening SQLite
  • direct SQLite runtime wiring for merchant, admin and relay HTTP surfaces
  • password bootstrap required only for a fresh v4 database; existing credential state is never replaced from env
  • persisted webhook settings loaded at startup
  • payment-expiry worker plus durable webhook worker
  • /health endpoint with live SQLite check
  • explicit CORS allowlist for the separate test frontend
  • graceful SIGINT/SIGTERM HTTP shutdown
  • native SQLite Online Backup API inside the one PayGate process
  • backup integrity + foreign-key verification, fsync, 0600 permissions and atomic no-overwrite publish
  • daily UTC backup worker with bounded retention
  • correct QR/App-Link composition (/device/pair/<token>) separate from the relay pairing API

Tests / validation

  • fresh-bootstrap refusal and successful bootstrap
  • exclusive process-lock ownership
  • health, CORS and Android admin login through assembled router
  • real merchant payment creation proving routing remains server-owned
  • worker-driven payment expiry
  • verified backup readability and bounded retention
  • live-database/existing-destination backup refusal
  • QR/App-Link runtime composition
  • full internal/v4/... unit tests, race tests, vet and git diff --check
  • go build ./cmd/paygate-v4
  • go list -deps ./cmd/paygate-v4 confirms no github.com/pocketbase/pocketbase dependency

Safety

This adds a separate v4 binary only. It is not deployed, does not replace the v3 PocketBase process, and does not migrate production data.

@Phloraxx
Phloraxx changed the base branch from v4/relay-http to main September 1, 2026 08:23
@Phloraxx
Phloraxx marked this pull request as ready for review September 1, 2026 08:24
@Phloraxx
Phloraxx merged commit 69b6328 into main Sep 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant