Repository navigation
app/: self-managed GitLab instances, their sign-in, webhooks and sync (sc-8900, forge) - #96
Draft
ndbroadbent wants to merge 5 commits into
Draft
ndbroadbent wants to merge 5 commits into
ndbroadbent wants to merge 5 commits into
Conversation
…::encrypt/decrypt (AES-256-GCM keyed by VISUALCI_SECRETS_KEY; nothing stored in the clear without it) and secrets::webhook_secret; a gitlab_instances table; forge::instances (normalise_base refuses gitlab.com, paths, IP addresses and http outside development; for_site, for_organization, by_pid, json_for, upsert, enabled) and admins' POST/DELETE /api/ui/orgs/{org}/gitlab-instances, answering with the organization's instances, their sign-in and callback URLs
…ge, ported): /auth/gitlab-<instance id> runs the OAuth code flow with PKCE itself (social login's providers are fixed at boot), the state bound to the instance in the session; forge::outbound guards every request to an instance (public addresses only, checked at DNS resolution; no redirects; time and 8 MB limits; VISUALCI_FORGE_PRIVATE_ADDRESSES=1 for development), and gitlab.rs's API reads go through it; an instance's identity names its site, so its addresses never match an existing account; the configured GitLab's URL is recognised at boot
…900, forge, ported): POST /webhooks/gitlab/{project} checks the project's own secret and linked repository and dispatches PullRequestMerged, BranchClosed or BranchReopened for that project alone; forge::gitlab_hooks adds each project's hook (merge request and push events) when the bot or token is a Maintainer, on linking, from POST /api/ui/orgs/{org}/projects/{project}/gitlab-webhook and in the hourly sync; link_repository links a project on one of the organization's instances with an access token (api scope, Developer or more), stored encrypted, after checking the person is a maintainer there
…gitlab_sync rechecks everyone's GitLab memberships from each linked project's members, per site (gitlab.com through the bot, an organization's instance through each project's token), changing nobody at a site where some project can't be read; GitLab projects' open source status (only gitlab.com's count); the heartbeat fails when the bot's token expires within 30 days or is revoked, or a GitLab can't be read; webhooks still missing are added each run
…erals refused as instances, proxies off and one 30-second deadline for an organization's server, a 16 MB cap across list pages, one unreadable project holds back only its organizations' memberships, forge tokens never serialised, the webhook's URL and secret shown to admins, instances listed
ndbroadbent
force-pushed
the
laravel-gitlab
branch
from
December 2, 2026 23:41
880f982 to
8662daf
Compare
ndbroadbent
marked this pull request as draft
December 3, 2026 00:00
This branch has not been deployed
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.
Ports self-managed GitLab to app/: an organization's own instance.
POST/DELETE /api/ui/orgs/{org}/gitlab-instances[/{id}]. The OAuth application's secret is AES-256-GCM encrypted withVISUALCI_SECRETS_KEY; a server without that key refuses to store it.normalise_baserefuses gitlab.com, paths, IP addresses, and http outside development.forge::instances::json_forgives the organization page its list./auth/gitlab-<instance id>runs the OAuth code flow with PKCE itself, because social login fixes its providers at boot. The state is tied to the instance in the session. An instance's identity names its site, so its email addresses never match an existing account.forge::outbound): every request to an instance reaches public addresses only (checked at DNS resolution), follows no redirects, and has time and 8 MB limits.VISUALCI_FORGE_PRIVATE_ADDRESSES=1lifts the address check for development.POST /webhooks/gitlab/{project}checks that project's own secret and linked repository, then dispatches PullRequestMerged, BranchClosed or BranchReopened for that project only. VisualCI adds the hook when it may: on linking, fromPOST /api/ui/orgs/{org}/projects/{project}/gitlab-webhook, and in the hourly sync.gitlab_instances.rs(8),gitlab_hooks.rs(4),gitlab_sync.rs(4), plus unit tests.Stacked on #95.
Review fixes
VISUALCI_FORGE_PRIVATE_ADDRESSES=1).GET /api/ui/orgs/{org}/gitlab-instanceslists them.one_unreadable_project_doesnt_stop_everyone_elses_sync);Synced.failednames the repositories.forge_token_encis never serialised. Admins see the project's webhook URL and secret (GET …/projects/{project}/gitlab-webhook).