Skip to content

feat(plugins): install and configure official plugins from the environment - #4602

Merged
Quick104 merged 12 commits into
mainfrom
feat/plugin-install-via-env
Nov 20, 2026
Merged

Quick104 merged 12 commits into
mainfrom
feat/plugin-install-via-env

Conversation

@Quick104

@Quick104 Quick104 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Operators can configure Silo settings from their deployment, but setting up an official plugin still takes manual admin steps. On a new database, an OIDC operator also needs the installation ID before they can register a redirect URL. This change lets a deployment install the plugin, supply its credentials, and register the redirect URI before the server starts.

Related issue: N/A
Discussion: #4585
Validation tasks: changes #1224 C1/C2 and #1225 C1/C2
Other clients: Apple N/A (uses the advertised native start path), Android N/A (uses the advertised native start path), Roku N/A (uses device sign-in). Web admin is included here.

Approach

Supply inline JSON in SILO_PLUGINS or mount a YAML or JSON file with SILO_PLUGINS_FILE. An exact version pins a signed official release. A declaration owns the fields it names. Admins can edit neighboring fields, disable the installation, or regain control when the declaration releases a field.

One API replica applies the declaration. Its peers read committed state and reconcile their plugin processes. A restart with the same declaration can reuse the verified archive offline. The stable OIDC callback preserves the existing numeric route. External sign-in becomes available after local Owner setup.

Validation

The Go and web suites, changed-line lint, API contract checks, production web build and bundle budget passed. PostgreSQL 18 tests covered ownership, package changes, secret fields, and all four restore scenarios. The recovery CLI cleared a running writer’s hold. After PostgreSQL terminated its session, the writer reconnected and kept the old declaration inactive. Focused race tests passed. Both complete and partial releases reported every installation that remained locked.

Evidence

In a two-replica deployment on a fresh database, the provisioning replica installed and verified signed OIDC 0.1.1 while discovery advertised 0.1.2. Browser and native PKCE sign-in completed through Authelia under a URL prefix. The sandbox confirmed group restrictions, offline restart, secret rotation after a missed event, writer contention, and restore recovery. In web admin the declared client secret stayed masked, editing a neighboring field succeeded, and emergency disable withdrew the provider. This run used 4efb356b7c. A separate fresh API run at 9d2906c387 installed signed OIDC 0.1.2 and confirmed the Owner gate and stable callback after the YAML integer correction.

The sandbox recorded these sign-in results at 4efb356b7c.

ALLOW allowed via web: writer → follower → writer; role=user, callback=/media/api/v2/auth/oauth/callback, completion replay refused
ALLOW admin via native PKCE: follower → writer → follower; role=admin, callback=/media/api/v2/auth/oauth/callback, completion replay refused

PostgreSQL checks at c005e5b5b4 exercised writer contention, partial releases, and restore with changed credentials.

ok  	github.com/Silo-Server/silo-server/internal/plugins	1.383s
ok  	github.com/Silo-Server/silo-server/internal/backup	10.925s

At dde76ab5e6, the plugin suite passed under the race detector against PostgreSQL 18. Selective restore preserved a deployment-owned field when an administrator submitted a stale selection and restored an editable field beside it. All 2,953 web tests passed, including ownership changes during a sign-in edit.

At 383b669658, a surviving replica loaded a restored plugin at its previous path, and a delayed archive read could not overwrite it. A restore hold kept a metadata provider out of library chains until an operator acknowledged the hold and restarted the writer. The plugin suite passed under the race detector on PostgreSQL 18. All four full restore scenarios and selective restore passed.

After catalog PR #23 merged, the public manifest and all 32 release descriptors matched catalog commit a3a9306b58 byte for byte. Using a fresh PostgreSQL 18 database, server commit 383b669658 installed OIDC pinned to 0.1.1 and verified its release signature while discovery returned 0.1.2. Silo then reused the archive offline and rebuilt an empty plugin cache from it.

On the branch through 6d513c385a, Chromium confirmed that releasing a managed field discarded its old draft and pending secret clear. PostgreSQL 18 covered moving a credential between fields, replacing an incompatible installed release, selectively restoring an omitted field, and reading status during an ownership transfer. The plugin race suite and all four full-restore scenarios passed. The Go suite and 3,020 web tests passed.

At a9e5c5fbff, an enabled OAuth provider remained available for account checks after the public URL was cleared. The inventory returned the new installation path when a peer replaced the same version before or during the read. Both tests failed before the fix and passed under the race detector afterward. The full Go suite, build and changed-line lint passed. A fresh PostgreSQL 18 database applied all 727 migrations.

Risks

Upgrade all API and proxy replicas before enabling the declaration, then mount it on one API instance. After a restrictive restore, stop the writer, review the declaration, acknowledge the current hold and start the designated instance. A competing instance that was refused at startup must restart to assume authority.

Catalog PR: Silo-Server/silo-plugins#23
Operator guide: Silo-Server/siloserver.org#429
Server base: #4596 merged into main at f42b93271a. This branch includes main through 3786bd9d7e.

Checklist

  • I read and can explain the diff.
  • This pull request addresses deployment-managed plugin provisioning.
  • Added tests cover regressions in parsing, trust, ownership, sign-in and restore.
  • The evidence describes the observed user and administrator behavior.

AI Disclosure

  • Harness: OpenAI Codex in T3 Code, Claude Code, and Antigravity
  • Tool(s): Codex, Claude Code, Antigravity, and GitHub CLI
  • Council: Opus 5.5 and Neon, 2 rounds, reviewed ac710f2
  • Model(s): gpt-6.2-astra, gpt-6.2-sol, claude-fable-5-2, claude-opus-5-5, and gemini-4-neon
  • Involvement: AI-assisted
  • Adversarial review: Opus and Neon reviewed restore authority, writer failover, release selection, and operator examples. Their findings led to a restart requirement after a restore hold, retry of an orphaned writer session, stricter version validation, and status reporting for blocked releases. PostgreSQL regressions cover complete and partial releases. Sol reviewed package replacement, secret handling and runtime convergence.

Note

Add environment-based plugin provisioning with ownership guards and stable OAuth callbacks

  • Adds a provisioning document read from environment variables (inline or file, JSON/YAML, 1 MiB limit, schema-validated) that installs and configures official plugins at startup, driven by a new ProvisionWriter with advisory-lock authority and persisted status records. See provision_document.go and provision_writer.go.
  • Introduces per-installation provision ownership (plugin_provision_ownership table) with a version pin and owned config/binding fields. Writes through RuntimeConfigStore (PutGlobalConfig, compareAndSwapGlobalConfig, UpsertAuthBinding), restore, and auto-update preserve owned fields and reject version-pinned or managed installation changes.
  • Adds stable OAuth callback mode (callback_mode column, default installation) with a shared callback route, callback-mode validation per capability, and registry gating of sign-in providers on initial setup and public-URL availability.
  • Reworks plugin runtime management: per-installation runtime locks, tracked runtime identity, resident reconciliation through ResidentSupervisor, and release-scoped archive-cache retirement with retry, replacing the prior stop-then-replace flow.
  • Backup/restore now carries plugin credentials, ownership, and release state, writes a provisioning restore hold during restore, and exposes silo plugins restore-hold|acknowledge-restore recovery commands.
  • Risk: plugins.Host drops NextStartSeq, OAuthHandlerDeps.ResolveClient returns callback mode and capability ID, DatabaseLoader requires FinishPluginProvisionRestore, and ResidentSupervisor.Reset is removed — out-of-tree implementations of these interfaces break. New DB tables and columns require migrations to run before startup.

Macroscope summarized a9e5c5f.

@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T01:07:34.082728Z a9e5c5f New commits
🔒 Security Review ✅ Completed 2026-11-20T01:08:38.385729Z a9e5c5f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body labels Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

This pull request adds declarative plugin provisioning with managed ownership and status reporting. It adds stable OAuth callback support and setup-aware provider discovery. It also changes plugin backup and restore handling, restore holds, installation updates, archive retirement, and lifecycle reconciliation.

Changes: Plugin provisioning and lifecycle

Layer / File(s) Summary
Provisioning contracts and startup
contracts/plugins/provisioning/v1/*, contracts/api/v2/*, cmd/silo/*, migrations/sql/*
Defines the provisioning document schema and API contracts. Startup reads declarations, initializes the provision writer, cleans abandoned staging files, and exposes restore-hold recovery commands. Adds ownership, provisioning-status, callback-mode, and placement database structures.
Provisioning engine and ownership enforcement
internal/plugins/provision_*, internal/plugins/runtime_config.go, internal/plugins/installation.go, internal/plugins/catalog_service.go, internal/plugins/installer.go, internal/metadata/chain.go
Parses and validates declarations, prepares verified official packages, and applies configuration and auth bindings transactionally. Tracks managed fields and pins, records outcomes, and queues metadata placement.
Backup and restore handling
internal/backup/*, internal/plugins/restore.go, internal/plugins/provision_restore_hold.go
Carries matching plugin configuration, credentials, and ownership during restore. Excludes transient status and placement data from backup replay. Creates fresh restore holds when restored plugin state is restricted and adds selective-restore handling for managed fields.
Plugin installation and lifecycle reconciliation
internal/plugins/archive_cache.go, internal/plugins/service.go, internal/plugins/resident.go, internal/plugins/lifecycle_events.go, internal/plugins/auto_update.go
Adds guarded installation updates, per-installation runtime coordination, lifecycle reconciliation with polling fallback, and targeted archive retirement. Automatic updates account for holds, version pins, managed declarations, and withdrawn catalog releases.

Stable OAuth callbacks and provider setup

Layer / File(s) Summary
Callback modes and OAuth flow
internal/plugins/auth_callback.go, internal/auth/*, internal/apiv2/oauth_handshakes.go, internal/apiv2/admin_plugin_installations.go, migrations/sql/*
Adds installation-specific and stable callback modes. Signed state records callback mode and capability identity; callback handling validates the recorded redirect URI. Provider discovery checks setup and OAuth availability.
Callback API and documentation
contracts/api/v2/openapi.json, web/src/api/v2/*, docs/architecture/external-sign-in.md, docs/auth-api.md
Documents stable callback capability and route, callback-mode fields, and callback behavior. Adds API schema and operation mappings.

Administrator UI

Layer / File(s) Summary
Provisioning status and managed plugin controls
web/src/pages/AdminPlugins.tsx, web/src/pages/AdminPluginDetail.tsx, web/src/components/admin/plugins/*, web/src/hooks/queries/admin/plugins.ts
Fetches and displays provisioning status. Shows ownership and version-pin metadata. Disables uninstall and configuration controls for managed fields.
Managed sign-in controls and translations
web/src/pages/admin-settings/*, web/src/lib/externalSignInAdmin.ts, web/src/locales/*
Displays managed and pending callback states, excludes managed values from drafts and writes, and adds localized provisioning labels and messages.

Estimated code review effort: 5 (Critical) | ~120 minutes

Change: Feature

Suggested reviewers: rhainland, coffeeknyte

Merge Risk: Moderate · up to 88855

This PR adds deployment-managed plugin provisioning and stable OAuth callbacks. If an administrator clears the public URL, OAuth sign-in users can be blocked from refreshing their sessions under fail-closed policy. A refused sign-in binding conflict also does not re-apply without a restart. Several smaller consistency and recovery issues remain open. Resolve the OAuth re-check regression before merging.

Security architecture risk: Minimal · up to 88855

This is a substantial change to plugin management and sign-in routing. The inspected paths preserve administrative authorization, verified-release restrictions, transactional ownership checks, and restore safeguards. No introduced security or recovery defect was established within the reviewed scope.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — Declaration authority is deployment-level rather than user-local: it can select plugin releases, supply global configuration, and configure external sign-in and automatic account creation. Its committed effects extend to plugin runtimes using the shared installation database and to accounts authenticating through the configured provider. Exploiting this authority directly requires control of deployment inputs or an authorized administrative mutation path.

Trust Boundaries and Controls

  • observed — Anonymous stable-callback input does not directly choose the authenticated installation. The shared callback verifies signed state, requires agreement between route and callback mode, checks installation and persisted redirect identity, consumes the flow once, requires its browser binder, and checks the resolved capability before exchanging the code.
  • observed — Administrator binding writes use authenticated acting-admin gates. The database mutation locks the installation and binding domain, rejects changes to declaration-owned fields, validates explicit callback modes against capability modes, and checks enabled-provider eligibility before commit. Omitting callback mode preserves the stored mode.
  • observed — The provider registry receives the first-account setup predicate and public-URL availability check. During rebuild it publishes no external providers while setup is pending, excludes disabled bindings and installations, and omits OAuth providers when a public redirect URL is unavailable.

Resilience and Maintainability Implications

  • observed — Metadata placement uses a separate transaction per installation, with authority and restore-hold checks before placement and queue deletion. Failed placement rolls back that installation's work while preserving earlier completed placements. Package staging is private and lock-owned; abandoned staging can be cleaned, and committed packages can be recovered from their stored archives.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: official plugins are installed and configured from the deployment environment. The raw summary confirms this with the SILO_PLUGINS and SILO_PLUGINS_FILE provisioning p…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is related to the changeset. It describes deployment-managed installation and configuration of official plugins through SILO_PLUGINS or SILO_PLUGINS_FILE, the managed-field ownership m…
Full details: Title check

Explanation

The title names the main change: official plugins are installed and configured from the deployment environment. The raw summary confirms this with the SILO_PLUGINS and SILO_PLUGINS_FILE provisioning pipeline, the provisioning writer, and ownership rules. The title does not mention the other large parts of the changeset, such as OAuth stable callbacks, restore holds, and the notification settings removal, but the task allows that. The title is specific and concise.

Full details: Description check

Explanation

The description is related to the changeset. It describes deployment-managed installation and configuration of official plugins through SILO_PLUGINS or SILO_PLUGINS_FILE, the managed-field ownership model, the restore hold and recovery commands, the stable OAuth callback, and the validation performed. This matches the changes in the raw summary, including the provisioning document, provisioning writer, ownership table, restore hold, and admin UI changes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

Minor comments: 14

web/src/pages/AdminPluginDetail.tsx: 1

113-115: Minor · Functional Correctness · Quick win

Keep provisioning loading and error states before reporting “not found.”

If a declared plugin has no installation or catalog entry, a pending provisioning request leaves provisioning undefined. The page then reports that the plugin does not exist. If the request fails, that response remains and the page provides no provisioning retry.

Keep the query object. Before the final not-found response, handle provisioning loading and errors, with a retry action. Keep existing installation and catalog content available.

web/src/pages/admin-settings/useSignInProviderDrafts.ts: 1

99-106: Minor · Data Integrity & Integration · Quick win

Remove obsolete field drafts when provisioning takes ownership.

If an admin drafts issuer_url=A and provisioning then commits issuer_url=B, this code displays B but retains A in drafts. The change count hides A, and Save skips an entry with no remaining editable changes. When provisioning releases the field, A returns as an unsaved edit and can overwrite B on the next save.

Remove that field's draft value and pending secret clear when ownership is acquired. Preserve drafts for neighboring unmanaged fields.

internal/plugins/provision_ownership.go: 1

214-214: Minor · Data Integrity & Integration · Quick win

Validate explicitly owned installation callback modes on replacement.

If an unpinned OAuth provider owns callback: installation, a verified update can retain the capability ID but switch it to password mode. This check and final binding validation only validate stable, so the update can commit. On the next apply, preflight rejects the same declaration because explicit installation mode also requires OAuth. Validate the mode when callback_mode is owned, while keeping the implicit installation default valid for ordinary password bindings. (raw.githubusercontent.com)

internal/plugins/provision_document.go: 1

193-193: Minor · Functional Correctness · Quick win

Reject duplicate YAML keys before decoding them into a map.

If a plugin mapping contains &v version: 1.0.0 and then uses *v as a second key with value 2.0.0, yaml.v3 compares the two key nodes before resolving the alias. It then resolves both to version and overwrites the first value. The JSON validator sees only 2.0.0, so provisioning can select a different release instead of rejecting the declaration. Check resolved keys before map decode, or reject aliases in mapping keys. (raw.githubusercontent.com)

internal/plugins/provision_ownership_db_test.go: 1

130-130: Minor · Stability & Availability · Quick win

Use a non-canceled context for the repository cleanup.

t.Context() is canceled before cleanup functions run, so the DELETE at line 130 cannot acquire a connection. Its error is also discarded, so the failure is silent. The repository row remains in the shared test database. Later tests that read plugin_repositories without a filter can then see this row.

Use context.Background() for this cleanup, as seedResidentQueryInstallation already does. Add the context import for this change.

Suggested fix

-	t.Cleanup(func() { _, _ = pool.Exec(ctx, `DELETE FROM plugin_repositories WHERE id = $1`, repositoryID) })
+	t.Cleanup(func() {
+		_, _ = pool.Exec(context.Background(), `DELETE FROM plugin_repositories WHERE id = $1`, repositoryID)
+	})
 import (
+	"context"
 	"errors"
 	"testing"
internal/plugins/installer.go: 1

752-752: Minor · Stability & Availability · Quick win

Sweep abandoned manifest stages even without a declaration.

A manual binary upload now writes its temporary executable under the persistent plugin cache. If the process stops before stage.remove runs, the next start leaves those files in place unless it has a declaration and acquires writer authority during StartOffline. Acquiring authority later in Run does not sweep either. Repeated interruptions can leave multiple executable copies in the cache. (raw.githubusercontent.com)

Run the locked stage sweep at plugin startup, independently of provisioning authority. Keep the owner lock check so an active manifest command is not interrupted.

internal/plugins/provision_writer.go: 1

281-281: Minor · Stability & Availability · Heavy lift

Commit each queued placement in its own transaction and deadline.

finishPlacement applies every queued installation in one transaction under one provisionDBTimeout context. When the queue holds several installations whose combined placement time exceeds that deadline, the last placement times out. The rollback then undoes the earlier placements and their queue deletes. Each retry repeats the same work, so the later installations never commit.

Scope the acknowledgement and placement for each plugin_installation_id to its own transaction, with its own deadline. Keep the placement and its queue delete atomic per item. Items do not need to share a transaction.

internal/plugins/catalog_service.go: 1

210-210: Minor · Data Integrity & Integration · Heavy lift

Clear update notices for explicitly withdrawn releases.

If the notify policy already recorded 1.1.0 and the official catalog withdraws it without listing another newer release, this filter hides the candidate from the update pass. The pass leaves available_version unchanged. Admins still see an available update, but applying it returns the withdrawal error and leaves the notice in place. Pass explicit withdrawal information to update reconciliation so it can clear the matching notice without clearing notices when a catalog is temporarily unreachable. (raw.githubusercontent.com)

internal/plugins/installation.go: 1

763-763: Minor · Stability & Availability · Heavy lift

Reconcile the uninstall after the database commits.

If local file removal fails, Delete returns an error after the installation and its dependent rows are gone. The admin handler treats that error as a failed deletion. It tries to restart the removed plugin and returns without calling OnLifecycleChange. Retrying the uninstall cannot clean up the files because the row no longer exists. Keep cleanup failures separate from database deletion failures. Publish the lifecycle change for a committed deletion and retain enough information to retry cleanup. (raw.githubusercontent.com)

internal/plugins/lazy_start_test.go: 1

38-38: Minor · Functional Correctness · Quick win

Assert that Start returns the injected host error.

The test passes if Start returns an unrelated error before reaching Host.Start: the runtime state would still be stopped with no recorded failure. Assert errors.Is(err, host.startErr) before checking the runtime state. (raw.githubusercontent.com)

internal/plugins/lifecycle_events.go: 1

222-222: Minor · Stability & Availability · Quick win

Retry failed archive retirement.

If a follower cannot remove release A after observing release B, it logs the error and records B as reconciled. When the filesystem recovers, the next poll no longer has A to retry. Keep failed retirements pending until deletion succeeds. Do not delay recording B or reconciling its process. (raw.githubusercontent.com)

internal/plugins/resident.go: 1

611-611: Minor · Stability & Availability · Heavy lift

Honor restart cancellation while waiting for reconciliation.

Reconcile holds reconcileMu while it reads manifests and stops removed processes. If a restart caller cancels during that work, restart cannot reach its context select until the mutex is released. It can also schedule a restart after acquiring the lock despite the canceled request. Make admission cancellable. Once a restart has been accepted, preserve the existing behavior that caller cancellation does not cancel the launch. (raw.githubusercontent.com)

internal/plugins/restore.go: 1

177-177: Minor · Functional Correctness · Quick win

Do not offer a restore when only an owned field differs.

If a verified backup differs only in an environment-owned field, the selective-restore planner compares the raw maps and makes the item selectable. Apply preserves the current field and writes nothing. The next preview offers the same change. Use the same ownership-aware comparison in preview and apply. Explain why an owned field is skipped, and keep the item selectable when an unowned field can be restored. (raw.githubusercontent.com)

internal/plugins/service.go: 1

694-695: Minor · Stability & Availability · Heavy lift

Keep the runtime record consistent when Host.Start fails.

Service.start clears the runtime record before Host.Start. Host.Start binds the host identity before it replaces an existing instance. If the identity bind fails, the previous client stays registered, but the runtime record is already gone. For a resident plugin, ensureClient then rejects the live process with "is changing" until a successful start or a restart stores the record again.

The recovery path in DeleteAdminPluginInstallation can reach this state. It calls Service.Start after a failed row delete. A supervisor relaunch between the handler's Stop and that Start leaves a live resident client, so a failing identity resolver can trigger the rejection. The failure depends on that timing and on the resolver's configuration.

Make the runtime record match the registered client on every Host.Start error. The record must not be cleared while the previous client remains registered. Preserve the stop-before-replace behavior for a successful launch.

Nitpick comments: 3

docs/architecture/backups.md: 1

1987-1989: Trivial · Maintainability & Code Quality · Quick win

Move the restore-hold command procedure to the user manual.

Keep the hold lifecycle and matching-ID contract here. Move the commands to the manual and link to the complete recovery procedure, including stopping the writer, reviewing the declaration, acknowledging the hold, and starting the designated instance.

This keeps the recovery sequence in one place instead of leaving a partial procedure in architecture documentation. As per coding guidelines, “Guides for installing, configuring, operating, or troubleshooting Silo belong in the user manual.”

Source: Coding guidelines

internal/plugins/provision_package.go: 1

152-154: Trivial · Performance & Scalability · Quick win

Validate the generated archive once.

buildBinaryPluginArchive already calls openPluginArchive. The second call decompresses and hashes the same executable again. Remove the second call and keep the validation in buildBinaryPluginArchive, which also protects its other callers. (raw.githubusercontent.com)

internal/plugins/lazy_start_test.go: 1

81-84: Trivial · Maintainability & Code Quality · Quick win

Change the stored release while the lazy launch is in flight.

The store update currently runs after ensureClient returns. A regression that re-reads the installation while recording the failure would still see the old version and pass this test. Block the launch after it reads the old row, update the fake store, then let the launch fail. The existing assertions can then distinguish the tried release from the current one. (raw.githubusercontent.com)

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe1bcfd2-36f2-4122-9d51-7b8ae1bb401d
Commits

Reviewing files that changed from the base of the PR and between c5e414a and c005e5b.

Files selected for processing: 182

  • .silo-translations
  • cmd/silo/main.go
  • cmd/silo/marker_plugin_migration_test.go
  • cmd/silo/plugin_recovery_command.go
  • contracts/api/v2/fixtures/get_admin_plugin_capabilities_ok.json
  • contracts/api/v2/fixtures/get_oauth_handshake_capabilities_ok.json
  • contracts/api/v2/fixtures/index.json
  • contracts/api/v2/fixtures/list_admin_plugin_provisioning_status_ok.json
  • contracts/api/v2/openapi.json
  • contracts/plugins/provisioning/v1/embed.go
  • contracts/plugins/provisioning/v1/schema.json
  • docs/admin-api.md
  • docs/admin-plugin-catalog-api.md
  • docs/architecture/backups.md
  • docs/architecture/external-sign-in.md
  • docs/auth-api.md
  • internal/api/handlers/admin.go
  • internal/api/handlers/admin_plugin_lifecycle.go
  • internal/api/handlers/admin_settings_checks_test.go
  • internal/api/handlers/plugins.go
  • internal/api/router.go
  • internal/api/router_v2_plugin_settings_test.go
  • internal/api/testdata/media_routes.txt
  • internal/apiv2/admin_plugin_configuration.go
  • internal/apiv2/admin_plugin_installations.go
  • internal/apiv2/admin_plugin_provisioning.go
  • internal/apiv2/admin_plugin_provisioning_test.go
  • internal/apiv2/document.go
  • internal/apiv2/external_sign_in.go
  • internal/apiv2/external_sign_in_test.go
  • internal/apiv2/fixtures_test.go
  • internal/apiv2/oauth_handshakes.go
  • internal/apiv2/oauth_handshakes_test.go
  • internal/apiv2/pilot_fakes_test.go
  • internal/apiv2/problem.go
  • internal/apiv2/router.go
  • internal/auth/account_resolution.go
  • internal/auth/external_sign_in_db_test.go
  • internal/auth/oauth_flow.go
  • internal/auth/oauth_flow_db_test.go
  • internal/auth/oauth_handler.go
  • internal/auth/oauth_handler_test.go
  • internal/auth/oauth_state.go
  • internal/auth/plugin_provider.go
  • internal/auth/provider_registry.go
  • internal/auth/provider_registry_test.go
  • internal/auth/repository.go
  • internal/auth/service.go
  • internal/backup/backup_postgres_test.go
  • internal/backup/credentials.go
  • internal/backup/credentials_stricter.go
  • internal/backup/plugin_provision.go
  • internal/backup/plugin_provision_postgres_test.go
  • internal/backup/plugin_releases.go
  • internal/backup/restore.go
  • internal/backup/settings_classes.go
  • internal/backup/settings_classes_test.go
  • internal/backup/settings_outbound.go
  • internal/backup/swap.go
  • internal/backup/swap_test.go
  • internal/backup/tables.go
  • internal/metadata/chain.go
  • internal/plugins/archive_cache.go
  • internal/plugins/archive_cache_test.go
  • internal/plugins/auth_binding_db_test.go
  • internal/plugins/auth_callback.go
  • internal/plugins/auto_update.go
  • internal/plugins/auto_update_defaults_test.go
  • internal/plugins/auto_update_replace_test.go
  • internal/plugins/auto_update_restore_hold_db_test.go
  • internal/plugins/catalog_service.go
  • internal/plugins/config_sensitivity.go
  • internal/plugins/config_sensitivity_db_test.go
  • internal/plugins/host_adapter.go
  • internal/plugins/installation.go
  • internal/plugins/installation_paths.go
  • internal/plugins/installation_paths_test.go
  • internal/plugins/installer.go
  • internal/plugins/installer_replace_test.go
  • internal/plugins/lazy_start_test.go
  • internal/plugins/lifecycle_events.go
  • internal/plugins/network_access.go
  • internal/plugins/node_service.go
  • internal/plugins/package_error_test.go
  • internal/plugins/provision_apply.go
  • internal/plugins/provision_binding.go
  • internal/plugins/provision_document.go
  • internal/plugins/provision_document_test.go
  • internal/plugins/provision_hold_writer_db_test.go
  • internal/plugins/provision_number.go
  • internal/plugins/provision_ownership.go
  • internal/plugins/provision_ownership_db_test.go
  • internal/plugins/provision_package.go
  • internal/plugins/provision_package_test.go
  • internal/plugins/provision_placement_db_test.go
  • internal/plugins/provision_restore_hold.go
  • internal/plugins/provision_writer.go
  • internal/plugins/provision_writer_db_test.go
  • internal/plugins/repository.go
  • internal/plugins/resident.go
  • internal/plugins/resident_generation_test.go
  • internal/plugins/resident_test.go
  • internal/plugins/restore.go
  • internal/plugins/runtime_config.go
  • internal/plugins/service.go
  • internal/plugins/service_admin_config.go
  • internal/plugins/service_auth_connection.go
  • internal/plugins/service_hot_reload_test.go
  • internal/plugins/service_install_catalog_db_test.go
  • internal/plugins/service_lifecycle_test.go
  • internal/plugins/service_singleflight_test.go
  • internal/plugins/signature.go
  • internal/plugins/signature_test.go
  • internal/plugins/watch_sync_config.go
  • migrations/sql/20261119202657_plugin_provision_ownership.sql
  • migrations/sql/20261119202701_add_plugin_provision_status.sql
  • migrations/sql/20261119202736_plugin_auth_callback_mode.sql
  • migrations/sql/20261119204446_plugin_provision_placement.sql
  • scripts/ci/db-contracts.txt
  • web/src/api/types.ts
  • web/src/api/v2/operations.ts
  • web/src/api/v2/schema.ts
  • web/src/components/admin/plugins/PluginConfigForm.test.tsx
  • web/src/components/admin/plugins/PluginConfigForm.tsx
  • web/src/components/admin/plugins/PluginDetailSections.tsx
  • web/src/components/admin/plugins/PluginProvisioningStatus.tsx
  • web/src/components/admin/plugins/PluginTile.tsx
  • web/src/hooks/queries/admin/plugins.ts
  • web/src/hooks/queries/keys.ts
  • web/src/lib/externalSignInAdmin.ts
  • web/src/lib/pluginPresentation.ts
  • web/src/locales/ar-XB.json
  • web/src/locales/ar.json
  • web/src/locales/bg.json
  • web/src/locales/ca.json
  • web/src/locales/cs.json
  • web/src/locales/da.json
  • web/src/locales/de.json
  • web/src/locales/el.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/es.json
  • web/src/locales/et.json
  • web/src/locales/fi.json
  • web/src/locales/fr.json
  • web/src/locales/he.json
  • web/src/locales/hi.json
  • web/src/locales/hr.json
  • web/src/locales/hu.json
  • web/src/locales/id.json
  • web/src/locales/it.json
  • web/src/locales/ja.json
  • web/src/locales/keys.ts
  • web/src/locales/ko.json
  • web/src/locales/lt.json
  • web/src/locales/lv.json
  • web/src/locales/ms.json
  • web/src/locales/nb.json
  • web/src/locales/nl.json
  • web/src/locales/pl.json
  • web/src/locales/pt-BR.json
  • web/src/locales/pt-PT.json
  • web/src/locales/ro.json
  • web/src/locales/ru.json
  • web/src/locales/sk.json
  • web/src/locales/sl.json
  • web/src/locales/sv.json
  • web/src/locales/th.json
  • web/src/locales/tr.json
  • web/src/locales/uk.json
  • web/src/locales/vi.json
  • web/src/locales/zh-Hans.json
  • web/src/locales/zh-Hant.json
  • web/src/pages/AdminPluginDetail.test.tsx
  • web/src/pages/AdminPluginDetail.tsx
  • web/src/pages/AdminPlugins.tsx
  • web/src/pages/admin-settings/NetworkSignInSection.tsx
  • web/src/pages/admin-settings/SignInConfigField.tsx
  • web/src/pages/admin-settings/SignInProviderSlot.tsx
  • web/src/pages/admin-settings/SignInSettings.test.tsx
  • web/src/pages/admin-settings/signInSetup.ts
  • web/src/pages/admin-settings/useSignInProviderDrafts.ts
Files with no reviewable changes: 3

  • internal/plugins/host_adapter.go
  • internal/plugins/node_service.go
  • internal/plugins/service_hot_reload_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Comment thread internal/plugins/catalog_service.go Resolved
Comment thread internal/plugins/config_sensitivity.go Resolved
Comment thread internal/plugins/lifecycle_events.go Resolved
Comment thread internal/plugins/lifecycle_events.go Resolved
Comment thread internal/plugins/network_access.go Resolved
Comment thread internal/plugins/provision_number.go Resolved
Comment thread internal/plugins/provision_ownership.go Resolved
Comment thread internal/plugins/provision_package.go Resolved
Comment thread internal/plugins/resident.go Resolved
@Quick104

Copy link
Copy Markdown
Contributor Author

The fixes for the additional review comments are in 64a0b03 and dde76ab.

  • The plugin detail page offers a retry when provisioning status cannot load. Sign-in drafts discard individual edits and secret clears when a deployment takes ownership.
  • Package replacement checks explicitly managed OAuth callback modes. Startup sweeps abandoned package stages while preserving active ones. Catalog reconciliation clears a saved update notice when the official catalog withdraws that exact release.
  • Metadata placement commits each installation separately. Selective restore previews use the same ownership rules as apply. The restore architecture notes now link to the operator procedure.
  • A successful uninstall commits before local file cleanup. Hosts retry failed cleanup on later polls. Canceled restarts return while waiting for the process lock, and a failed launch preserves a previous client that the host still has registered.

The PostgreSQL and runtime tests cover these paths. The lazy launch regression now changes the installed release while the launch is in flight and checks the host error. The device approval test creates the local administrator before external sign-in.

🤖 Codex (gpt-6.2-astra)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 34f33565-0407-44a1-a621-08b8d218341a
Commits

Reviewing files that changed from the base of the PR and between c005e5b and dde76ab.

Files selected for processing: 47

  • cmd/silo/main.go
  • docs/architecture/backups.md
  • internal/api/handlers/auth_device_db_test.go
  • internal/backup/selective_apply.go
  • internal/backup/selective_plan.go
  • internal/backup/selective_plugin_postgres_test.go
  • internal/plugins/archive_cache.go
  • internal/plugins/auto_update.go
  • internal/plugins/auto_update_replace_test.go
  • internal/plugins/catalog_service.go
  • internal/plugins/config_sensitivity.go
  • internal/plugins/config_sensitivity_db_test.go
  • internal/plugins/installation.go
  • internal/plugins/installation_paths.go
  • internal/plugins/installation_paths_test.go
  • internal/plugins/lazy_start_test.go
  • internal/plugins/lifecycle_events.go
  • internal/plugins/manifest.go
  • internal/plugins/network_access.go
  • internal/plugins/network_access_generation_test.go
  • internal/plugins/provision_apply.go
  • internal/plugins/provision_document.go
  • internal/plugins/provision_document_test.go
  • internal/plugins/provision_number.go
  • internal/plugins/provision_ownership.go
  • internal/plugins/provision_ownership_db_test.go
  • internal/plugins/provision_package.go
  • internal/plugins/provision_package_test.go
  • internal/plugins/provision_placement_db_test.go
  • internal/plugins/provision_writer.go
  • internal/plugins/provision_writer_db_test.go
  • internal/plugins/provision_yaml_test.go
  • internal/plugins/resident.go
  • internal/plugins/resident_generation_test.go
  • internal/plugins/resident_test.go
  • internal/plugins/restore.go
  • internal/plugins/service.go
  • internal/plugins/service_hot_reload_test.go
  • internal/plugins/service_installation_cache_test.go
  • internal/plugins/service_lifecycle_test.go
  • internal/plugins/service_singleflight_test.go
  • scripts/ci/db-contracts.txt
  • web/src/pages/AdminPluginDetail.test.tsx
  • web/src/pages/AdminPluginDetail.tsx
  • web/src/pages/admin-settings/SignInSettings.test.tsx
  • web/src/pages/admin-settings/signInSetup.ts
  • web/src/pages/admin-settings/useSignInProviderDrafts.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment thread internal/plugins/archive_cache.go Resolved
Comment thread internal/plugins/provision_writer.go Resolved
Comment thread internal/plugins/service.go Resolved
Base automatically changed from refactor/notifications-processing-settings-cleanup to main November 20, 2026 00:18
@Quick104
Quick104 force-pushed the feat/plugin-install-via-env branch from 7d44219 to 888559e Compare November 20, 2026 00:20
@silo-kody

silo-kody Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

I checked CodeRabbit’s restore concern against the rebased writer and the recovery guide. A writer that observes a restore hold keeps its declaration paused across reconnects. A disconnected writer that never observed the hold can reuse its old declaration if an operator acknowledges the restore while that process is still alive.

The full restore procedure requires stopping Silo on every server before replacing the database. If Silo is started for review, the operator stops the provisioning instance again before acknowledging the hold, then starts it with the reviewed declaration. Those steps prevent the stale writer from returning. I’m retaining that documented restart requirement. Recovery procedure

🤖 Codex (gpt-6.2-astra)

Comment thread internal/plugins/auto_update.go Resolved
Comment thread internal/plugins/config_sensitivity.go Resolved
Comment thread internal/plugins/provision_package.go Resolved
Comment thread internal/plugins/restore.go Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

Major · Keep OAuth account re-checks available without a public callback URL. · main.go:3369-3371

cmd/silo/main.go:3369-3371
Major · Stability & Availability · Quick win

Keep OAuth account re-checks available without a public callback URL.

If an administrator clears server.public_url but leaves the OAuth binding enabled, the rebuild removes that provider from the registry used by AccountChecker. The next due re-check returns provider_unavailable without calling the reachable provider. With fail_closed, affected users cannot refresh their sessions until the public URL is restored. (raw.githubusercontent.com)

Use the public URL to gate discovery and new OAuth handshakes, not account re-checks. Keep the enabled provider available to AccountChecker; the handshake already rejects starts without a public URL. (raw.githubusercontent.com)

Minor · Use the enumerated installation to load the inventory manifest. · plugins.go:1156

internal/api/handlers/plugins.go:1156
Minor · Data Integrity & Integration · Quick win

Use the enumerated installation to load the inventory manifest.

After a peer replaces a plugin at the same version, the inventory can list the new row while ManifestForInstallation still loads the previous row from the service cache. If the previous path is not on disk, the release-qualified archive lookup returns ErrInstallationChanged. This fails the entire inventory page, including unrelated plugins, until the cache is invalidated. Load the manifest against the row being rendered. If another replacement makes that row stale, reload it and retry the item. (raw.githubusercontent.com)

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c18540fb-bdf5-4143-b053-1573f10bb3a9
Commits

Reviewing files that changed from the base of the PR and between dde76ab and 888559e.

Files selected for processing: 15

  • cmd/silo/main.go
  • contracts/api/v2/openapi.json
  • docs/admin-api.md
  • internal/api/handlers/plugins.go
  • internal/api/router.go
  • internal/apiv2/router.go
  • internal/backup/settings_classes.go
  • internal/plugins/archive_cache.go
  • internal/plugins/archive_cache_test.go
  • internal/plugins/lifecycle_events.go
  • internal/plugins/provision_apply.go
  • internal/plugins/provision_placement_db_test.go
  • internal/plugins/provision_writer.go
  • internal/plugins/service.go
  • web/src/api/v2/schema.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment thread docs/admin-api.md Resolved
Comment thread internal/api/handlers/plugins.go Resolved
Comment thread internal/plugins/lifecycle_events.go Resolved
Comment thread internal/plugins/provision_apply.go Resolved
Comment thread internal/plugins/provision_writer.go Resolved
Comment thread internal/plugins/service.go Resolved
@silo-kody

silo-kody Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

Fixed both findings from the review body in 0e15c23bac.

  • Clearing the public URL hides OAuth sign-in. Existing sessions can still reach the enabled provider for account checks. Initial Owner setup continues to block both paths.
  • The admin inventory reads the manifest for the installation row it lists. If a peer replaces the release during that read, the inventory reloads the affected item. Other installations remain visible.

Both regression tests failed on 6d513c385a and passed under the race detector after the fix. The PostgreSQL 18 inventory test covered a replacement at the same version, both before and after the inventory read the row. CodeRabbit review

🤖 Codex (gpt-6.2-astra)

@silo-kody

silo-kody Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. stacked Base is another open PR; merge in stack order named in the body

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant