Repository navigation
Sync v2: member list endpoint for pgacc - #1
Merged
Merged
Conversation
Sync v2, membership side: pgacc fetches the active members as JSON
([{id, uuid, name, lo, paid}]) from an internal listener. 403 with an
empty body unless the socket address is a configured peer and the bearer
token matches; an empty or missing configuration refuses everything; any
error after that is 503 with an empty body. One prepared SELECT on the
view pgacc_members (one row per valid user with an active role-2
membership; the latest active LO role 37-45, ties to the lowest id;
paid = field 26 after today), read by a user with SELECT on the view only.
Tests (tests/run.sh, MariaDB 12.3 + PHP 8.5 in Docker, synthetic users)
and a GitHub Actions workflow running them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The old encrypted member list for pgacc (mcrypt, shared key, no authentication) is replaced by internal/members.php. README and LICENSE no longer list it as imported code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… shared test harness The secrets file and its FastCGI parameter are named like the other sync v2 secrets (members-secrets.php / PGACC_MEMBERS_SECRETS). The test harness is the same in both sync v2 branches: one schema with every Admidio table the add-ons use, one users file, every pgacc/*.sql applied, and run.sh runs each tests/*-test.php, each resetting its own data. README: the sync v2 section in the shared structure, with the certificate path convention. LICENSE: the imported files as a list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Paid until 31 December" is still paid on 31 December: field 26 >= CURRENT_DATE (was >, as in the old adm_names.php, which made every member unpaid on 31 December). Tests for today, 31 December and 1 January. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync v2, membership side: the member list for pgacc (counterpart of PPOE/pgacc#84).
internal/members.php, with its own document root; the logic is inpgacc/members-api.php. It replaces and removespgacc/adm_names.php(the old mcrypt-encrypted member list).accsync.phpis replaced in Sync v2: write pgacc's payments into Admidio (accsync.php) #2.REMOTE_ADDRis a peer of the secrets file and the bearer token matches (hash_equals). A missing or invalid secrets file, an empty token or an empty peer list refuse everything. Database errors give 503 with an empty body.[{id, uuid, name, lo, paid}]from one prepared SELECT on the viewpgacc_members, read by a user with SELECT on the view only (pgacc/pgacc_members.sql).paidmeans field 26 is today or later: "paid until 31 December" still counts as paid on 31 December (the oldadm_names.phpmade everyone unpaid that day).members-secrets.php; its path comes from thePGACC_MEMBERS_SECRETSfastcgi_param. The deployment writes the file, sets up the listener and certificate and applies the SQL; the README describes them (certificate convention: own/etc/<app>/sync-tls.{crt,key}, peer's/etc/<app>/<peer>-tls.crt, self-signed by the callee, handed to the caller through the inventory).tests/run.sh(MariaDB 12.3 + PHP 8.5 in Docker, synthetic users only, red first, incl. the 31 December / 1 January boundary) plus a GitHub Actions workflow.Merging with #2: the test harness (
tests/schema.sqlwith every Admidio table both add-ons use,tests/users.sql,tests/grants.sh,compose.yaml,Dockerfile,run.shrunning eachtests/*-test.php,.github/workflows/tests.yml) is identical in both branches; each branch only adds its own test file andpgacc/*.sql. Whichever merges second merges cleanly except the README sections and the LICENSE list of imported files (keep onlymail-alias-sync/adm_mail.php).Astra review: nothing actionable on the first version; the re-run after these alignment changes hit the Codex usage limit (pending).
🤖 Generated with Claude Code