Skip to content

feat: provider CA trust, model-alias preservation, default-selection fix (2.4.1:2) - #3

Merged
MattDHill merged 1 commit into
Start9-Community:masterfrom
jonbotx:provider-ca-2.4.1-2
Nov 25, 2026
Merged

MattDHill merged 1 commit into
Start9-Community:masterfrom
jonbotx:provider-ca-2.4.1-2

Conversation

@jonbotx

@jonbotx jonbotx commented Nov 25, 2026 •

Copy link
Copy Markdown

Summary

Ships OpenCode 2.4.1:2 on top of the community audit and Configure Model Providers work (rebased onto master at 34f31ca).

  • Configure Provider CA — a new action to import, replace, or clear a single public PEM CA, so a private/self-signed HTTPS model endpoint can be trusted. Private keys and leaf certificates are rejected (only one public CA is accepted; clearing the field removes trust). The certificate lives on the startos volume, is mounted read-only at a fixed path, and is handed to OpenCode through NODE_EXTRA_CA_CERTS; because the mount is driven by a reactive .const() read, replacing the certificate re-runs setupMain and restarts the daemon. It is included in the service backup.
  • Model alias preservation — re-saving the provider form no longer resets existing aliases. The upstream modelID, display name, and any other stored keys are preserved (e.g. deepseek -> deepseek-ai/DeepSeek-V4.1-Flash).
  • Default-model fix — on reopen the current default is selected first; turning every Default off clears the model field; two defaults are rejected before anything is written.

2.4.1:1 shipped with an empty migration, so this is an in-place bump: current.ts keeps its migrations block and index.ts is unchanged, with no v2_4_1_1.ts.

Testing

Built in CI (2.4.1:2, gitHash 0cb704f) and installed on a StartOS 0.4.2 box (x86_64):

  • Upgrade from 2.4.1:1 preserved an existing chat and aliased provider.
  • The alias still resolves to its original upstream model (deepseek-ai/DeepSeek-V4.1-Flash); re-saving the form keeps the stored name and modelID even when the on-disk config is hand-written JSONC.
  • CA import → a prompt against a private HTTPS endpoint succeeds; clear → the same request fails TLS verification (UNABLE_TO_GET_ISSUER_CERT_LOCALLY); restore → succeeds again. Replacing the certificate restarts the daemon (the setupMain re-run is visible in the service log).
  • Private keys and leaf certificates are rejected; an empty input removes trust.
  • Default-off clears the model field; two defaults are rejected with no write to either file.

Prebuilt packages: https://github.com/jonbotx/opencode-startos/releases/tag/s9pk-2.4.1-2

@MattDHill

Copy link
Copy Markdown
Member

#2 and our follow-up #4 (the Default-toggle, default-order and key-reference fixes from helix's last review) are both on master now, so this is ready to rebase. The four items from my #2 approval still apply: drop v2_4_1_1.ts, mount the CA at a fixed path (the .const() read already restarts the daemon), add when/cost/repeat-safety notes to the README's CA section, and rewrite the manifest comment. Since #4 also changed configureProviders.ts, expect conflicts there with this PR's alias and default-selection work. Anything small left after that we'll handle ourselves.

@jonbotx
jonbotx force-pushed the provider-ca-2.4.1-2 branch from c2cab66 to 8e10ca3 Compare November 25, 2026 18:23
- Configure Provider CA action: import, replace or clear one public PEM CA.
  OpenCode receives it through NODE_EXTRA_CA_CERTS from a read-only mount at a
  fixed path; the reactive read restarts the daemon when the certificate
  changes. The certificate lives on the startos volume and is backed up.
- Configure Model Providers: an existing model's display name and upstream
  modelID are kept when its provider is saved again, and more than one Default
  is rejected before either file is written.
@jonbotx
jonbotx force-pushed the provider-ca-2.4.1-2 branch from 8e10ca3 to 0cb704f Compare November 25, 2026 18:35
@jonbotx

jonbotx commented Nov 25, 2026

Copy link
Copy Markdown
Author

Rebased onto master (34f31ca) — it's now a single commit, 0cb704f, with CI green on both arches. All four items:

  1. v2_4_1_1.ts dropped. 2.4.1:1 shipped an empty up, so this is an in-place bump: current.ts keeps its migrations block and index.ts is untouched.
  2. Fixed CA mount path. The digest-keyed mountpoint is gone. The CA mounts read-only at /etc/opencode-trust and NODE_EXTRA_CA_CERTS points there. You were right that the .const() read is enough — I confirmed it in the SDK docs and on the box: replacing the certificate re-runs setupMain and restarts the daemon.
  3. README when/cost/repeat-safety. The configure-provider-ca section now follows the same shape as the other actions, and instructions.md matches.
  4. Manifest comment rewritten to say startos holds the secrets plus the optional CA, of which only the CA subtree is mounted.

configureProviders.ts conflicted as you predicted: I took #4's version and re-applied only this PR's additions — the alias-preservation loop (name/modelID fall back to the stored values) and the >1-default guard, now i18n('Select only one default provider.').

Re-ran the box test against 0cb704f: alias kept on re-save (including a hand-written JSONC config), two defaults rejected with no write, and CA clear/replace restarts the daemon and flips TLS verification. Rebased build: https://github.com/jonbotx/opencode-startos/releases/tag/s9pk-2.4.1-2

@MattDHill MattDHill left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving 0cb704f. We tested it on our box as an update over the released 2.4.1:1. The update was clean and an aliased model survived a re-save. A private key and a leaf certificate were refused. A real CA mounted read-only with NODE_EXTRA_CA_CERTS set, and clearing it removed both. Health stayed green throughout. Thanks for the quick rebase. We'll update the README's quick-reference block for the CA action ourselves in a small follow-up.

@MattDHill
MattDHill merged commit 27774c6 into Start9-Community:master Nov 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants