Skip to content

feat(versioniq): build install-manual-upload - #715

Merged
rubenvdlinde merged 16 commits into
developmentfrom
quality/build-install-manual-upload
Nov 20, 2026
Merged

rubenvdlinde merged 16 commits into
developmentfrom
quality/build-install-manual-upload

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Builds openspec/changes/install-manual-upload. Every code task is now done. An admin can upload a .tar.gz on the app detail ("Install from a file"), see its app id, version, SHA-256 and whether the App Store's signature verifies it, and install it through the same checks a normal install runs. Development is merged in.

Tasks done

  • 1.1 UploadedArchive and POST /api/upload/inspect (/api/v1/..., UploadController). The route is admin only and needs strict password confirmation. It refuses files over 256 MB, reads only <app>/appinfo/info.xml from the tar stream, and computes the SHA-256. The archive is kept under a random token for one hour.
  • 1.2 StoreSignatureCheck and ArchiveSignature. When the App Store lists that app and version, its SHA-512 signature has to verify the uploaded bytes, and its certificate has to pass the signed installer's chain, revocation and issued-to checks (SelectedReleaseInstallerService::trustsCertificate()). Then the upload counts as signed. Anything else counts as unsigned, including a store that can't be reached. Inspect now returns signedByStore.
  • 2.1 InstallerService::installUploadedArchive() and POST /api/upload/{token}/install (strict confirmation; fields expectedSha256, acceptShown, allowDowngrade, overridePin).
    • It runs the guards of installAppVersion() in the same order: valid and manageable app, downgrade, pin, same version, withdrawn, pre-flight.
    • It then checks that the archive is still the inspected one and that it matches a pasted SHA-256.
    • A signed upload goes through the signed installer's full pipeline from a local file: certificate, signature, id/version, migration diff, backup/restore, finalize.
    • An unsigned upload is refused (403, the message names the setting) unless "Allow unsigned uploads" is on and the SHA-256 was pasted or accepted. It then goes through the external installer from the extraction onwards. The trusted-source allowlist and recorded digests do not apply to an upload.
    • Both installers gain a local-archive mode (installLocalArchive(), LocalArchive) and run under maintenance mode as usual. The source binding is never written. A small refactor lets the post-install helpers (pin settle, update event, classification, failure outcomes) take the run and version. Behaviour is unchanged: the installer golden tests give byte-identical output before and after.
  • 2.2 The audit row uses source id upload, says signed or unsigned, and names the SHA-256. The verified archive goes into the artifact cache under upload. The finalizer and LKG get the upload source, and the binding records no digest of the upload.
  • 2.3 install.allow_unsigned_upload setting and the Settings tab checkbox (earlier commit).
  • 3.1 src/dialogs/UploadInstallDialog.vue (+ src/utils/uploadInstall.ts):
    • pick a file, enter the password, read the archive
    • shows app, version, SHA-256 and signed state, and warns when the archive is another app
    • for an unsigned archive: a warning, an expected SHA-256 field and "I accept the SHA-256 shown"
    • Install; a refusal stays in the dialog
    • Strict confirmation sends the password as Basic credentials, the same as the enable-app dialog. The "Install from a file" button is on the Versions tab of the app detail.
  • 3.2 The dialog's strings in l10n en/nl (json, js regenerated). check:l10n-js and check-l10n-keys pass.

Tasks left

  • 3.3 tests/e2e/upload.spec.ts: e2e against a running instance, which this build cannot run.
  • 4.1 Set the matrix row to built and archive the change. This waits for the e2e evidence.

Tests

  • PHP new: StoreSignatureCheckTest (7: matching signature, different bytes, refused certificate, unlisted version, store error/unreachable, missing signature, garbage), InstallerServiceUploadTest (10: signed path keeps the binding, unsigned with the setting off, wrong expected SHA, unsigned with matching SHA, pasted-or-accepted rule, pinned 409, downgrade 409, unknown token 404, archive changed after inspect, failed install reported with source upload), UploadInstallRecordTest (3: unsigned audit+cache end to end on real files, SHA mismatch audited as failure and not cached, signed audit+cache meta). UploadControllerTest now has 11 tests.
  • PHPUnit (tests/phpunit-unit-only.xml) on the tree merged with development: 2161 → 2185 tests. The 2 failures are the same ones development has (ExternalReleaseInstallGoldenTest, SelectedReleaseInstallGoldenTest, environment-bound).
  • Vitest: 3090 on development → 3103, all passing. The 2 unhandled severities errors also happen on development.
  • php-cs-fixer is clean on the changed files. psalm shows no new errors on the changed files; the ones it reports are inherited. eslint is clean on the new files.
  • openapi.json: the two upload paths were generated with the extractor in a scratch copy. The extractor fails on development because of an unrelated missing 400 description on AdvisoryTriage#reopen, so only the upload paths were taken over.

Generated by Claude Code

First part of install from a file: an admin uploads a .tar.gz and
POST /api/upload/inspect reads the app id and version from its
appinfo/info.xml and its SHA-256, and keeps it for an hour under a token;
nothing is installed. Adds the install.allow_unsigned_upload setting
(off by default) to the Settings tab.

Assisted-by: ClaudeCode:claude-opus-5-5
Task 1.2: check an upload against the App Store's signature for that app
and version (StoreSignatureCheck, ArchiveSignature); inspect reports
signedByStore. Local-archive mode in both installers, the upload install
route and InstallerService::installUploadedArchive() (task 2.1, tests next).

Assisted-by: ClaudeCode:claude-opus-5-5
Tasks 2.1 and 2.2: installUploadedArchive() runs the guards of a normal
install, then installs a store-signed upload through the signed installer
or, with unsigned uploads switched on and the SHA-256 pasted or accepted,
through the external installer. The binding is not changed; the audit row
and the artifact cache entry carry source upload and the SHA-256.

Assisted-by: ClaudeCode:claude-opus-5-5
Tasks 3.1 and 3.2: UploadInstallDialog reads a picked archive and shows
its app, version, SHA-256 and signed state before anything is installed;
an unsigned archive needs a pasted or accepted SHA-256. Both requests send
the password for strict confirmation. "Install from a file" on the app
detail opens it. Strings in l10n en and nl.

Assisted-by: ClaudeCode:claude-opus-5-5
…ip ci]

Keeps both sides: the unsigned-upload switch next to development's GitHub
search switch and advisory feed source. The unsigned switch now uses
development's shared on/off validator.

Assisted-by: ClaudeCode:claude-opus-5-5
…p ci]

Assisted-by: ClaudeCode:claude-opus-5-5
…credentials as one value [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
…teps [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
…er into small helpers [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
…kip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
… the signature check [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
# Conflicts:
#	l10n/en.js
#	l10n/en.json
#	l10n/nl.js
#	l10n/nl.json
#	lib/Http/InstanceSettingsFields.php
#	lib/Service/Settings/InstanceSettings.php
#	openapi.json
#	src/components/InstanceSettingsPanel.failures.spec.ts
#	src/components/InstanceSettingsPanel.spec.ts
#	src/components/InstanceSettingsPanel.vue
Kept both sides: the archive upload install and its unsigned-upload switch
(#715) next to development's backup, migration preview, update checks,
force-incompatible, release channels, OSV address, re-enabling and
promotion settings. InstanceSettings stores the upload switch alongside the
cleared fields development now writes in one loop. openapi.json is a 3-way
JSON merge (the generator stops on development's own code); l10n is
development's catalogues plus this branch's keys.

cloud-merge-versioniq

Assisted-by: ClaudeCode:claude-opus-5-5
The promotion (#735) added an expectedShaRefusal(InstallRun) to InstallerService;
this branch's check of the SHA-256 an admin pastes for an upload had the
same name.

cloud-merge-versioniq

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit 382a7fa into development Nov 20, 2026
5 of 9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/versioniq @ 8a7de3d

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ❌
phpstan ✅
phpmetrics ✅
eslint ❌
stylelint ❌
build ✅
composer ✅ ✅ 58/58
npm ✅ ✅ 314/314
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌
Newman ⏭️
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-20 19:24 UTC

Download the full PDF report from the workflow artifacts.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant