railyard/apps/rithub-export/ecosystem.config.cjs
caelum0x 6801c08af9
Some checks failed
ci / cargo test (abacus) (push) Has been cancelled
ci / cargo test (agent-runtime) (push) Has been cancelled
ci / cargo test (context-passport) (push) Has been cancelled
ci / cargo test (game-economy) (push) Has been cancelled
ci / cargo test (ledgerline) (push) Has been cancelled
ci / cargo test (mint) (push) Has been cancelled
ci / cargo test (rago) (push) Has been cancelled
ci / cargo test (relay) (push) Has been cancelled
ci / node suites (push) Has been cancelled
ci / cargo test (toolgate) (push) Has been cancelled
ci / cargo test (turnstile) (push) Has been cancelled
ci / cargo test (vend) (push) Has been cancelled
feat(RIT-OPS,RIT-BRD): rename gitea -> rit everywhere we control, deployed + live-verified
apps/gitea -> apps/rithub-server; compose services/containers renamed
(rithub-server-app/postgres/act-runner) with explicit project name and
volume names pinned to the exact existing Docker volumes (no data loss);
our own GITEA_* compose/env var names -> RIT_*; new rit-admin CLI wrapper
on railyard-box; giteaSession.mjs/giteaOAuth.mjs/giteaInfo.mjs ->
ritSession/ritOAuth/ritInfo across 6 apps; GiteaForgeAdapter -> RitForgeAdapter
+ giteaSyncService/importGiteaRepos/syncGiteaRepos -> rit* in ritgram
(tsc clean); apps/console/lib/gitea.ts -> lib/ritProvision.ts; Go
internal/giteaclient -> internal/ritclient in rithub-async-import (go
build/test clean); new /auth/rit + /forges/rit/connect routes with
/gitea back-compat aliases; locale/swagger/footer/captcha template text
scrubbed of remaining "Gitea" strings.

Deployed to railyard-box: old containers stopped/removed, /srv/railyard-gitea
renamed to /srv/rithub-server with a symlink kept, docker compose up -d from
the new path, act_runner network-alias fix for its persisted instance URL.
Live-verified: docker compose config diff showed zero unintended value
changes, DB row counts unchanged (19 users, 635 repos), full route
regression 200/expected, 0 "gitea" in headers/bodies on every checked page,
real git clone+push over HTTPS and SSH with a disposable account (deleted
after). Deferred on purpose (documented in plans/railyard.md): the forge
discriminator / DB column names / Postgres role+volume names (data
migrations, not a naming change) and the upstream GITEA__ env-to-ini keys
and X-Gitea-* wire headers (hardcoded in the vendored engine binary).

See plans/railyard.md RIT-OPS/RIT-BRD entry for the full old->new map and
live evidence.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-12-01 16:34:39 +03:00

48 lines
2.3 KiB
JavaScript

// pm2 process definition for Rithub's full account export service
// (RIT-RET, queue item 4, 2026-12-01). Bound to 127.0.0.1 only -- public
// exposure is via Caddy's /export* handle block on rithub.dev, same
// pattern as /approvals*/device*/protect*. Holds nothing but a signed-in
// human's own OAuth2 access token (encrypted at rest, same stance as
// apps/rithub-approvals's oauthTokenStore.mjs) and the archives it builds
// with that token -- never a shared/admin credential.
module.exports = {
apps: [
{
name: "rithub-export",
cwd: __dirname,
script: "bin/start.mjs",
env: {
NODE_ENV: "production",
PORT: "3365",
RITHUB_BASE_URL: "https://rithub.dev",
// Loopback, not the public domain: git clone/fetch for every repo's
// bundle goes straight to the engine, bypassing Caddy/Cloudflare's
// edge timeout -- same reasoning as the 2026-11-26 import-timeout
// fix (plans/railyard.md, "root-caused + fixed why imports hit
// Cloudflare's edge timeout").
RITHUB_ENGINE_HOST: "127.0.0.1",
RITHUB_ENGINE_PORT: "3350",
RITHUB_EXPORT_DATA_DIR: "/var/lib/rithub-export/",
RITHUB_EXPORT_ARCHIVE_DIR: "/var/lib/rithub-export/archives/",
// Same real engine OAuth2 "Rit CLI" application every other
// rithub-* service uses (client_id confirmed live, non-confidential/
// PKCE), now carrying a 4th redirect_uri for /export/oauth/callback.
// Same GRANTED_SCOPE as apps/rithub-device-auth on purpose -- a
// different scope list on the same app/user hit a real, live
// "a grant exists with different scope" error while building this
// (see apps/rithub-approvals/src/ritOAuth.mjs's header comment).
RITHUB_EXPORT_OAUTH_CLIENT_ID: "a7e89e94-f193-4c2a-b24c-3f5322e639b0",
// Retention for the opt-in nightly copy kept on our own side
// (decided from plans/rithub-docs/architecture/00-overview.md,
// which names "full account export" but not a retention number) --
// 7 days, per the task spec's "at least a nightly archive kept for
// 7 days on our side".
RITHUB_EXPORT_NIGHTLY_RETENTION_DAYS: "7",
},
autorestart: true,
max_restarts: 10,
min_uptime: "10s",
},
],
};