062 - OpenPost Publishing Desk Role¶
User Story¶
As an Infinito.Nexus PR manager, I want a self-hosted OpenPost publishing desk deployed as the web-app-openpost role behind Keycloak single sign-on so that I can compose, schedule and publish content to Fediverse and commercial social networks from one sovereign interface.
Background¶
This requirement implements the publishing half of the OpenProject user story “sovereign social media publishing and crossposting” (story criteria AC1, AC2, AC3, AC4, AC6, AC7 and the desk part of AC8). Automated crossposting from Fediverse accounts (story criterion AC5 and its tests) is specified in 063-openpost-crossposter.md, which builds on this role. OpenPost is self-hosted and integrated like every other application of the stack: the official upstream image, configured through environment variables, wired into the shared proxy, Keycloak, Postgres, object storage and backups.
Evaluation and selection¶
Candidate |
Verdict |
Decisive evidence |
|---|---|---|
Selected |
Only candidate that publishes to Mastodon (any instance), Pixelfed and PeerTube as well as Facebook, Instagram, X, YouTube, LinkedIn, Threads, TikTok and Bluesky. One image, Postgres, S3 media, OIDC with issuer discovery, AES-256-GCM encryption of provider tokens. |
|
Rejected |
No Pixelfed or PeerTube code, one Mastodon instance per deployment, provider tokens stored in plaintext, Temporal plus Elasticsearch required, OIDC without discovery that self-registers users even with registrations disabled, 19 published advisories. |
|
Reference only |
Closed SaaS without self-hosting, no Pixelfed or PeerTube, no named legal entity in its privacy policy. |
|
Mixpost Pro |
Rejected |
Commercial source-available licence, no PeerTube, image and database support unverified. |
Rejected |
No published image, no documented SSO, major version churn within weeks. |
|
Not a desk |
Automation engine only, Sustainable Use License, native OIDC is a paid feature. |
OpenPost carries known risks that this requirement mitigates rather than ignores: it was created on 2026-03-21, one maintainer wrote about 95% of its commits, it shipped 265 releases by 2026-10-20, only the latest release receives security fixes, and its maintainer states that no posting option has passed the project’s own live certification yet (provider reference).
Upstream facts established by research¶
All OpenPost source references point at commit 0deadaf7, the branch head on 2026-10-20; the latest published release is v7.22.9.
Topic |
Finding |
Source |
|---|---|---|
Image |
|
|
Processes |
One binary with the roles |
|
Database |
SQLite or Postgres; no MariaDB, no Redis. |
|
Media |
Local disk or S3 ( |
|
App URL |
|
Proof run on 2026-10-21 (see Egress proof) |
SSO |
One instance-wide OIDC provider ( |
|
Proxy auth |
Trusted-proxy mode accepts |
|
Secrets at rest |
Provider tokens and secrets use AES-256-GCM with key IDs and rotation; JWT, encryption and media signing keys accept |
|
Telemetry |
Diagnostics to |
|
Egress guard |
|
|
Guard exceptions |
Only operator configuration may reach private addresses: the instance OIDC issuer and custom connectors with |
|
Providers |
Mastodon (any instance, out-of-band code, |
|
API |
REST API with |
|
Cost control |
|
Egress proof¶
Inside the development stack, sibling domains such as *.infinito.test resolve to the private stack address, and in split-horizon or WireGuard deployments they resolve to private or mesh addresses (NETWORK_MESH_POOL is 10.100.0.0/16), so the unmodified image refuses them.
A role-local egress relay solves this without touching OpenPost: OpenPost reaches the deployment’s sibling vhosts through network aliases on a Docker network whose subnet lies outside the guard’s ranges, and the relay forwards the untouched TLS stream by SNI to the shared proxy.
The design was proven on 2026-10-21 against the unmodified ghcr.io/getopenpost/openpost:v7.22.9 with an nginx:1.30.6-alpine stream relay on 192.88.99.0/24 (the deprecated 6to4 relay anycast block, RFC 7526) in the compose development stack:
Check |
Observed result |
|---|---|
Aliased name forwarded to a Mastodon stub |
Mastodon app registration succeeded; the stub received |
Aliased name forwarded to the real shared proxy by address |
TLS verified against the platform CA through OpenResty; the vhost answered HTTP 404 because it is not a Mastodon instance. |
Sibling name resolved through normal DNS to the stack address |
Rejected: “resolves to a private or local address”. |
Private alias and private IP literal |
Rejected by the guard. |
Aliased name missing from the relay’s SNI map |
Refused by the relay. |
Platform constraints¶
Network |
Access path for one organisation |
Publish quota |
Cost (October 2026) |
Token upkeep |
Constraint |
|---|---|---|---|---|---|
Facebook Pages |
Own Meta Business app; Standard Access for app-role users without App Review |
Reels: 30 per Page per 24 h |
No fee found |
Long-lived Page tokens do not expire |
Development-mode posts are visible only to app-role users |
Professional account via Facebook Login or Instagram Login |
100 per 24 h |
No fee found |
Instagram Login tokens last 60 days and refresh |
JPEG only, fetched from a public URL |
|
X |
Developer app with prepaid credits |
100 per 15 min per user |
$0.015 per post, $0.20 per post with a URL |
OAuth 2.0 access tokens refresh via |
Identical content across own accounts is forbidden |
YouTube |
Google OAuth client in production status |
100 |
No fee found |
Testing-status refresh tokens expire after 7 days |
Private-upload rule for unverified projects is contradictory |
Community Management API with legal-entity vetting |
Development tier: 500 calls per app per day |
No fee found |
60-day tokens without refresh |
Human re-authorisation every 60 days |
|
Threads |
Meta app with |
250 per 24 h |
No fee found |
60 days, refreshable |
500 characters per post |
TikTok |
Content Posting API plus audit |
About 15 per creator per day |
No fee found |
Not researched |
In-house upload tools are an unacceptable use case |
Bluesky |
App password or atproto OAuth |
About 1,666 creates per hour |
No fee found |
Up to 180 days |
Already reachable through |
Sources:
In-repo analogues¶
web-app-nextcloud,web-app-mastodon,web-app-fider,web-app-penpotandweb-app-discourserelax their own SSRF guards through native switches; OpenPost has none for built-in providers, which is why the relay exists.container_extra_hosts.py already resolves the address that reaches the shared proxy per deploy mode for the SSO back-channel pin; the relay forwards to the same address.
svc-net-wireguardcarries swarm overlay traffic inside itsswarmmesh, so the role’s overlay network is tunnelled without extra configuration.web-app-semaphoreconsumes Keycloak throughsso.flavor: oidc.web-app-mastodon,web-app-pixelfedandweb-app-peertubeprovide the local Fediverse accounts used as publishing targets in tests.web-svc-seaweedfsprovides S3 object storage through theseaweedfsservice withpublic: true, as inweb-app-mastodon.18_api.yml is the central SPOT for proprietary API credentials, read through
lookup('api', ...)and gated bylookup('api_enabled', ...).
Confirmed Decisions¶
These decisions were confirmed by the operator before implementation starts and are NOT subject to re-litigation during implementation.
# |
Decision |
Reason |
|---|---|---|
1 |
OpenPost is the publishing desk. |
Only candidate covering every required source and target network. |
2 |
Role id |
|
3 |
The role runs the official |
The application is integrated like every other role; the project does not maintain OpenPost. |
4 |
OpenPost reaches the deployment’s own sibling vhosts only through an always-on, role-local egress relay on the role network |
One proven path for development, CI and production, including split-horizon DNS and WireGuard meshes, with the guard intact for every other destination; the existing role-subnet exception mechanism already carries out-of-pool blocks, so no new SPOT is needed. |
5 |
Keycloak SSO through native OIDC ( |
OpenPost ships an OIDC adapter and does not consume group claims. |
6 |
Shared |
Postgres is the only multi-process database; S3 gives public media URLs for Meta. |
7 |
One |
State lives in Postgres and S3, so rescheduling is safe; split |
8 |
Provider app credentials live in the central |
One place for proprietary credentials. |
9 |
Diagnostics, update check, PostHog telemetry, feedback and public profiles are disabled. |
No unnecessary transmission of internal data. |
10 |
CI tests Fediverse publishing end to end against local instances through the relay, and the commercial adapters against a role-local provider simulator on the same role network; real platforms are checked manually in staging. |
Real OAuth logins, public redirect hosts and per-post billing make real platforms unusable in CI. |
11 |
Automated crossposting is a separate sidecar specified in 063. |
Separable deliverable and pull request. |
Target Schema¶
Role layout¶
roles/web-app-openpost/
├── Administration.md
├── README.md
├── files/
│ ├── playwright/
│ │ ├── _shared.js
│ │ ├── playwright.spec.js
│ │ └── test-*.js
│ ├── simulator/
│ └── test/
│ ├── probe.py
│ └── test.sh
├── meta/
│ ├── csp.yml
│ ├── domains.yml
│ ├── info.yml
│ ├── main.yml
│ ├── networks.yml
│ ├── rbac.yml
│ ├── secrets.yml
│ ├── services.yml
│ ├── tests.yml
│ ├── users.yml
│ ├── variants.yml
│ └── volumes.yml
├── tasks/
│ ├── 00_core.yml
│ ├── 01_fediverse_apps.yml
│ ├── 02_simulator.yml
│ ├── 03_breakglass.yml
│ └── main.yml
├── templates/
│ ├── compose.yml.j2
│ ├── env.j2
│ ├── playwright.env.j2
│ ├── relay.conf.j2
│ └── test.env.j2
└── vars/
└── main.yml
templates/relay.conf.j2 renders the relay’s SNI map from the deployed sibling vhosts; files/simulator/ holds the provider simulator mappings.
meta/services.yml excerpt (proposed shape)¶
openpost:
image: ghcr.io/getopenpost/openpost
version: "v7.22.9"
update:
type: registry_tags
ports:
internal:
http: 8080
local:
http: 8100
lifecycle: alpha
relay:
image: nginx
version: 1.31.7-alpine
simulator:
enabled: false
image: wiremock/wiremock
version: "3.13.2"
Acceptance Criteria¶
Evaluation and documentation (story AC1)¶
[x]
roles/web-app-openpost/Administration.mddocuments, per network (Mastodon, Pixelfed, PeerTube, Facebook Pages, Instagram, X, YouTube, LinkedIn, Threads, TikTok, Bluesky), the supported post types, the developer app and account type, the required scopes, review or verification steps, quotas, costs and token upkeep.[x]
Administration.mdlists every unsupported feature with its workaround, including TikTok’s ban on in-house upload tools, the X link surcharge, Instagram’s JPEG and public-URL rule, LinkedIn vetting and Bluesky reach throughweb-app-bridgy-fed.[x]
Administration.mddocuments data processing (which data each platform receives), third-party dependencies, and licence compatibility of the unmodified AGPL-3.0-only application with the role’s own licence.[x]
Administration.mdcontains a staging checklist and a verified-combinations matrix (network, content type, OpenPost version, date) for manual checks of the real platforms.
Image and configuration (story AC2)¶
[x] The role runs
ghcr.io/getopenpost/openpostpinned to a release tag inmeta/services.ymland ships no role-local Dockerfile or source modification.[x] The external update tooling proposes new upstream release tags through
update.type: registry_tags.[x] Every OpenPost setting is rendered through
templates/env.j2, andOPENPOST_APP_URLandOPENPOST_PUBLIC_URLcarryhttps://publish.{{ DOMAIN_PRIMARY }}.
Egress relay (story AC2, AC4, AC7)¶
[ ]
roles/web-app-openpost/meta/networks.ymldeclares the role subnet192.88.99.0/24, a block outside every range OpenPost’s guard rejects and outside every Docker, mesh, Tor and role subnet pool, and setsoutside_pool: truenext to it, whichNETWORK_ROLE_SUBNET_EXCEPTION_ROLESingroup_vars/all/08_networks.ymlcollects throughlookup('role_subnet_exceptions'); the network is a bridge in compose and an overlay in swarm.[x] A
relayentity running a pinnednginximage carries network aliases, declared asservices.relay.network_aliasesinmeta/services.ymland read by the sharedcontainer_networkslookup, only for the canonical domains of the deployed sibling roles OpenPost publishes to (web-app-mastodon,web-app-pixelfed,web-app-peertube), each gated by that role’s dynamic service flag.[ ] The relay forwards TLS unmodified by SNI to
host.docker.internal, whichcontainer_extra_hostsresolves to the address that reaches the shared proxy in the effective deploy mode, and never resolves its own aliases.[x] The relay refuses every SNI that is not in its map.
[x] When
TLS_MODEis self-signed, OpenPost trusts the platform CA so that relayed vhosts verify; with public certificates no extra trust is configured.[x] The CLI test proves that OpenPost reaches an aliased sibling vhost, that it still rejects a private container name and a private IP literal, and that the relay refuses a TLS connection whose SNI is not in its map.
[ ] Publishing to a local Mastodon account succeeds in swarm through the role’s overlay network, verified by
make roundtrip apps="web-app-openpost".[x]
Administration.mdexplains the guard, the relay, and how a deployment with sibling vhosts on another host or behind split-horizon DNS is covered.
Deployment and operations (story AC2)¶
[x]
publish.{{ DOMAIN_PRIMARY }}serves the OpenPost UI through the shared OpenResty proxy with TLS and aContent-Security-Policyheader, and/api/v1/readyreturns HTTP 200.[ ] The role deploys green in compose (
make compose-deploy mode=reinstall apps=web-app-openpost full_cycle=true) and in swarm, with oneallreplica and no reliance oncontainer_name.[x] OpenPost stores its data in
svc-db-postgres, and no SQLite database exists in the container.[x] With
web-svc-seaweedfsdeployed, media lands in S3 and an uploaded file is fetchable anonymously over HTTPS from its public URL; without it, media lands in a role volume served under/media/.[x] Media URLs and
/api/v1/accounts/<provider>/callbackare reachable without a session, while every other UI and API route requires authentication.[x] The container healthcheck probes
/api/v1/health, and the deploy waits for/api/v1/ready.[x] Database and media are part of the platform backup, and a restore drill (purge, restore, redeploy) brings back users, connected accounts and publications.
[x] Changing the pinned version and redeploying migrates the schema without manual steps.
[x] OpenPost sends mail through the platform mail service resolved by
lookup('email', application_id).
Secrets and provider credentials (story AC2, AC7)¶
[x] The JWT secret, encryption key and media signing key are generated through
meta/secrets.yml, the OIDC client secret comes fromOIDC.CLIENT.SECRET, and all of them reach OpenPost through the role’s env file like every other role’s secrets.[x] The break-glass instance admin
web-app-openpost-breakglassis declared inmeta/users.ymlwith a generated password, is bootstrapped as the first account on a fresh instance, and its e-mail differs from every Keycloak user so just-in-time provisioning never collides with it.[x]
group_vars/all/18_api.ymlgains the entriesx,meta,threads,linkedin,youtubeandtiktok, and the role renders them intoX_CLIENT_*,THREADS_CLIENT_*,LINKEDIN_CLIENT_*andOPENPOST_PROVIDER_APPS.[x] A provider whose
lookup('api_enabled', ...)is false cannot be connected in the UI.[x] Connected provider tokens are stored encrypted, verified by reading the token column from Postgres and finding no plaintext token.
[x]
Administration.mddocuments that OpenPost’s X budget guardrail (OPENPOST_X_MONTHLY_BUDGET_MICROUSD) applies only in its cloud edition, so a self-hosted deployment caps X spending through the prepaid credits of the X developer account.
Single sign-on (story AC3)¶
[x]
meta/services.ymldeclaressso.flavor: oidc, and OpenPost reads its issuer fromOIDC.CLIENT.ISSUER_URL, its client fromOIDC.CLIENT.IDandOIDC.CLIENT.SECRET, and uses the scopesopenid profile email.[x] Password self-registration is closed and SSO users are provisioned just in time on their first login; because OpenPost gates both with
OPENPOST_DISABLE_REGISTRATIONS, the role keeps the switch open when Keycloak is deployed and the shared proxy answersPOST /api/v1/auth/registerwith HTTP 403.[x] The platform administrator becomes instance administrator through
OPENPOST_OIDC_BOOTSTRAP_ALLOWLISTon first SSO login.[x] A just-in-time provisioned user without a workspace invitation cannot see or use the organisation workspace or its connected accounts.
[x]
Administration.mddocuments the break-glass procedure (OPENPOST_SSO_BREAK_GLASS_EMAILS), linking an existing account to its SSO identity, and the trusted-proxy fallback through oauth2-proxy.[x]
README.mddocuments that OpenPost ships no LDAP adapter, so the role declares noldapservice and directory accounts sign in through Keycloak’s OpenLDAP federation over OIDC.
Telemetry and data minimisation (story AC7)¶
[x]
OPENPOST_DIAGNOSTICS_ENABLED,OPENPOST_UPDATE_CHECK_ENABLED,OPENPOST_TELEMETRY_ENABLED,OPENPOST_FEEDBACK_ENABLEDandOPENPOST_PUBLIC_PROFILES_ENABLEDare rendered asfalse, and the CLI test asserts it through the running instance.
Fediverse publishing (story AC4)¶
[x] The deploy registers an
OpenPostapp once on each deployed sibling Mastodon and Pixelfed instance, persists it, and pins it throughMASTODON_SERVERSandPIXELFED_SERVERSnamed by the canonical URL, because the dynamic registration path of v7.22.9 fails its own readiness check on code exchange.[x] An administrator connects a local Mastodon account through the out-of-band code flow and publishes a text post that appears on the Mastodon instance.
[x] An administrator connects a local Pixelfed account and publishes an image post that appears on the Pixelfed instance.
[x] An administrator connects a local PeerTube account and publishes a video that appears on the PeerTube instance.
Provider simulator (story AC4, AC8)¶
[x] A
simulatorentity running the pinnedwiremock/wiremockimage is enabled by onemeta/variants.ymlvariant only and is absent from the base configuration.[x] Inside that variant, the simulator joins the role network with aliases for the API hostnames OpenPost uses for X, Facebook, Instagram, YouTube, LinkedIn and TikTok, presents a certificate for those names signed by a per-deploy test CA, and OpenPost trusts that CA.
[x] An X, Facebook Page, Instagram, YouTube, LinkedIn and TikTok account each connect through OpenPost’s real callback against the simulator without a real provider login.
[x] Publishing to those accounts produces the documented request sequence, asserted from the simulator’s request journal: one X post within 280 weighted characters, one Facebook Page post, an Instagram media container followed by a publish call with a public JPEG URL, a resumable YouTube upload, one LinkedIn post, and one TikTok photo post followed by a status poll.
[x] A simulated 429 response with a reset header is retried automatically and ends in exactly one successful delivery.
[x] A simulated 503 response to a write leaves the destination in OpenPost’s manual review instead of resending it, because OpenPost treats it as an ambiguous delivery; publishing the post again to that destination alone ends in exactly one successful delivery.
[x] A permanent 4xx response leaves the rendition in a failed state that the UI shows together with the provider error, which OpenPost v7.22.9 reports as the provider’s HTTP status and the reason
provider_rejected.
Publishing management (story AC6)¶
[x] A post published immediately reaches the local Mastodon target, and a post scheduled two minutes ahead reaches its simulated destination exactly once and not before its time.
[x] Every destination shows its state (scheduled, published, failed) and a failed destination can be retried alone.
[x] Two accounts of the same network can be connected in one workspace and selected together for one publication.
[x] A workspace member with a role that cannot publish is refused when publishing, while an editor succeeds.
Variants, tests and quality (story AC8)¶
[x]
meta/variants.ymlstays within the three-variant limit: variant 0 enables every integration but the onion, the simulator and the local Mastodon target, variant 1 adds the local Pixelfed and PeerTube targets with the integrations off, and variant 2 switches everything off, so no single round deploys all three instances; every variant deploys cleanly on a fresh host.[x]
files/playwright/covers theguest,biberandadministratorpersonas per the Playwright contract, with the administrator connecting a Fediverse account and publishing, andbiberbeing denied the organisation workspace.[x]
files/test/test.shwithtemplates/test.env.j2covers readiness, the telemetry flags, the egress relay and its negative controls, token encryption at rest, Fediverse delivery and the simulator journal assertions.[ ]
make compose-playwright role=web-app-openpostexits 0 without stub tests and ends logged out.[ ]
make roundtrip apps="web-app-openpost"is green in compose and swarm.[ ]
make testis green tree-wide.
Role documentation¶
[x]
README.mdfollows the role README rules and states the image and bump policy, the egress relay, the SSO model and the telemetry defaults;meta/services.ymldeclares therelayentity that the documentation build draws into the role’s Cosmos diagram.[ ] This requirement is cross-linked from the implementing pull request and from the OpenProject work item.
Validation Apps¶
INFINITO_PLAYWRIGHT_KEEP=true make compose-deploy mode=reinstall apps=web-app-openpost full_cycle=true
make roundtrip apps="web-app-openpost"
Smoke: open https://publish.{{ DOMAIN_PRIMARY }}/, sign in through Keycloak, connect the local Mastodon account, publish a post and find it on the Mastodon instance.
Prerequisites¶
Before implementation, the agent MUST read AGENTS.md, then Compose Loop, Swarm Loop and the Playwright contract.
Implementation Strategy¶
Execute autonomously and start from the proven egress topology: the role network on 192.88.99.0/24, an nginx stream relay with ssl_preread and an SNI map, and OpenPost attached to that network.
Verify against the pinned upstream image before claiming a criterion: the provider hostnames and OAuth endpoints the simulator must answer, how OpenPost validates the OAuth state on its callback, and the account-linking flow.
Prove every relay and simulator change in the live stack via make compose-exec and make compose-inner-run before redeploying.
Commit Policy¶
No git commit until every Acceptance Criterion is checked off.
When met and
make testis green, instruct the operator to rungit-sign-pushoutside the sandbox. The agent MUST NOT push.
See Also¶
Automated crossposting: 063-openpost-crossposter.md
Requirement format: requirements.md
How agents process requirements: requirements.md