diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml
index 5f95a88d8d..1b2a1dd0d8 100644
--- a/.forgejo/workflows/release.yml
+++ b/.forgejo/workflows/release.yml
@@ -12,11 +12,17 @@ name: Release
type: boolean
default: false
RELEASE_REGISTRY:
- description: The registry to publish to
+ description: The registry to publish to. Defaults to the caller's RELEASE_REGISTRY variable.
type: string
+ default: ${{ vars.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL:
- description: S3 base URL for package uploads (e.g. https://bucket.region.digitaloceanspaces.com)
+ description: S3 base URL for package uploads (e.g. https://bucket.region.digitaloceanspaces.com). Defaults to the caller's S3_S9PKS_BASE_URL variable.
type: string
+ default: ${{ vars.S3_S9PKS_BASE_URL }}
+ REGISTRY_PROXY:
+ description: Proxy URL start-cli uses to reach the registries, e.g. socks5h://proxy.example:9050 for .onion registries. The proxy must already be reachable from the runner. Defaults to the caller's REGISTRY_PROXY variable.
+ type: string
+ default: ${{ vars.REGISTRY_PROXY }}
secrets:
DEV_KEY:
description: Developer signing key
@@ -93,14 +99,14 @@ jobs:
uses: https://github.com/Start9Labs/start-technologies/.github/actions/build-s9pk@master
with:
target: ${{ matrix.target }}
- - name: Upload s9pks for Publish stage
+ - name: Upload s9pks
uses: https://data.forgejo.org/forgejo/upload-artifact@v4
with:
- name: build-${{ matrix.target || 'default' }}
- path: ./*.s9pk
if-no-files-found: error
+ retention-days: 14
compression-level: 0
- retention-days: 1
+ name: s9pks-${{ matrix.target || 'default' }}
+ path: '*.s9pk'
Publish:
needs: BuildMatrix
runs-on: ubuntu-latest
@@ -109,6 +115,10 @@ jobs:
steps:
- name: Setup publish environment
uses: https://github.com/Start9Labs/start-technologies/.forgejo/actions/setup-publish-env@master
+ - name: Configure registry proxy
+ uses: https://github.com/Start9Labs/start-technologies/.github/actions/configure-registry-proxy@master
+ with:
+ proxy: ${{ inputs.REGISTRY_PROXY }}
- name: Checkout services repository
uses: https://github.com/actions/checkout@v6
with:
@@ -121,7 +131,6 @@ jobs:
- name: Collect s9pks from BuildMatrix
uses: https://data.forgejo.org/forgejo/download-artifact@v4
with:
- pattern: build-*
merge-multiple: true
path: .
- name: Verify s9pks
@@ -302,10 +311,3 @@ jobs:
start-cli --registry "$REGISTRY" registry package add "$s9pk" --url "${GH_URL}/${s9pk}"
done
shell: bash
- - name: Upload s9pks
- uses: https://data.forgejo.org/forgejo/upload-artifact@v4
- with:
- retention-days: 14
- compression-level: 0
- name: s9pks
- path: '*.s9pk'
diff --git a/.forgejo/workflows/tagAndRelease.yml b/.forgejo/workflows/tagAndRelease.yml
index 1cec470000..654f157161 100644
--- a/.forgejo/workflows/tagAndRelease.yml
+++ b/.forgejo/workflows/tagAndRelease.yml
@@ -4,19 +4,25 @@ name: Tag and Release
workflow_call:
inputs:
REFERENCE_REGISTRY:
- description: Registry where published versions are permanent (used to check if a version is already taken)
+ description: Registry where published versions are permanent (used to check if a version is already taken). Defaults to the caller's REFERENCE_REGISTRY variable.
type: string
- required: true
+ default: ${{ vars.REFERENCE_REGISTRY }}
FREE_DISK_SPACE:
description: Free up disk space before building
type: boolean
default: false
RELEASE_REGISTRY:
- description: Test registry to publish to
+ description: Test registry to publish to. Defaults to the caller's RELEASE_REGISTRY variable.
type: string
+ default: ${{ vars.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL:
- description: S3 base URL for package uploads
+ description: S3 base URL for package uploads. Defaults to the caller's S3_S9PKS_BASE_URL variable.
+ type: string
+ default: ${{ vars.S3_S9PKS_BASE_URL }}
+ REGISTRY_PROXY:
+ description: Proxy URL start-cli uses to reach the registries, e.g. socks5h://proxy.example:9050 for .onion registries. The proxy must already be reachable from the runner. Defaults to the caller's REGISTRY_PROXY variable.
type: string
+ default: ${{ vars.REGISTRY_PROXY }}
secrets:
DEV_KEY:
description: Developer signing key
@@ -40,6 +46,10 @@ jobs:
uses: https://github.com/actions/checkout@v6
- name: Install start-cli
uses: https://github.com/Start9Labs/start-technologies/.github/actions/install-start-cli@master
+ - name: Configure registry proxy
+ uses: https://github.com/Start9Labs/start-technologies/.github/actions/configure-registry-proxy@master
+ with:
+ proxy: ${{ inputs.REGISTRY_PROXY }}
- name: Extract package ID and version
id: extract
uses: https://github.com/Start9Labs/start-technologies/.github/actions/extract-version@master
@@ -49,6 +59,10 @@ jobs:
PACKAGE_ID="${{ steps.extract.outputs.package_id }}"
VERSION="${{ steps.extract.outputs.version }}"
REFERENCE_REGISTRY="${{ inputs.REFERENCE_REGISTRY }}"
+ if [ -z "$REFERENCE_REGISTRY" ]; then
+ echo "::error::No reference registry: set the REFERENCE_REGISTRY variable or pass the input."
+ exit 1
+ fi
# hello-world is the canonical package scaffold, not a released package.
# Skipping it here lets every caller (including hello-world's own) use the
@@ -94,6 +108,7 @@ jobs:
FREE_DISK_SPACE: ${{ inputs.FREE_DISK_SPACE }}
RELEASE_REGISTRY: ${{ inputs.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL: ${{ inputs.S3_S9PKS_BASE_URL }}
+ REGISTRY_PROXY: ${{ inputs.REGISTRY_PROXY }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
diff --git a/.github/actions/configure-registry-proxy/action.yml b/.github/actions/configure-registry-proxy/action.yml
new file mode 100644
index 0000000000..73a6c0d27f
--- /dev/null
+++ b/.github/actions/configure-registry-proxy/action.yml
@@ -0,0 +1,41 @@
+name: 'Configure Registry Proxy'
+description: |
+ Routes this runner's start-cli requests through a proxy, so registries can be
+ Tor (.onion) addresses. No proxy removes any proxy an earlier job configured.
+inputs:
+ proxy:
+ description: 'Proxy URL for start-cli, e.g. socks5h://proxy.example:9050. A .onion registry needs socks5h, which resolves names through the proxy.'
+ required: false
+ default: ''
+runs:
+ using: 'composite'
+ steps:
+ - name: Configure registry proxy
+ env:
+ PROXY: ${{ inputs.proxy }}
+ run: |
+ # Host-backed Forgejo jobs share this home directory across jobs and runs.
+ CONFIG=~/.startos/config.yaml
+ without_proxy() { grep -v '^proxy:' "$CONFIG" 2>/dev/null || true; }
+
+ if [ -z "$PROXY" ]; then
+ if [ -f "$CONFIG" ]; then
+ without_proxy > "$CONFIG.new"
+ mv "$CONFIG.new" "$CONFIG"
+ fi
+ exit 0
+ fi
+
+ case "$PROXY" in
+ *://*) ;;
+ *)
+ echo "::error::The registry proxy has no scheme; use e.g. socks5h://proxy.example:9050"
+ exit 1
+ ;;
+ esac
+
+ mkdir -p ~/.startos
+ { without_proxy; printf 'proxy: %s\n' "$(jq -n --arg p "$PROXY" '$p')"; } > "$CONFIG.new"
+ mv "$CONFIG.new" "$CONFIG"
+ echo "start-cli will reach registries through the configured proxy."
+ shell: bash
diff --git a/.github/actions/riscv-action-runtime/action.yml b/.github/actions/riscv-action-runtime/action.yml
new file mode 100644
index 0000000000..01550f1c6b
--- /dev/null
+++ b/.github/actions/riscv-action-runtime/action.yml
@@ -0,0 +1,40 @@
+name: RISC-V action runtime
+description: >-
+ Replaces the runner's bundled action Node with the requested release, run
+ `--single-threaded`. V8's background threads corrupt the heap on the riscv64
+ runners during large artifact transfers. Leaves the runtime untouched when the
+ download or probe fails.
+inputs:
+ nodejs-version:
+ description: Node release to install
+ required: true
+runs:
+ using: composite
+ steps:
+ # Actions use the runner's bundled Node, not the Node on GITHUB_PATH.
+ # Its wrapper is bash; dash drops hyphenated `INPUT_*` variables.
+ - shell: bash
+ env:
+ NODEJS_VERSION: ${{ inputs.nodejs-version }}
+ run: |
+ set -euo pipefail
+ worker="$(readlink -f "/proc/$PPID/exe")"
+ test "$(basename "$worker")" = Runner.Worker
+ runner_node="$(dirname "$worker")/../externals/node24/bin/node"
+ echo "Bundled action runtime: $("$runner_node" --version)"
+ base="https://unofficial-builds.nodejs.org/download/release/v${NODEJS_VERSION}"
+ tarball="node-v${NODEJS_VERSION}-linux-riscv64.tar.xz"
+ cd "$RUNNER_TEMP"
+ curl -fsSLO "$base/$tarball"
+ curl -fsSL "$base/SHASUMS256.txt" | grep " $tarball\$" | sha256sum -c -
+ tar -xJf "$tarball"
+ node_dir="$RUNNER_TEMP/${tarball%.tar.xz}"
+ test "$("$node_dir/bin/node" --version)" = "v${NODEJS_VERSION}"
+ "$node_dir/bin/node" --single-threaded -e 'require("node:crypto").createHash("sha256").update("action-runtime").digest(); console.log(process.versions)'
+ install -m 755 "$node_dir/bin/node" "$runner_node.real.next"
+ mv -f "$runner_node.real.next" "$runner_node.real"
+ printf '#!/bin/bash\nexec "%s" --single-threaded "$@"\n' "$runner_node.real" > "$runner_node.next"
+ chmod 755 "$runner_node.next"
+ mv -f "$runner_node.next" "$runner_node"
+ echo "Updated action runtime: $("$runner_node" --version)"
+ echo "$node_dir/bin" >> "$GITHUB_PATH"
diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml
index 4f4d2567a8..b187b4d444 100644
--- a/.github/actions/setup-build/action.yml
+++ b/.github/actions/setup-build/action.yml
@@ -21,6 +21,10 @@ inputs:
description: Remove unnecessary packages to free disk space
required: false
default: 'true'
+ swap-size:
+ description: Size of a swapfile to add, such as 8G; empty adds none
+ required: false
+ default: ''
runs:
using: composite
@@ -30,6 +34,18 @@ runs:
shell: bash
run: '"$GITHUB_ACTION_PATH/free-disk-space.sh"'
+ - name: Add swap
+ if: inputs.swap-size != ''
+ shell: bash
+ env:
+ SWAP_SIZE: ${{ inputs.swap-size }}
+ run: |
+ sudo fallocate -l "$SWAP_SIZE" /swapfile-build
+ sudo chmod 600 /swapfile-build
+ sudo mkswap /swapfile-build
+ sudo swapon /swapfile-build
+ swapon --show
+
# Some runners lack /opt/hostedtoolcache, which setup-python and setup-qemu expect
- name: Ensure hostedtoolcache exists
shell: bash
diff --git a/.github/actions/sync-next/sync-next.mjs b/.github/actions/sync-next/sync-next.mjs
index edc5417307..caee018381 100644
--- a/.github/actions/sync-next/sync-next.mjs
+++ b/.github/actions/sync-next/sync-next.mjs
@@ -32,8 +32,13 @@ export async function syncNext({ cwd, base, forge, botName, botEmail }) {
)
const defaultBranch = await forge.defaultBranch()
+ const lineBranches = git(
+ 'for-each-ref',
+ '--format=%(refname)',
+ 'refs/remotes/origin/next/',
+ )
const target =
- exists(`next/${base}`) || base !== defaultBranch ? `next/${base}` : 'next'
+ lineBranches || base !== defaultBranch ? `next/${base}` : 'next'
const baseSha = git('rev-parse', `origin/${base}`)
if (!exists(target)) {
git('push', 'origin', `${baseSha}:refs/heads/${target}`)
diff --git a/.github/actions/tests/apt-publish-alpha.test.mjs b/.github/actions/tests/apt-publish-alpha.test.mjs
index b1ab8d2d30..26b439b0cf 100644
--- a/.github/actions/tests/apt-publish-alpha.test.mjs
+++ b/.github/actions/tests/apt-publish-alpha.test.mjs
@@ -17,8 +17,11 @@ const ARCHES = ['x86_64', 'aarch64', 'riscv64']
const daysAgo = days =>
new Date(Date.now() - days * 86400e3).toISOString().replace(/\.\d+Z$/, 'Z')
+const deb = (product, arch) => `${product}-0.4.0-aaaaaaa_${arch}.deb`
const debs = (product, arches = ARCHES) =>
- arches.map(arch => `${product}_${arch}.deb`)
+ arches.map(arch => deb(product, arch))
+const downloaded = (runId, product) =>
+ ARCHES.map(arch => `${runId} ${deb(product, arch)}`)
const run = (id, created, artifacts, overrides = {}) => ({
id,
created_at: created,
@@ -64,11 +67,14 @@ test('each product comes from its newest master build holding every arch', t =>
}),
])
assert.equal(result.status, 0, result.stdout + result.stderr)
- assert.deepEqual(downloads.sort(), [
- '1 start-registry_*.deb',
- '1 start-tunnel_*.deb',
- '2 start-cli_*.deb',
- ])
+ assert.deepEqual(
+ downloads.sort(),
+ [
+ ...downloaded(1, 'start-registry'),
+ ...downloaded(1, 'start-tunnel'),
+ ...downloaded(2, 'start-cli'),
+ ].sort(),
+ )
})
test('PR-only activity does not hide complete master artifacts', t => {
@@ -83,11 +89,45 @@ test('PR-only activity does not hide complete master artifacts', t => {
),
])
assert.equal(result.status, 0, result.stdout + result.stderr)
- assert.deepEqual(downloads.sort(), [
- '1 start-cli_*.deb',
- '1 start-registry_*.deb',
- '1 start-tunnel_*.deb',
+ assert.deepEqual(
+ downloads.sort(),
+ [
+ ...downloaded(1, 'start-cli'),
+ ...downloaded(1, 'start-registry'),
+ ...downloaded(1, 'start-tunnel'),
+ ].sort(),
+ )
+})
+
+test('all products share one paginated artifact discovery', t => {
+ const { result, downloads, calls } = collectFrom(t, [
+ run(1, daysAgo(2), [
+ ...debs('start-cli'),
+ ...debs('start-tunnel'),
+ ...debs('start-registry'),
+ ]),
+ run(
+ 2,
+ daysAgo(1),
+ Array.from({ length: 201 }, (_, index) => `unrelated-${index}`),
+ ),
])
+ assert.equal(result.status, 0, result.stdout + result.stderr)
+ assert.deepEqual(
+ downloads.sort(),
+ [
+ ...downloaded(1, 'start-cli'),
+ ...downloaded(1, 'start-tunnel'),
+ ...downloaded(1, 'start-registry'),
+ ].sort(),
+ )
+ const listings = calls.flatMap(args =>
+ args.filter(arg =>
+ arg.startsWith(`repos/${REPOSITORY}/actions/artifacts?`),
+ ),
+ )
+ assert.ok(listings.length > 1)
+ assert.equal(listings.length, new Set(listings).size)
})
test('a product without a complete build keeps its published package', t => {
@@ -95,11 +135,11 @@ test('a product without a complete build keeps its published package', t => {
run(1, daysAgo(3), [
...debs('start-cli'),
...debs('start-registry', ['x86_64']),
- { name: 'start-tunnel_x86_64.deb', expired: true },
+ { name: deb('start-tunnel', 'x86_64'), expired: true },
]),
])
assert.equal(result.status, 0, result.stdout + result.stderr)
- assert.deepEqual(downloads, ['1 start-cli_*.deb'])
+ assert.deepEqual(downloads.sort(), downloaded(1, 'start-cli').sort())
assert.match(result.stdout, /start-tunnel has no complete master build left/)
assert.match(
result.stdout,
@@ -122,21 +162,24 @@ test('an older run with unexpired rerun artifacts remains eligible', t => {
...debs('start-cli'),
...debs('start-tunnel'),
...debs('start-registry'),
- ],
+ ].map(name => ({ name, created_at: daysAgo(1) })),
{ run_attempt: 2 },
),
])
assert.equal(result.status, 0, result.stdout + result.stderr)
- assert.deepEqual(downloads.sort(), [
- '1 start-cli_*.deb',
- '1 start-registry_*.deb',
- '1 start-tunnel_*.deb',
- ])
+ assert.deepEqual(
+ downloads.sort(),
+ [
+ ...downloaded(1, 'start-cli'),
+ ...downloaded(1, 'start-registry'),
+ ...downloaded(1, 'start-tunnel'),
+ ].sort(),
+ )
})
test('expired artifacts do not cause run metadata queries', t => {
const { result, calls } = collectFrom(t, [
- run(1, daysAgo(20), [{ name: 'start-cli_x86_64.deb', expired: true }]),
+ run(1, daysAgo(20), [{ name: deb('start-cli', 'x86_64'), expired: true }]),
])
assert.notEqual(result.status, 0)
assert.equal(
diff --git a/.github/actions/tests/changed-products.test.mjs b/.github/actions/tests/changed-products.test.mjs
index 44c90501b0..1f4e7db642 100644
--- a/.github/actions/tests/changed-products.test.mjs
+++ b/.github/actions/tests/changed-products.test.mjs
@@ -41,6 +41,13 @@ for (const [path, push, pullRequest = push, osImage = false] of [
true,
],
['projects/start-os/startd.service', ['start-os'], undefined, true],
+ [
+ 'projects/start-os/container-runtime/deb-install.sh',
+ ['start-os'],
+ undefined,
+ true,
+ ],
+ ['projects/start-os/container-runtime/src/index.ts', ['start-os']],
['projects/start-os/src/main.rs', ['start-os']],
['projects/start-os/docs/src/overview.md', []],
['projects/start-os/release-notes/0.4.1.md', ['start-os'], undefined, true],
diff --git a/.github/actions/tests/configure-registry-proxy.test.mjs b/.github/actions/tests/configure-registry-proxy.test.mjs
new file mode 100644
index 0000000000..adc641f726
--- /dev/null
+++ b/.github/actions/tests/configure-registry-proxy.test.mjs
@@ -0,0 +1,75 @@
+import assert from 'node:assert/strict'
+import { execFileSync } from 'node:child_process'
+import {
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ rmSync,
+ writeFileSync,
+} from 'node:fs'
+import { createRequire } from 'node:module'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { test } from 'node:test'
+
+const require = createRequire(import.meta.url)
+const yaml = require('js-yaml')
+const action = yaml.load(
+ readFileSync(
+ new URL('../configure-registry-proxy/action.yml', import.meta.url),
+ 'utf8',
+ ),
+)
+const step = action.runs.steps.find(
+ ({ name }) => name === 'Configure registry proxy',
+)
+for (const existing of [
+ '',
+ 'registry: https://registry.example',
+ 'registry: https://registry.example\nproxy: "socks5h://stale.example:9050"',
+]) {
+ test(`reapplying a proxy leaves one proxy in ${JSON.stringify(existing)}`, t => {
+ const home = mkdtempSync(join(tmpdir(), 'registry-proxy-test-'))
+ t.after(() => rmSync(home, { recursive: true, force: true }))
+ const config = join(home, '.startos', 'config.yaml')
+ if (existing) {
+ mkdirSync(join(home, '.startos'))
+ writeFileSync(config, existing)
+ }
+ const proxy = 'socks5h://registry-proxy.example:9050'
+ const configure = () =>
+ execFileSync('bash', ['-e', '-o', 'pipefail', '-c', step.run], {
+ env: { ...process.env, HOME: home, PROXY: proxy },
+ stdio: 'pipe',
+ })
+
+ configure()
+ const first = readFileSync(config, 'utf8')
+ configure()
+ const second = readFileSync(config, 'utf8')
+
+ assert.equal(second, first)
+ assert.deepEqual(yaml.load(second), {
+ ...(existing ? { registry: 'https://registry.example' } : {}),
+ proxy,
+ })
+ })
+}
+
+test('an unset proxy removes a proxy an earlier job configured', t => {
+ const home = mkdtempSync(join(tmpdir(), 'registry-proxy-test-'))
+ t.after(() => rmSync(home, { recursive: true, force: true }))
+ const config = join(home, '.startos', 'config.yaml')
+ mkdirSync(join(home, '.startos'))
+ writeFileSync(
+ config,
+ 'registry: https://registry.example\nproxy: "socks5h://stale.example:9050"\n',
+ )
+ execFileSync('bash', ['-e', '-o', 'pipefail', '-c', step.run], {
+ env: { ...process.env, HOME: home, PROXY: '' },
+ stdio: 'pipe',
+ })
+ assert.deepEqual(yaml.load(readFileSync(config, 'utf8')), {
+ registry: 'https://registry.example',
+ })
+})
diff --git a/.github/actions/tests/publisher-cli.test.mjs b/.github/actions/tests/publisher-cli.test.mjs
index 314e6f059f..586224b9a9 100644
--- a/.github/actions/tests/publisher-cli.test.mjs
+++ b/.github/actions/tests/publisher-cli.test.mjs
@@ -454,7 +454,7 @@ test('every product builds from one compile per target, on standard runners', ()
)
assert.ok(compile !== -1)
for (const [product, recipe] of [
- ['start-os', 'make compiled-${{ matrix.arch }}.tar'],
+ ['start-os', 'make compiled-${{ matrix.arch }}.tar.gz'],
['start-cli', 'make start-cli-deb'],
['start-registry', 'make start-registry-deb'],
['start-tunnel', 'make start-tunnel-deb'],
@@ -483,7 +483,7 @@ test('the CLI binaries cover every triple a release attaches', () => {
const linux = products.jobs.build.steps.find(
step =>
step.uses === 'actions/upload-artifact@v7' &&
- step.with.name.endsWith('-unknown-linux-musl'),
+ step.with.name?.endsWith('-unknown-linux-musl'),
)
const built = [
...['x86_64', 'aarch64', 'riscv64'].map(arch =>
@@ -502,6 +502,37 @@ test('the CLI binaries cover every triple a release attaches', () => {
)
})
+test('registry image platforms match the downloaded deb architectures', t => {
+ const mapPlatforms = step(
+ products.jobs['registry-image'],
+ 'Map matrix.arch to docker platform',
+ ).run
+ for (const [arches, expected] of [
+ [['x86_64'], ['linux/amd64']],
+ [['aarch64'], ['linux/arm64']],
+ [['riscv64'], ['linux/riscv64']],
+ [
+ ['x86_64', 'aarch64', 'riscv64'],
+ ['linux/amd64', 'linux/arm64', 'linux/riscv64'],
+ ],
+ ]) {
+ const f = fixture(t)
+ for (const arch of arches)
+ f.write(`start-registry-0.4.0-aaaaaaa_${arch}.deb`, '')
+ const output = f.write('env', '')
+ const result = f.run('bash', ['-e', '-c', mapPlatforms], {
+ env: { ...f.env, GITHUB_ENV: output },
+ encoding: 'utf8',
+ })
+ assert.equal(result.status, 0, result.stdout + result.stderr)
+ const platforms = readFileSync(output, 'utf8')
+ .trim()
+ .replace(/^DOCKER_PLATFORM=/, '')
+ .split(',')
+ assert.deepEqual(platforms.sort(), expected.sort())
+ }
+})
+
test('build environments: release-equivalent on master and NONE, dev elsewhere', () => {
for (const [event, input, ref, expected] of [
['push', {}, 'refs/heads/master', ''],
@@ -523,15 +554,19 @@ test('build environments: release-equivalent on master and NONE, dev elsewhere',
test('a publishing build dispatches startos-iso.yaml pinned to its commit', t => {
const publish = products.jobs.publish
- assert.deepEqual(publish.needs, ['changes', 'build'])
- for (const [channel, build, expected] of [
+ assert.deepEqual(publish.needs, ['changes', 'build', 'rootfs'])
+ for (const [channel, rootfs, expected] of [
['alpha', 'success', true],
['', 'success', false],
['alpha', 'failure', false],
+ ['alpha', 'skipped', false],
])
assert.equal(
evaluate(publish.if, {
- needs: { changes: { outputs: { channel } }, build: { result: build } },
+ needs: {
+ changes: { outputs: { channel } },
+ rootfs: { result: rootfs },
+ },
}),
expected,
)
@@ -803,3 +838,45 @@ test('product builds trigger on every push and pull request and classify in the
}
assert.deepEqual(wrt.jobs.deploy.needs, ['image'])
})
+
+test('the rootfs builds once per architecture for every image this run or its publish builds', () => {
+ const { image, rootfs } = products.jobs
+ assert.deepEqual(image.needs, ['changes', 'build', 'rootfs'])
+ for (const [event, osImage, channel, rootfsRuns, imageRuns] of [
+ ['pull_request', 'true', '', true, true],
+ ['pull_request', 'false', '', false, false],
+ ['push', 'false', '', true, true],
+ ['push', 'false', 'alpha', true, false],
+ ]) {
+ const outputs = { 'start-os': 'true', 'os-image': osImage, channel }
+ const context = {
+ github: { event_name: event },
+ needs: {
+ changes: { outputs },
+ build: { result: 'success' },
+ rootfs: { result: 'success' },
+ },
+ }
+ assert.equal(evaluate(rootfs.if, context), rootfsRuns, `${event} rootfs`)
+ assert.equal(evaluate(image.if, context), imageRuns, `${event} image`)
+ }
+ assert.equal(
+ evaluate(image.if, {
+ github: { event_name: 'push' },
+ needs: {
+ changes: { outputs: { 'start-os': 'true', channel: '' } },
+ rootfs: { result: 'failure' },
+ },
+ }),
+ false,
+ )
+})
+
+test('compiled-artifact consumers grant Actions read permission', () => {
+ for (const permissions of [
+ products.jobs.rootfs.permissions,
+ products.jobs.image.permissions,
+ iso.permissions,
+ ])
+ assert.equal(permissions.actions, 'read')
+})
diff --git a/.github/actions/tests/startos-deploy.test.mjs b/.github/actions/tests/startos-deploy.test.mjs
index 41343dfb4b..c7d72278ff 100644
--- a/.github/actions/tests/startos-deploy.test.mjs
+++ b/.github/actions/tests/startos-deploy.test.mjs
@@ -457,3 +457,111 @@ for (const [name, deployed, published, status, warning] of [
assert.equal(f.run('test -e deleted.log').status, 1)
})
}
+
+test('a deploy leg missing one of its images fails before uploading', t => {
+ const check = step(leg, 'Check downloaded images')
+ for (const [platform, files, ok] of [
+ [PLATFORM, FILES, true],
+ [PLATFORM, [FILES[0]], false],
+ [
+ PLATFORM,
+ [`startos-${VERSION}-aaaaaaa_${PLATFORM}-nonfree.iso`, FILES[0]],
+ false,
+ ],
+ [
+ 'raspberrypi',
+ [
+ `startos-${VERSION}-aaaaaaa_raspberrypi.squashfs`,
+ `startos-${VERSION}-aaaaaaa_raspberrypi.img.gz`,
+ ],
+ true,
+ ],
+ [
+ 'raspberrypi',
+ [
+ `startos-${VERSION}-aaaaaaa_raspberrypi.squashfs`,
+ `startos-${VERSION}-aaaaaaa_raspberrypi.img`,
+ ],
+ false,
+ ],
+ ['raspberrypi', [`startos-${VERSION}-aaaaaaa_raspberrypi.squashfs`], false],
+ ]) {
+ const f = fixture(t)
+ for (const file of files) f.write(`artifacts/${file}`, '')
+ const result = f.run('bash', ['-e', '-c', check], {
+ cwd: join(f.root, 'artifacts'),
+ env: { ...f.env, PLATFORM: platform },
+ encoding: 'utf8',
+ })
+ assert.equal(
+ result.status === 0,
+ ok,
+ `${platform} ${files}: ${result.stdout}`,
+ )
+ }
+})
+
+test('a start-wrt deploy missing one of its images fails before uploading', t => {
+ const check = step(
+ load('start-wrt.yaml').jobs.deploy,
+ 'Check downloaded images',
+ )
+ for (const [files, ok] of [
+ [WRT_IMAGES, true],
+ [[WRT_IMAGES[0]], false],
+ [[WRT_IMAGES[1]], false],
+ ]) {
+ const f = fixture(t)
+ for (const file of files) f.write(`artifacts/${file}`, '')
+ const result = f.run('bash', ['-e', '-c', check], {
+ cwd: join(f.root, 'artifacts'),
+ env: f.env,
+ encoding: 'utf8',
+ })
+ assert.equal(result.status === 0, ok, `${files}: ${result.stdout}`)
+ }
+})
+
+test('a raspberrypi deploy indexes its img gzipped and records the img.gz as published', t => {
+ const f = deployFixture(t, index({ [VERSION]: entry(SHA) }))
+ const pi = [
+ `startos-${VERSION}-aaaaaaa_raspberrypi.squashfs`,
+ `startos-${VERSION}-aaaaaaa_raspberrypi.img.gz`,
+ ]
+ for (const file of pi) f.write(`artifacts/${file}`, `${file} built\n`)
+ const env = { PLATFORM: 'raspberrypi', RUNNER_TEMP: f.root }
+ const result = f.run(indexAssets, env, join(f.root, 'artifacts'))
+ assert.equal(result.status, 0, result.stdout + result.stderr)
+ const version = f.registry().versions[VERSION]
+ assert.deepEqual(version.img.raspberrypi.urls, [
+ `https://cdn.example/v${VERSION}/${pi[1]}`,
+ ])
+ assert.deepEqual(version.squashfs.raspberrypi.urls, [
+ `https://cdn.example/v${VERSION}/${pi[0]}`,
+ ])
+ const add = f
+ .calls()
+ .find(
+ call =>
+ call.slice(0, 4).join(' ') === 'registry os asset add' &&
+ call.some(arg => arg.endsWith('.img.gz')),
+ )
+ const indexedFile = add.slice(4).find(arg => !arg.startsWith('--'))
+ assert.equal(indexedFile, pi[1].replace(/\.gz$/, ''))
+ assert.equal(
+ readFileSync(join(f.root, 'artifacts', indexedFile), 'utf8'),
+ `${pi[1]} built\n`,
+ )
+ const recorded = f.run(
+ step(leg, 'Record published images'),
+ env,
+ join(f.root, 'artifacts'),
+ )
+ assert.equal(recorded.status, 0, recorded.stderr)
+ assert.deepEqual(
+ readFileSync(join(f.root, 'published-raspberrypi.txt'), 'utf8')
+ .trim()
+ .split('\n'),
+ [pi[0], pi[1]],
+ )
+})
diff --git a/.github/actions/tests/startos-runners.test.mjs b/.github/actions/tests/startos-runners.test.mjs
index 13f6ebe404..6c17f43271 100644
--- a/.github/actions/tests/startos-runners.test.mjs
+++ b/.github/actions/tests/startos-runners.test.mjs
@@ -17,8 +17,15 @@ const runners = yaml.load(image['runs-on'].match(/fromJson\('([\s\S]*?)'\)/)[1])
const architectures = yaml.load(
image.env.ARCH.match(/fromJson\('([\s\S]*?)'\)/)[1],
)
-const bootstrap = image.steps.find(
- step => step.name === 'Update RISC-V action runtime',
+const bootstrap = yaml.load(
+ readFileSync(
+ new URL('../riscv-action-runtime/action.yml', import.meta.url),
+ 'utf8',
+ ),
+).runs.steps[0]
+const rootfs = products.jobs.rootfs
+const rootfsRunners = yaml.load(
+ rootfs['runs-on'].match(/fromJson\('([\s\S]*?)'\)/)[1],
)
for (const platform of ['riscv64', 'riscv64-nonfree']) {
@@ -28,10 +35,28 @@ for (const platform of ['riscv64', 'riscv64-nonfree']) {
})
}
-test('the native runtime bootstrap precedes every JavaScript action', () => {
- assert.ok(bootstrap)
- assert.ok(image.steps.indexOf(bootstrap) < image.steps.findIndex(s => s.uses))
- assert.equal(bootstrap.if, "${{ env.ARCH == 'riscv64' }}")
+test('each architecture builds its container runtime rootfs natively', () => {
+ assert.deepEqual(rootfsRunners, {
+ x86_64: 'ubuntu-latest',
+ aarch64: 'ubuntu-24.04-arm',
+ riscv64: 'ubuntu-24.04-riscv',
+ })
+ for (const [platform, arch] of Object.entries(architectures))
+ assert.equal(rootfsRunners[arch], runners[platform], platform)
+})
+
+test('the native runtime bootstrap precedes every JavaScript action after checkout', () => {
+ for (const [job, arch] of [
+ [image, 'env.ARCH'],
+ [rootfs, 'matrix.arch'],
+ ]) {
+ const actions = job.steps.filter(step => step.uses)
+ assert.equal(actions[0].uses, 'actions/checkout@v6')
+ assert.equal(actions[1].uses, './.github/actions/riscv-action-runtime')
+ assert.equal(actions[1].if, `\${{ ${arch} == 'riscv64' }}`)
+ assert.equal(actions[1].with['nodejs-version'], '${{ env.NODEJS_VERSION }}')
+ }
+ assert.equal(bootstrap.env.NODEJS_VERSION, '${{ inputs.nodejs-version }}')
for (const caller of [workflow, products])
assert.equal(
caller.jobs.image.with['nodejs-version'],
diff --git a/.github/actions/tests/sync-next.test.mjs b/.github/actions/tests/sync-next.test.mjs
index 3a4754705a..5732c51814 100644
--- a/.github/actions/tests/sync-next.test.mjs
+++ b/.github/actions/tests/sync-next.test.mjs
@@ -84,6 +84,13 @@ test('uses explicit next/base even for the default branch', async t => {
assert.equal(f.remoteSha('next/master'), tip)
})
+test('a default branch with no next/base joins its sibling next/* lines', async t => {
+ const f = fixture(t)
+ f.git('push', 'origin', 'master:refs/heads/next/older')
+ assert.equal(await f.run(), 'created')
+ assert.equal(f.remoteSha('next/master'), f.initial)
+})
+
test('non-default branches get their own iteration branch', async t => {
const f = fixture(t)
f.forge.defaultBranch = async () => 'main'
diff --git a/.github/actions/tests/workflow-variants.test.mjs b/.github/actions/tests/workflow-variants.test.mjs
index 8adedb1c48..4d71aaeb9b 100644
--- a/.github/actions/tests/workflow-variants.test.mjs
+++ b/.github/actions/tests/workflow-variants.test.mjs
@@ -92,13 +92,15 @@ test('remote calls and their inner jobs select the x86 runner for emulated build
test('Forgejo artifacts use compatible actions and preserve the build-to-publish handoff', () => {
const release = document('.forgejo/workflows/release.yml')
const upload = release.jobs.BuildMatrix.steps.find(
- step => step.name === 'Upload s9pks for Publish stage',
+ step => step.name === 'Upload s9pks',
)
assert.equal(
upload.uses,
'https://data.forgejo.org/forgejo/upload-artifact@v4',
)
- assert.equal(upload.with.name, "build-${{ matrix.target || 'default' }}")
+ assert.equal(upload.with.name, "s9pks-${{ matrix.target || 'default' }}")
+ assert.equal(upload.with.archive, undefined)
+ assert.equal(upload.with['compression-level'], 0)
const download = release.jobs.Publish.steps.find(
step => step.name === 'Collect s9pks from BuildMatrix',
)
@@ -106,7 +108,7 @@ test('Forgejo artifacts use compatible actions and preserve the build-to-publish
download.uses,
'https://data.forgejo.org/forgejo/download-artifact@v4',
)
- assert.equal(download.with.pattern, 'build-*')
+ assert.equal(download.with.pattern, undefined)
assert.equal(download.with['merge-multiple'], true)
const build = document('.forgejo/workflows/build.yml')
assert.equal(
@@ -117,6 +119,8 @@ test('Forgejo artifacts use compatible actions and preserve the build-to-publish
build.jobs.BuildMatrix.steps.at(-1).with.name,
"s9pks-${{ matrix.target || 'default' }}",
)
+ assert.equal(build.jobs.BuildMatrix.steps.at(-1).with.archive, undefined)
+ assert.equal(build.jobs.BuildMatrix.steps.at(-1).with['compression-level'], 0)
})
test('Forgejo releases use the in-place Forgejo publisher and caller credentials', () => {
diff --git a/.github/actions/upload-each/action.yml b/.github/actions/upload-each/action.yml
index d69e39351a..fb9b3e4fc0 100644
--- a/.github/actions/upload-each/action.yml
+++ b/.github/actions/upload-each/action.yml
@@ -12,6 +12,10 @@ inputs:
description: 'Zip compression level passed to @actions/artifact (0-9).'
required: false
default: '6'
+ archive:
+ description: 'Zip each file before upload. When false, each artifact is the file itself and compression-level is ignored.'
+ required: false
+ default: 'true'
if-no-files-found:
description: 'Behavior when the glob matches nothing: warn | error | ignore.'
required: false
diff --git a/.github/actions/upload-each/dist/index.js b/.github/actions/upload-each/dist/index.js
index 471a5a78fe..48f6bab346 100644
--- a/.github/actions/upload-each/dist/index.js
+++ b/.github/actions/upload-each/dist/index.js
@@ -89,4 +89,4 @@ const og=32;const ag=9;const Ag=59;const cg=61;const lg=34;const ug=92;const dg=
()=>new ArrayBuffer(0)))}}function isJSONResponse(e){return e.type==="application/json"||e.type==="application/scim+json"}function toErrorMessage(e){if(typeof e==="string"){return e}if(e instanceof ArrayBuffer){return"Unknown error"}if(typeof e==="object"&&e!==null&&"message"in e){const t=e;const r="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map((e=>JSON.stringify(e))).join(", ")}${r}`:`${t.message}${r}`}return`Unknown error: ${JSON.stringify(e)}`}function dist_bundle_withDefaults(e,t){const r=e.defaults(t);const newApi=function(e,t){const n=r.merge(e,t);if(!n.request||!n.request.hook){return fetchWrapper(r.parse(n))}const request2=(e,t)=>fetchWrapper(r.parse(r.merge(e,t)));Object.assign(request2,{endpoint:r,defaults:dist_bundle_withDefaults.bind(null,r)});return n.request.hook(request2,n)};return Object.assign(newApi,{endpoint:r,defaults:dist_bundle_withDefaults.bind(null,r)})}var Ug=dist_bundle_withDefaults(ig,Mg);
/* v8 ignore next -- @preserve */
/* v8 ignore else -- @preserve */var Lg="0.0.0-development";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map((e=>` - ${e.message}`)).join("\n")}var _g=class extends Error{constructor(e,t,r){super(_buildMessageForResponseErrors(r));this.request=e;this.headers=t;this.response=r;this.errors=r.errors;this.data=r.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}request;headers;response;name="GraphqlResponseError";errors;data};var Pg=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Og=["query","method","url"];var Hg=/\/api\/v3\/?$/;function graphql(e,t,r){if(r){if(typeof t==="string"&&"query"in r){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in r){if(!Og.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const n=typeof t==="string"?Object.assign({query:t},r):t;const s=Object.keys(n).reduce(((e,t)=>{if(Pg.includes(t)){e[t]=n[t];return e}if(!e.variables){e.variables={}}e.variables[t]=n[t];return e}),{});const i=n.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(Hg.test(i)){s.url=i.replace(Hg,"/api/graphql")}return e(s).then((e=>{if(e.data.errors){const t={};for(const r of Object.keys(e.headers)){t[r]=e.headers[r]}throw new _g(s,t,e.data)}return e.data.data}))}function graphql_dist_bundle_withDefaults(e,t){const r=e.defaults(t);const newApi=(e,t)=>graphql(r,e,t);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,r),endpoint:r.endpoint})}var Gg=graphql_dist_bundle_withDefaults(Ug,{headers:{"user-agent":`octokit-graphql.js/${Lg} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}
-/* v8 ignore if -- @preserve */var Yg="(?:[a-zA-Z0-9_-]+)";var Vg="\\.";var Jg=new RegExp(`^${Yg}${Vg}${Yg}${Vg}${Yg}$`);var qg=Jg.test.bind(Jg);async function auth(e){const t=qg(e);const r=e.startsWith("v1.")||e.startsWith("ghs_");const n=e.startsWith("ghu_");const s=t?"app":r?"installation":n?"user-to-server":"oauth";return{type:"token",token:e,tokenType:s}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,t,r,n){const s=t.endpoint.merge(r,n);s.headers.authorization=withAuthorizationPrefix(e);return t(s)}var Wg=function createTokenAuth2(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};const zg="7.0.8";const dist_src_noop=()=>{};const jg=console.warn.bind(console);const Kg=console.error.bind(console);function createLogger(e={}){if(typeof e.debug!=="function"){e.debug=dist_src_noop}if(typeof e.info!=="function"){e.info=dist_src_noop}if(typeof e.warn!=="function"){e.warn=jg}if(typeof e.error!=="function"){e.error=Kg}return e}const Zg=`octokit-core.js/${zg} ${getUserAgent()}`;class Octokit{static VERSION=zg;static defaults(e){const t=class extends(this){constructor(...t){const r=t[0]||{};if(typeof e==="function"){super(e(r));return}super(Object.assign({},e,r,r.userAgent&&e.userAgent?{userAgent:`${r.userAgent} ${e.userAgent}`}:null))}};return t}static plugins=[];static plugin(...e){const t=this.plugins;const r=class extends(this){static plugins=t.concat(e.filter((e=>!t.includes(e))))};return r}constructor(e={}){const t=new eg.Collection;const r={baseUrl:Ug.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};r.headers["user-agent"]=e.userAgent?`${e.userAgent} ${Zg}`:Zg;if(e.baseUrl){r.baseUrl=e.baseUrl}if(e.previews){r.mediaType.previews=e.previews}if(e.timeZone){r.headers["time-zone"]=e.timeZone}this.request=Ug.defaults(r);this.graphql=withCustomRequest(this.request).defaults(r);this.log=createLogger(e.log);this.hook=t;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const r=Wg(e.auth);t.wrap("request",r.hook);this.auth=r}}else{const{authStrategy:r,...n}=e;const s=r(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:n},e.auth));t.wrap("request",s.hook);this.auth=s}const n=this.constructor;for(let t=0;t({async next(){if(!a)return{done:true};try{const e=await s({method:i,url:a,headers:o});const t=normalizePaginatedListResponse(e);a=((t.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1];if(!a&&"total_commits"in t.data){const e=new URL(t.url);const r=e.searchParams;const n=parseInt(r.get("page")||"1",10);const s=parseInt(r.get("per_page")||"250",10);if(n*s{if(s.done){return t}let i=false;function done(){i=true}t=t.concat(n?n(s.value,done):s.value.data);if(i){return t}return gather(e,t,r,n)}))}var sf=Object.assign(paginate,{iterator:iterator});var of=null&&["GET /advisories","GET /app/hook/deliveries","GET /app/installation-requests","GET /app/installations","GET /assignments/{assignment_id}/accepted_assignments","GET /classrooms","GET /classrooms/{classroom_id}/assignments","GET /enterprises/{enterprise}/code-security/configurations","GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories","GET /enterprises/{enterprise}/dependabot/alerts","GET /enterprises/{enterprise}/teams","GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships","GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations","GET /events","GET /gists","GET /gists/public","GET /gists/starred","GET /gists/{gist_id}/comments","GET /gists/{gist_id}/commits","GET /gists/{gist_id}/forks","GET /installation/repositories","GET /issues","GET /licenses","GET /marketplace_listing/plans","GET /marketplace_listing/plans/{plan_id}/accounts","GET /marketplace_listing/stubbed/plans","GET /marketplace_listing/stubbed/plans/{plan_id}/accounts","GET /networks/{owner}/{repo}/events","GET /notifications","GET /organizations","GET /organizations/{org}/dependabot/repository-access","GET /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/hosted-runners","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories","GET /orgs/{org}/actions/runner-groups","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners","GET /orgs/{org}/actions/runners","GET /orgs/{org}/actions/secrets","GET /orgs/{org}/actions/secrets/{secret_name}/repositories","GET /orgs/{org}/actions/variables","GET /orgs/{org}/actions/variables/{name}/repositories","GET /orgs/{org}/attestations/repositories","GET /orgs/{org}/attestations/{subject_digest}","GET /orgs/{org}/blocks","GET /orgs/{org}/campaigns","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/code-security/configurations","GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories","GET /orgs/{org}/codespaces","GET /orgs/{org}/codespaces/secrets","GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories","GET /orgs/{org}/copilot/billing/seats","GET /orgs/{org}/copilot/metrics","GET /orgs/{org}/dependabot/alerts","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}","GET /orgs/{org}/insights/api/subject-stats","GET /orgs/{org}/insights/api/user-stats/{user_id}","GET /orgs/{org}/installations","GET /orgs/{org}/invitations","GET /orgs/{org}/invitations/{invitation_id}/teams","GET /orgs/{org}/issues","GET /orgs/{org}/members","GET /orgs/{org}/members/{username}/codespaces","GET /orgs/{org}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/organization-roles/{role_id}/teams","GET /orgs/{org}/organization-roles/{role_id}/users","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/personal-access-token-requests","GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories","GET /orgs/{org}/personal-access-tokens","GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories","GET /orgs/{org}/private-registries","GET /orgs/{org}/projects","GET /orgs/{org}/projectsV2","GET /orgs/{org}/projectsV2/{project_number}/fields","GET /orgs/{org}/projectsV2/{project_number}/items","GET /orgs/{org}/properties/values","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/rulesets","GET /orgs/{org}/rulesets/rule-suites","GET /orgs/{org}/rulesets/{ruleset_id}/history","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/security-advisories","GET /orgs/{org}/settings/immutable-releases/repositories","GET /orgs/{org}/settings/network-configurations","GET /orgs/{org}/team/{team_slug}/copilot/metrics","GET /orgs/{org}/teams","GET /orgs/{org}/teams/{team_slug}/discussions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions","GET /orgs/{org}/teams/{team_slug}/invitations","GET /orgs/{org}/teams/{team_slug}/members","GET /orgs/{org}/teams/{team_slug}/projects","GET /orgs/{org}/teams/{team_slug}/repos","GET /orgs/{org}/teams/{team_slug}/teams","GET /projects/{project_id}/collaborators","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","GET /repos/{owner}/{repo}/actions/organization-secrets","GET /repos/{owner}/{repo}/actions/organization-variables","GET /repos/{owner}/{repo}/actions/runners","GET /repos/{owner}/{repo}/actions/runs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts","GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs","GET /repos/{owner}/{repo}/actions/secrets","GET /repos/{owner}/{repo}/actions/variables","GET /repos/{owner}/{repo}/actions/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/activity","GET /repos/{owner}/{repo}/assignees","GET /repos/{owner}/{repo}/attestations/{subject_digest}","GET /repos/{owner}/{repo}/branches","GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations","GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs","GET /repos/{owner}/{repo}/code-scanning/alerts","GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances","GET /repos/{owner}/{repo}/code-scanning/analyses","GET /repos/{owner}/{repo}/codespaces","GET /repos/{owner}/{repo}/codespaces/devcontainers","GET /repos/{owner}/{repo}/codespaces/secrets","GET /repos/{owner}/{repo}/collaborators","GET /repos/{owner}/{repo}/comments","GET /repos/{owner}/{repo}/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/commits","GET /repos/{owner}/{repo}/commits/{commit_sha}/comments","GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls","GET /repos/{owner}/{repo}/commits/{ref}/check-runs","GET /repos/{owner}/{repo}/commits/{ref}/check-suites","GET /repos/{owner}/{repo}/commits/{ref}/status","GET /repos/{owner}/{repo}/commits/{ref}/statuses","GET /repos/{owner}/{repo}/compare/{basehead}","GET /repos/{owner}/{repo}/compare/{base}...{head}","GET /repos/{owner}/{repo}/contributors","GET /repos/{owner}/{repo}/dependabot/alerts","GET /repos/{owner}/{repo}/dependabot/secrets","GET /repos/{owner}/{repo}/deployments","GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses","GET /repos/{owner}/{repo}/environments","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps","GET /repos/{owner}/{repo}/environments/{environment_name}/secrets","GET /repos/{owner}/{repo}/environments/{environment_name}/variables","GET /repos/{owner}/{repo}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/hooks","GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries","GET /repos/{owner}/{repo}/invitations","GET /repos/{owner}/{repo}/issues","GET /repos/{owner}/{repo}/issues/comments","GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/issues/events","GET /repos/{owner}/{repo}/issues/{issue_number}/comments","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking","GET /repos/{owner}/{repo}/issues/{issue_number}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues","GET /repos/{owner}/{repo}/issues/{issue_number}/timeline","GET /repos/{owner}/{repo}/keys","GET /repos/{owner}/{repo}/labels","GET /repos/{owner}/{repo}/milestones","GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels","GET /repos/{owner}/{repo}/notifications","GET /repos/{owner}/{repo}/pages/builds","GET /repos/{owner}/{repo}/projects","GET /repos/{owner}/{repo}/pulls","GET /repos/{owner}/{repo}/pulls/comments","GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/pulls/{pull_number}/comments","GET /repos/{owner}/{repo}/pulls/{pull_number}/commits","GET /repos/{owner}/{repo}/pulls/{pull_number}/files","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments","GET /repos/{owner}/{repo}/releases","GET /repos/{owner}/{repo}/releases/{release_id}/assets","GET /repos/{owner}/{repo}/releases/{release_id}/reactions","GET /repos/{owner}/{repo}/rules/branches/{branch}","GET /repos/{owner}/{repo}/rulesets","GET /repos/{owner}/{repo}/rulesets/rule-suites","GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history","GET /repos/{owner}/{repo}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","GET /repos/{owner}/{repo}/security-advisories","GET /repos/{owner}/{repo}/stargazers","GET /repos/{owner}/{repo}/subscribers","GET /repos/{owner}/{repo}/tags","GET /repos/{owner}/{repo}/teams","GET /repos/{owner}/{repo}/topics","GET /repositories","GET /search/code","GET /search/commits","GET /search/issues","GET /search/labels","GET /search/repositories","GET /search/topics","GET /search/users","GET /teams/{team_id}/discussions","GET /teams/{team_id}/discussions/{discussion_number}/comments","GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /teams/{team_id}/discussions/{discussion_number}/reactions","GET /teams/{team_id}/invitations","GET /teams/{team_id}/members","GET /teams/{team_id}/projects","GET /teams/{team_id}/repos","GET /teams/{team_id}/teams","GET /user/blocks","GET /user/codespaces","GET /user/codespaces/secrets","GET /user/emails","GET /user/followers","GET /user/following","GET /user/gpg_keys","GET /user/installations","GET /user/installations/{installation_id}/repositories","GET /user/issues","GET /user/keys","GET /user/marketplace_purchases","GET /user/marketplace_purchases/stubbed","GET /user/memberships/orgs","GET /user/migrations","GET /user/migrations/{migration_id}/repositories","GET /user/orgs","GET /user/packages","GET /user/packages/{package_type}/{package_name}/versions","GET /user/public_emails","GET /user/repos","GET /user/repository_invitations","GET /user/social_accounts","GET /user/ssh_signing_keys","GET /user/starred","GET /user/subscriptions","GET /user/teams","GET /users","GET /users/{username}/attestations/{subject_digest}","GET /users/{username}/events","GET /users/{username}/events/orgs/{org}","GET /users/{username}/events/public","GET /users/{username}/followers","GET /users/{username}/following","GET /users/{username}/gists","GET /users/{username}/gpg_keys","GET /users/{username}/keys","GET /users/{username}/orgs","GET /users/{username}/packages","GET /users/{username}/projects","GET /users/{username}/projectsV2","GET /users/{username}/projectsV2/{project_number}/fields","GET /users/{username}/projectsV2/{project_number}/items","GET /users/{username}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/social_accounts","GET /users/{username}/ssh_signing_keys","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(e){if(typeof e==="string"){return of.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=nf;const af=new Context;const Af=getApiBaseUrl();const cf={baseUrl:Af,request:{agent:getProxyAgent(Af),fetch:getProxyFetch(Af)}};const lf=Octokit.plugin(restEndpointMethods,paginateRest).defaults(cf);function getOctokitOptions(e,t){const r=Object.assign({},t||{});const n=getAuthString(e,r);if(n){r.auth=n}const s=getUserAgentWithOrchestrationId(r.userAgent);if(s){r.userAgent=s}return r}const uf=new Context;function getOctokit(e,t,...r){const n=lf.plugin(...r);return new n(getOctokitOptions(e,t))}var df=__nccwpck_require__(33991);var hf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};const scrubQueryParameters=e=>{const t=new URL(e);t.search="";return t.toString()};function download_artifact_exists(e){return hf(this,void 0,void 0,(function*(){try{yield Gh.access(e);return true}catch(e){if(e.code==="ENOENT"){return false}else{throw e}}}))}function streamExtract(e,t,r){return hf(this,void 0,void 0,(function*(){let n=0;while(n<5){try{return yield streamExtractExternal(e,t,{skipDecompress:r})}catch(e){n++;core_debug(`Failed to download artifact after ${n} retries due to ${e.message}. Retrying in 5 seconds...`);yield new Promise((e=>setTimeout(e,5e3)))}}throw new Error(`Artifact download failed after ${n} retries.`)}))}function streamExtractExternal(e,t){return hf(this,arguments,void 0,(function*(e,t,r={}){const{timeout:n=30*1e3,skipDecompress:s=false}=r;const i=new lib_HttpClient(getUserAgentString());const o=yield i.get(e);if(o.message.statusCode!==200){throw new Error(`Unexpected HTTP response from blob storage: ${o.message.statusCode} ${o.message.statusMessage}`)}const a=o.message.headers["content-type"]||"";const A=a.split(";",1)[0].trim().toLowerCase();const c=new URL(e).pathname.toLowerCase();const h=c.endsWith(".zip");const g=A==="application/zip"||A==="application/x-zip-compressed"||A==="application/zip-compressed"||h;const f=o.message.headers["content-disposition"]||"";let p="artifact";const B=f.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i);const I=f.match(/(?{const timerFn=()=>{const e=new Error(`Blob storage chunk did not respond in ${n}ms`);o.message.destroy(e);r(e)};const i=setTimeout(timerFn,n);const onError=e=>{core_debug(`response.message: Artifact download failed: ${e.message}`);clearTimeout(i);r(e)};const a=l.createHash("sha256").setEncoding("hex");const A=(new nr.PassThrough).on("data",(()=>{i.refresh()})).on("error",onError);o.message.pipe(A);A.pipe(a);const onClose=()=>{clearTimeout(i);if(a){a.end();y=a.read();info(`SHA256 digest of downloaded artifact is ${y}`)}e({sha256Digest:`sha256:${y}`})};if(g&&!s){A.pipe(df.Extract({path:t})).on("close",onClose).on("error",onError)}else{const e=d.join(t,p);const r=u.createWriteStream(e);info(`Downloading raw file (non-zip) to: ${e}`);A.pipe(r).on("close",onClose).on("error",onError)}}))}))}function downloadArtifactPublic(e,t,r,n,s){return hf(this,void 0,void 0,(function*(){const i=yield resolveOrCreateDirectory(s===null||s===void 0?void 0:s.path);const o=getOctokit(n);let a=false;info(`Downloading artifact '${e}' from '${t}/${r}'`);const{headers:A,status:c}=yield o.rest.actions.downloadArtifact({owner:t,repo:r,artifact_id:e,archive_format:"zip",request:{redirect:"manual"}});if(c!==302){throw new Error(`Unable to download artifact. Unexpected status: ${c}`)}const{location:l}=A;if(!l){throw new Error(`Unable to redirect to artifact download url`)}info(`Redirecting to blob download url: ${scrubQueryParameters(l)}`);try{info(`Starting download of artifact to: ${i}`);const e=yield streamExtract(l,i,s===null||s===void 0?void 0:s.skipDecompress);info(`Artifact download completed successfully.`);if(s===null||s===void 0?void 0:s.expectedHash){if((s===null||s===void 0?void 0:s.expectedHash)!==e.sha256Digest){a=true;core_debug(`Computed digest: ${e.sha256Digest}`);core_debug(`Expected digest: ${s.expectedHash}`)}}}catch(e){throw new Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:i,digestMismatch:a}}))}function downloadArtifactInternal(e,t){return hf(this,void 0,void 0,(function*(){const r=yield resolveOrCreateDirectory(t===null||t===void 0?void 0:t.path);const n=internalArtifactTwirpClient();let s=false;const{workflowRunBackendId:i,workflowJobRunBackendId:o}=getBackendIdsFromToken();const a={workflowRunBackendId:i,workflowJobRunBackendId:o,idFilter:Se.create({value:e.toString()})};const{artifacts:A}=yield n.ListArtifacts(a);if(A.length===0){throw new ArtifactNotFoundError(`No artifacts found for ID: ${e}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`)}if(A.length>1){warning("Multiple artifacts found, defaulting to first.")}const c={workflowRunBackendId:A[0].workflowRunBackendId,workflowJobRunBackendId:A[0].workflowJobRunBackendId,name:A[0].name};const{signedUrl:l}=yield n.GetSignedArtifactURL(c);info(`Redirecting to blob download url: ${scrubQueryParameters(l)}`);try{info(`Starting download of artifact to: ${r}`);const e=yield streamExtract(l,r,t===null||t===void 0?void 0:t.skipDecompress);info(`Artifact download completed successfully.`);if(t===null||t===void 0?void 0:t.expectedHash){if((t===null||t===void 0?void 0:t.expectedHash)!==e.sha256Digest){s=true;core_debug(`Computed digest: ${e.sha256Digest}`);core_debug(`Expected digest: ${t.expectedHash}`)}}}catch(e){throw new Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:r,digestMismatch:s}}))}function resolveOrCreateDirectory(){return hf(this,arguments,void 0,(function*(e=getGitHubWorkspaceDir()){if(!(yield download_artifact_exists(e))){core_debug(`Artifact destination folder does not exist, creating: ${e}`);yield Gh.mkdir(e,{recursive:true})}else{core_debug(`Artifact destination folder already exists: ${e}`)}return e}))}const gf=5;const ff=[400,401,403,404,422];function getRetryOptions(e,t=gf,r=ff){var n;if(t<=0){return[{enabled:false},e.request]}const s={enabled:true};if(r.length>0){s.doNotRetry=r}const i=Object.assign(Object.assign({},e.request),{retries:t});core_debug(`GitHub client configured with: (retries: ${i.retries}, retry-exempt-status-code: ${(n=s.doNotRetry)!==null&&n!==void 0?n:"octokit default: [400, 401, 403, 404, 422]"})`);return[s,i]}const pf="6.0.0";function requestLog(e){e.hook.wrap("request",((t,r)=>{e.log.debug("request",r);const n=Date.now();const s=e.request.endpoint.parse(r);const i=s.url.replace(r.baseUrl,"");return t(r).then((t=>{const r=t.headers["x-github-request-id"];e.log.info(`${s.method} ${i} - ${t.status} with id ${r} in ${Date.now()-n}ms`);return t})).catch((t=>{const r=t.response?.headers["x-github-request-id"]||"UNKNOWN";e.log.error(`${s.method} ${i} - ${t.status} with id ${r} in ${Date.now()-n}ms`);throw t}))}))}requestLog.VERSION=pf;var Ef=__nccwpck_require__(63251);var mf="0.0.0-development";function isRequestError(e){return e.request!==void 0}async function errorRequest(e,t,r,n){if(!isRequestError(r)||!r?.request.request){throw r}if(r.status>=400&&!e.doNotRetry.includes(r.status)){const s=n.request.retries!=null?n.request.retries:e.retries;const i=Math.pow((n.request.retryCount||0)+1,2);throw t.retry.retryRequest(r,s,i)}throw r}async function wrapRequest(e,t,r,n){const s=new Ef;s.on("failed",(function(t,r){const s=~~t.request.request?.retries;const i=~~t.request.request?.retryAfter;n.request.retryCount=r.retryCount+1;if(s>r.retryCount){return i*e.retryAfterBaseValue}}));return s.schedule(requestWithGraphqlErrorHandling.bind(null,e,t,r),n)}async function requestWithGraphqlErrorHandling(e,t,r,n){const s=await r(n);if(s.data&&s.data.errors&&s.data.errors.length>0&&/Something went wrong while executing your query/.test(s.data.errors[0].message)){const r=new RequestError(s.data.errors[0].message,500,{request:n,response:s});return errorRequest(e,t,r,n)}return s}function retry(e,t){const r=Object.assign({enabled:true,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,410,422,451],retries:3},t.retry);const n={retry:{retryRequest:(e,t,r)=>{e.request.request=Object.assign({},e.request.request,{retries:t,retryAfter:r});return e}}};if(r.enabled){e.hook.error("request",errorRequest.bind(null,r,n));e.hook.wrap("request",wrapRequest.bind(null,r,n))}return n}retry.VERSION=mf;var Cf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};function getArtifactPublic(e,t,r,n,s){return Cf(this,void 0,void 0,(function*(){var i;const[o,a]=getRetryOptions(cf);const A={log:undefined,userAgent:getUserAgentString(),previews:undefined,retry:o,request:a};const c=getOctokit(s,A,retry,requestLog);const l=yield c.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}",{owner:r,repo:n,run_id:t,name:e});if(l.status!==200){throw new InvalidResponseError(`Invalid response from GitHub API: ${l.status} (${(i=l===null||l===void 0?void 0:l.headers)===null||i===void 0?void 0:i["x-github-request-id"]})`)}if(l.data.artifacts.length===0){throw new ArtifactNotFoundError(`Artifact not found for name: ${e}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let u=l.data.artifacts[0];if(l.data.artifacts.length>1){u=l.data.artifacts.sort(((e,t)=>t.id-e.id))[0];core_debug(`More than one artifact found for a single name, returning newest (id: ${u.id})`)}return{artifact:{name:u.name,id:u.id,size:u.size_in_bytes,createdAt:u.created_at?new Date(u.created_at):undefined,digest:u.digest}}}))}function getArtifactInternal(e){return Cf(this,void 0,void 0,(function*(){var t;const r=internalArtifactTwirpClient();const{workflowRunBackendId:n,workflowJobRunBackendId:s}=getBackendIdsFromToken();const i={workflowRunBackendId:n,workflowJobRunBackendId:s,nameFilter:Te.create({value:e})};const o=yield r.ListArtifacts(i);if(o.artifacts.length===0){throw new ArtifactNotFoundError(`Artifact not found for name: ${e}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let a=o.artifacts[0];if(o.artifacts.length>1){a=o.artifacts.sort(((e,t)=>Number(t.databaseId)-Number(e.databaseId)))[0];core_debug(`More than one artifact found for a single name, returning newest (id: ${a.databaseId})`)}return{artifact:{name:a.name,id:Number(a.databaseId),size:Number(a.size),createdAt:a.createdAt?ye.toDate(a.createdAt):undefined,digest:(t=a.digest)===null||t===void 0?void 0:t.value}}}))}var Bf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};function deleteArtifactPublic(e,t,r,n,s){return Bf(this,void 0,void 0,(function*(){var i;const[o,a]=getRetryOptions(cf);const A={log:undefined,userAgent:getUserAgentString(),previews:undefined,retry:o,request:a};const c=getOctokit(s,A,retry,requestLog);const l=yield getArtifactPublic(e,t,r,n,s);const u=yield c.rest.actions.deleteArtifact({owner:r,repo:n,artifact_id:l.artifact.id});if(u.status!==204){throw new InvalidResponseError(`Invalid response from GitHub API: ${u.status} (${(i=u===null||u===void 0?void 0:u.headers)===null||i===void 0?void 0:i["x-github-request-id"]})`)}return{id:l.artifact.id}}))}function deleteArtifactInternal(e){return Bf(this,void 0,void 0,(function*(){const t=internalArtifactTwirpClient();const{workflowRunBackendId:r,workflowJobRunBackendId:n}=getBackendIdsFromToken();const s={workflowRunBackendId:r,workflowJobRunBackendId:n,nameFilter:Te.create({value:e})};const i=yield t.ListArtifacts(s);if(i.artifacts.length===0){throw new ArtifactNotFoundError(`Artifact not found for name: ${e}`)}let o=i.artifacts[0];if(i.artifacts.length>1){o=i.artifacts.sort(((e,t)=>Number(t.databaseId)-Number(e.databaseId)))[0];core_debug(`More than one artifact found for a single name, returning newest (id: ${o.databaseId})`)}const a={workflowRunBackendId:o.workflowRunBackendId,workflowJobRunBackendId:o.workflowJobRunBackendId,name:o.name};const A=yield t.DeleteArtifact(a);info(`Artifact '${e}' (ID: ${A.artifactId}) deleted`);return{id:Number(A.artifactId)}}))}var If=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};const Qf=getMaxArtifactListCount();const yf=100;const bf=Math.ceil(Qf/yf);function listArtifactsPublic(e,t,r,n){return If(this,arguments,void 0,(function*(e,t,r,n,s=false){info(`Fetching artifact list for workflow run ${e} in repository ${t}/${r}`);let i=[];const[o,a]=getRetryOptions(cf);const A={log:undefined,userAgent:getUserAgentString(),previews:undefined,retry:o,request:a};const c=getOctokit(n,A,retry,requestLog);let l=1;const{data:u}=yield c.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",{owner:t,repo:r,run_id:e,per_page:yf,page:l});let d=Math.ceil(u.total_count/yf);const h=u.total_count;if(h>Qf){warning(`Workflow run ${e} has ${h} artifacts, exceeding the limit of ${Qf}. Results will be incomplete as only the first ${Qf} artifacts will be returned`);d=bf}for(const e of u.artifacts){i.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):undefined,digest:e.digest})}l++;for(l;l<=d;l++){core_debug(`Fetching page ${l} of artifact list`);const{data:n}=yield c.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",{owner:t,repo:r,run_id:e,per_page:yf,page:l});for(const e of n.artifacts){i.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):undefined,digest:e.digest})}}if(s){i=filterLatest(i)}info(`Found ${i.length} artifact(s)`);return{artifacts:i}}))}function listArtifactsInternal(){return If(this,arguments,void 0,(function*(e=false){const t=internalArtifactTwirpClient();const{workflowRunBackendId:r,workflowJobRunBackendId:n}=getBackendIdsFromToken();const s={workflowRunBackendId:r,workflowJobRunBackendId:n};const i=yield t.ListArtifacts(s);let o=i.artifacts.map((e=>{var t;return{name:e.name,id:Number(e.databaseId),size:Number(e.size),createdAt:e.createdAt?ye.toDate(e.createdAt):undefined,digest:(t=e.digest)===null||t===void 0?void 0:t.value}}));if(e){o=filterLatest(o)}info(`Found ${o.length} artifact(s)`);return{artifacts:o}}))}function filterLatest(e){e.sort(((e,t)=>t.id-e.id));const t=[];const r=new Set;for(const n of e){if(!r.has(n.name)){t.push(n);r.add(n.name)}}return t}var wf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var Sf=undefined&&undefined.__rest||function(e,t){var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0)r[n]=e[n];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s!e.endsWith(i.sep)));if(c.length===0){const t=`No files matched pattern: ${e}`;if(s==="error")return o.setFailed(t);if(s==="warn")return o.warning(t);return o.info(t)}const l=new DefaultArtifactClient;const u=process.cwd();const d=[];for(const e of c){const t=i.basename(e);const s=i.relative(u,e)||e;o.info(`Uploading ${t} (${s})`);const a={compressionLevel:n};if(r>0)a.retentionDays=r;const A=await l.uploadArtifact(t,[e],u,a);o.info(` artifact id=${A.id} size=${A.size}`);d.push(t)}o.setOutput("artifact-names",JSON.stringify(d));o.info(`Uploaded ${d.length} artifact(s).`)}run().catch((e=>o.setFailed(e&&e.stack?e.stack:String(e))));
\ No newline at end of file
+/* v8 ignore if -- @preserve */var Yg="(?:[a-zA-Z0-9_-]+)";var Vg="\\.";var Jg=new RegExp(`^${Yg}${Vg}${Yg}${Vg}${Yg}$`);var qg=Jg.test.bind(Jg);async function auth(e){const t=qg(e);const r=e.startsWith("v1.")||e.startsWith("ghs_");const n=e.startsWith("ghu_");const s=t?"app":r?"installation":n?"user-to-server":"oauth";return{type:"token",token:e,tokenType:s}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,t,r,n){const s=t.endpoint.merge(r,n);s.headers.authorization=withAuthorizationPrefix(e);return t(s)}var Wg=function createTokenAuth2(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};const zg="7.0.8";const dist_src_noop=()=>{};const jg=console.warn.bind(console);const Kg=console.error.bind(console);function createLogger(e={}){if(typeof e.debug!=="function"){e.debug=dist_src_noop}if(typeof e.info!=="function"){e.info=dist_src_noop}if(typeof e.warn!=="function"){e.warn=jg}if(typeof e.error!=="function"){e.error=Kg}return e}const Zg=`octokit-core.js/${zg} ${getUserAgent()}`;class Octokit{static VERSION=zg;static defaults(e){const t=class extends(this){constructor(...t){const r=t[0]||{};if(typeof e==="function"){super(e(r));return}super(Object.assign({},e,r,r.userAgent&&e.userAgent?{userAgent:`${r.userAgent} ${e.userAgent}`}:null))}};return t}static plugins=[];static plugin(...e){const t=this.plugins;const r=class extends(this){static plugins=t.concat(e.filter((e=>!t.includes(e))))};return r}constructor(e={}){const t=new eg.Collection;const r={baseUrl:Ug.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};r.headers["user-agent"]=e.userAgent?`${e.userAgent} ${Zg}`:Zg;if(e.baseUrl){r.baseUrl=e.baseUrl}if(e.previews){r.mediaType.previews=e.previews}if(e.timeZone){r.headers["time-zone"]=e.timeZone}this.request=Ug.defaults(r);this.graphql=withCustomRequest(this.request).defaults(r);this.log=createLogger(e.log);this.hook=t;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const r=Wg(e.auth);t.wrap("request",r.hook);this.auth=r}}else{const{authStrategy:r,...n}=e;const s=r(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:n},e.auth));t.wrap("request",s.hook);this.auth=s}const n=this.constructor;for(let t=0;t({async next(){if(!a)return{done:true};try{const e=await s({method:i,url:a,headers:o});const t=normalizePaginatedListResponse(e);a=((t.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1];if(!a&&"total_commits"in t.data){const e=new URL(t.url);const r=e.searchParams;const n=parseInt(r.get("page")||"1",10);const s=parseInt(r.get("per_page")||"250",10);if(n*s{if(s.done){return t}let i=false;function done(){i=true}t=t.concat(n?n(s.value,done):s.value.data);if(i){return t}return gather(e,t,r,n)}))}var sf=Object.assign(paginate,{iterator:iterator});var of=null&&["GET /advisories","GET /app/hook/deliveries","GET /app/installation-requests","GET /app/installations","GET /assignments/{assignment_id}/accepted_assignments","GET /classrooms","GET /classrooms/{classroom_id}/assignments","GET /enterprises/{enterprise}/code-security/configurations","GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories","GET /enterprises/{enterprise}/dependabot/alerts","GET /enterprises/{enterprise}/teams","GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships","GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations","GET /events","GET /gists","GET /gists/public","GET /gists/starred","GET /gists/{gist_id}/comments","GET /gists/{gist_id}/commits","GET /gists/{gist_id}/forks","GET /installation/repositories","GET /issues","GET /licenses","GET /marketplace_listing/plans","GET /marketplace_listing/plans/{plan_id}/accounts","GET /marketplace_listing/stubbed/plans","GET /marketplace_listing/stubbed/plans/{plan_id}/accounts","GET /networks/{owner}/{repo}/events","GET /notifications","GET /organizations","GET /organizations/{org}/dependabot/repository-access","GET /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/hosted-runners","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories","GET /orgs/{org}/actions/runner-groups","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners","GET /orgs/{org}/actions/runners","GET /orgs/{org}/actions/secrets","GET /orgs/{org}/actions/secrets/{secret_name}/repositories","GET /orgs/{org}/actions/variables","GET /orgs/{org}/actions/variables/{name}/repositories","GET /orgs/{org}/attestations/repositories","GET /orgs/{org}/attestations/{subject_digest}","GET /orgs/{org}/blocks","GET /orgs/{org}/campaigns","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/code-security/configurations","GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories","GET /orgs/{org}/codespaces","GET /orgs/{org}/codespaces/secrets","GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories","GET /orgs/{org}/copilot/billing/seats","GET /orgs/{org}/copilot/metrics","GET /orgs/{org}/dependabot/alerts","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}","GET /orgs/{org}/insights/api/subject-stats","GET /orgs/{org}/insights/api/user-stats/{user_id}","GET /orgs/{org}/installations","GET /orgs/{org}/invitations","GET /orgs/{org}/invitations/{invitation_id}/teams","GET /orgs/{org}/issues","GET /orgs/{org}/members","GET /orgs/{org}/members/{username}/codespaces","GET /orgs/{org}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/organization-roles/{role_id}/teams","GET /orgs/{org}/organization-roles/{role_id}/users","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/personal-access-token-requests","GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories","GET /orgs/{org}/personal-access-tokens","GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories","GET /orgs/{org}/private-registries","GET /orgs/{org}/projects","GET /orgs/{org}/projectsV2","GET /orgs/{org}/projectsV2/{project_number}/fields","GET /orgs/{org}/projectsV2/{project_number}/items","GET /orgs/{org}/properties/values","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/rulesets","GET /orgs/{org}/rulesets/rule-suites","GET /orgs/{org}/rulesets/{ruleset_id}/history","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/security-advisories","GET /orgs/{org}/settings/immutable-releases/repositories","GET /orgs/{org}/settings/network-configurations","GET /orgs/{org}/team/{team_slug}/copilot/metrics","GET /orgs/{org}/teams","GET /orgs/{org}/teams/{team_slug}/discussions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions","GET /orgs/{org}/teams/{team_slug}/invitations","GET /orgs/{org}/teams/{team_slug}/members","GET /orgs/{org}/teams/{team_slug}/projects","GET /orgs/{org}/teams/{team_slug}/repos","GET /orgs/{org}/teams/{team_slug}/teams","GET /projects/{project_id}/collaborators","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","GET /repos/{owner}/{repo}/actions/organization-secrets","GET /repos/{owner}/{repo}/actions/organization-variables","GET /repos/{owner}/{repo}/actions/runners","GET /repos/{owner}/{repo}/actions/runs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts","GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs","GET /repos/{owner}/{repo}/actions/secrets","GET /repos/{owner}/{repo}/actions/variables","GET /repos/{owner}/{repo}/actions/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/activity","GET /repos/{owner}/{repo}/assignees","GET /repos/{owner}/{repo}/attestations/{subject_digest}","GET /repos/{owner}/{repo}/branches","GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations","GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs","GET /repos/{owner}/{repo}/code-scanning/alerts","GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances","GET /repos/{owner}/{repo}/code-scanning/analyses","GET /repos/{owner}/{repo}/codespaces","GET /repos/{owner}/{repo}/codespaces/devcontainers","GET /repos/{owner}/{repo}/codespaces/secrets","GET /repos/{owner}/{repo}/collaborators","GET /repos/{owner}/{repo}/comments","GET /repos/{owner}/{repo}/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/commits","GET /repos/{owner}/{repo}/commits/{commit_sha}/comments","GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls","GET /repos/{owner}/{repo}/commits/{ref}/check-runs","GET /repos/{owner}/{repo}/commits/{ref}/check-suites","GET /repos/{owner}/{repo}/commits/{ref}/status","GET /repos/{owner}/{repo}/commits/{ref}/statuses","GET /repos/{owner}/{repo}/compare/{basehead}","GET /repos/{owner}/{repo}/compare/{base}...{head}","GET /repos/{owner}/{repo}/contributors","GET /repos/{owner}/{repo}/dependabot/alerts","GET /repos/{owner}/{repo}/dependabot/secrets","GET /repos/{owner}/{repo}/deployments","GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses","GET /repos/{owner}/{repo}/environments","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps","GET /repos/{owner}/{repo}/environments/{environment_name}/secrets","GET /repos/{owner}/{repo}/environments/{environment_name}/variables","GET /repos/{owner}/{repo}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/hooks","GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries","GET /repos/{owner}/{repo}/invitations","GET /repos/{owner}/{repo}/issues","GET /repos/{owner}/{repo}/issues/comments","GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/issues/events","GET /repos/{owner}/{repo}/issues/{issue_number}/comments","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking","GET /repos/{owner}/{repo}/issues/{issue_number}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues","GET /repos/{owner}/{repo}/issues/{issue_number}/timeline","GET /repos/{owner}/{repo}/keys","GET /repos/{owner}/{repo}/labels","GET /repos/{owner}/{repo}/milestones","GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels","GET /repos/{owner}/{repo}/notifications","GET /repos/{owner}/{repo}/pages/builds","GET /repos/{owner}/{repo}/projects","GET /repos/{owner}/{repo}/pulls","GET /repos/{owner}/{repo}/pulls/comments","GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/pulls/{pull_number}/comments","GET /repos/{owner}/{repo}/pulls/{pull_number}/commits","GET /repos/{owner}/{repo}/pulls/{pull_number}/files","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments","GET /repos/{owner}/{repo}/releases","GET /repos/{owner}/{repo}/releases/{release_id}/assets","GET /repos/{owner}/{repo}/releases/{release_id}/reactions","GET /repos/{owner}/{repo}/rules/branches/{branch}","GET /repos/{owner}/{repo}/rulesets","GET /repos/{owner}/{repo}/rulesets/rule-suites","GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history","GET /repos/{owner}/{repo}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","GET /repos/{owner}/{repo}/security-advisories","GET /repos/{owner}/{repo}/stargazers","GET /repos/{owner}/{repo}/subscribers","GET /repos/{owner}/{repo}/tags","GET /repos/{owner}/{repo}/teams","GET /repos/{owner}/{repo}/topics","GET /repositories","GET /search/code","GET /search/commits","GET /search/issues","GET /search/labels","GET /search/repositories","GET /search/topics","GET /search/users","GET /teams/{team_id}/discussions","GET /teams/{team_id}/discussions/{discussion_number}/comments","GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /teams/{team_id}/discussions/{discussion_number}/reactions","GET /teams/{team_id}/invitations","GET /teams/{team_id}/members","GET /teams/{team_id}/projects","GET /teams/{team_id}/repos","GET /teams/{team_id}/teams","GET /user/blocks","GET /user/codespaces","GET /user/codespaces/secrets","GET /user/emails","GET /user/followers","GET /user/following","GET /user/gpg_keys","GET /user/installations","GET /user/installations/{installation_id}/repositories","GET /user/issues","GET /user/keys","GET /user/marketplace_purchases","GET /user/marketplace_purchases/stubbed","GET /user/memberships/orgs","GET /user/migrations","GET /user/migrations/{migration_id}/repositories","GET /user/orgs","GET /user/packages","GET /user/packages/{package_type}/{package_name}/versions","GET /user/public_emails","GET /user/repos","GET /user/repository_invitations","GET /user/social_accounts","GET /user/ssh_signing_keys","GET /user/starred","GET /user/subscriptions","GET /user/teams","GET /users","GET /users/{username}/attestations/{subject_digest}","GET /users/{username}/events","GET /users/{username}/events/orgs/{org}","GET /users/{username}/events/public","GET /users/{username}/followers","GET /users/{username}/following","GET /users/{username}/gists","GET /users/{username}/gpg_keys","GET /users/{username}/keys","GET /users/{username}/orgs","GET /users/{username}/packages","GET /users/{username}/projects","GET /users/{username}/projectsV2","GET /users/{username}/projectsV2/{project_number}/fields","GET /users/{username}/projectsV2/{project_number}/items","GET /users/{username}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/social_accounts","GET /users/{username}/ssh_signing_keys","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(e){if(typeof e==="string"){return of.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=nf;const af=new Context;const Af=getApiBaseUrl();const cf={baseUrl:Af,request:{agent:getProxyAgent(Af),fetch:getProxyFetch(Af)}};const lf=Octokit.plugin(restEndpointMethods,paginateRest).defaults(cf);function getOctokitOptions(e,t){const r=Object.assign({},t||{});const n=getAuthString(e,r);if(n){r.auth=n}const s=getUserAgentWithOrchestrationId(r.userAgent);if(s){r.userAgent=s}return r}const uf=new Context;function getOctokit(e,t,...r){const n=lf.plugin(...r);return new n(getOctokitOptions(e,t))}var df=__nccwpck_require__(33991);var hf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};const scrubQueryParameters=e=>{const t=new URL(e);t.search="";return t.toString()};function download_artifact_exists(e){return hf(this,void 0,void 0,(function*(){try{yield Gh.access(e);return true}catch(e){if(e.code==="ENOENT"){return false}else{throw e}}}))}function streamExtract(e,t,r){return hf(this,void 0,void 0,(function*(){let n=0;while(n<5){try{return yield streamExtractExternal(e,t,{skipDecompress:r})}catch(e){n++;core_debug(`Failed to download artifact after ${n} retries due to ${e.message}. Retrying in 5 seconds...`);yield new Promise((e=>setTimeout(e,5e3)))}}throw new Error(`Artifact download failed after ${n} retries.`)}))}function streamExtractExternal(e,t){return hf(this,arguments,void 0,(function*(e,t,r={}){const{timeout:n=30*1e3,skipDecompress:s=false}=r;const i=new lib_HttpClient(getUserAgentString());const o=yield i.get(e);if(o.message.statusCode!==200){throw new Error(`Unexpected HTTP response from blob storage: ${o.message.statusCode} ${o.message.statusMessage}`)}const a=o.message.headers["content-type"]||"";const A=a.split(";",1)[0].trim().toLowerCase();const c=new URL(e).pathname.toLowerCase();const h=c.endsWith(".zip");const g=A==="application/zip"||A==="application/x-zip-compressed"||A==="application/zip-compressed"||h;const f=o.message.headers["content-disposition"]||"";let p="artifact";const B=f.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i);const I=f.match(/(?{const timerFn=()=>{const e=new Error(`Blob storage chunk did not respond in ${n}ms`);o.message.destroy(e);r(e)};const i=setTimeout(timerFn,n);const onError=e=>{core_debug(`response.message: Artifact download failed: ${e.message}`);clearTimeout(i);r(e)};const a=l.createHash("sha256").setEncoding("hex");const A=(new nr.PassThrough).on("data",(()=>{i.refresh()})).on("error",onError);o.message.pipe(A);A.pipe(a);const onClose=()=>{clearTimeout(i);if(a){a.end();y=a.read();info(`SHA256 digest of downloaded artifact is ${y}`)}e({sha256Digest:`sha256:${y}`})};if(g&&!s){A.pipe(df.Extract({path:t})).on("close",onClose).on("error",onError)}else{const e=d.join(t,p);const r=u.createWriteStream(e);info(`Downloading raw file (non-zip) to: ${e}`);A.pipe(r).on("close",onClose).on("error",onError)}}))}))}function downloadArtifactPublic(e,t,r,n,s){return hf(this,void 0,void 0,(function*(){const i=yield resolveOrCreateDirectory(s===null||s===void 0?void 0:s.path);const o=getOctokit(n);let a=false;info(`Downloading artifact '${e}' from '${t}/${r}'`);const{headers:A,status:c}=yield o.rest.actions.downloadArtifact({owner:t,repo:r,artifact_id:e,archive_format:"zip",request:{redirect:"manual"}});if(c!==302){throw new Error(`Unable to download artifact. Unexpected status: ${c}`)}const{location:l}=A;if(!l){throw new Error(`Unable to redirect to artifact download url`)}info(`Redirecting to blob download url: ${scrubQueryParameters(l)}`);try{info(`Starting download of artifact to: ${i}`);const e=yield streamExtract(l,i,s===null||s===void 0?void 0:s.skipDecompress);info(`Artifact download completed successfully.`);if(s===null||s===void 0?void 0:s.expectedHash){if((s===null||s===void 0?void 0:s.expectedHash)!==e.sha256Digest){a=true;core_debug(`Computed digest: ${e.sha256Digest}`);core_debug(`Expected digest: ${s.expectedHash}`)}}}catch(e){throw new Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:i,digestMismatch:a}}))}function downloadArtifactInternal(e,t){return hf(this,void 0,void 0,(function*(){const r=yield resolveOrCreateDirectory(t===null||t===void 0?void 0:t.path);const n=internalArtifactTwirpClient();let s=false;const{workflowRunBackendId:i,workflowJobRunBackendId:o}=getBackendIdsFromToken();const a={workflowRunBackendId:i,workflowJobRunBackendId:o,idFilter:Se.create({value:e.toString()})};const{artifacts:A}=yield n.ListArtifacts(a);if(A.length===0){throw new ArtifactNotFoundError(`No artifacts found for ID: ${e}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`)}if(A.length>1){warning("Multiple artifacts found, defaulting to first.")}const c={workflowRunBackendId:A[0].workflowRunBackendId,workflowJobRunBackendId:A[0].workflowJobRunBackendId,name:A[0].name};const{signedUrl:l}=yield n.GetSignedArtifactURL(c);info(`Redirecting to blob download url: ${scrubQueryParameters(l)}`);try{info(`Starting download of artifact to: ${r}`);const e=yield streamExtract(l,r,t===null||t===void 0?void 0:t.skipDecompress);info(`Artifact download completed successfully.`);if(t===null||t===void 0?void 0:t.expectedHash){if((t===null||t===void 0?void 0:t.expectedHash)!==e.sha256Digest){s=true;core_debug(`Computed digest: ${e.sha256Digest}`);core_debug(`Expected digest: ${t.expectedHash}`)}}}catch(e){throw new Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:r,digestMismatch:s}}))}function resolveOrCreateDirectory(){return hf(this,arguments,void 0,(function*(e=getGitHubWorkspaceDir()){if(!(yield download_artifact_exists(e))){core_debug(`Artifact destination folder does not exist, creating: ${e}`);yield Gh.mkdir(e,{recursive:true})}else{core_debug(`Artifact destination folder already exists: ${e}`)}return e}))}const gf=5;const ff=[400,401,403,404,422];function getRetryOptions(e,t=gf,r=ff){var n;if(t<=0){return[{enabled:false},e.request]}const s={enabled:true};if(r.length>0){s.doNotRetry=r}const i=Object.assign(Object.assign({},e.request),{retries:t});core_debug(`GitHub client configured with: (retries: ${i.retries}, retry-exempt-status-code: ${(n=s.doNotRetry)!==null&&n!==void 0?n:"octokit default: [400, 401, 403, 404, 422]"})`);return[s,i]}const pf="6.0.0";function requestLog(e){e.hook.wrap("request",((t,r)=>{e.log.debug("request",r);const n=Date.now();const s=e.request.endpoint.parse(r);const i=s.url.replace(r.baseUrl,"");return t(r).then((t=>{const r=t.headers["x-github-request-id"];e.log.info(`${s.method} ${i} - ${t.status} with id ${r} in ${Date.now()-n}ms`);return t})).catch((t=>{const r=t.response?.headers["x-github-request-id"]||"UNKNOWN";e.log.error(`${s.method} ${i} - ${t.status} with id ${r} in ${Date.now()-n}ms`);throw t}))}))}requestLog.VERSION=pf;var Ef=__nccwpck_require__(63251);var mf="0.0.0-development";function isRequestError(e){return e.request!==void 0}async function errorRequest(e,t,r,n){if(!isRequestError(r)||!r?.request.request){throw r}if(r.status>=400&&!e.doNotRetry.includes(r.status)){const s=n.request.retries!=null?n.request.retries:e.retries;const i=Math.pow((n.request.retryCount||0)+1,2);throw t.retry.retryRequest(r,s,i)}throw r}async function wrapRequest(e,t,r,n){const s=new Ef;s.on("failed",(function(t,r){const s=~~t.request.request?.retries;const i=~~t.request.request?.retryAfter;n.request.retryCount=r.retryCount+1;if(s>r.retryCount){return i*e.retryAfterBaseValue}}));return s.schedule(requestWithGraphqlErrorHandling.bind(null,e,t,r),n)}async function requestWithGraphqlErrorHandling(e,t,r,n){const s=await r(n);if(s.data&&s.data.errors&&s.data.errors.length>0&&/Something went wrong while executing your query/.test(s.data.errors[0].message)){const r=new RequestError(s.data.errors[0].message,500,{request:n,response:s});return errorRequest(e,t,r,n)}return s}function retry(e,t){const r=Object.assign({enabled:true,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,410,422,451],retries:3},t.retry);const n={retry:{retryRequest:(e,t,r)=>{e.request.request=Object.assign({},e.request.request,{retries:t,retryAfter:r});return e}}};if(r.enabled){e.hook.error("request",errorRequest.bind(null,r,n));e.hook.wrap("request",wrapRequest.bind(null,r,n))}return n}retry.VERSION=mf;var Cf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};function getArtifactPublic(e,t,r,n,s){return Cf(this,void 0,void 0,(function*(){var i;const[o,a]=getRetryOptions(cf);const A={log:undefined,userAgent:getUserAgentString(),previews:undefined,retry:o,request:a};const c=getOctokit(s,A,retry,requestLog);const l=yield c.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}",{owner:r,repo:n,run_id:t,name:e});if(l.status!==200){throw new InvalidResponseError(`Invalid response from GitHub API: ${l.status} (${(i=l===null||l===void 0?void 0:l.headers)===null||i===void 0?void 0:i["x-github-request-id"]})`)}if(l.data.artifacts.length===0){throw new ArtifactNotFoundError(`Artifact not found for name: ${e}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let u=l.data.artifacts[0];if(l.data.artifacts.length>1){u=l.data.artifacts.sort(((e,t)=>t.id-e.id))[0];core_debug(`More than one artifact found for a single name, returning newest (id: ${u.id})`)}return{artifact:{name:u.name,id:u.id,size:u.size_in_bytes,createdAt:u.created_at?new Date(u.created_at):undefined,digest:u.digest}}}))}function getArtifactInternal(e){return Cf(this,void 0,void 0,(function*(){var t;const r=internalArtifactTwirpClient();const{workflowRunBackendId:n,workflowJobRunBackendId:s}=getBackendIdsFromToken();const i={workflowRunBackendId:n,workflowJobRunBackendId:s,nameFilter:Te.create({value:e})};const o=yield r.ListArtifacts(i);if(o.artifacts.length===0){throw new ArtifactNotFoundError(`Artifact not found for name: ${e}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let a=o.artifacts[0];if(o.artifacts.length>1){a=o.artifacts.sort(((e,t)=>Number(t.databaseId)-Number(e.databaseId)))[0];core_debug(`More than one artifact found for a single name, returning newest (id: ${a.databaseId})`)}return{artifact:{name:a.name,id:Number(a.databaseId),size:Number(a.size),createdAt:a.createdAt?ye.toDate(a.createdAt):undefined,digest:(t=a.digest)===null||t===void 0?void 0:t.value}}}))}var Bf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};function deleteArtifactPublic(e,t,r,n,s){return Bf(this,void 0,void 0,(function*(){var i;const[o,a]=getRetryOptions(cf);const A={log:undefined,userAgent:getUserAgentString(),previews:undefined,retry:o,request:a};const c=getOctokit(s,A,retry,requestLog);const l=yield getArtifactPublic(e,t,r,n,s);const u=yield c.rest.actions.deleteArtifact({owner:r,repo:n,artifact_id:l.artifact.id});if(u.status!==204){throw new InvalidResponseError(`Invalid response from GitHub API: ${u.status} (${(i=u===null||u===void 0?void 0:u.headers)===null||i===void 0?void 0:i["x-github-request-id"]})`)}return{id:l.artifact.id}}))}function deleteArtifactInternal(e){return Bf(this,void 0,void 0,(function*(){const t=internalArtifactTwirpClient();const{workflowRunBackendId:r,workflowJobRunBackendId:n}=getBackendIdsFromToken();const s={workflowRunBackendId:r,workflowJobRunBackendId:n,nameFilter:Te.create({value:e})};const i=yield t.ListArtifacts(s);if(i.artifacts.length===0){throw new ArtifactNotFoundError(`Artifact not found for name: ${e}`)}let o=i.artifacts[0];if(i.artifacts.length>1){o=i.artifacts.sort(((e,t)=>Number(t.databaseId)-Number(e.databaseId)))[0];core_debug(`More than one artifact found for a single name, returning newest (id: ${o.databaseId})`)}const a={workflowRunBackendId:o.workflowRunBackendId,workflowJobRunBackendId:o.workflowJobRunBackendId,name:o.name};const A=yield t.DeleteArtifact(a);info(`Artifact '${e}' (ID: ${A.artifactId}) deleted`);return{id:Number(A.artifactId)}}))}var If=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};const Qf=getMaxArtifactListCount();const yf=100;const bf=Math.ceil(Qf/yf);function listArtifactsPublic(e,t,r,n){return If(this,arguments,void 0,(function*(e,t,r,n,s=false){info(`Fetching artifact list for workflow run ${e} in repository ${t}/${r}`);let i=[];const[o,a]=getRetryOptions(cf);const A={log:undefined,userAgent:getUserAgentString(),previews:undefined,retry:o,request:a};const c=getOctokit(n,A,retry,requestLog);let l=1;const{data:u}=yield c.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",{owner:t,repo:r,run_id:e,per_page:yf,page:l});let d=Math.ceil(u.total_count/yf);const h=u.total_count;if(h>Qf){warning(`Workflow run ${e} has ${h} artifacts, exceeding the limit of ${Qf}. Results will be incomplete as only the first ${Qf} artifacts will be returned`);d=bf}for(const e of u.artifacts){i.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):undefined,digest:e.digest})}l++;for(l;l<=d;l++){core_debug(`Fetching page ${l} of artifact list`);const{data:n}=yield c.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",{owner:t,repo:r,run_id:e,per_page:yf,page:l});for(const e of n.artifacts){i.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):undefined,digest:e.digest})}}if(s){i=filterLatest(i)}info(`Found ${i.length} artifact(s)`);return{artifacts:i}}))}function listArtifactsInternal(){return If(this,arguments,void 0,(function*(e=false){const t=internalArtifactTwirpClient();const{workflowRunBackendId:r,workflowJobRunBackendId:n}=getBackendIdsFromToken();const s={workflowRunBackendId:r,workflowJobRunBackendId:n};const i=yield t.ListArtifacts(s);let o=i.artifacts.map((e=>{var t;return{name:e.name,id:Number(e.databaseId),size:Number(e.size),createdAt:e.createdAt?ye.toDate(e.createdAt):undefined,digest:(t=e.digest)===null||t===void 0?void 0:t.value}}));if(e){o=filterLatest(o)}info(`Found ${o.length} artifact(s)`);return{artifacts:o}}))}function filterLatest(e){e.sort(((e,t)=>t.id-e.id));const t=[];const r=new Set;for(const n of e){if(!r.has(n.name)){t.push(n);r.add(n.name)}}return t}var wf=undefined&&undefined.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var Sf=undefined&&undefined.__rest||function(e,t){var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0)r[n]=e[n];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s!e.endsWith(i.sep)));if(l.length===0){const t=`No files matched pattern: ${e}`;if(A==="error")return o.setFailed(t);if(A==="warn")return o.warning(t);return o.info(t)}const u=new DefaultArtifactClient;const d=process.cwd();const h=[];for(const e of l){const t=i.basename(e);const a=i.relative(d,e)||e;o.info(`Uploading ${t} (${a})`);const A=s?{compressionLevel:n}:{skipArchive:true};if(r>0)A.retentionDays=r;const c=await u.uploadArtifact(t,[e],d,A);o.info(` artifact id=${c.id} size=${c.size}`);h.push(t)}o.setOutput("artifact-names",JSON.stringify(h));o.info(`Uploaded ${h.length} artifact(s).`)}run().catch((e=>o.setFailed(e&&e.stack?e.stack:String(e))));
\ No newline at end of file
diff --git a/.github/actions/upload-each/src/index.js b/.github/actions/upload-each/src/index.js
index cafa25b703..9295b4248c 100644
--- a/.github/actions/upload-each/src/index.js
+++ b/.github/actions/upload-each/src/index.js
@@ -11,6 +11,7 @@ async function run() {
core.getInput('compression-level') || '6',
10,
)
+ const archive = core.getInput('archive') !== 'false'
const ifNoFilesFound = (
core.getInput('if-no-files-found') || 'warn'
).toLowerCase()
@@ -33,7 +34,7 @@ async function run() {
const name = path.basename(file)
const rel = path.relative(cwd, file) || file
core.info(`Uploading ${name} (${rel})`)
- const opts = { compressionLevel }
+ const opts = archive ? { compressionLevel } : { skipArchive: true }
if (retentionDays > 0) opts.retentionDays = retentionDays
const result = await client.uploadArtifact(name, [file], cwd, opts)
core.info(` artifact id=${result.id} size=${result.size}`)
diff --git a/.github/actions/upload-each/test/index.test.cjs b/.github/actions/upload-each/test/index.test.cjs
index 9d29b0420b..df4f4ccea4 100644
--- a/.github/actions/upload-each/test/index.test.cjs
+++ b/.github/actions/upload-each/test/index.test.cjs
@@ -98,6 +98,17 @@ test('uses repository retention and compression defaults', async () => {
])
})
+test('uploads each file unarchived when archive is false', async () => {
+ const file = path.resolve('one.s9pk')
+ const { uploads } = await runAction(
+ { pattern: '*.s9pk', archive: 'false', 'compression-level': '0' },
+ [file],
+ )
+ assert.deepEqual(uploads, [
+ ['one.s9pk', [file], process.cwd(), { skipArchive: true }],
+ ])
+})
+
for (const mode of ['warn', 'error', 'ignore']) {
test(`handles no files in ${mode} mode without uploading`, async () => {
const { uploads, messages, outcome } = await runAction(
diff --git a/.github/actions/use-compiled-artifacts/action.yml b/.github/actions/use-compiled-artifacts/action.yml
new file mode 100644
index 0000000000..f28072698c
--- /dev/null
+++ b/.github/actions/use-compiled-artifacts/action.yml
@@ -0,0 +1,45 @@
+name: Use compiled artifacts
+description: >-
+ Unpacks a build-products.yaml run's compiled-.tar.gz into the checkout
+ and marks it current, so make uses it rather than recompiling.
+ Requires `actions: read`.
+inputs:
+ arch:
+ description: Architecture whose tarball to unpack
+ required: true
+ run-id:
+ description: Run holding the tarball
+ required: true
+runs:
+ using: composite
+ steps:
+ - uses: actions/download-artifact@v8
+ with:
+ name: compiled-${{ inputs.arch }}.tar.gz
+ run-id: ${{ inputs.run-id }}
+ github-token: ${{ github.token }}
+
+ - shell: bash
+ env:
+ TARBALL: compiled-${{ inputs.arch }}.tar.gz
+ run: |
+ set -euo pipefail
+ tar -xzvf "$TARBALL"
+ mkdir -p node_modules
+ mkdir -p projects/start-os/web/dist/raw
+ mkdir -p projects/start-tunnel/web/dist/raw
+ mkdir -p shared-libs/crates/start-core/bindings
+ mkdir -p shared-libs/ts-modules/start-core/lib/osBindings
+ mkdir -p projects/start-os/container-runtime/node_modules
+ mkdir -p projects/start-os/container-runtime/dist
+ mkdir -p projects/start-os/container-runtime/dist/node_modules
+ mkdir -p projects/start-sdk/dist
+ mkdir -p shared-libs/ts-modules/start-core/dist
+ mkdir -p shared-libs/crates/patch-db/client/node_modules
+ mkdir -p shared-libs/crates/patch-db/client/dist
+ mkdir -p .angular
+ mkdir -p projects/start-os/web/dist/raw/ui
+ mkdir -p projects/start-os/web/dist/raw/setup-wizard
+ mkdir -p projects/start-os/web/dist/static/ui
+ mkdir -p projects/start-os/web/dist/static/setup-wizard
+ make -t "$TARBALL"
diff --git a/.github/scripts/changed-products.mjs b/.github/scripts/changed-products.mjs
index bcfbfdb3f1..5aa7fe671c 100644
--- a/.github/scripts/changed-products.mjs
+++ b/.github/scripts/changed-products.mjs
@@ -118,6 +118,8 @@ export const OS_IMAGE_PATHS = [
'projects/start-os/changelog/**',
'projects/start-os/*.service',
'projects/start-os/*.slice',
+ 'projects/start-os/container-runtime/*.sh',
+ 'projects/start-os/container-runtime/*.service',
'scripts/changelog*.mjs',
'shared-libs/crates/start-core/locales/release-notes.json',
'.prettierrc.json',
diff --git a/.github/workflows/apt-publish-alpha.yml b/.github/workflows/apt-publish-alpha.yml
index a7a7d958db..b11bf71a77 100644
--- a/.github/workflows/apt-publish-alpha.yml
+++ b/.github/workflows/apt-publish-alpha.yml
@@ -60,10 +60,9 @@ jobs:
products=(start-cli start-tunnel start-registry)
arches=(x86_64 aarch64 riscv64)
declare -A chosen=()
+ product_glob=$(IFS='|'; printf '%s' "${products[*]}")
candidate_ids=$(
- for product in "${products[@]}"; do
- ./scripts/gha-artifact-run-ids.sh "$GITHUB_REPOSITORY" "${product}_${arches[0]}.deb" master || exit 1
- done | sort -nu
+ ./scripts/gha-artifact-run-ids.sh "$GITHUB_REPOSITORY" "@($product_glob)-*_${arches[0]}.deb" master | sort -nu
)
run_metadata=$(
for run_id in $candidate_ids; do
@@ -85,7 +84,11 @@ jobs:
[ -z "${chosen[$product]:-}" ] || continue
complete=1
for arch in "${arches[@]}"; do
- grep -qx "${product}_${arch}.deb" <<< "$names" || complete=0
+ has_deb=0
+ while read -r name; do
+ [[ $name != ${product}-*_${arch}.deb ]] || has_deb=1
+ done <<< "$names"
+ [ "$has_deb" = 1 ] || complete=0
done
[ "$complete" = 0 ] || chosen[$product]=$run_id
done
@@ -98,7 +101,7 @@ jobs:
echo "::warning::$product has no complete master build left; the suite keeps whatever version it already holds."
continue
fi
- gh run download -R "$GITHUB_REPOSITORY" "$run_id" -p "${product}_*.deb" -D debs
+ ./scripts/gha-artifact-download.sh "$GITHUB_REPOSITORY" "$run_id" "${product}-*.deb" debs
echo "$product: collected from run $run_id ($(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$run_id" --jq .head_sha))"
collected=1
done
diff --git a/.github/workflows/build-products.yaml b/.github/workflows/build-products.yaml
index 2d58b5444b..c0e4d305ec 100644
--- a/.github/workflows/build-products.yaml
+++ b/.github/workflows/build-products.yaml
@@ -197,12 +197,13 @@ jobs:
- name: Package StartOS
if: needs.changes.outputs.start-os == 'true'
- run: make compiled-${{ matrix.arch }}.tar
+ run: make compiled-${{ matrix.arch }}.tar.gz
+ # Uploaded as-is: a zipped artifact drops the binaries' execute bits.
- if: needs.changes.outputs.start-os == 'true'
uses: actions/upload-artifact@v7
with:
- name: compiled-${{ matrix.arch }}.tar
- path: compiled-${{ matrix.arch }}.tar
+ path: compiled-${{ matrix.arch }}.tar.gz
+ archive: false
retention-days: 1
- name: Package start-cli
@@ -211,8 +212,8 @@ jobs:
- if: needs.changes.outputs.start-cli == 'true'
uses: actions/upload-artifact@v7
with:
- name: start-cli_${{ matrix.arch }}.deb
path: results/start-cli-*_${{ matrix.arch }}.deb
+ archive: false
retention-days: 14
- if: needs.changes.outputs.start-cli == 'true'
uses: actions/upload-artifact@v7
@@ -227,8 +228,8 @@ jobs:
- if: needs.changes.outputs.start-registry == 'true'
uses: actions/upload-artifact@v7
with:
- name: start-registry_${{ matrix.arch }}.deb
path: results/start-registry-*_${{ matrix.arch }}.deb
+ archive: false
retention-days: 14
- name: Package start-tunnel
@@ -237,8 +238,8 @@ jobs:
- if: needs.changes.outputs.start-tunnel == 'true'
uses: actions/upload-artifact@v7
with:
- name: start-tunnel_${{ matrix.arch }}.deb
path: results/start-tunnel-*_${{ matrix.arch }}.deb
+ archive: false
retention-days: 14
cli-macos:
@@ -270,7 +271,8 @@ jobs:
registry-image:
name: Create Docker Image
needs: [changes, build]
- if: ${{ !cancelled() && needs.changes.outputs.start-registry == 'true' && needs.build.result == 'success' }}
+ # Pushes to ghcr.io/start9labs, which only Start9's org can do.
+ if: ${{ !cancelled() && needs.changes.outputs.start-registry == 'true' && needs.build.result == 'success' && github.repository_owner == 'Start9Labs' }}
env:
PUSH_IMAGE: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
permissions:
@@ -304,7 +306,8 @@ jobs:
- name: Download debian package
uses: actions/download-artifact@v8
with:
- pattern: start-registry_*.deb
+ pattern: start-registry-*.deb
+ merge-multiple: true
- name: Map matrix.arch to docker platform
run: |
@@ -355,21 +358,73 @@ jobs:
EOF
+ # The container-runtime rootfs runs target-architecture code, so each
+ # architecture's is built once, on a native runner, for every image that
+ # this run or its publish builds.
+ rootfs:
+ name: Container runtime (${{ matrix.arch }})
+ needs: [changes, build]
+ if: >-
+ !cancelled() && needs.build.result == 'success'
+ && needs.changes.outputs.start-os == 'true'
+ && (needs.changes.outputs.channel != '' || github.event_name != 'pull_request' || needs.changes.outputs.os-image == 'true')
+ strategy:
+ fail-fast: false
+ matrix:
+ arch: ${{ fromJson(needs.changes.outputs.arches) }}
+ runs-on: >-
+ ${{
+ fromJson('{
+ "x86_64": "ubuntu-latest",
+ "aarch64": "ubuntu-24.04-arm",
+ "riscv64": "ubuntu-24.04-riscv"
+ }')[matrix.arch]
+ }}
+ permissions:
+ contents: read
+ actions: read
+ env:
+ ARCH: ${{ matrix.arch }}
+ PLATFORM: ${{ matrix.arch }}
+ steps:
+ - uses: actions/checkout@v6
+
+ # Precedes every JavaScript action after checkout.
+ - name: Update RISC-V action runtime
+ if: ${{ matrix.arch == 'riscv64' }}
+ uses: ./.github/actions/riscv-action-runtime
+ with:
+ nodejs-version: ${{ env.NODEJS_VERSION }}
+
+ - uses: ./.github/actions/use-compiled-artifacts
+ with:
+ arch: ${{ matrix.arch }}
+ run-id: ${{ github.run_id }}
+
+ - name: Build container runtime rootfs
+ run: make projects/start-os/container-runtime/rootfs.${{ matrix.arch }}.squashfs
+
+ - uses: actions/upload-artifact@v7
+ with:
+ path: projects/start-os/container-runtime/rootfs.${{ matrix.arch }}.squashfs
+ archive: false
+ retention-days: 1
+
# A build that does not publish checks the images here: every push outside
# master, a dispatch without a channel, and a pull request that touches
# image assembly. A publishing build's images are built by startos-iso.yaml.
image:
name: Image (${{ matrix.platform }})
- needs: [changes, build]
+ needs: [changes, build, rootfs]
if: >-
- !cancelled() && needs.build.result == 'success'
+ !cancelled() && needs.rootfs.result == 'success'
&& needs.changes.outputs.start-os == 'true' && needs.changes.outputs.channel == ''
&& (github.event_name != 'pull_request' || needs.changes.outputs.os-image == 'true')
strategy:
fail-fast: false
matrix:
platform: ${{ fromJson(needs.changes.outputs.platforms) }}
- # Downloading this run's compiled-.tar by run id needs `actions: read`.
+ # Downloading this run's compiled tarball and rootfs by run id needs `actions: read`.
permissions:
contents: read
actions: read
@@ -381,8 +436,8 @@ jobs:
publish:
name: Publish StartOS
- needs: [changes, build]
- if: ${{ !cancelled() && needs.build.result == 'success' && needs.changes.outputs.channel != '' }}
+ needs: [changes, build, rootfs]
+ if: ${{ !cancelled() && needs.rootfs.result == 'success' && needs.changes.outputs.channel != '' }}
runs-on: ubuntu-latest
permissions:
actions: write
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7e20695a40..f4b336d878 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -120,5 +120,5 @@ jobs:
uses: Start9Labs/start-technologies/.github/actions/upload-each@master
with:
pattern: '*.s9pk'
+ archive: false
retention-days: 14
- compression-level: 0
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 186f313406..39b00fd8d6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,11 +12,17 @@ on:
type: boolean
default: false
RELEASE_REGISTRY:
- description: 'The registry to publish to'
+ description: "The registry to publish to. Defaults to the caller's RELEASE_REGISTRY variable."
type: string
+ default: ${{ vars.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL:
- description: 'S3 base URL for package uploads (e.g. https://bucket.region.digitaloceanspaces.com)'
+ description: "S3 base URL for package uploads (e.g. https://bucket.region.digitaloceanspaces.com). Defaults to the caller's S3_S9PKS_BASE_URL variable."
type: string
+ default: ${{ vars.S3_S9PKS_BASE_URL }}
+ REGISTRY_PROXY:
+ description: "Proxy URL start-cli uses to reach the registries, e.g. socks5h://proxy.example:9050 for .onion registries. The proxy must already be reachable from the runner. Defaults to the caller's REGISTRY_PROXY variable."
+ type: string
+ default: ${{ vars.REGISTRY_PROXY }}
secrets:
DEV_KEY:
description: 'Developer signing key'
@@ -137,16 +143,13 @@ jobs:
with:
target: ${{ matrix.target }}
- - name: Upload s9pks for Publish stage
- uses: actions/upload-artifact@v7
+ - name: Upload each s9pk as its own artifact
+ uses: Start9Labs/start-technologies/.github/actions/upload-each@master
with:
- # `default` covers the fallback single-entry case where matrix.target
- # is empty (package not yet on the new s9pk.mk).
- name: build-${{ matrix.target || 'default' }}
- path: ./*.s9pk
+ pattern: '*.s9pk'
+ archive: false
if-no-files-found: error
- compression-level: 0
- retention-days: 1
+ retention-days: 14
Publish:
needs: BuildMatrix
@@ -157,6 +160,11 @@ jobs:
- name: Setup publish environment
uses: Start9Labs/start-technologies/.github/actions/setup-publish-env@master
+ - name: Configure registry proxy
+ uses: Start9Labs/start-technologies/.github/actions/configure-registry-proxy@master
+ with:
+ proxy: ${{ inputs.REGISTRY_PROXY }}
+
- name: Checkout services repository
uses: actions/checkout@v6
with:
@@ -172,10 +180,10 @@ jobs:
printf '%s' "${{ secrets.DEV_KEY }}" > ~/.startos/developer.key.pem
shell: bash
+ # BuildMatrix's s9pks are the run's only artifacts.
- name: Collect s9pks from BuildMatrix
uses: actions/download-artifact@v8
with:
- pattern: build-*
merge-multiple: true
path: .
@@ -368,10 +376,3 @@ jobs:
start-cli --registry "$REGISTRY" registry package add "$s9pk" --url "${GH_URL}/${s9pk}"
done
shell: bash
-
- - name: Upload each s9pk as its own artifact
- uses: Start9Labs/start-technologies/.github/actions/upload-each@master
- with:
- pattern: '*.s9pk'
- retention-days: 14
- compression-level: 0
diff --git a/.github/workflows/start-wrt.yaml b/.github/workflows/start-wrt.yaml
index 4ca7842188..7a11df5c6e 100644
--- a/.github/workflows/start-wrt.yaml
+++ b/.github/workflows/start-wrt.yaml
@@ -40,6 +40,8 @@ concurrency:
env:
NODEJS_VERSION: '24.17.0'
+ # Compiling the riscv64 binary outgrows the RAM of runners without swap.
+ BUILD_SWAP_SIZE: 8G
jobs:
changes:
@@ -78,6 +80,7 @@ jobs:
- uses: ./.github/actions/setup-build
with:
nodejs-version: ${{ env.NODEJS_VERSION }}
+ swap-size: ${{ env.BUILD_SWAP_SIZE }}
- name: Make start-wrt
run: make start-wrt
@@ -133,6 +136,7 @@ jobs:
- uses: ./.github/actions/setup-build
with:
nodejs-version: ${{ env.NODEJS_VERSION }}
+ swap-size: ${{ env.BUILD_SWAP_SIZE }}
# Host deps for the OpenWrt build, restored from the old standalone
# repo's setup-build action (the monorepo's shared setup-build serves
@@ -165,13 +169,17 @@ jobs:
- name: Build image
run: make start-wrt-image
- - uses: actions/upload-artifact@v7
+ - name: Verify the image trust store
+ run: make start-wrt-ca-test
+
+ # Mirrors build.mk's STARTWRT_BASENAME: the image rule renames the raw
+ # OpenWrt outputs to startwrt--_spacemit-k1-*.img.gz.
+ - uses: ./.github/actions/upload-each
with:
- name: startwrt-openwrt-image
- # Mirrors build.mk's STARTWRT_BASENAME: the image rule renames the raw
- # OpenWrt outputs to startwrt--_spacemit-k1-*.
- path: results/startwrt-*
+ pattern: results/startwrt-*.img.gz
+ archive: false
retention-days: 14
+ if-no-files-found: error
# Publish path: upload the built images to shared S3 (the registry CDN serves
# them from here) and register + index the version into the beta registry,
@@ -247,12 +255,20 @@ jobs:
run: |
CHANGELOG_REF="${{ github.sha }}" ./scripts/manage-release.sh registry-notes start-wrt > "$RUNNER_TEMP/release-notes.json"
- - name: Download image artifact
+ - name: Download images
uses: actions/download-artifact@v8
with:
- name: startwrt-openwrt-image
+ pattern: startwrt-*.img.gz
+ merge-multiple: true
path: artifacts/
+ - name: Check downloaded images
+ working-directory: artifacts
+ run: |
+ for file in startwrt-*-sdcard.img.gz startwrt-*-sysupgrade.img.gz; do
+ [ -f "$file" ] || { echo "::error::No $file artifact in this run"; exit 1; }
+ done
+
- name: Install start-cli
uses: Start9Labs/start-technologies/.github/actions/install-start-cli@master
with:
diff --git a/.github/workflows/startos-image.yaml b/.github/workflows/startos-image.yaml
index 72fa79a815..5c904fe58e 100644
--- a/.github/workflows/startos-image.yaml
+++ b/.github/workflows/startos-image.yaml
@@ -17,7 +17,7 @@ on:
type: string
required: true
compiled-run-id:
- description: Run holding compiled-.tar; empty for this run
+ description: Run holding compiled-.tar.gz and rootfs..squashfs; empty for this run
type: string
default: ''
commit:
@@ -87,76 +87,39 @@ jobs:
- name: Ensure hostedtoolcache exists
run: sudo mkdir -p /opt/hostedtoolcache && sudo chown "$USER:$USER" /opt/hostedtoolcache
- # Actions use the runner's bundled Node, not the Node on GITHUB_PATH.
- # V8's background GC threads corrupt the heap on these runners during
- # large artifact transfers, so the action host runs `--single-threaded`.
- # Its wrapper is bash; dash drops hyphenated `INPUT_*` variables.
+ - uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.commit || github.sha }}
+ fetch-depth: 0
+
+ # Precedes every JavaScript action after checkout.
- name: Update RISC-V action runtime
if: ${{ env.ARCH == 'riscv64' }}
- run: |
- set -euo pipefail
- worker="$(readlink -f "/proc/$PPID/exe")"
- test "$(basename "$worker")" = Runner.Worker
- runner_node="$(dirname "$worker")/../externals/node24/bin/node"
- echo "Bundled action runtime: $("$runner_node" --version)"
- base="https://unofficial-builds.nodejs.org/download/release/v${NODEJS_VERSION}"
- tarball="node-v${NODEJS_VERSION}-linux-riscv64.tar.xz"
- cd "$RUNNER_TEMP"
- curl -fsSLO "$base/$tarball"
- curl -fsSL "$base/SHASUMS256.txt" | grep " $tarball\$" | sha256sum -c -
- tar -xJf "$tarball"
- node_dir="$RUNNER_TEMP/${tarball%.tar.xz}"
- test "$("$node_dir/bin/node" --version)" = "v${NODEJS_VERSION}"
- "$node_dir/bin/node" --single-threaded -e 'require("node:crypto").createHash("sha256").update("action-runtime").digest(); console.log(process.versions)'
- install -m 755 "$node_dir/bin/node" "$runner_node.real.next"
- mv -f "$runner_node.real.next" "$runner_node.real"
- printf '#!/bin/bash\nexec "%s" --single-threaded "$@"\n' "$runner_node.real" > "$runner_node.next"
- chmod 755 "$runner_node.next"
- mv -f "$runner_node.next" "$runner_node"
- echo "Updated action runtime: $("$runner_node" --version)"
- echo "$node_dir/bin" >> "$GITHUB_PATH"
+ uses: ./.github/actions/riscv-action-runtime
+ with:
+ nodejs-version: ${{ env.NODEJS_VERSION }}
- name: Set up docker QEMU
uses: docker/setup-qemu-action@v4
- - uses: actions/checkout@v6
- with:
- ref: ${{ inputs.commit || github.sha }}
- fetch-depth: 0
-
- name: Free space
run: .github/actions/setup-build/free-disk-space.sh
- - name: Download compiled artifacts
+ - uses: ./.github/actions/use-compiled-artifacts
+ with:
+ arch: ${{ env.ARCH }}
+ run-id: ${{ inputs.compiled-run-id || github.run_id }}
+
+ - name: Download container runtime rootfs
uses: actions/download-artifact@v8
with:
- name: compiled-${{ env.ARCH }}.tar
+ name: rootfs.${{ env.ARCH }}.squashfs
+ path: projects/start-os/container-runtime
run-id: ${{ inputs.compiled-run-id || github.run_id }}
github-token: ${{ github.token }}
- - name: Extract compiled artifacts
- run: tar -xvf compiled-${{ env.ARCH }}.tar
-
- - name: Prevent rebuild of compiled artifacts
- run: |
- mkdir -p node_modules
- mkdir -p projects/start-os/web/dist/raw
- mkdir -p projects/start-tunnel/web/dist/raw
- mkdir -p shared-libs/crates/start-core/bindings
- mkdir -p shared-libs/ts-modules/start-core/lib/osBindings
- mkdir -p projects/start-os/container-runtime/node_modules
- mkdir -p projects/start-os/container-runtime/dist
- mkdir -p projects/start-os/container-runtime/dist/node_modules
- mkdir -p projects/start-sdk/dist
- mkdir -p shared-libs/ts-modules/start-core/dist
- mkdir -p shared-libs/crates/patch-db/client/node_modules
- mkdir -p shared-libs/crates/patch-db/client/dist
- mkdir -p .angular
- mkdir -p projects/start-os/web/dist/raw/ui
- mkdir -p projects/start-os/web/dist/raw/setup-wizard
- mkdir -p projects/start-os/web/dist/static/ui
- mkdir -p projects/start-os/web/dist/static/setup-wizard
- make -t compiled-${{ env.ARCH }}.tar
+ - name: Prevent rebuild of the rootfs
+ run: make -t projects/start-os/container-runtime/rootfs.${{ env.ARCH }}.squashfs
- run: git status
@@ -168,41 +131,53 @@ jobs:
run: make start-os-img
if: ${{ inputs.platform == 'raspberrypi' }}
- # Images are already compressed, so the artifacts are stored as-is.
+ - name: Compress img
+ run: gzip results/*.img
+ if: ${{ inputs.platform == 'raspberrypi' }}
+
+ - name: Archive kernel backport packages
+ uses: actions/upload-artifact@v7
+ if: ${{ inputs.platform == 'x86_64' || inputs.platform == 'aarch64' }}
+ with:
+ name: ${{ inputs.platform }}.kernel-backports
+ path: results/kernel-backports/
+ if-no-files-found: error
+ retention-days: 14
+ compression-level: 0
+
+ # Release tooling in scripts/ finds these artifacts by file name.
- uses: actions/upload-artifact@v7
with:
- name: ${{ inputs.platform }}.squashfs
path: results/*.squashfs
+ archive: false
retention-days: 14
- compression-level: 0
- uses: actions/upload-artifact@v7
with:
- name: ${{ inputs.platform }}.iso
path: results/*.iso
+ archive: false
retention-days: 14
- compression-level: 0
if: ${{ inputs.platform != 'raspberrypi' }}
- uses: actions/upload-artifact@v7
with:
- name: ${{ inputs.platform }}.img
- path: results/*.img
+ path: results/*.img.gz
+ archive: false
retention-days: 14
- compression-level: 0
if: ${{ inputs.platform == 'raspberrypi' }}
# The OTA payload legacy (0.3.5.1) boxes pull via their frozen rsync updater:
# the 0.4.0 base squashfs (built just above) repackaged onto the published
# 0.3.5.1 rootfs. Pure repackaging (no OS compile), so it runs on x86_64 for
# every platform. Only platforms that shipped in 0.3.5.1 (no nvidia/riscv);
- # raspberrypi requires a reflash (#3443). The .migration.squashfs
+ # raspberrypi requires a reflash (#3443). The startos-*_.migration.squashfs
# artifact is what ops publishes to the frozen registry as the version's OTA
# image. See projects/start-os/build/assemble-migration-payload.sh and PR #3399.
migration:
name: Migration Image
needs: [build]
- if: contains(fromJson('["x86_64", "x86_64-nonfree", "aarch64", "aarch64-nonfree"]'), inputs.platform)
+ # Downloads a release of the previous version, which only Start9's repository has.
+ if: github.repository_owner == 'Start9Labs' && contains(fromJson('["x86_64", "x86_64-nonfree", "aarch64", "aarch64-nonfree"]'), inputs.platform)
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
@@ -217,7 +192,8 @@ jobs:
- name: Fetch the 0.4.0 base squashfs
uses: actions/download-artifact@v8
with:
- name: ${{ inputs.platform }}.squashfs
+ pattern: startos-*_${{ inputs.platform }}.squashfs
+ merge-multiple: true
path: base-new
- name: Fetch the legacy (0.3.5.1) base image
@@ -251,8 +227,8 @@ jobs:
- uses: actions/upload-artifact@v7
with:
- name: ${{ inputs.platform }}.migration.squashfs
path: results/*.migration.squashfs
+ archive: false
retention-days: 14
deploy:
@@ -283,25 +259,20 @@ jobs:
sparse-checkout: scripts/s3-put-once.sh
sparse-checkout-cone-mode: false
- - name: Download squashfs
- uses: actions/download-artifact@v8
- with:
- name: ${{ inputs.platform }}.squashfs
- path: artifacts/
-
- - name: Download ISO
- if: ${{ inputs.platform != 'raspberrypi' }}
+ - name: Download images
uses: actions/download-artifact@v8
with:
- name: ${{ inputs.platform }}.iso
+ pattern: startos-*_${{ inputs.platform }}.{squashfs,iso,img.gz}
+ merge-multiple: true
path: artifacts/
- - name: Download IMG
- if: ${{ inputs.platform == 'raspberrypi' }}
- uses: actions/download-artifact@v8
- with:
- name: ${{ inputs.platform }}.img
- path: artifacts/
+ - name: Check downloaded images
+ working-directory: artifacts
+ run: |
+ image=$([ "$PLATFORM" = raspberrypi ] && echo img.gz || echo iso)
+ for file in startos-*_"$PLATFORM".squashfs startos-*_"$PLATFORM".$image; do
+ [ -f "$file" ] || { echo "::error::No $file artifact in this run"; exit 1; }
+ done
- name: Install start-cli
uses: Start9Labs/start-technologies/.github/actions/install-start-cli@master
@@ -330,7 +301,7 @@ jobs:
run: |
set -uo pipefail
pids=()
- for file in *_"$PLATFORM".squashfs *_"$PLATFORM".iso *_"$PLATFORM".img; do
+ for file in *_"$PLATFORM".squashfs *_"$PLATFORM".iso *_"$PLATFORM".img.gz; do
[ -f "$file" ] || continue
"$GITHUB_WORKSPACE/scripts/s3-put-once.sh" "$file" "$S3_BUCKET/v$VERSION/$file" &
pids+=("$!")
@@ -351,8 +322,15 @@ jobs:
registered_commit() {
jq -er --arg version "$VERSION" '.versions | objects | .[$version].gitHash // ""' <<<"$1"
}
+ # The registry slot a file fills.
+ slot() {
+ case "$1" in
+ *.img.gz) echo img ;;
+ *) echo "${1##*.}" ;;
+ esac
+ }
files=()
- for file in *_"$PLATFORM".squashfs *_"$PLATFORM".iso *_"$PLATFORM".img; do
+ for file in *_"$PLATFORM".squashfs *_"$PLATFORM".iso *_"$PLATFORM".img.gz; do
[ -f "$file" ] && files+=("$file")
done
@@ -368,16 +346,22 @@ jobs:
index() {
if [ "$FORCE_OVERWRITE" = true ]; then
- start-cli --registry="$REGISTRY" registry os asset remove "${1##*.}" "$VERSION" "$PLATFORM" || return 1
+ start-cli --registry="$REGISTRY" registry os asset remove "$(slot "$1")" "$VERSION" "$PLATFORM" || return 1
+ fi
+ # `asset add` takes the slot from the file extension. The img is
+ # indexed gzipped, through a hardlink named for its slot.
+ local indexed=$1 attempt
+ if [ "$(slot "$1")" = img ]; then
+ indexed=${1%.gz}
+ ln -f "$1" "$indexed" || return 1
fi
# Adding a file that is already indexed is a no-op, so a failure retries.
- local attempt
for attempt in 1 2 3; do
echo "Indexing $1 for platform $PLATFORM (attempt $attempt)..."
start-cli --registry="$REGISTRY" registry os asset add \
--platform="$PLATFORM" \
--version="$VERSION" \
- "$1" \
+ "$indexed" \
"$S3_CDN/v$VERSION/$1" && return 0
[ "$attempt" -eq 3 ] || sleep $((attempt * 30))
done
@@ -401,11 +385,11 @@ jobs:
fi
if [ "$commit" != "$COMMIT" ]; then
for file in "${files[@]}"; do
- jq -e --arg version "$VERSION" --arg kind "${file##*.}" --arg platform "$PLATFORM" \
+ jq -e --arg version "$VERSION" --arg kind "$(slot "$file")" --arg platform "$PLATFORM" \
--arg url "$S3_CDN/v$VERSION/$file" \
'.versions[$version][$kind][$platform].urls // [] | any(.[]; . == $url)' \
<<<"$index_json" > /dev/null || continue
- start-cli --registry="$REGISTRY" registry os asset remove "${file##*.}" "$VERSION" "$PLATFORM" \
+ start-cli --registry="$REGISTRY" registry os asset remove "$(slot "$file")" "$VERSION" "$PLATFORM" \
|| echo "::error::could not remove $file from v$VERSION in $REGISTRY"
done
echo "::error::v$VERSION in $REGISTRY was registered for ${commit:-no commit} while $PLATFORM indexed; this leg's images were withdrawn."
@@ -417,7 +401,7 @@ jobs:
working-directory: artifacts
run: |
shopt -s nullglob
- printf '%s\n' *_"$PLATFORM".squashfs *_"$PLATFORM".iso *_"$PLATFORM".img > "$RUNNER_TEMP/published-$PLATFORM.txt"
+ printf '%s\n' *_"$PLATFORM".squashfs *_"$PLATFORM".iso *_"$PLATFORM".img.gz > "$RUNNER_TEMP/published-$PLATFORM.txt"
- uses: actions/upload-artifact@v7
with:
diff --git a/.github/workflows/startos-iso.yaml b/.github/workflows/startos-iso.yaml
index 527f000065..c51cee0a51 100644
--- a/.github/workflows/startos-iso.yaml
+++ b/.github/workflows/startos-iso.yaml
@@ -10,7 +10,7 @@ on:
workflow_dispatch:
inputs:
build-run-id:
- description: build-products.yaml run whose compiled-.tar artifacts to publish
+ description: build-products.yaml run whose compiled-.tar.gz artifacts to publish
type: string
required: true
commit:
@@ -253,10 +253,10 @@ jobs:
https://alpha-registry-x.start9.com
# Spares every upload that is not indexed yet: another run's deploy
# between its upload and its index, and a hand upload into a version
- # directory that is already indexed — manage-release.sh's push-gz, or
- # the per-platform hotfix that leaves one version legitimately
- # referencing two commits. Hand uploads are interactive, so give it
- # days. Orphans are permanent; waiting only costs storage.
+ # directory that is already indexed, such as the per-platform hotfix
+ # that leaves one version legitimately referencing two commits. Hand
+ # uploads are interactive, so give it days. Orphans are permanent;
+ # waiting only costs storage.
MIN_AGE_DAYS: 14
run: |
set -euo pipefail
diff --git a/.github/workflows/tagAndRelease.yml b/.github/workflows/tagAndRelease.yml
index 238e445375..651070f12c 100644
--- a/.github/workflows/tagAndRelease.yml
+++ b/.github/workflows/tagAndRelease.yml
@@ -4,19 +4,25 @@ on:
workflow_call:
inputs:
REFERENCE_REGISTRY:
- description: 'Registry where published versions are permanent (used to check if a version is already taken)'
+ description: "Registry where published versions are permanent (used to check if a version is already taken). Defaults to the caller's REFERENCE_REGISTRY variable."
type: string
- required: true
+ default: ${{ vars.REFERENCE_REGISTRY }}
FREE_DISK_SPACE:
description: 'Free up disk space before building'
type: boolean
default: false
RELEASE_REGISTRY:
- description: 'Test registry to publish to'
+ description: "Test registry to publish to. Defaults to the caller's RELEASE_REGISTRY variable."
type: string
+ default: ${{ vars.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL:
- description: 'S3 base URL for package uploads'
+ description: "S3 base URL for package uploads. Defaults to the caller's S3_S9PKS_BASE_URL variable."
+ type: string
+ default: ${{ vars.S3_S9PKS_BASE_URL }}
+ REGISTRY_PROXY:
+ description: "Proxy URL start-cli uses to reach the registries, e.g. socks5h://proxy.example:9050 for .onion registries. The proxy must already be reachable from the runner. Defaults to the caller's REGISTRY_PROXY variable."
type: string
+ default: ${{ vars.REGISTRY_PROXY }}
secrets:
DEV_KEY:
description: 'Developer signing key'
@@ -43,6 +49,11 @@ jobs:
- name: Install start-cli
uses: Start9Labs/start-technologies/.github/actions/install-start-cli@master
+ - name: Configure registry proxy
+ uses: Start9Labs/start-technologies/.github/actions/configure-registry-proxy@master
+ with:
+ proxy: ${{ inputs.REGISTRY_PROXY }}
+
- name: Extract package ID and version
id: extract
uses: Start9Labs/start-technologies/.github/actions/extract-version@master
@@ -53,6 +64,10 @@ jobs:
PACKAGE_ID="${{ steps.extract.outputs.package_id }}"
VERSION="${{ steps.extract.outputs.version }}"
REFERENCE_REGISTRY="${{ inputs.REFERENCE_REGISTRY }}"
+ if [ -z "$REFERENCE_REGISTRY" ]; then
+ echo "::error::No reference registry: set the REFERENCE_REGISTRY variable or pass the input."
+ exit 1
+ fi
# hello-world is the canonical package scaffold, not a released package.
# Skipping it here lets every caller (including hello-world's own) use the
@@ -106,6 +121,7 @@ jobs:
FREE_DISK_SPACE: ${{ inputs.FREE_DISK_SPACE }}
RELEASE_REGISTRY: ${{ inputs.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL: ${{ inputs.S3_S9PKS_BASE_URL }}
+ REGISTRY_PROXY: ${{ inputs.REGISTRY_PROXY }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
diff --git a/.gitignore b/.gitignore
index 7ffe380b5e..a6f09c5130 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,7 +17,7 @@ secrets.db
/results
/dpkg-workdir
/compiled.tar
-/compiled-*.tar
+/compiled-*.tar.gz
/projects/start-os/build/firmware
/projects/start-os/build/lib/firmware
tmp
diff --git a/AGENTS.md b/AGENTS.md
index 44e6f587f3..1b726663af 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -211,11 +211,12 @@ the source of truth.
## Releases
+- **Assess kernel security before OS releases.** The release author compares each image's installed kernel, including vendor patches, with current stable/vendor security releases and outstanding advisories. Review every fixed-version kernel source through that assessment; an upstream source commit or accepted source upload is not an installable vendor package. Kernel security updates take priority over NVIDIA compatibility: test candidate releases on NVIDIA hardware before shipping, and report regressions rather than freezing a vulnerable kernel.
- **Changelog and Highlights compilation is shared by tag CI, builds, and the release script.** `docs-sync-on-tag.yml` uses the `docs-publish` App to compile tagged fragments under `## []`, write the generated history to `master`, archive each release's published notes there, and consume only fragments unchanged since the tag. It retains the generated history and every locale's notes on `live-docs`. Re-running an unchanged tag is idempotent; changing an already-compiled release's fragments fails rather than overwriting history. `manage-release.sh` renders the same changelog from the commit being tagged, embeds that version's changelog section in an expandable GitHub release section, and attaches the full history as `CHANGELOG.md`. Releases stay in draft until the tag exists; promotion follows publication. A retry resumes a draft missing its notes or changelog instead of treating the release's existence as completion. The shared Node compiler formats generated Markdown with the root `package.json`'s pinned Prettier and `.prettierrc.json` before committing history or attaching it.
- **Cutting `/v` is what advances `live-docs` for that product.** StartOS RC tags neither publish books nor consume changelog fragments. [`.github/workflows/docs-sync-on-tag.yml`](.github/workflows/docs-sync-on-tag.yml) takes the tagged tree **whole**, then puts every _other_ `projects/*` back on the release it is on. So a tag moves its own project, the shared libraries beneath it (`shared-libs/`), and the repo root — and nothing another product owns. The shared `projects/start-docs/` site tree rides along only with a product that ships a book, but in `versions.conf` a tag speaks only for its own book's line: other products keep the label `live-docs` publishes, and StartOS and StartWRT tags derive their own from the version (`start-wrt/v1.3.0` publishes under `1.3.x`). The `start-tunnel` and `packaging` lines are hand-maintained and must name the label you want **before** you tag. A bookless release (start-cli, start-registry) still advances its own project and the shared tree; it just leaves the site alone, so no deploy fires. Nothing moves backwards: a tag behind a release already synced — a deb release adopts the commit alpha built, often older than a tag cut before it — still advances its own project but leaves the shared trees where the newer release put them, and a tag behind its own product's last release publishes its book alone.
- **Cut every release with [`scripts/manage-release.sh`](scripts/manage-release.sh)** — `./scripts/manage-release.sh release ` (`start-os`, `start-cli`, `start-tunnel`, `start-registry`, `start-sdk`, `start-wrt`); `--help` lists the individual subcommands and env vars. A product's version is read from its manifest (`Cargo.toml`, or `package.json` for the SDK), and its git tag / GitHub release is `/v`. **StartOS is the exception:** its version carries a revision segment SemVer cannot express (`0.4.0.1`), so the **root `package.json`** holds it and `projects/start-os/Cargo.toml` carries only a `0.4.0-rev.1` label — never a comparand, since a SemVer prerelease sorts _below_ its release. Read it via `build/env/version.sh`; see [`shared-libs/crates/start-core/VERSION_BUMP.md`](shared-libs/crates/start-core/VERSION_BUMP.md).
- **Release notes are picked, edited, and translated by the release manager, then published from the GitHub release.** `create-gh-release` runs before `tag`. It shows a checkbox picker of the release's non-security fragments for `## Highlights` (`release-notes: true` ones start checked; Tab rewords one for the notes only), compiles the choice and every `security` fragment into the framing, opens the result in `$VISUAL`, `$EDITOR`, or else `sensible-editor` (the picker's Tab uses the same editor), translates the edited English into every locale in `shared-libs/crates/start-core/locales/release-notes.json` with the `claude` CLI, formats every locale with the pinned Prettier, and drafts the GitHub release at the commit being tagged with the locale map attached as `release-notes.json`. That asset is the single source for the notes: the GitHub body shows its English, `index` writes it to the registry, and tag CI (`changelog.mjs sync`) archives every locale onto `master` as `projects//release-notes/[.].md`, so it must exist before the tag is pushed. Re-running `create-gh-release` starts from the uploaded notes and translates again only when the English changed. A release or RC after an RC of the same version starts from that RC's notes, and only fragments added or changed since are offered or added; they are inserted into the matching existing section. `publish-gh-release` takes the draft public once the tag exists. English is the editable source; generated translations bypass the editor. `NO_TRANSLATE=1` publishes English only. `pre-check` fails when `claude` is missing and `NO_TRANSLATE` is unset.
-- **StartOS prereleases promote the image alpha already built.** `./scripts/manage-release.sh pre-release start-os` promotes alpha into beta and publishes a GitHub prerelease with a git-only `start-os/v-rc.N` tag; the OS image and registry version remain ``. Every invocation allocates the RC number after the highest RC tag for that version, including another invocation for the same image commit or after a partial failure; a failure before the RC tag is pushed leaves its draft to the next invocation, which reuses that number. Unlike stable `release`, `pre-release` starts a new RC rather than resuming the previous one. The registry's `gitHash` identifies the image commit to tag; a missing hash blocks release rather than guessing from HEAD. `STARTOS_ALPHA_REGISTRY` selects alpha, while `STARTOS_SOURCE_REGISTRY` remains beta (the source for stable release and destination for prerelease). Each prerelease replaces the beta listing for that version by removing its previous entry before promotion. OS images are identical for a given commit: subsequent releases and RCs reuse a published same-version, same-commit prerelease's generated download links, checksums, and signature archive without staging images, uploading gzip copies, or re-signing. Reuse requires its notes, changelog, signature archive, and generated download section; otherwise the ordinary asset flow runs. Notes still receive a final edit, and tagging, GitHub publication, and registry promotion still run. `FORCE=1` runs the ordinary asset flow. Security metadata comes from security changelog fragments owned by that release, including fragments omitted from release notes; metadata refresh preserves the indexed image commit.
+- **StartOS prereleases promote the image alpha already built.** `./scripts/manage-release.sh pre-release start-os` promotes alpha into beta and publishes a GitHub prerelease with a git-only `start-os/v-rc.N` tag; the OS image and registry version remain ``. Every invocation allocates the RC number after the highest RC tag for that version, including another invocation for the same image commit or after a partial failure; a failure before the RC tag is pushed leaves its draft to the next invocation, which reuses that number. Unlike stable `release`, `pre-release` starts a new RC rather than resuming the previous one. The registry's `gitHash` identifies the image commit to tag; a missing hash blocks release rather than guessing from HEAD. `STARTOS_ALPHA_REGISTRY` selects alpha, while `STARTOS_SOURCE_REGISTRY` remains beta (the source for stable release and destination for prerelease). Each prerelease replaces the beta listing for that version by removing its previous entry before promotion. OS images are identical for a given commit: subsequent releases and RCs reuse a published same-version, same-commit prerelease's generated download links, checksums, and signature archive without staging images or re-signing. Reuse requires its notes, changelog, signature archive, and generated download section; otherwise the ordinary asset flow runs. Notes still receive a final edit, and tagging, GitHub publication, and registry promotion still run. `FORCE=1` runs the ordinary asset flow. Security metadata comes from security changelog fragments owned by that release, including fragments omitted from release notes; metadata refresh preserves the indexed image commit.
- **Release-note files are optional notices, not summaries.** Do not maintain one-sentence release descriptions. Create `projects//release-notes/.md` only for necessary `## Important` notices; otherwise omit it. Important contains actions or warnings for people upgrading: who is affected, what they must do, and when. Put pre-update actions in the pre-update companion instead. Internal rollout prerequisites, publisher coordination, maintainer signing operations, migration implementation details, and verification notes belong in the PR or maintainer release procedure, not Important. A preserved setting needs no notice unless the user must act. `node scripts/changelog.mjs notes projects/` compiles Highlights from the fragments the picker checks by default and Security from every `security` fragment, sorted by filename within each section, before the notices; alpha registry notes and the StartOS image's welcome use it. Highlights is a short list of the release's most notable user benefits, not a second changelog: uncheck routine entries in the picker. Section titles come from `shared-libs/crates/start-core/locales/release-notes.json`. `--ref ` reads the tagged snapshot; fetch tags before preparing a build. Already-released notes remain as published. The compiler accepts the legacy `user-facing` field only when reading git snapshots, preserving their original selection; historical tags without selection metadata retain their curated notes. After an update, the StartOS welcome shows the registry notes the updater saved for the installed version, in the server's locale and without the pre-update section. Without them (a sideloaded image, or an update performed by an older release), it falls back to the compiled English notes the image installs as `/usr/lib/startos/release-notes.md`.
Put pre-update instructions in optional `.pre-update.md`, headed `## ⚠️ Before You Update`. Optional `..pre-update.md` overrides it for that locale; missing or empty translations fall back to English. GitHub and registry notes include these warnings between `` and `` markers; welcome artifacts exclude them. Every locale's notes must keep the English notes' HTML comments. GitHub output and `manage-release.sh notes ` remain English. Registry notes end with a localized full-changelog link, as does the welcome. The default link opens the published GitHub release. An explicit `CHANGELOG_REF` (used by alpha) links to that ref's pending fragments, then its compiled history.
`registry-notes ` produces `{releaseNotes}` with the shared `LocaleString`: an English string without translations, otherwise a locale map including `en_US`. Registries store and promote it unchanged; current StartOS clients select locally with their existing localization pipe and accept English-only registries. Existing compatibility middleware projects English strings for known StartOS clients before 0.4.0.5 and string-only StartWRT clients. Device information, or an explicit update source version without that header, selects compatibility; headerless CLI queries without a source version retain the complete map.
@@ -362,7 +363,7 @@ before adding one. `deny.toml` encodes which licenses are accepted.
Some pairs of files mirror each other by hand — nothing enforces them, so a change to one half is incomplete until you update the other. Update both in the **same** commit:
-- **A product's build inputs in CI ↔ its `build.mk` prerequisites.** StartOS, start-cli, start-registry and start-tunnel build in `.github/workflows/build-products.yaml`, and StartWRT in `.github/workflows/start-wrt.yaml`. Each workflow's `changes` job runs `.github/scripts/classify-event.sh`, which rebuilds only the products a pull request touches, or a push changed since that workflow's last successful push build. `PRODUCTS` in `.github/scripts/changed-products.mjs` is a hand-maintained mirror of the prerequisites in each `projects//build.mk` (the project dir, `shared-libs/**` or the specific crates it pulls in, `Cargo.*`, `build/**`, `debian/**`, the web config for products with a UI, …), and records the workflow that builds each product. When you add or drop a build input in a `build.mk`, update that mirror — otherwise CI will silently stop rebuilding the product on changes that affect it. `OS_IMAGE_PATHS` in the same script carries a finer mirror: on PRs it gates the expensive **image** matrix on image-_assembly_ paths (packaging, image-recipe, systemd units, `apt/**`, shared `build/**`) — the inputs the image target pulls in _beyond_ the compiled binary. When you change what feeds the image target in `projects/start-os/build.mk` (vs. the binary, which the per-target build always covers), update that list too, or image-affecting PRs will skip image validation.
+- **A product's build inputs in CI ↔ its `build.mk` prerequisites.** StartOS, start-cli, start-registry and start-tunnel build in `.github/workflows/build-products.yaml`, and StartWRT in `.github/workflows/start-wrt.yaml`. Each workflow's `changes` job runs `.github/scripts/classify-event.sh`, which rebuilds only the products a pull request touches, or a push changed since that workflow's last successful push build. `PRODUCTS` in `.github/scripts/changed-products.mjs` is a hand-maintained mirror of the prerequisites in each `projects//build.mk` (the project dir, `shared-libs/**` or the specific crates it pulls in, `Cargo.*`, `build/**`, `debian/**`, the web config for products with a UI, …), and records the workflow that builds each product. When you add or drop a build input in a `build.mk`, update that mirror — otherwise CI will silently stop rebuilding the product on changes that affect it. `OS_IMAGE_PATHS` in the same script carries a finer mirror: on PRs it gates the expensive **image** matrix on image-_assembly_ paths (packaging, image-recipe, systemd units, the container-runtime rootfs scripts, `apt/**`, shared `build/**`) — the inputs the image target pulls in _beyond_ the compiled binary. When you change what feeds the image target in `projects/start-os/build.mk` (vs. the binary, which the per-target build always covers), update that list too, or image-affecting PRs will skip image validation.
- **Pull request retargets run through `.github/workflows/pr-retarget.yml`.** A base change is an `edited` event, but trigger-level `branches:` and `paths:` filters evaluate the new base and diff before a workflow starts. The unfiltered listener therefore calls the explicit base-sensitive set: `test`, `rust-builder`, `build-products`, and `start-wrt`; title and body edits finish in its classifier without replacing existing check conclusions. Keep each called target reusable through `workflow_call`, give its concurrency group a workflow-specific literal prefix, and leave `edited` out of its direct `pull_request:` types. `conflict-markers` remains a direct unfiltered `pull_request` listener and rescans every edit, because its `Conflict Markers` job must itself replace any stale verdict after a retarget. `live-docs-guard` listens directly too, on `pull_request_target` so a fork's PR is checked without waiting for workflow approval: it keeps its `live-docs` branch filter but takes `edited` too, since the filter sees the new base and a PR retargeted onto `live-docs` must be checked before its next push. It reads the changed paths from the API and must never check out the pull request. Grant called jobs their minimum permissions: `packages: write` belongs on the `build-products` and `rust-builder` calls, and `actions: write` on `build-products` for its StartOS publish dispatch. `build-products` confines `packages: write` to `registry-image` and `actions: write` to `publish`, with its build jobs explicitly downgraded to `contents: read`; the builder's `build` and `publish` jobs also request `packages: write` and restrict uploads to master. `.github/workflows/pr-retarget-conflict.yml` reports GitHub's native conflict verdict through its PR-numbered `Mergeability` job; the `pull_request_target` run itself supplies the pending and final check result without writing a commit status. Base changes use mergeability-specific concurrency and poll until GitHub resolves mergeability; other edits finish under a PR-numbered `Metadata edit` job with separate concurrency. When a base-change event's head or base SHA is stale, it cancels its own run so the obsolete check finishes neutral. It never replaces the separate `Conflict Markers` check, whose real head/base scan clears stale marker failures after a clean retarget. The privileged listener must never check out or execute pull request code. `.github/scripts/check-pr-retarget-workflows.py` enforces independent audited target sets, permissions, concurrency, event routing, and conflict-listener isolation.
- **start-wrt's CI publish constants ↔ `scripts/manage-release.sh`'s wrt config.** The `deploy` job in `.github/workflows/start-wrt.yaml` registers builds into the beta registry with values (registry URL, S3 CDN, platform, compat floor) and register/index commands that hand-mirror `manage-release.sh`'s `STARTWRT_*` vars and `cmd_register` (the manual fallback). Change one side, change the other.
- **StartOS release-note inputs ↔ the StartOS image.** `projects/start-os/build.mk` renders the optional framing and pending fragments for `VERSION.txt` into `/usr/lib/startos/release-notes.md`. The renderer, formatter config, shared locale catalog, optional notices, and fragments are image-assembly inputs. `version/release_notes.rs` reads the packaged file after an update when no saved registry notes match the installed version, and strips the same pre-update markers `scripts/changelog.mjs` writes. Keep `build.mk`, the StartOS entries in `.github/scripts/changed-products.mjs` (`PRODUCTS` and `OS_IMAGE_PATHS`), and `startos-iso.yaml`'s `deploy-prepare` `sparse-checkout` aligned with the renderer's inputs.
diff --git a/Cargo.lock b/Cargo.lock
index 4a02e81a10..5e52158b18 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8470,6 +8470,7 @@ dependencies = [
"qrcode",
"r3bl_tui",
"rand 0.10.3",
+ "rayon",
"rcgen",
"regex",
"reqwest",
@@ -8535,7 +8536,7 @@ dependencies = [
[[package]]
name = "start-registry"
-version = "1.6.0"
+version = "1.7.0"
dependencies = [
"mimalloc",
"start-core",
@@ -8590,7 +8591,7 @@ dependencies = [
[[package]]
name = "startwrt-core"
-version = "1.4.1"
+version = "1.5.0"
dependencies = [
"async_cell",
"axum",
diff --git a/Makefile b/Makefile
index 295fa4eac3..d09fad2a75 100644
--- a/Makefile
+++ b/Makefile
@@ -59,7 +59,7 @@ format-check:
.PHONY: release-notes-test package-ci-test
release-notes-test:
node --test scripts/tests/*-test.mjs
- bash scripts/tests/release-resume-test.sh
+ bash scripts/tests/release-images-test.sh
bash scripts/tests/apt-publish-test.sh
package-ci-test:
diff --git a/NOTICE.md b/NOTICE.md
index bf878ed1c9..59e58b4672 100644
--- a/NOTICE.md
+++ b/NOTICE.md
@@ -13,8 +13,8 @@ license and is not redistributed in this repository.
### `projects/start-wrt/openwrt-overlay/`, `projects/start-wrt/openwrt-patches/`
GPL-licensed, mostly GPL-2.0-only. Files added to, and patches against, the
-OpenWrt build tree — copyright SpaceMiT Ltd., OpenWrt.org and the Linux kernel
-contributors. Sixteen carry an explicit `SPDX-License-Identifier` header. Full
+OpenWrt build tree — copyright SpaceMiT Ltd., OpenWrt.org, the Linux kernel
+contributors and the Debian ca-certificates contributors. Sixteen carry an explicit `SPDX-License-Identifier` header. Full
text: [`projects/start-wrt/openwrt-overlay/COPYING`](projects/start-wrt/openwrt-overlay/COPYING).
Details: [`projects/start-wrt/openwrt-overlay/README.md`](projects/start-wrt/openwrt-overlay/README.md).
diff --git a/debian/publish.sh b/debian/publish.sh
index 6c3c8bf3cf..15808084af 100755
--- a/debian/publish.sh
+++ b/debian/publish.sh
@@ -121,8 +121,6 @@ sync_down "dists/${SUITE}/" "$REPO_DIR/dists/${SUITE}/"
DEB_FILES=()
for arg in "$@"; do
if [ -d "$arg" ]; then
- # `gh run download` leaves a directory per artifact, and the product
- # workflows name theirs `_.deb`.
while IFS= read -r -d '' f; do
DEB_FILES+=("$f")
done < <(find "$arg" -type f -name '*.deb' -print0)
diff --git a/projects/brochure-marketplace/src/app/services/api.fixures.ts b/projects/brochure-marketplace/src/app/services/api.fixures.ts
index 6a387c44ee..e432f31ea7 100644
--- a/projects/brochure-marketplace/src/app/services/api.fixures.ts
+++ b/projects/brochure-marketplace/src/app/services/api.fixures.ts
@@ -15,6 +15,7 @@ const mockDescription = {
export namespace Mock {
export const RegistryInfo: T.RegistryInfo = {
+ defaultLocale: 'en_US',
trustSigners: {},
name: 'Start9 Registry',
icon: REGISTRY_ICON,
@@ -164,6 +165,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
'#knots:27.1.0:0': {
@@ -202,6 +204,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -253,6 +256,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -303,6 +307,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
'#test:0.5.0:0': {
@@ -340,6 +345,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
diff --git a/projects/brochure-marketplace/src/app/services/localize.ts b/projects/brochure-marketplace/src/app/services/localize.ts
index 03c8f6a0d1..480f79f6be 100644
--- a/projects/brochure-marketplace/src/app/services/localize.ts
+++ b/projects/brochure-marketplace/src/app/services/localize.ts
@@ -13,7 +13,10 @@ import { T } from '@start9labs/start-core'
* the guarantee even if a component forgets to localize, and is the hook a
* future in-app language selector re-runs to re-localize without re-fetching.
*/
-export type Localize = (value: T.LocaleString) => string
+export type Localize = (
+ value: T.LocaleString,
+ defaultLocale?: string | null,
+) => string
export function localizeRegistryInfo(
info: T.RegistryInfo,
@@ -23,7 +26,7 @@ export function localizeRegistryInfo(
...info,
categories: mapValues(info.categories, c => ({
...c,
- name: localize(c.name),
+ name: localize(c.name, info.defaultLocale),
})),
}
}
@@ -39,7 +42,7 @@ export function localizePackageRes(
res.otherVersions &&
mapValues(res.otherVersions, v => ({
...v,
- releaseNotes: localize(v.releaseNotes),
+ releaseNotes: localize(v.releaseNotes, v.defaultLocale),
})),
}
}
@@ -51,15 +54,17 @@ function localizeVersionInfo(
return {
...v,
description: {
- short: localize(v.description.short),
- long: localize(v.description.long),
+ short: localize(v.description.short, v.defaultLocale),
+ long: localize(v.description.long, v.defaultLocale),
},
- releaseNotes: localize(v.releaseNotes),
+ releaseNotes: localize(v.releaseNotes, v.defaultLocale),
dependencyMetadata: mapValues(v.dependencyMetadata, d => ({
...d,
- title: d.title == null ? d.title : localize(d.title),
+ title: d.title == null ? d.title : localize(d.title, v.defaultLocale),
description:
- d.description == null ? d.description : localize(d.description),
+ d.description == null
+ ? d.description
+ : localize(d.description, v.defaultLocale),
})),
}
}
diff --git a/projects/brochure-marketplace/src/app/services/marketplace.service.ts b/projects/brochure-marketplace/src/app/services/marketplace.service.ts
index efda31c747..d74e8942f3 100644
--- a/projects/brochure-marketplace/src/app/services/marketplace.service.ts
+++ b/projects/brochure-marketplace/src/app/services/marketplace.service.ts
@@ -59,8 +59,8 @@ export class MarketplaceService extends AbstractMarketplaceService {
// Collapse LocaleString metadata to the active locale as it enters the app —
// see localize.ts for why this static site must do it client-side.
- private readonly localize: Localize = value =>
- this.i18nService.localize(value)
+ private readonly localize: Localize = (value, defaultLocale) =>
+ this.i18nService.localize(value, defaultLocale)
// Emits the url of a registry that failed to load (unreachable / CORS).
readonly registryError$ = new Subject()
diff --git a/projects/start-cli/changelog/patch-added-manifest-default-locale.md b/projects/start-cli/changelog/patch-added-manifest-default-locale.md
new file mode 100644
index 0000000000..535a49fe7d
--- /dev/null
+++ b/projects/start-cli/changelog/patch-added-manifest-default-locale.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Packed s9pks keep the manifest's default locale.
diff --git a/projects/start-cli/changelog/patch-changed-package-packing-speed.md b/projects/start-cli/changelog/patch-changed-package-packing-speed.md
new file mode 100644
index 0000000000..2a3b1aaba0
--- /dev/null
+++ b/projects/start-cli/changelog/patch-changed-package-packing-speed.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Speed up service-package packing on multi-core systems.
diff --git a/projects/start-cli/changelog/patch-fixed-gzipped-image-download-names.md b/projects/start-cli/changelog/patch-fixed-gzipped-image-download-names.md
new file mode 100644
index 0000000000..8c37e31782
--- /dev/null
+++ b/projects/start-cli/changelog/patch-fixed-gzipped-image-download-names.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Preserve the `.gz` suffix when downloading compressed OS and router images with `registry os asset get`.
diff --git a/projects/start-cli/man/start-cli-registry-info-set-default-locale.1 b/projects/start-cli/man/start-cli-registry-info-set-default-locale.1
new file mode 100644
index 0000000000..d1496200b3
--- /dev/null
+++ b/projects/start-cli/man/start-cli-registry-info-set-default-locale.1
@@ -0,0 +1,19 @@
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.TH start-cli-registry-info-set-default-locale 1 "set-default-locale "
+.SH NAME
+start\-cli\-registry\-info\-set\-default\-locale \- Set the locale the registry\*(Aqs own text falls back to
+.SH SYNOPSIS
+\fBstart\-cli registry info set\-default\-locale\fR [\fB\-\-clear\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIDEFAULT_LOCALE\fR]
+.SH DESCRIPTION
+Set the locale the registry\*(Aqs own text falls back to
+.SH OPTIONS
+.TP
+\fB\-\-clear\fR
+Remove the registry default locale
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print help
+.TP
+[\fIDEFAULT_LOCALE\fR]
+Locale the registry\*(Aqs own text falls back to, such as en_US
diff --git a/projects/start-cli/man/start-cli-registry-info.1 b/projects/start-cli/man/start-cli-registry-info.1
index 28085f6088..53cfd545a8 100644
--- a/projects/start-cli/man/start-cli-registry-info.1
+++ b/projects/start-cli/man/start-cli-registry-info.1
@@ -16,6 +16,9 @@ View or edit registry information
Print help
.SH SUBCOMMANDS
.TP
+start\-cli\-registry\-info\-set\-default\-locale(1)
+Set the locale the registry\*(Aqs own text falls back to
+.TP
start\-cli\-registry\-info\-set\-description(1)
Set the registry description
.TP
diff --git a/projects/start-cli/man/start-cli-ssh-add.1 b/projects/start-cli/man/start-cli-ssh-add.1
index 196b2f8cfd..3144b96f07 100644
--- a/projects/start-cli/man/start-cli-ssh-add.1
+++ b/projects/start-cli/man/start-cli-ssh-add.1
@@ -13,4 +13,4 @@ Add ssh key
Print help
.TP
<\fIKEY\fR>
-SSH public key
+SSH public key, passed as one quoted argument, e.g. "$(cat ~/.ssh/id_ed25519.pub)"
diff --git a/projects/start-os/AGENTS.md b/projects/start-os/AGENTS.md
index e9d16feda7..ab7e87d88c 100644
--- a/projects/start-os/AGENTS.md
+++ b/projects/start-os/AGENTS.md
@@ -152,6 +152,12 @@ make start-os-deb # Debian package (start-os-squashfs for the squa
`make start-core-ts-bindings` regenerates the TS bindings from the Rust types (see [Cross-layer changes](#cross-layer-changes)).
+#### Kernel backport packages
+
+Before changing or retiring the signed-kernel bridge, read
+[`build/image-recipe/kernel-backports/AGENTS.md`](build/image-recipe/kernel-backports/AGENTS.md).
+That directory owns its build rules, tests, configuration and removal boundary.
+
#### Deploying to a device
These targets push to a **live device** and are slow/destructive — be deliberate. For devices on the same network:
@@ -172,7 +178,7 @@ To deploy a **CI build** rather than a local one — no local compile, and the i
| `start-os-update-from-gha REMOTE=start9@ RUN_ID=` | A specific Actions run (e.g. an integration PR) |
| `start-os-update-from-gha REMOTE=start9@ BRANCH=` | That branch's latest successful build |
-It reads the platform off the device, downloads that run's `.squashfs`, and runs the same checksummed upgrade as `start-os-update-squashfs`. Needs `gh` (authenticated), `b3sum`, and `jq`. Squashfs artifacts expire 14 days after the run. `scripts/update-from-gha.sh --help` documents the rest.
+It reads the platform off the device, downloads that run's `startos-*_.squashfs`, and runs the same checksummed upgrade as `start-os-update-squashfs`. Needs `gh` (authenticated), `b3sum`, and `jq`. Squashfs artifacts expire 14 days after the run. `scripts/update-from-gha.sh --help` documents the rest.
For devices on a different network (uses [magic-wormhole](https://github.com/magic-wormhole/magic-wormhole)):
diff --git a/projects/start-os/build.mk b/projects/start-os/build.mk
index f33c6af9a0..147dea2375 100644
--- a/projects/start-os/build.mk
+++ b/projects/start-os/build.mk
@@ -8,8 +8,9 @@ IMAGE_RECIPE_SRC := $(call ls-files, projects/start-os/build/image-recipe/)
STARTD_SRC := projects/start-os/startd.service projects/start-os/services.slice projects/start-os/startos-shutdown.service projects/start-os/startos-restart.service $(BUILD_SRC)
STARTOS_RELEASE_NOTES := projects/start-os/release-notes/$(shell cat $(VERSION_FILE)).md
STARTOS_RELEASE_NOTES_SRC := scripts/changelog.mjs scripts/changelog-version.mjs shared-libs/crates/start-core/locales/release-notes.json .prettierrc.json package.json $(wildcard $(STARTOS_RELEASE_NOTES)) $(call ls-files, projects/start-os/changelog)
-COMPILED_TARGETS := target/$(RUST_ARCH)-unknown-linux-musl/$(PROFILE)/startbox target/$(RUST_ARCH)-unknown-linux-musl/release/start-container target/$(RUST_ARCH)-unknown-linux-musl/release/startos-backup-fs projects/start-os/container-runtime/rootfs.$(ARCH).squashfs
-STARTOS_TARGETS := $(STARTD_SRC) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) $(STARTOS_RELEASE_NOTES_SRC) $(COMPILED_TARGETS) $(PLATFORM_FILE) \
+COMPILED_TARGETS := target/$(RUST_ARCH)-unknown-linux-musl/$(PROFILE)/startbox target/$(RUST_ARCH)-unknown-linux-musl/release/start-container target/$(RUST_ARCH)-unknown-linux-musl/release/startos-backup-fs
+CONTAINER_RUNTIME_DIST := projects/start-os/container-runtime/dist/index.js projects/start-os/container-runtime/dist/node_modules/.package-lock.json
+STARTOS_TARGETS := $(STARTD_SRC) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) $(STARTOS_RELEASE_NOTES_SRC) $(COMPILED_TARGETS) projects/start-os/container-runtime/rootfs.$(ARCH).squashfs $(PLATFORM_FILE) \
$(shell if [ "$(PLATFORM)" = "raspberrypi" ]; then \
echo target/aarch64-unknown-linux-musl/release/pi-beep; \
fi) \
@@ -38,7 +39,7 @@ start-os-upgrade-identity-test: projects/start-os/build/tests/upgrade-identity.t
start-os-grub-test: projects/start-os/build/tests/grub-overrides-test.sh projects/start-os/build/lib/grub-user.cfg projects/start-os/build/lib/scripts/nvme-isolation-test projects/start-os/debian/postinst projects/start-os/build/image-recipe/raspberrypi/squashfs/etc/default/grub.d/raspberrypi.cfg
./projects/start-os/build/tests/grub-overrides-test.sh
-start-os-scripts-test: start-os-grub-test start-os-forward-transport-test start-os-upgrade-identity-test projects/start-os/build/tests/dns-config-test.sh projects/start-os/build/lib/resolved.conf projects/start-os/container-runtime/deb-install.sh projects/start-os/container-runtime/update-image.sh projects/start-os/build/lib/scripts/normalize-fstab projects/start-os/build/tests/normalize-fstab-test.sh projects/start-os/build/image-recipe/raspberrypi/img/usr/lib/startos/scripts/init_resize.sh projects/start-os/build/tests/init-resize-test.sh projects/start-os/build/image-recipe/build.sh projects/start-os/build/tests/backports-pref-test.sh projects/start-os/build/lib/scripts/gather-debug-info projects/start-os/debian/postinst projects/start-os/build/tests/crash-diagnostics-test.sh projects/start-os/build/tests/btrfsmaintenance-test.sh projects/start-os/build/dpkg-deps/depends projects/start-os/build/tests/runtime-package-upgrade-test.sh projects/start-os/build/tests/migration-images-test.sh projects/start-os/build/save-migration-images.sh
+start-os-scripts-test: start-os-grub-test start-os-forward-transport-test start-os-upgrade-identity-test start-os-kbuild-test projects/start-os/build/tests/dns-config-test.sh projects/start-os/build/lib/resolved.conf projects/start-os/container-runtime/deb-install.sh projects/start-os/container-runtime/update-image.sh projects/start-os/build/lib/scripts/normalize-fstab projects/start-os/build/tests/normalize-fstab-test.sh projects/start-os/build/image-recipe/raspberrypi/img/usr/lib/startos/scripts/init_resize.sh projects/start-os/build/tests/init-resize-test.sh projects/start-os/build/image-recipe/build.sh projects/start-os/build/tests/backports-pref-test.sh projects/start-os/build/lib/scripts/gather-debug-info projects/start-os/debian/postinst projects/start-os/build/tests/crash-diagnostics-test.sh projects/start-os/build/tests/btrfsmaintenance-test.sh projects/start-os/build/dpkg-deps/depends projects/start-os/build/tests/runtime-package-upgrade-test.sh projects/start-os/build/tests/migration-images-test.sh projects/start-os/build/save-migration-images.sh
./projects/start-os/build/tests/migration-images-test.sh
./projects/start-os/build/tests/normalize-fstab-test.sh
./projects/start-os/build/tests/init-resize-test.sh
@@ -56,6 +57,13 @@ projects/start-os/build/lib/migration-images/.done: projects/start-os/build/save
./projects/start-os/build/save-migration-images.sh projects/start-os/build/lib/migration-images
touch $@
+# May be included from an isolated build directory.
+include $(dir $(lastword $(MAKEFILE_LIST)))build/image-recipe/kernel-backports/build.mk
+
+.PHONY: start-os-kbuild-test
+start-os-kbuild-test: projects/start-os/build/tests/kernel-kbuild-test.sh projects/start-os/build/image-recipe/build.sh
+ ./projects/start-os/build/tests/kernel-kbuild-test.sh
+
start-os-deb: results/$(BASENAME).deb
results/$(BASENAME).deb: debian/build.sh build/common.mk build/bash-completion projects/start-os/build.mk $(call ls-files,projects/start-os/debian) $(STARTOS_TARGETS)
@@ -218,7 +226,7 @@ projects/start-os/container-runtime/dist/node_modules/.package-lock.json project
./projects/start-os/container-runtime/install-dist-deps.sh
touch projects/start-os/container-runtime/dist/node_modules/.package-lock.json
-projects/start-os/container-runtime/rootfs.$(ARCH).squashfs: projects/start-os/build/lib/resolved.conf projects/start-os/container-runtime/debian.$(ARCH).squashfs projects/start-os/container-runtime/container-runtime.service projects/start-os/container-runtime/update-image.sh projects/start-os/container-runtime/update-image-local.sh projects/start-os/container-runtime/deb-install.sh projects/start-os/container-runtime/dist/index.js projects/start-os/container-runtime/dist/node_modules/.package-lock.json target/$(RUST_ARCH)-unknown-linux-musl/release/start-container
+projects/start-os/container-runtime/rootfs.$(ARCH).squashfs: projects/start-os/build/lib/resolved.conf projects/start-os/container-runtime/debian.$(ARCH).squashfs projects/start-os/container-runtime/container-runtime.service projects/start-os/container-runtime/update-image.sh projects/start-os/container-runtime/update-image-local.sh projects/start-os/container-runtime/deb-install.sh $(CONTAINER_RUNTIME_DIST) target/$(RUST_ARCH)-unknown-linux-musl/release/start-container
ARCH=$(ARCH) ./projects/start-os/container-runtime/update-image-local.sh
projects/start-os/build/lib/depends projects/start-os/build/lib/conflicts: $(ENVIRONMENT_FILE) $(PLATFORM_FILE) $(shell ls projects/start-os/build/dpkg-deps/*)
@@ -247,9 +255,10 @@ target/$(RUST_ARCH)-unknown-linux-musl/release/start-container: $(START_CONTAINE
ARCH=$(ARCH) PROFILE=release ./build/build-rust-bins.sh start-os:start-container
touch target/$(RUST_ARCH)-unknown-linux-musl/release/start-container
-# used by github actions
-compiled-$(ARCH).tar: $(COMPILED_TARGETS) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE)
- tar -cvf $@ $^
+# CI's cross-compiled image inputs. Must not run target-architecture code; CI
+# builds the container-runtime rootfs on a native runner.
+compiled-$(ARCH).tar.gz: $(COMPILED_TARGETS) $(CONTAINER_RUNTIME_DIST) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE)
+ tar -czvf $@ $(COMPILED_TARGETS) projects/start-os/container-runtime/dist $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE)
target/$(RUST_ARCH)-unknown-linux-musl/release/startos-backup-fs: $(call ls-files, projects/start-os/backup-fs) $(BACKUP_PROTOCOL_SRC) Cargo.toml Cargo.lock $(ENVIRONMENT_FILE) $(RUST_ZIG_BUILDER_INPUTS)
ARCH=$(ARCH) PROFILE=release ./projects/start-os/backup-fs/build-backup-fs.sh
diff --git a/projects/start-os/build/image-recipe/Dockerfile b/projects/start-os/build/image-recipe/Dockerfile
index 13d1a80b09..71f67ecef4 100644
--- a/projects/start-os/build/image-recipe/Dockerfile
+++ b/projects/start-os/build/image-recipe/Dockerfile
@@ -8,6 +8,7 @@ RUN apt-get update && \
live-build \
procps \
binfmt-support \
+ binutils \
qemu-utils \
qemu-user-static \
xorriso \
diff --git a/projects/start-os/build/image-recipe/README.md b/projects/start-os/build/image-recipe/README.md
index 91f77f5000..650dbb6639 100644
--- a/projects/start-os/build/image-recipe/README.md
+++ b/projects/start-os/build/image-recipe/README.md
@@ -1,19 +1,22 @@
# StartOS Image Recipes
-Code that uses `live-build` to create the StartOS live and installer
-images.
-
-If you want to build a local image in the exact same environment used to build
-official StartOS images, you can use the `run-local-build.sh` helper script:
+`live-build` assembles the StartOS live and installer images inside the Debian
+Docker builder defined here. Run the owning recipes from the repository root:
```bash
-# Prerequisites
-sudo apt-get install -y debspawn binfmt-support
-sudo mkdir -p /etc/debspawn/ && echo "AllowUnsafePermissions=true" | sudo tee /etc/debspawn/global.toml
-
-# Build image
-./run-local-build.sh
+make start-os-iso PLATFORM=x86_64
+make start-os-img PLATFORM=raspberrypi
```
-In order for the build to work properly, you will need debspawn >= 0.5.1, the
-build may fail with prior versions.
+See [StartOS build prerequisites](../../AGENTS.md#prerequisites) for Docker,
+architecture emulation and image tooling. `run-local-build.sh` is the recipe's
+container wrapper and accepts the prepared StartOS `.deb` path.
+
+Generic x86/ARM images use the isolated
+[signed-kernel bridge](kernel-backports/README.md). Its build rules, tests,
+configuration and retirement boundary live in that directory.
+
+Raspberry Pi and other vendor kernels, and RISC-V kernel selection, are unchanged.
+Both Pi `rpi-v8` and `rpi-2712` packages must remain available. The root
+[kernel-security review requirements](../../../../AGENTS.md#releases) govern
+release validation.
diff --git a/projects/start-os/build/image-recipe/build.sh b/projects/start-os/build/image-recipe/build.sh
index 0df502be09..49f7b9a38c 100755
--- a/projects/start-os/build/image-recipe/build.sh
+++ b/projects/start-os/build/image-recipe/build.sh
@@ -84,7 +84,7 @@ PLATFORM_CONFIG_EXTRAS=()
if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then
PLATFORM_CONFIG_EXTRAS+=( --firmware-binary false )
PLATFORM_CONFIG_EXTRAS+=( --firmware-chroot false )
- RPI_KERNEL_VERSION=6.18.33+rpt
+ RPI_KERNEL_VERSION=6.18.60+rpt
PLATFORM_CONFIG_EXTRAS+=( --linux-packages linux-image-$RPI_KERNEL_VERSION )
PLATFORM_CONFIG_EXTRAS+=( --linux-flavours "rpi-v8 rpi-2712" )
elif [ "${IB_TARGET_PLATFORM}" = "rockchip64" ]; then
@@ -128,6 +128,8 @@ mkdir -p config/packages.chroot/
cp $RESULTS_DIR/$IMAGE_BASENAME.deb config/packages.chroot/
dpkg-name config/packages.chroot/*.deb
+"$SOURCE_DIR/kernel-backports/stage.sh" "$IB_SUITE" "$IB_TARGET_PLATFORM" "$IB_TARGET_ARCH" "$RESULTS_DIR"
+
mkdir -p config/includes.chroot/etc
echo start > config/includes.chroot/etc/hostname
cat > config/includes.chroot/etc/hosts << EOT
@@ -233,7 +235,7 @@ Pin-Priority: -1
EOF
else
cat > config/archives/backports.pref <<-EOF
-Package: linux-image-* linux-headers-* linux-base *nvidia*
+Package: linux-image-* linux-headers-* linux-base* linux-binary-* linux-modules-* linux-kbuild-* *nvidia*
Pin: release n=${IB_SUITE}-backports
Pin-Priority: 500
EOF
@@ -363,13 +365,14 @@ if [ "${NVIDIA}" = "1" ]; then
echo "[nvidia-hook] Removed build dependencies." >&2
fi
-# Install linux-kbuild for sign-file (Secure Boot module signing)
KVER_ALL="\$(ls -1t /boot/vmlinuz-* 2>/dev/null | head -n1 | sed 's|.*/vmlinuz-||')"
if [ -n "\${KVER_ALL}" ]; then
- KBUILD_VER="\$(echo "\${KVER_ALL}" | grep -oP '^\d+\.\d+')"
- if [ -n "\${KBUILD_VER}" ]; then
- echo "[build] Installing linux-kbuild-\${KBUILD_VER} for Secure Boot support" >&2
- apt-get install -y "linux-kbuild-\${KBUILD_VER}" || echo "[build] WARNING: linux-kbuild-\${KBUILD_VER} not available" >&2
+ KBUILD_PACKAGE="\$(apt-cache depends "linux-headers-\${KVER_ALL}" 2>/dev/null | awk '/Depends: linux-kbuild-/ { print \$2; exit }')"
+ if [ -n "\${KBUILD_PACKAGE}" ]; then
+ echo "[build] Installing \${KBUILD_PACKAGE} for Secure Boot support" >&2
+ apt-get install -y "\${KBUILD_PACKAGE}" || echo "[build] WARNING: \${KBUILD_PACKAGE} not available" >&2
+ else
+ echo "[build] WARNING: no kbuild dependency found for linux-headers-\${KVER_ALL}" >&2
fi
fi
@@ -427,7 +430,14 @@ else
cat ./chroot/debootstrap/debootstrap.log
exit $EXIT
fi
-retry lb chroot
+# live-build's failure cleanup unmounts the local archives but keeps the
+# `chroot_archives` stagefile, which would skip binding them again.
+lb_chroot() {
+ rm -f .build/chroot_archives
+ lb chroot
+}
+retry lb_chroot
+"$SOURCE_DIR/kernel-backports/verify-kernel-backports.sh" chroot "$IB_TARGET_ARCH"
# riscv64 binaries target RVA23, which the build host may lack.
RUN_TARGET=()
diff --git a/projects/start-os/build/image-recipe/kernel-backports/AGENTS.md b/projects/start-os/build/image-recipe/kernel-backports/AGENTS.md
new file mode 100644
index 0000000000..4500149262
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/AGENTS.md
@@ -0,0 +1,39 @@
+# Kernel bridge maintenance
+
+This directory is the complete temporary kernel backport implementation, including
+its configuration, tests and Make rules. The parent image recipe may stage and
+verify the bridge through its two hooks; keep package/snapshot/platform policy
+inside this directory.
+
+Build with `make start-os-kernel-backports KERNEL_DEB_ARCH=amd64` or `arm64`.
+Outputs are `results/kernel-backports///`. Run
+`make start-os-kernel-backports-test` for focused coverage. Both targets use the
+existing product build infrastructure.
+
+Signed kernel/module payload bytes and Debian signatures must survive
+repackaging. Header compiler selectors may change with their package checksums;
+the ABI and kernel configuration stay intact. Rebuilding or locally signing the
+kernel is outside this bridge's contract.
+
+## Retirement
+
+Retire the bridge once official trixie-backports provides a patched signed kernel
+and usable matching headers/compiler dependencies. Its version sorts below the
+corresponding official backport. Never mix its forky ABI with official backports
+modules or headers.
+
+The removal boundary is:
+
+- Delete this directory.
+- Delete the two `kernel-backports/` calls in the parent `build.sh`.
+- Delete this directory's Make include from `projects/start-os/build.mk`.
+- Delete the `Archive kernel backport packages` step in `startos-image.yaml`.
+- Remove the bridge's explicit `binutils` dependency from the image Dockerfile.
+- Replace the bridge pointers in the parent README and StartOS AGENTS with normal
+ backports selection documentation.
+
+Keep the permanent family-wide backports preferences, target-header-based kbuild
+lookup, their tests/Make target, and the image-built `GRUB_TOP_LEVEL` contract.
+Retain the security changelog benefit, updating its kernel version if necessary.
+Preserve incoming-image boot preference over retained higher-ABI kernels when
+verifying the official-backport transition.
diff --git a/projects/start-os/build/image-recipe/kernel-backports/CLAUDE.md b/projects/start-os/build/image-recipe/kernel-backports/CLAUDE.md
new file mode 100644
index 0000000000..43c994c2d3
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/CLAUDE.md
@@ -0,0 +1 @@
+@AGENTS.md
diff --git a/projects/start-os/build/image-recipe/kernel-backports/README.md b/projects/start-os/build/image-recipe/kernel-backports/README.md
new file mode 100644
index 0000000000..724ae33a3e
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/README.md
@@ -0,0 +1,24 @@
+# Signed-kernel backport bridge
+
+This directory owns the forky bridge for generic trixie x86/ARM images, including
+nonfree and NVIDIA variants. `stage.sh` adds a build-local archive;
+`verify-kernel-backports.sh` checks it after chroot assembly and skips images
+without that archive. The parent recipe contains only these two hooks.
+
+`kernel-backports.conf` owns the snapshot, ABI, package version, compiler and
+archive-list path. Native APT verifies Debian signatures and package hashes from
+the pinned snapshot; historical metadata expiry is disabled for that fixed input.
+The signed kernel/module payload archives remain byte-identical. Header compiler
+selectors and checksums use trixie's compiler while the ABI and kernel
+configuration stay intact. Header directory timestamps are reproducible.
+
+`live-build` binds the flat file archive through its chroot-only archive facility.
+`trusted=yes` applies to that generated archive, not the Debian network source.
+Neither the source nor its deb files remain in the assembled image. APT selects
+needed packages without installing every header into every image.
+
+The image check requires a sufficiently new installed kernel package, identical
+module/boot binaries and incoming `GRUB_TOP_LEVEL`. Retained higher-ABI boot files
+must not displace the incoming image when returning to official backports.
+
+Read [AGENTS.md](AGENTS.md) for builds, contracts and the removal boundary.
diff --git a/projects/start-os/build/image-recipe/kernel-backports/build-kernel-backports.sh b/projects/start-os/build/image-recipe/kernel-backports/build-kernel-backports.sh
new file mode 100755
index 0000000000..1cae360af5
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/build-kernel-backports.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+set -euo pipefail
+
+ARCH=$1
+OUTPUT_ROOT=$(realpath -m "$2")
+SOURCE_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
+source "$SOURCE_DIR/kernel-backports.conf"
+OUTPUT="$OUTPUT_ROOT/$KERNEL_BACKPORT_VERSION"
+case "$ARCH" in
+ amd64|arm64) ;;
+ *) echo "No Debian-signed kernel bridge for $ARCH" >&2; exit 1 ;;
+esac
+WORK=$(mktemp -d)
+trap 'rm -rf -- "$WORK"' EXIT
+mkdir -p "$WORK"/{etc/apt.conf.d,etc/preferences.d,state/lists/partial,cache/archives/partial,log,downloads} "$OUTPUT"
+chmod 755 "$WORK"
+if [ "$(id -u)" -eq 0 ]; then
+ chown _apt "$WORK/downloads"
+fi
+touch "$WORK/state/status"
+cat > "$WORK/apt.conf" < "$WORK/etc/sources.list" < "$WORK/plan"
+
+PACKAGES=()
+while read -r filename; do
+ package=${filename%%_*}
+ case "$package" in
+ linux-*"$KERNEL_BACKPORT_ABI"*|linux-*-"$ARCH")
+ PACKAGES+=("$package=$KERNEL_BACKPORT_UPSTREAM_VERSION") ;;
+ esac
+done < <(awk '/^\047/ { print $2 }' "$WORK/plan")
+if [ "${#PACKAGES[@]}" -eq 0 ]; then
+ echo 'APT did not select any kernel packages' >&2
+ exit 1
+fi
+(cd "$WORK/downloads" && apt-get download "${PACKAGES[@]}")
+for deb in "$WORK/downloads"/*.deb; do
+ "$SOURCE_DIR/repack-kernel-deb.sh" "$deb" "$OUTPUT"
+done
+(
+ cd "$OUTPUT"
+ dpkg-scanpackages . /dev/null > Packages
+ gzip -n -c Packages > Packages.gz
+)
+printf 'Kernel backports archive: %s\n' "$OUTPUT"
diff --git a/projects/start-os/build/image-recipe/kernel-backports/build.mk b/projects/start-os/build/image-recipe/kernel-backports/build.mk
new file mode 100644
index 0000000000..7cd002d472
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/build.mk
@@ -0,0 +1,11 @@
+KERNEL_BACKPORTS_DIR := projects/start-os/build/image-recipe/kernel-backports
+KERNEL_DEB_ARCH ?= $(shell dpkg --print-architecture)
+
+.PHONY: start-os-kernel-backports start-os-kernel-backports-test
+start-os-kernel-backports:
+ FORCE_COMPAT=1 REQUIRES=debian ./build/os-compat/run-compat.sh ./$(KERNEL_BACKPORTS_DIR)/build-kernel-backports.sh $(KERNEL_DEB_ARCH) results/kernel-backports/$(KERNEL_DEB_ARCH)
+
+start-os-kernel-backports-test: $(wildcard $(KERNEL_BACKPORTS_DIR)/*.sh) $(KERNEL_BACKPORTS_DIR)/kernel-backports.conf
+ ./$(KERNEL_BACKPORTS_DIR)/test.sh
+
+start-os-scripts-test: start-os-kernel-backports-test
diff --git a/projects/start-os/build/image-recipe/kernel-backports/kernel-backports.conf b/projects/start-os/build/image-recipe/kernel-backports/kernel-backports.conf
new file mode 100644
index 0000000000..fd9f664634
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/kernel-backports.conf
@@ -0,0 +1,7 @@
+KERNEL_BACKPORT_ARCHIVE_LIST=config/archives/kernel-backports.list.chroot
+KERNEL_BACKPORT_SNAPSHOT=20261118T180000Z
+KERNEL_BACKPORT_ABI=7.3.4+deb14
+KERNEL_BACKPORT_UPSTREAM_VERSION=7.3.4-1
+KERNEL_BACKPORT_VERSION=7.3.4-1~bpo13+1~start9.1
+KERNEL_BACKPORT_COMPILER=gcc-14-for-host
+KERNEL_BACKPORT_MAINTAINER='Start9 Labs '
diff --git a/projects/start-os/build/image-recipe/kernel-backports/repack-kernel-deb.sh b/projects/start-os/build/image-recipe/kernel-backports/repack-kernel-deb.sh
new file mode 100755
index 0000000000..ace10c30b2
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/repack-kernel-deb.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+set -euo pipefail
+
+SOURCE=$(realpath "$1")
+OUTPUT=$(realpath -m "$2")
+source "$(dirname "${BASH_SOURCE[0]}")/kernel-backports.conf"
+WORK=$(mktemp -d)
+trap 'rm -rf -- "$WORK"' EXIT
+
+PACKAGE=$(dpkg-deb -f "$SOURCE" Package)
+ARCH=$(dpkg-deb -f "$SOURCE" Architecture)
+UPSTREAM_VERSION=$(dpkg-deb -f "$SOURCE" Version)
+if [ "$UPSTREAM_VERSION" != "$KERNEL_BACKPORT_UPSTREAM_VERSION" ]; then
+ echo "Unexpected kernel package version: $UPSTREAM_VERSION" >&2
+ exit 1
+fi
+
+dpkg-deb --control "$SOURCE" "$WORK/control"
+awk -v old="$UPSTREAM_VERSION" -v version="$KERNEL_BACKPORT_VERSION" \
+ -v compiler="$KERNEL_BACKPORT_COMPILER" -v maintainer="$KERNEL_BACKPORT_MAINTAINER" \
+ -v hash="$(sha256sum "$SOURCE" | cut -d' ' -f1)" '
+function replace_version(value, result, position) {
+ while ((position = index(value, old)) != 0) {
+ result = result substr(value, 1, position - 1) version
+ value = substr(value, position + length(old))
+ }
+ return result value
+}
+/^[^ \t]/ { field = $1 }
+/^Version:/ { print "Version: " version; next }
+/^Maintainer:/ {
+ sub(/^Maintainer:/, "Original-Maintainer:")
+ print
+ print "Maintainer: " maintainer
+ next
+}
+field ~ /^(Depends|Pre-Depends|Recommends|Suggests|Breaks|Conflicts|Replaces|Provides):$/ {
+ $0 = replace_version($0)
+ gsub(/gcc-[0-9]+-for-host/, compiler)
+}
+{ print }
+END {
+ print "Origin: Start9"
+ print "X-Start9-Upstream-SHA256: " hash
+}
+' "$WORK/control/control" > "$WORK/control.new"
+mv "$WORK/control.new" "$WORK/control/control"
+
+# Preserve Debian's signed kernel, modules and ABI byte-for-byte.
+DATA=$(ar t "$SOURCE" | grep '^data\.tar')
+(cd "$WORK" && ar x "$SOURCE" debian-binary "$DATA")
+if [[ "$PACKAGE" = linux-headers-* ]]; then
+ dpkg-deb --extract "$SOURCE" "$WORK/data"
+ mapfile -t selectors < <(find "$WORK/data" -name .kernelvariables -type f)
+ for selector in "${selectors[@]}"; do
+ cp -p "$selector" "$WORK/compiler-reference"
+ sed -i -E "/^CC =/s/gcc-[0-9]+$/${KERNEL_BACKPORT_COMPILER%-for-host}/" "$selector"
+ touch -r "$WORK/compiler-reference" "$selector"
+ relative=${selector#"$WORK/data/"}
+ hash=$(md5sum "$selector" | cut -d' ' -f1)
+ awk -v path="$relative" -v hash="$hash" '
+ $2 == path { $0 = hash " " path }
+ { print }
+ ' "$WORK/control/md5sums" > "$WORK/md5sums.new"
+ mv "$WORK/md5sums.new" "$WORK/control/md5sums"
+ done
+ if [ "${#selectors[@]}" -gt 0 ]; then
+ DATA=data.tar.gz
+ # Extraction defers symlinks and leaves their parent timestamps nondeterministic.
+ find "$WORK/data" -type d -exec touch -d @0 {} +
+ tar --format=gnu --sort=name --owner=0 --group=0 --numeric-owner \
+ -C "$WORK/data" -cf - . | gzip -n > "$WORK/$DATA"
+ fi
+fi
+tar --sort=name --mtime=@0 --owner=0 --group=0 --numeric-owner \
+ -C "$WORK/control" -cf - . | gzip -n > "$WORK/control.tar.gz"
+(cd "$WORK" && ar rcD package.deb debian-binary control.tar.gz "$DATA")
+if [[ "$PACKAGE" != linux-headers-* ]]; then
+ cmp <(ar p "$SOURCE" "$DATA") <(ar p "$WORK/package.deb" "$DATA")
+fi
+mkdir -p "$OUTPUT"
+DEB="$OUTPUT/${PACKAGE}_${KERNEL_BACKPORT_VERSION}_${ARCH}.deb"
+mv "$WORK/package.deb" "$DEB"
+printf '%s\n' "$DEB"
diff --git a/projects/start-os/build/image-recipe/kernel-backports/stage.sh b/projects/start-os/build/image-recipe/kernel-backports/stage.sh
new file mode 100755
index 0000000000..f28a117ea9
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/stage.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -euo pipefail
+SUITE=$1
+PLATFORM=$2
+ARCH=$3
+RESULTS_DIR=$4
+SOURCE_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
+source "$SOURCE_DIR/kernel-backports.conf"
+case "$SUITE:${PLATFORM%%-*}" in
+ trixie:x86_64|trixie:aarch64)
+ ARCHIVE="$RESULTS_DIR/kernel-backports/$ARCH"
+ "$SOURCE_DIR/build-kernel-backports.sh" "$ARCH" "$ARCHIVE"
+ mkdir -p "$(dirname "$KERNEL_BACKPORT_ARCHIVE_LIST")"
+ printf 'deb [trusted=yes] file://%s ./\n' "$ARCHIVE/$KERNEL_BACKPORT_VERSION" \
+ > "$KERNEL_BACKPORT_ARCHIVE_LIST"
+ ;;
+esac
diff --git a/projects/start-os/build/image-recipe/kernel-backports/test.sh b/projects/start-os/build/image-recipe/kernel-backports/test.sh
new file mode 100755
index 0000000000..65dbf3ccff
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/test.sh
@@ -0,0 +1,147 @@
+#!/bin/bash
+set -euo pipefail
+RECIPE=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
+source "$RECIPE/kernel-backports.conf"
+WORK=$(mktemp -d)
+trap 'rm -rf -- "$WORK"' EXIT
+
+fail() { echo "FAIL: $*" >&2; exit 1; }
+if grep -Eq 'KERNEL_BACKPORT_|snapshot\.debian\.org|kernel-backports\.list' "$RECIPE/../build.sh"; then
+ fail 'bridge policy leaked into the parent recipe'
+fi
+[ "$(grep -Fc '"$SOURCE_DIR/kernel-backports/' "$RECIPE/../build.sh")" -eq 2 ] || fail 'expected two bridge hooks'
+if grep -Eq '^KERNEL_(BACKPORT|DEB_ARCH)' "$RECIPE/../../../build.mk"; then
+ fail 'bridge build policy leaked into the parent Makefile'
+fi
+fixture() {
+ local package=$1 architecture=$2 compression=$3
+ rm -rf "$WORK/input"
+ mkdir -p "$WORK/input/DEBIAN" "$WORK/input/boot"
+ printf 'signed-kernel-payload\000keep-unchanged\377\n' > "$WORK/input/boot/vmlinuz-test"
+ if [[ "$package" = linux-headers-* ]]; then
+ mkdir -p "$WORK/input/usr/src/kernel-test"
+ printf 'CC = $(CROSS_COMPILE)gcc-16\noverride KERNELRELEASE = test-abi\n' \
+ > "$WORK/input/usr/src/kernel-test/.kernelvariables"
+ mkdir -p "$WORK/input/usr/lib/modules/test-abi"
+ ln -s ../../../src/kernel-test "$WORK/input/usr/lib/modules/test-abi/build"
+ printf 'CONFIG_GCC_VERSION=160200\n' > "$WORK/input/usr/src/kernel-test/.config"
+ (cd "$WORK/input" && md5sum usr/src/kernel-test/.kernelvariables usr/src/kernel-test/.config > DEBIAN/md5sums)
+ fi
+ cat > "$WORK/input/DEBIAN/control" <
+Source: linux ($KERNEL_BACKPORT_UPSTREAM_VERSION)
+Built-Using: linux (= $KERNEL_BACKPORT_UPSTREAM_VERSION)
+Depends: linux-base-test (= $KERNEL_BACKPORT_UPSTREAM_VERSION),
+ gcc-16-for-host, libc6 (>= 2.38)
+Breaks: linux-base-old (<< $KERNEL_BACKPORT_UPSTREAM_VERSION~)
+Description: test payload $KERNEL_BACKPORT_UPSTREAM_VERSION gcc-16-for-host
+EOF
+ dpkg-deb --root-owner-group -Z"$compression" --build "$WORK/input" "$WORK/source.deb" >/dev/null
+}
+
+for fixture_case in 'linux-image-test amd64 xz' 'linux-headers-test all gzip'; do
+ read -r package architecture compression <<< "$fixture_case"
+ fixture "$package" "$architecture" "$compression"
+ "$RECIPE/repack-kernel-deb.sh" "$WORK/source.deb" "$WORK/output" >/dev/null
+ deb="$WORK/output/${package}_${KERNEL_BACKPORT_VERSION}_${architecture}.deb"
+ [ "$(dpkg-deb -f "$deb" Version)" = "$KERNEL_BACKPORT_VERSION" ] || fail version
+ [ "$(dpkg-deb -f "$deb" Source)" = "linux ($KERNEL_BACKPORT_UPSTREAM_VERSION)" ] || fail source
+ [ "$(dpkg-deb -f "$deb" Built-Using)" = "linux (= $KERNEL_BACKPORT_UPSTREAM_VERSION)" ] || fail provenance
+ [ "$(dpkg-deb -f "$deb" Original-Maintainer)" = 'Debian Kernel Team ' ] || fail attribution
+ [ "$(dpkg-deb -f "$deb" X-Start9-Upstream-SHA256)" = "$(sha256sum "$WORK/source.deb" | cut -d' ' -f1)" ] || fail commitment
+ dpkg-deb -f "$deb" Depends | grep -Fq "linux-base-test (= $KERNEL_BACKPORT_VERSION)" || fail dependency
+ dpkg-deb -f "$deb" Depends | grep -Fq "$KERNEL_BACKPORT_COMPILER" || fail compiler
+ dpkg-deb -f "$deb" Breaks | grep -Fq "<< $KERNEL_BACKPORT_VERSION~" || fail breaks
+ dpkg-deb -f "$deb" Description | grep -Fq "$KERNEL_BACKPORT_UPSTREAM_VERSION gcc-16-for-host" || fail description
+ rm -rf "$WORK/inspect" "$WORK/inspect-control"
+ dpkg-deb --extract "$deb" "$WORK/inspect"
+ cmp "$WORK/input/boot/vmlinuz-test" "$WORK/inspect/boot/vmlinuz-test" || fail kernel-bytes
+ if [[ "$package" = linux-headers-* ]]; then
+ grep -Fxq "CC = \$(CROSS_COMPILE)${KERNEL_BACKPORT_COMPILER%-for-host}" \
+ "$WORK/inspect/usr/src/kernel-test/.kernelvariables" || fail compiler-selector
+ grep -Fxq 'override KERNELRELEASE = test-abi' \
+ "$WORK/inspect/usr/src/kernel-test/.kernelvariables" || fail abi
+ cmp "$WORK/input/usr/src/kernel-test/.config" "$WORK/inspect/usr/src/kernel-test/.config" || fail kernel-config
+ dpkg-deb --control "$deb" "$WORK/inspect-control"
+ (cd "$WORK/inspect" && md5sum -c "$WORK/inspect-control/md5sums") || fail header-checksum
+ else
+ data=$(ar t "$WORK/source.deb" | grep '^data\.tar')
+ cmp <(ar p "$WORK/source.deb" "$data") <(ar p "$deb" "$data") || fail payload
+ fi
+ cp "$deb" "$WORK/first.deb"
+ sleep 1
+ "$RECIPE/repack-kernel-deb.sh" "$WORK/source.deb" "$WORK/output" >/dev/null
+ cmp "$WORK/first.deb" "$deb" || fail reproducibility
+done
+
+dpkg --compare-versions "$KERNEL_BACKPORT_VERSION" lt "$KERNEL_BACKPORT_UPSTREAM_VERSION~bpo13+1" || fail official-order
+sed -i 's/^Version:.*/Version: 1.0/' "$WORK/input/DEBIAN/control"
+dpkg-deb --root-owner-group --build "$WORK/input" "$WORK/wrong.deb" >/dev/null
+if "$RECIPE/repack-kernel-deb.sh" "$WORK/wrong.deb" "$WORK/output" >/dev/null 2>&1; then
+ fail 'unmatched source version accepted'
+fi
+
+mkdir -p "$WORK/recipe" "$WORK/stage/config/archives"
+cp "$RECIPE/kernel-backports.conf" "$RECIPE/stage.sh" "$WORK/recipe/"
+cat > "$WORK/recipe/build-kernel-backports.sh" <<'EOF'
+#!/bin/bash
+printf '%s\n' "$@" > "$RESULTS_DIR/called"
+EOF
+chmod +x "$WORK/recipe/build-kernel-backports.sh"
+export SOURCE_DIR="$WORK/recipe" RESULTS_DIR="$WORK"
+cd "$WORK/stage"
+for target in x86_64:amd64 x86_64-nonfree:amd64 x86_64-nvidia:amd64 aarch64:arm64 aarch64-nonfree:arm64 aarch64-nvidia:arm64; do
+ IFS=: read -r platform arch <<< "$target"
+ rm -f config/archives/kernel-backports.list.chroot "$WORK/called"
+ bash "$WORK/recipe/stage.sh" trixie "$platform" "$arch" "$RESULTS_DIR"
+ [ -f "$WORK/called" ] || fail "$platform archive build"
+ grep -Fxq "deb [trusted=yes] file://$WORK/kernel-backports/$arch/$KERNEL_BACKPORT_VERSION ./" \
+ config/archives/kernel-backports.list.chroot || fail "$platform archive URL"
+done
+for target in raspberrypi:arm64 rockchip64:arm64 riscv64:riscv64 riscv64-nonfree:riscv64; do
+ IFS=: read -r platform arch <<< "$target"
+ rm -f config/archives/kernel-backports.list.chroot "$WORK/called"
+ bash "$WORK/recipe/stage.sh" trixie "$platform" "$arch" "$RESULTS_DIR"
+ [ ! -f "$WORK/called" ] || fail "$platform kernel selection changed"
+ [ ! -f config/archives/kernel-backports.list.chroot ] || fail "$platform retained bridge archive"
+done
+rm -f "$WORK/called"
+bash "$WORK/recipe/stage.sh" bookworm x86_64 amd64 "$RESULTS_DIR"
+[ ! -f "$WORK/called" ] || fail 'bridge used outside trixie'
+
+"$RECIPE/verify-kernel-backports.sh" "$WORK/not-an-image" amd64
+: > "$KERNEL_BACKPORT_ARCHIVE_LIST"
+IMAGE="$WORK/image"
+ABI=7.3.4+deb13-amd64
+mkdir -p "$IMAGE"/{var/lib/dpkg,usr/lib/modules/$ABI,boot,etc/default}
+cat > "$IMAGE/var/lib/dpkg/status" <
+Description: official backport fixture
+EOF
+printf 'selected-kernel' > "$IMAGE/usr/lib/modules/$ABI/vmlinuz"
+cp "$IMAGE/usr/lib/modules/$ABI/vmlinuz" "$IMAGE/boot/vmlinuz-$ABI"
+printf 'retained-kernel' > "$IMAGE/boot/vmlinuz-7.3.4+deb14-amd64"
+printf 'GRUB_TOP_LEVEL="/boot/vmlinuz-%s"\n' "$ABI" > "$IMAGE/etc/default/grub"
+"$RECIPE/verify-kernel-backports.sh" "$IMAGE" amd64
+printf 'GRUB_TOP_LEVEL="/boot/vmlinuz-7.3.4+deb14-amd64"\n' > "$IMAGE/etc/default/grub"
+if "$RECIPE/verify-kernel-backports.sh" "$IMAGE" amd64 >/dev/null 2>&1; then
+ fail 'retained higher ABI selected'
+fi
+printf 'GRUB_TOP_LEVEL="/boot/vmlinuz-%s"\n' "$ABI" > "$IMAGE/etc/default/grub"
+printf 'wrong-kernel' > "$IMAGE/boot/vmlinuz-$ABI"
+if "$RECIPE/verify-kernel-backports.sh" "$IMAGE" amd64 >/dev/null 2>&1; then
+ fail 'mismatched boot binary accepted'
+fi
+cp "$IMAGE/usr/lib/modules/$ABI/vmlinuz" "$IMAGE/boot/vmlinuz-$ABI"
+sed -i 's/^Version:.*/Version: 7.2.12-1~bpo13+1/' "$IMAGE/var/lib/dpkg/status"
+if "$RECIPE/verify-kernel-backports.sh" "$IMAGE" amd64 >/dev/null 2>&1; then
+ fail 'old kernel package accepted'
+fi
+printf 'kernel backports tests passed\n'
diff --git a/projects/start-os/build/image-recipe/kernel-backports/verify-kernel-backports.sh b/projects/start-os/build/image-recipe/kernel-backports/verify-kernel-backports.sh
new file mode 100755
index 0000000000..77baaec544
--- /dev/null
+++ b/projects/start-os/build/image-recipe/kernel-backports/verify-kernel-backports.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -euo pipefail
+source "$(dirname "${BASH_SOURCE[0]}")/kernel-backports.conf"
+[ -f "$KERNEL_BACKPORT_ARCHIVE_LIST" ] || exit 0
+ROOT=$(realpath "$1")
+ARCH=$2
+VERSION=$(dpkg-query --admindir="$ROOT/var/lib/dpkg" -W -f='${Version}' "linux-image-$ARCH")
+dpkg --compare-versions "$VERSION" ge "$KERNEL_BACKPORT_VERSION"
+mapfile -t BINARIES < <(find "$ROOT/usr/lib/modules" -mindepth 2 -maxdepth 2 -name vmlinuz -type f)
+if [ "${#BINARIES[@]}" -ne 1 ]; then
+ echo 'Expected one image-selected kernel binary' >&2
+ exit 1
+fi
+KVER=$(basename "$(dirname "${BINARIES[0]}")")
+cmp "${BINARIES[0]}" "$ROOT/boot/vmlinuz-$KVER"
+grep -Fxq "GRUB_TOP_LEVEL=\"/boot/vmlinuz-$KVER\"" "$ROOT/etc/default/grub"
+printf 'Verified image kernel %s, package %s\n' "$KVER" "$VERSION"
diff --git a/projects/start-os/build/tests/backports-pref-test.sh b/projects/start-os/build/tests/backports-pref-test.sh
index e15fd2afc4..ecccc31fa0 100755
--- a/projects/start-os/build/tests/backports-pref-test.sh
+++ b/projects/start-os/build/tests/backports-pref-test.sh
@@ -27,7 +27,7 @@ cd "$TMP"
for IB_SUITE in trixie bookworm; do
export IB_SUITE
cat > "$TMP/expected" < \/etc\/NetworkManager\/NetworkManager.conf\n([\s\S]*?)\nEOF/)[1]
assert.match(nm, /^dns=none$/m)
+assert.match(nm, /^systemd-resolved=false$/m, 'NetworkManager must not publish per-link DNS to systemd-resolved')
for (const [script, server] of [['debian/postinst', '127.0.0.1'], ['container-runtime/deb-install.sh', '10.0.3.1']]) {
const source = read(base + script)
assert.deepEqual([...source.matchAll(/echo "nameserver ([^"]+)"/g)].map(match => match[1]), [server])
@@ -58,6 +59,6 @@ try {
}
const recipe = read(base + 'build/image-recipe/build.sh')
assert.doesNotMatch(recipe, /resolv\.conf\.bak/, 'must not restore build-host DNS into the shipped rootfs')
-assert.match(recipe, /\nretry lb chroot\n[\s\S]*?\nretry lb installer\nretry lb binary_chroot\nretry lb chroot_prep install all mode-apt-install-binary mode-archives-chroot\nretry lb binary_rootfs\n[\s\S]*?if \[ "\$\{IMAGE_TYPE\}" = iso \]; then/, 'ISO and img share live-build resolver cleanup and rootfs assembly')
+assert.match(recipe, /\nretry lb_chroot\n[\s\S]*?\nretry lb installer\nretry lb binary_chroot\nretry lb chroot_prep install all mode-apt-install-binary mode-archives-chroot\nretry lb binary_rootfs\n[\s\S]*?if \[ "\$\{IMAGE_TYPE\}" = iso \]; then/, 'ISO and img share live-build resolver cleanup and rootfs assembly')
console.log('DNS configuration preserves build DNS until live-build restores the runtime OS stub')
NODE
diff --git a/projects/start-os/build/tests/kernel-kbuild-test.sh b/projects/start-os/build/tests/kernel-kbuild-test.sh
new file mode 100755
index 0000000000..30530d2073
--- /dev/null
+++ b/projects/start-os/build/tests/kernel-kbuild-test.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -euo pipefail
+ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")/../../../..")
+WORK=$(mktemp -d)
+trap 'rm -rf -- "$WORK"' EXIT
+awk '
+/^KVER_ALL=/ { found=1 }
+found && /^if \[ "\$\{IB_SUITE\}" = trixie \]/ { exit }
+found { gsub(/\\\$/, "$"); print }
+' "$ROOT/projects/start-os/build/image-recipe/build.sh" > "$WORK/kbuild.sh"
+mkdir "$WORK/bin"
+cat > "$WORK/bin/ls" <<'EOF'
+#!/bin/bash
+printf '/boot/vmlinuz-target-abi\n'
+EOF
+cat > "$WORK/bin/apt-cache" <<'EOF'
+#!/bin/bash
+[ "$*" = 'depends linux-headers-target-abi' ] || exit 1
+printf ' Depends: linux-kbuild-from-header-metadata\n'
+EOF
+cat > "$WORK/bin/apt-get" <<'EOF'
+#!/bin/bash
+printf '%s\n' "$*" > "$RESULTS_DIR/kbuild-installed"
+EOF
+chmod +x "$WORK/bin/"*
+RESULTS_DIR="$WORK" PATH="$WORK/bin:$PATH" bash "$WORK/kbuild.sh"
+grep -Fxq 'install -y linux-kbuild-from-header-metadata' "$WORK/kbuild-installed"
+printf 'target kbuild selection test passed\n'
diff --git a/projects/start-os/changelog/minor-added-optical-drives.md b/projects/start-os/changelog/minor-added-optical-drives.md
new file mode 100644
index 0000000000..bf11fd6109
--- /dev/null
+++ b/projects/start-os/changelog/minor-added-optical-drives.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Services can be granted the server's optical drives, including ones connected while the service runs, so disc-ripping apps work with a USB or SATA drive.
diff --git a/projects/start-os/changelog/minor-added-volumes.md b/projects/start-os/changelog/minor-added-volumes.md
index 8b2af2ec33..9cb9a119e0 100644
--- a/projects/start-os/changelog/minor-added-volumes.md
+++ b/projects/start-os/changelog/minor-added-volumes.md
@@ -5,6 +5,7 @@ release-notes: true
- Share data between services, or with other devices, using local folders, folders on external drives and CIFS shares in System → Shared Volumes, with separate No Access, Read and Read/write grants for each supported service. Format a drive while adding it as a volume, update a CIFS share's connection details, and see each volume's availability, free space and source errors on the same page. Managed local folders and backup targets survive server restarts on the data drive. Deleting a volume permanently removes managed local data but preserves external-drive and network-share contents.
- Attached-drive lists update automatically. Shared-volume status, free space and source errors refresh after drive and network changes, with mounted shares following the kernel's connection state and periodic free-space checks. Service and backup mount requests reject disconnected shares without tearing down active mounts. Services refresh shared-volume mounts after drive replacement, older attachment cleanup leaves replacement mounts usable, and healthy idle shares avoid repeated network connections.
- Keep unsaved names, folder edits and discard warnings while volume, backup-target or drive updates arrive. Clear vanished drive or partition choices without automatically selecting formatting; removal or changed drive details during erase confirmation require a fresh choice. CIFS connection changes notify reactive services; existing mounts keep their source until remounted or restarted.
-- Services can treat missing registered folders as unavailable without accepting invalid mount requests.
+- Access changes deny future unauthorized mounts and detach incompatible SDK-managed mounts. Revocation is best-effort: independently created extra mounts and open files can remain usable.
+- Services can treat missing registered folders as unavailable without accepting invalid mount requests. Local shared folders preserve service file ownership across mounts and backup restores; existing prerelease folders migrate automatically without copying file data.
- Manage volumes and backup targets by name, with source error messages highlighted in red and a loading state while backup history is fetched. Partitions that already contain a StartOS backup are marked when adding a drive; stored CIFS targets and credentials carry forward automatically.
- Back up volumes independently of services and restore them as new local copies without overwriting existing data. Backup destinations cannot overlap source folders through case variations or local directory aliases. Local volumes and targets support fast deletion and remain registered for retry if deletion fails.
diff --git a/projects/start-os/changelog/patch-changed-default-locale-fallback.md b/projects/start-os/changelog/patch-changed-default-locale-fallback.md
new file mode 100644
index 0000000000..d54317bf3e
--- /dev/null
+++ b/projects/start-os/changelog/patch-changed-default-locale-fallback.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- When a service's description, release notes or alerts aren't translated into your language, StartOS shows the service's own default language instead of an arbitrary one.
diff --git a/projects/start-os/changelog/patch-changed-package-conversion-speed.md b/projects/start-os/changelog/patch-changed-package-conversion-speed.md
new file mode 100644
index 0000000000..d96a62789f
--- /dev/null
+++ b/projects/start-os/changelog/patch-changed-package-conversion-speed.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Speed up legacy service-package conversion on multi-core systems.
diff --git a/projects/start-os/changelog/patch-changed-raspberrypi-image-format.md b/projects/start-os/changelog/patch-changed-raspberrypi-image-format.md
new file mode 100644
index 0000000000..4b621702c5
--- /dev/null
+++ b/projects/start-os/changelog/patch-changed-raspberrypi-image-format.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Publish Raspberry Pi images in gzip-compressed `.img.gz` format.
diff --git a/projects/start-os/changelog/patch-fixed-bind-propagation.md b/projects/start-os/changelog/patch-fixed-bind-propagation.md
new file mode 100644
index 0000000000..f1271f6bda
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-bind-propagation.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Keep subcontainer bind mounts independent during cleanup and enforce read-only access on nested mounts.
diff --git a/projects/start-os/changelog/patch-fixed-connections-survive-address-changes.md b/projects/start-os/changelog/patch-fixed-connections-survive-address-changes.md
new file mode 100644
index 0000000000..60adf13911
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-connections-survive-address-changes.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Adding, removing or reconfiguring a gateway, or switching an address off, no longer disconnects open sessions on the addresses that remain enabled. Deleting a gateway no longer reports an error after it succeeds.
diff --git a/projects/start-os/changelog/patch-fixed-duplicate-ssh-key.md b/projects/start-os/changelog/patch-fixed-duplicate-ssh-key.md
new file mode 100644
index 0000000000..77bb4596cb
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-duplicate-ssh-key.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Re-adding an SSH key updates its existing entry, keeping its creation date, instead of duplicating its row. The SSH key list stays synchronized across browser sessions and CLI changes.
diff --git a/projects/start-os/changelog/patch-fixed-range-domain-renumber.md b/projects/start-os/changelog/patch-fixed-range-domain-renumber.md
new file mode 100644
index 0000000000..1916b216bd
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-range-domain-renumber.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- A port range's public IP address stays enabled with its plain public domain when the gateway's public IP changes, as it already did for single-port interfaces.
diff --git a/projects/start-os/changelog/patch-fixed-reflink-metadata.md b/projects/start-os/changelog/patch-fixed-reflink-metadata.md
new file mode 100644
index 0000000000..eeabb678a5
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-reflink-metadata.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Converting package volume folders to subvolumes keeps file capabilities and no longer adds inherited ACLs to copied files.
diff --git a/projects/start-os/changelog/patch-fixed-release-notes-height.md b/projects/start-os/changelog/patch-fixed-release-notes-height.md
new file mode 100644
index 0000000000..5089bf52c4
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-release-notes-height.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Show a package's release notes in full in the marketplace and Updates sidebars and on the sideload page, and open their links in a new tab.
diff --git a/projects/start-os/changelog/patch-fixed-restart-after-failed-service-teardown.md b/projects/start-os/changelog/patch-fixed-restart-after-failed-service-teardown.md
new file mode 100644
index 0000000000..fcd150c896
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-restart-after-failed-service-teardown.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Carry out a requested restart or shutdown when a service fails to stop cleanly, instead of entering Diagnostic Mode.
diff --git a/projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md b/projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md
new file mode 100644
index 0000000000..89b8dd41e1
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- DNS servers supplied by a VPN gateway no longer bypass the StartOS resolver for host lookups such as clock synchronization.
diff --git a/projects/start-os/changelog/patch-fixed-wireguard-gateway-discovery.md b/projects/start-os/changelog/patch-fixed-wireguard-gateway-discovery.md
new file mode 100644
index 0000000000..0a18386859
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-wireguard-gateway-discovery.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Fixed a newly added or reconnected WireGuard gateway sometimes staying unrecognized, with no IP information and its pinned services blocked, until the server restarted.
diff --git a/projects/start-os/changelog/patch-fixed-wireguard-gateway-mtu.md b/projects/start-os/changelog/patch-fixed-wireguard-gateway-mtu.md
new file mode 100644
index 0000000000..eb0a187c55
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-wireguard-gateway-mtu.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- WireGuard gateways now honor the `MTU` setting in their configuration, both when added and when their configuration is updated. Configurations without it still use the automatic MTU. Updating a gateway's configuration to a different MTU briefly reconnects it.
diff --git a/projects/start-os/changelog/patch-security-kernel-backports.md b/projects/start-os/changelog/patch-security-kernel-backports.md
new file mode 100644
index 0000000000..5a07d93c5e
--- /dev/null
+++ b/projects/start-os/changelog/patch-security-kernel-backports.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Fix Linux networking vulnerabilities CVE-2026-99284 and CVE-2026-99288 on x86 and generic ARM servers by updating to Debian-signed Linux 7.3.4.
diff --git a/projects/start-os/changelog/patch-security-pi-tcp-kernel.md b/projects/start-os/changelog/patch-security-pi-tcp-kernel.md
new file mode 100644
index 0000000000..4c09e36eab
--- /dev/null
+++ b/projects/start-os/changelog/patch-security-pi-tcp-kernel.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Update the Raspberry Pi kernel to fix CVE-2026-98432, a flaw in TCP connection handling.
diff --git a/projects/start-os/container-runtime/AGENTS.md b/projects/start-os/container-runtime/AGENTS.md
index 8279157173..6f34d552c0 100644
--- a/projects/start-os/container-runtime/AGENTS.md
+++ b/projects/start-os/container-runtime/AGENTS.md
@@ -36,6 +36,7 @@ Tests are Jest + `ts-jest` (`jest.config.js`, `rootDir: ./src`). `mime` is mocke
- Compiled JS is installed into the container at `/usr/lib/startos/init/index.js` (the systemd unit runs `start-container pipe-wrap node … /usr/lib/startos/init/index.js`).
- `update-image-local.sh` mounts the **repo root** into `start9/build-env` (at `/root/start-os`) and runs `update-image.sh` inside it. `update-image.sh` `cd`s to its own dir (`projects/start-os/container-runtime/`), so it reaches the repo-root build output three levels up — it copies `start-container` from `../../../target/-unknown-linux-musl/release/`.
- The squashfs lands at `rootfs..squashfs` and is installed to `/usr/lib/startos/container-runtime/rootfs.squashfs`.
+- `update-image.sh` runs target-architecture code (`deb-install.sh` in the chroot), so CI builds the rootfs once per architecture on a native runner, in `build-products.yaml`'s `rootfs` job, not in its cross-compiling build job: `compiled-.tar.gz` carries `dist/` and `start-container` instead, and each image build downloads `rootfs..squashfs`. A pull request changing these scripts or units builds the images through `OS_IMAGE_PATHS` in `.github/scripts/changed-products.mjs`.
## Host effects bindings
diff --git a/projects/start-os/container-runtime/ARCHITECTURE.md b/projects/start-os/container-runtime/ARCHITECTURE.md
index bc8d907a73..33234b1afa 100644
--- a/projects/start-os/container-runtime/ARCHITECTURE.md
+++ b/projects/start-os/container-runtime/ARCHITECTURE.md
@@ -32,16 +32,17 @@ This runtime lives at `projects/start-os/container-runtime` and is a Node.js pac
## `/media/startos/` directory (mounted by the host into the container)
-| Path | Description |
-| -------------------- | ----------------------------------------------------- |
-| `volumes//` | Package data volumes (id-mapped, persistent) |
-| `assets/` | Read-only assets from s9pk `assets.squashfs` |
-| `images//` | Container images (squashfs, used for subcontainers) |
-| `images/.env` | Environment variables for image |
-| `images/.json` | Image metadata |
-| `backup/` | Backup mount point (mounted during backup operations) |
-| `rpc/service.sock` | RPC socket (container runtime listens here) |
-| `rpc/host.sock` | Host RPC socket (effects callbacks back to host) |
+| Path | Description |
+| -------------------- | ------------------------------------------------------------------ |
+| `volumes//` | Package data volumes (id-mapped, persistent) |
+| `shared-volumes/` | Host-owned shared sources and read-only placeholder for host binds |
+| `assets/` | Read-only assets from s9pk `assets.squashfs` |
+| `images//` | Container images (squashfs, used for subcontainers) |
+| `images/.env` | Environment variables for image |
+| `images/.json` | Image metadata |
+| `backup/` | Backup mount point (mounted during backup operations) |
+| `rpc/service.sock` | RPC socket (container runtime listens here) |
+| `rpc/host.sock` | Host RPC socket (effects callbacks back to host) |
## RPC protocol
@@ -55,7 +56,7 @@ The runtime ships as a squashfs rootfs baked into the StartOS image:
1. `download-base-image.sh` fetches the Debian trixie LXC base (`debian..squashfs`).
2. `npm run build` compiles `src/` to `dist/`; `install-dist-deps.sh` installs production deps into `dist/node_modules`.
-3. `update-image-local.sh` runs `update-image.sh` inside the `start9/build-env` container: it overlays `dist/` into the base at `/usr/lib/startos/init/`, drops in `start-container` and the systemd units, runs `deb-install.sh` in the chroot to upgrade base packages and install runtime dependencies, and mksquashfs's the result to `rootfs..squashfs`.
+3. `update-image-local.sh` runs `update-image.sh` inside the `start9/build-env` container: it extracts the base, copies `dist/` into it at `/usr/lib/startos/init/`, drops in `start-container` and the systemd units, runs `deb-install.sh` in the chroot to upgrade base packages and install runtime dependencies, and mksquashfs's the result to `rootfs..squashfs`.
The top-level `Makefile` orchestrates all of this (`projects/start-os/container-runtime/rootfs.$(ARCH).squashfs` target); the squashfs is installed to `/usr/lib/startos/container-runtime/rootfs.squashfs` in the final OS image.
diff --git a/projects/start-os/container-runtime/package-lock.json b/projects/start-os/container-runtime/package-lock.json
index 008f8bd145..e8aa0e7cb1 100644
--- a/projects/start-os/container-runtime/package-lock.json
+++ b/projects/start-os/container-runtime/package-lock.json
@@ -64,7 +64,7 @@
},
"../../start-sdk/dist": {
"name": "@start9labs/start-sdk",
- "version": "4.2.0",
+ "version": "5.0.0",
"bundleDependencies": [
"@start9labs/start-core"
],
@@ -79,13 +79,13 @@
"@vercel/ncc": "^0.38.4",
"deep-equality-data-structures": "^2.0.0",
"eslint": "^9.39.4",
- "fast-xml-parser": "~5.7.0",
+ "fast-xml-parser": "^5.12.1",
"ini": "^5.0.0",
"isomorphic-fetch": "^3.0.0",
"mime": "^4.1.0",
"prettier": "3.8.3",
"typescript": "^6.0.3",
- "typescript-eslint": "^8.61.0",
+ "typescript-eslint": "^8.73.0",
"yaml": "^2.8.3",
"zod": "4.6.7"
},
diff --git a/projects/start-os/container-runtime/src/Adapters/EffectCreator.test.ts b/projects/start-os/container-runtime/src/Adapters/EffectCreator.test.ts
index 1d6bc01730..9c15529eb3 100644
--- a/projects/start-os/container-runtime/src/Adapters/EffectCreator.test.ts
+++ b/projects/start-os/container-runtime/src/Adapters/EffectCreator.test.ts
@@ -501,7 +501,7 @@ describe('generated effects RPC boundary', () => {
{ kind: 'unavailable', reason: 'sourceUnavailable' },
{ kind: 'unavailable', reason: 'timeout' },
])(
- 'preserves shared-volume mount outcome %j and original fields',
+ 'delegates shared-volume mounting once and preserves outcome %j and original fields',
async outcome => {
const effects = makeEffects({ eventId: null })
const options = Object.freeze({
diff --git a/projects/start-os/container-runtime/update-image-local.sh b/projects/start-os/container-runtime/update-image-local.sh
index c92b4e9809..08b39f06b5 100755
--- a/projects/start-os/container-runtime/update-image-local.sh
+++ b/projects/start-os/container-runtime/update-image-local.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+set -e
+
cd "$(dirname "${BASH_SOURCE[0]}")/../../.."
USE_TTY=
diff --git a/projects/start-os/container-runtime/update-image.sh b/projects/start-os/container-runtime/update-image.sh
index 7a453c2055..0c01afe21b 100755
--- a/projects/start-os/container-runtime/update-image.sh
+++ b/projects/start-os/container-runtime/update-image.sh
@@ -9,10 +9,9 @@ if [ "$ARCH" = "riscv64" ]; then
RUST_ARCH="riscv64gc"
fi
+# The riscv64 image runner's kernel cannot mount squashfs.
mount -t tmpfs tmpfs /tmp
-mkdir -p /tmp/lower /tmp/upper /tmp/work /tmp/combined
-mount -o loop debian.${ARCH}.squashfs /tmp/lower
-mount -t overlay -olowerdir=/tmp/lower,upperdir=/tmp/upper,workdir=/tmp/work overlay /tmp/combined
+unsquashfs -q -d /tmp/combined debian.${ARCH}.squashfs
mkdir -p /tmp/combined/usr/lib/startos/
cp ../build/lib/resolved.conf /tmp/combined/usr/lib/startos/resolved.conf
diff --git a/projects/start-os/debian/postinst b/projects/start-os/debian/postinst
index f9794c5c67..7fb9b021a8 100755
--- a/projects/start-os/debian/postinst
+++ b/projects/start-os/debian/postinst
@@ -44,6 +44,7 @@ if [ -f /etc/default/grub ]; then
mkdir -p /etc/default/grub.d
cp /usr/lib/startos/grub-user.cfg /etc/default/grub.d/zz-startos-user.cfg
grub_set GRUB_DISTRIBUTOR "StartOS v$(cat /usr/lib/startos/VERSION.txt)"
+ # Image-built defaults must select their kernel across lower-ABI updates.
grub_set GRUB_TOP_LEVEL "$(ls -1 /boot/vmlinuz-* | sort -V | tail -n1)"
# Graphical terminal (serial added conditionally via /etc/grub.d/01_serial)
grub_set GRUB_TERMINAL_INPUT 'console'
@@ -143,10 +144,12 @@ rm -f "$resolv_conf"
echo "nameserver 127.0.0.1" > "$resolv_conf"
echo "#" > /etc/network/interfaces
+# The StartOS resolver is the only host DNS path; NetworkManager publishes no resolver config.
cat << EOF > /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
dns=none
+systemd-resolved=false
[ifupdown]
managed=true
diff --git a/projects/start-os/docs/src/clearnet.md b/projects/start-os/docs/src/clearnet.md
index 4b3f9b3656..f11a24cefa 100644
--- a/projects/start-os/docs/src/clearnet.md
+++ b/projects/start-os/docs/src/clearnet.md
@@ -29,7 +29,7 @@ If your gateway is your home router, you are revealing the approximate location
| **IP stability** | Home IP can change without warning, breaking all your domains until DNS is updated. [Dynamic DNS](https://en.wikipedia.org/wiki/Dynamic_DNS) is highly recommended, but support varies by router and may cost money. | Static IP from the VPS provider. No dynamic DNS needed. |
| **Privacy** | Exposes your home's approximate location | Exposes the VPS location, not your home |
| **CGNAT compatible** | No. If your ISP uses [CGNAT](cgnat.md), you cannot use your router as a gateway. | Yes |
-| **Port forwarding** | Configured in router admin panel | Configured in [StartTunnel](/start-tunnel/port-forwarding.html) |
+| **Port forwarding** | Configured in router admin panel | Configured in [StartTunnel](/start-tunnel/published-ports.html) |
## Add a Public Domain
@@ -46,7 +46,7 @@ If your gateway is your home router, you are revealing the approximate location
1. StartOS automatically tests your DNS record and port forwarding — plus the IPv6 firewall when your gateway has a GUA, and port `443` for a Let's Encrypt domain served on any other port. If everything passes, the domain is ready to use. Otherwise a setup modal appears showing what still needs attention, with instructions and the ability to re-test each check.
> [!NOTE]
- > The port `443` test is what tells you a Let's Encrypt domain will work: the authority validates there regardless of which port the address itself uses, and until the first certificate is issued the address answers nothing. The test applies while the domain is waiting on that certificate and again through each renewal window — a domain being renewed keeps serving the certificate it holds, so keep `443` forwarded and it renews without interruption. See [Configure Port Forwarding](#configure-port-forwarding); the rule also appears under **System → Gateways → Port Forwards**.
+ > The port `443` test is advisory: StartOS requests a Let's Encrypt certificate the first time a TLS connection for the domain reaches its service port, whether or not the test passed. The authority validates on port `443` regardless of which port the address itself uses, and until the first certificate is issued the address answers nothing. The test applies while the domain is waiting on that certificate and again through each renewal window — a domain being renewed keeps serving the certificate it holds, so keep `443` forwarded and it renews without interruption. See [Configure Port Forwarding](#configure-port-forwarding); the rule also appears under **System → Gateways → Port Forwards**.
## Set Up DNS Records
@@ -60,6 +60,9 @@ StartOS tests DNS automatically when you add or enable a public domain, and will
If you use subdomains, consider using a wildcard (`*`) for that host so that all future subdomains work without needing additional records.
+ > [!WARNING]
+ > If your DNS is on Cloudflare, set the record to **DNS only**. A proxied record (the orange cloud) points the name at Cloudflare instead of your gateway, so the DNS test fails and Let's Encrypt cannot validate the domain.
+
> [!TIP]
> It can take up to a few hours for DNS changes to propagate. You can check propagation using [https://dnschecker.org](https://dnschecker.org).
@@ -77,9 +80,19 @@ When a public address is enabled, StartOS first **attempts to open the port auto
> [!IMPORTANT]
> A Let's Encrypt domain needs port `443` even when its interface is served somewhere else — an Electrum server on `50002`, for example. Let's Encrypt proves you control a name by connecting to it on port `443`, regardless of which port the service behind it uses, and StartOS answers there for every domain it holds an authority for. Over StartTunnel, StartOS claims `443` for that domain automatically alongside the interface's own port, and over IPv6 it opens the matching `443` pinhole, so there is nothing to do. On a router, forward `443` to your server as you would for a standard domain, and keep it forwarded — the certificate is renewed the same way, and the rule is listed for you under **System → Gateways → Port Forwards**. Such a domain is served on its own port only, so reach it as `https://:`. Choose **Local Root CA** instead for a domain whose gateway cannot offer port `443`.
+>
+> To confirm the StartTunnel route, open **Published Ports** in StartTunnel: the **Automatic** table should list port `443` to your server with the exact domain as its hostname. If it is missing, check that auto-publish is on for the server, or add the entry by hand — External `443`, your server, Internal `443`, IPv4, and the domain as its [Hostname](/start-tunnel/published-ports.html#sni-hostnames-ipv4-only).
How you create a port forwarding rule depends on the type of gateway.
- **Routers**: Port forwarding is supported by all routers and easy to do. Many routers also support PCP, NAT-PMP, or UPnP, in which case StartOS opens the port for you automatically. If none is available or they are disabled, refer to your router's manual to add the rule manually.
-- **StartTunnel**: StartTunnel supports PCP and UPnP over the tunnel, so StartOS opens the required port automatically. To add or manage forwards manually, refer to the [StartTunnel Port Forwarding guide](/start-tunnel/port-forwarding.html).
+- **StartTunnel**: StartTunnel supports PCP and UPnP over the tunnel, so StartOS opens the required port automatically. To add or manage forwards manually, refer to the [StartTunnel Published Ports guide](/start-tunnel/published-ports.html).
+
+## Troubleshooting Let's Encrypt
+
+- **`Network Error … error sending request for url (https://ifconfig.co/port/443)`.** StartOS could not reach the outside services it asks to test the port (`ipconfig.io` and `ifconfig.co` by default). That says nothing about whether the port is open, and it does not block the certificate. Over StartTunnel, StartOS skips them when an automatic mapping for the port reports a public IP, so this error means either no automatic mapping is active or, on a StartTunnel host behind upstream NAT, it reports a private IP: check **Published Ports** as described in [Configure Port Forwarding](#configure-port-forwarding). To test the port yourself, run `curl -v https://ifconfig.co/port/443` on the VPS, not on your server, which would test your home connection instead.
+
+- **No certificate, no "Could not get a certificate" notification, and no ACME lines in the logs** (such as `performing ACME auth challenge` or `ACME order failed`). Connect to the domain on the service's actual port to trigger issuance — for example, `50002` for an Electrum interface. Port `443` carries validation, but a normal connection to `443` does not trigger an order for a domain served only on another port. If there are still no ACME messages, check the Let's Encrypt configuration, the DNS record, and forwarding for both the service port and `443`.
+
+- **A "Could not get a certificate for …" notification.** The order failed or timed out. The notification gives the reason.
diff --git a/projects/start-os/docs/src/cli-reference.md b/projects/start-os/docs/src/cli-reference.md
index 32a8cfb6ea..52da1b1138 100644
--- a/projects/start-os/docs/src/cli-reference.md
+++ b/projects/start-os/docs/src/cli-reference.md
@@ -675,7 +675,11 @@ Manage authorized SSH keys for server access.
### `start-cli ssh add `
-Add an SSH public key.
+Add an SSH public key. Pass the key's text, not its path, as a single quoted argument:
+
+```sh
+start-cli ssh add "$(cat ~/.ssh/id_ed25519.pub)"
+```
### `start-cli ssh list`
@@ -683,9 +687,9 @@ List authorized SSH keys.
- `--format` — Output format
-### `start-cli ssh remove `
+### `start-cli ssh remove `
-Remove an SSH key.
+Remove an SSH key by the fingerprint `start-cli ssh list` shows for it.
## WiFi
@@ -976,6 +980,14 @@ Set the registry's description (markdown), shown above its services in the marke
Over RPC, pass `null` in the setter's `description` field to clear it; a value sets it.
+### `start-cli registry info set-default-locale [DEFAULT_LOCALE] [--clear]`
+
+Set the locale, such as `en_US`, that the registry's own description, category names and OS release notes fall back to when a reader's language is missing. Supply either `DEFAULT_LOCALE` or `--clear`, but not both.
+
+- `--clear` — Remove the registry's default locale
+
+Over RPC, pass `null` in the setter's `defaultLocale` field to clear it; a value sets it.
+
### `start-cli registry info set-trust-signers [SIGNER...]`
Select which existing signers the registry offers to StartOS servers for package trust. Run it without signer IDs to clear the selection. See [Trusted Keys](trusted-keys.md#keys-from-registries) for how StartOS treats offered keys.
diff --git a/projects/start-os/docs/src/faq.md b/projects/start-os/docs/src/faq.md
index 901cd45dc1..e1e4031571 100644
--- a/projects/start-os/docs/src/faq.md
+++ b/projects/start-os/docs/src/faq.md
@@ -108,7 +108,7 @@ If you would rather not use a terminal, paste the domain into [dnschecker.org](h
- **The domain is private.** A private domain has no public record, so a public resolver never answers for it. It resolves only through the DNS server of the gateway it was added to: on an Ethernet or WiFi gateway your router must hand out StartOS as its DNS server, and on a StartTunnel gateway your device must be connected to the tunnel _and_ using the tunnel's resolver, with [DNS injection](/start-tunnel/dns-records.html) enabled for the server (the default). A phone runs only one VPN at a time, so turning on a privacy VPN such as ProtonVPN or Mullvad disconnects your StartTunnel tunnel and takes its resolver with it; private domains stop resolving until you switch back. If your device is connected and still gets no answer, check that the record appears on StartTunnel's DNS Records page, then re-import a freshly generated config for the device: configs generated before StartTunnel 1.1.0 have no `DNS =` line, so the device keeps asking its usual resolver. If the private domain is also a real domain with public records, a device that is not using the gateway's resolver gets the public answer instead, which can look like the name works while it points somewhere else entirely.
-- **The answer is the right address, but the page still does not load.** The right address is your gateway's public IP for a public domain, and your server's LAN IP or tunnel address for a private one. DNS is not the problem. For a private domain, confirm the device is actually on that network (the tunnel is connected, or you are on the LAN) and that you have [trusted your Root CA](trust-ca.md). For a public domain, run the port-forwarding test from the address's **Settings** on the service's [Interfaces](interfaces.md) tab.
+- **The answer is the right address, but the page still does not load.** The right address is your gateway's public IP for a public domain, and your server's LAN IP or tunnel address for a private one. DNS is not the problem. For a private domain, confirm the device is actually on that network (the tunnel is connected, or you are on the LAN) and that you have [trusted your Root CA](trust-ca.md). For a public domain, run the port-forwarding test from the address's **Settings** on the service's [Interfaces](interfaces.md) tab. If the domain uses Let's Encrypt and has no certificate yet, see [Troubleshooting Let's Encrypt](clearnet.md#troubleshooting-lets-encrypt).
## A public domain still loads after disabling it
diff --git a/projects/start-os/docs/src/shared-volumes.md b/projects/start-os/docs/src/shared-volumes.md
index a167501dfb..eded187ec1 100644
--- a/projects/start-os/docs/src/shared-volumes.md
+++ b/projects/start-os/docs/src/shared-volumes.md
@@ -28,16 +28,16 @@ Use a volume's **Manage** dialog, or the service's **Shared Volumes** page. Each
The **Shared Volumes** tab appears only for services that support shared volumes. Creating a volume grants access to no services automatically. Multiple services can use the same volume with different access modes.
-Revoking access detaches that service's attachments without detaching other consumers. How a service responds to missing storage depends on its package. Prefer volumes for optional media, documents and other shared files rather than operation-critical databases.
+Revocation is best-effort. Access changes control future mount requests and detach incompatible SDK-managed mounts. Extra mounts created independently by a service and open files can remain usable. Services that read their volume configuration reactively refresh affected workloads through their normal lifecycle; other consumers retain their own access. A saved **No Access** or **Read** setting does not prove earlier access has ended. Prefer volumes for optional media, documents and other shared files rather than operation-critical databases.
## Remove a volume
Remove a volume from its **Manage** dialog. Removing revokes all service access, and what happens to the data depends on the source:
-- For a managed **Local folder**, the button reads **Delete**. It permanently deletes the folder and its contents after attachments are detached, so StartOS asks you to type the volume's name to confirm.
+- For a managed **Local folder**, the button reads **Delete**. It permanently deletes the folder and its contents after managed source mounts are cleaned up, so StartOS asks you to type the volume's name to confirm.
- For an **External drive** or **CIFS share**, **Remove** deletes the volume configuration but leaves the source's contents untouched.
-If detachment or local deletion fails, StartOS reports the error and keeps the local volume registered without service access. Retry **Delete** from its **Manage** dialog. Local deletion completes before the request returns; the filesystem can reclaim its space afterward.
+If managed-source cleanup or local deletion fails, StartOS reports the error and keeps the local volume registered without service access. Retry **Delete** from its **Manage** dialog. Local deletion completes before the request returns; the filesystem can reclaim its space afterward.
Uninstalling or rolling back a consuming service leaves volume contents untouched.
diff --git a/projects/start-os/web/ui/scripts/ssh-keys.test.mjs b/projects/start-os/web/ui/scripts/ssh-keys.test.mjs
new file mode 100644
index 0000000000..04477cf0f9
--- /dev/null
+++ b/projects/start-os/web/ui/scripts/ssh-keys.test.mjs
@@ -0,0 +1,133 @@
+import assert from 'node:assert/strict'
+import test from 'node:test'
+import '@angular/compiler'
+import { createEnvironmentInjector, runInInjectionContext } from '@angular/core'
+import { Subject } from 'rxjs'
+import { loadTypeScript } from './typescript-loader.mjs'
+
+loadTypeScript(
+ new Map([
+ [
+ '@start9labs/shared',
+ `export class DialogService {}
+ export class DocsLinkDirective {}
+ export class i18nPipe {}
+ export class TaskService {}`,
+ ],
+ ['@start9labs/start-core', 'export const ISB = {}'],
+ ['@taiga-ui/core', 'export class TuiButton {}'],
+ ['src/app/services/api/embassy-api.service', 'export class ApiService {}'],
+ [
+ 'src/app/services/form-dialog.service',
+ 'export class FormDialogService {}',
+ ],
+ ['src/app/services/title.service', 'export class TitleDirective {}'],
+ [
+ 'src/app/routes/portal/components/form.component',
+ 'export class FormComponent {}',
+ ],
+ [
+ 'src/app/utils/configBuilderToSpec',
+ 'export const configBuilderToSpec = value => value',
+ ],
+ ['./table.component', 'export class SSHTableComponent {}'],
+ ]),
+)
+const { PatchDB } = await import('patch-db-client')
+const { DialogService, i18nPipe, TaskService } =
+ await import('@start9labs/shared')
+const { ApiService } = await import('src/app/services/api/embassy-api.service')
+const { FormDialogService } =
+ await import('src/app/services/form-dialog.service')
+const { sshKeyRows } = await import('src/app/utils/ssh-keys')
+const { default: Ssh } =
+ await import('src/app/routes/portal/routes/system/routes/ssh/ssh.component')
+
+const keyData =
+ 'AAAAC3NzaC1lZDI1NTE5AAAAIMcFf+jmv4w+tRbA1aXDvovqViM0NVRu86Hk5kcQItfI'
+const fingerprint = '00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff'
+const createdAt = '2020-01-01T00:00:00Z'
+const stored = value => ({
+ created_at: createdAt,
+ updated_at: '2021-01-01T00:00:00Z',
+ value,
+})
+const expected = hostname => ({
+ fingerprint,
+ alg: 'ssh-ed25519',
+ hostname,
+ createdAt,
+})
+
+for (const [name, options] of [
+ ['bare key', ''],
+ ['restricted key', 'restrict '],
+ ['multiple options', 'from="192.0.2.0/24",no-pty '],
+ ['quoted command', 'command="echo ssh-ed25519 AAAA decoy",no-pty '],
+ [
+ 'escaped quotes',
+ String.raw`command="printf \"ssh-rsa AAAA decoy\"",restrict `,
+ ],
+]) {
+ test(`${name} keeps options out of the algorithm and hostname`, () => {
+ const hostname = 'workstation rack\tone'
+ assert.deepEqual(
+ sshKeyRows({
+ [fingerprint]: stored(`${options}ssh-ed25519 ${keyData} ${hostname}`),
+ }),
+ [expected(hostname)],
+ )
+ })
+}
+
+test('empty collections and keys without comments remain displayable', () => {
+ assert.deepEqual(sshKeyRows({}), [])
+ for (const suffix of ['', ' ']) {
+ assert.deepEqual(
+ sshKeyRows({
+ [fingerprint]: stored(`ssh-ed25519 ${keyData}${suffix}`),
+ }),
+ [expected('')],
+ )
+ }
+})
+
+test('an older cached snapshot stays loading until the SSH collection arrives', t => {
+ const updates = new Subject()
+ const patch = new PatchDB(updates)
+ patch.start()
+ updates.next([{ id: 7, value: { serverInfo: {} } }])
+ const injector = createEnvironmentInjector([
+ { provide: PatchDB, useValue: patch },
+ ...[
+ ApiService,
+ TaskService,
+ FormDialogService,
+ i18nPipe,
+ DialogService,
+ ].map(provide => ({ provide, useValue: {} })),
+ ])
+ t.after(() => {
+ injector.destroy()
+ patch.stop()
+ })
+ const page = runInInjectionContext(injector, () => new Ssh())
+ assert.equal(page.keys(), null)
+
+ updates.next([
+ {
+ id: 8,
+ value: {
+ serverInfo: {},
+ sshPubkeys: {
+ [fingerprint]: stored(`restrict ssh-ed25519 ${keyData} workstation`),
+ },
+ },
+ },
+ ])
+ assert.deepEqual(page.keys(), [expected('workstation')])
+ updates.next([
+ { id: 9, patch: [{ op: 'remove', path: `/sshPubkeys/${fingerprint}` }] },
+ ])
+ assert.deepEqual(page.keys(), [])
+})
diff --git a/projects/start-os/web/ui/scripts/ui.test.mjs b/projects/start-os/web/ui/scripts/ui.test.mjs
index a9fa17fdcc..230ae6e3ba 100644
--- a/projects/start-os/web/ui/scripts/ui.test.mjs
+++ b/projects/start-os/web/ui/scripts/ui.test.mjs
@@ -300,8 +300,8 @@ const catalog = {
'0.4.0.3': { releaseNotes: 'newer', squashfs },
}
const candidates = [
- { version: '0.4.0.4', notes: 'newest', squashfs },
- { version: '0.4.0.3', notes: 'newer', squashfs },
+ { version: '0.4.0.4', notes: 'newest', squashfs, defaultLocale: 'pl_PL' },
+ { version: '0.4.0.3', notes: 'newer', squashfs, defaultLocale: 'pl_PL' },
]
const state = version => ({
registryCache: {},
@@ -513,7 +513,7 @@ function fixture(t, cachedVersion, providers = []) {
versions = catalog,
{ registry = 'https://registry.test/', status = 'connected' } = {},
) {
- osUpdateCache = { registry, versions, status }
+ osUpdateCache = { registry, versions, defaultLocale: 'pl_PL', status }
source.next([
{
id: ++revision,
@@ -1090,7 +1090,14 @@ test('a registry switch releases a load waiting for the previous source without
{ registry: 'https://second.test' },
)
await f.os.checkForUpdates()
- assert.equal(f.os.updateCandidates()[0].notes, 'selected')
+ assert.deepEqual(f.os.updateCandidates(), [
+ {
+ version: '0.4.0.3',
+ notes: 'selected',
+ squashfs,
+ defaultLocale: 'pl_PL',
+ },
+ ])
})
test('without a cache, load waits for the first live state', async t => {
@@ -1137,7 +1144,12 @@ test('strictly newer candidates sort descending; offline cache remains readable;
assert.equal(f.requests.length, 0)
await f.load({ '0.4.0.5': { releaseNotes: 'refreshed', squashfs } })
assert.deepEqual(f.os.updateCandidates(), [
- { version: '0.4.0.5', notes: 'refreshed', squashfs },
+ {
+ version: '0.4.0.5',
+ notes: 'refreshed',
+ squashfs,
+ defaultLocale: 'pl_PL',
+ },
])
})
@@ -1150,7 +1162,12 @@ test('a different image at the installed version is offered and submitted', asyn
})
assert.deepEqual(f.os.updateCandidates(), [
...candidates,
- { version: '0.4.0.2', notes: 'next image', squashfs },
+ {
+ version: '0.4.0.2',
+ notes: 'next image',
+ squashfs,
+ defaultLocale: 'pl_PL',
+ },
])
await f.load({
@@ -1211,7 +1228,12 @@ test('a same-version image is offered from the synced catalog without a manual c
'0.4.0.2': { releaseNotes: 'next image', squashfs, gitHash: nextGitHash },
})
assert.deepEqual(f.os.updateCandidates(), [
- { version: '0.4.0.2', notes: 'next image', squashfs },
+ {
+ version: '0.4.0.2',
+ notes: 'next image',
+ squashfs,
+ defaultLocale: 'pl_PL',
+ },
])
assert.equal(f.availability.at(-1), true)
f.build(nextGitHash)
diff --git a/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/components/controls.component.ts b/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/components/controls.component.ts
index aec90f432f..d108da56df 100644
--- a/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/components/controls.component.ts
+++ b/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/components/controls.component.ts
@@ -159,7 +159,7 @@ export class MarketplaceControlsComponent {
if (
!this.file() &&
!(await this.alerts.alertPreDownload(
- this.pkg().preDownloadAlert,
+ this.pkg(),
localPkg ? getManifest(localPkg).version : null,
))
)
diff --git a/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/services/alerts.service.ts b/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/services/alerts.service.ts
index 4cf552973d..0edf88b38d 100644
--- a/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/services/alerts.service.ts
+++ b/projects/start-os/web/ui/src/app/routes/portal/routes/marketplace/services/alerts.service.ts
@@ -20,6 +20,7 @@ import { MarketplaceService } from 'src/app/services/marketplace.service'
type PreDownloadDialogData = TuiConfirmData & {
content: PolymorpheusComponent
message: T.LocaleString
+ defaultLocale?: string | null
}
@Component({
@@ -28,7 +29,9 @@ type PreDownloadDialogData = TuiConfirmData & {
`,
@@ -41,9 +44,8 @@ type PreDownloadDialogData = TuiConfirmData & {
],
})
class PreDownloadMessage {
- protected readonly message =
+ protected readonly data =
injectContext>().data
- .message
}
const PRE_DOWNLOAD_MESSAGE = new PolymorpheusComponent(PreDownloadMessage)
@@ -86,7 +88,10 @@ export class MarketplaceAlertsService {
}
async alertPreDownload(
- alert: T.PreDownloadAlert | null | undefined,
+ {
+ preDownloadAlert: alert,
+ defaultLocale,
+ }: Pick,
sourceVersion: string | null,
): Promise {
if (
@@ -100,6 +105,7 @@ export class MarketplaceAlertsService {
const data: PreDownloadDialogData = {
content: PRE_DOWNLOAD_MESSAGE,
message: alert.message,
+ defaultLocale,
yes: 'Continue',
no: 'Cancel',
}
diff --git a/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/general/update.component.ts b/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/general/update.component.ts
index 84983f4001..07faf0f0c2 100644
--- a/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/general/update.component.ts
+++ b/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/general/update.component.ts
@@ -40,7 +40,9 @@ import { TRUSTED_KEYS_LINK } from '../../system.const'
}
}
diff --git a/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/ssh/ssh.component.ts b/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/ssh/ssh.component.ts
index e25384121a..6a1fff567f 100644
--- a/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/ssh/ssh.component.ts
+++ b/projects/start-os/web/ui/src/app/routes/portal/routes/system/routes/ssh/ssh.component.ts
@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common'
import { Component, inject, viewChild } from '@angular/core'
+import { toSignal } from '@angular/core/rxjs-interop'
import { RouterLink } from '@angular/router'
import {
DialogService,
@@ -9,12 +10,15 @@ import {
} from '@start9labs/shared'
import { ISB, T } from '@start9labs/start-core'
import { TuiButton } from '@taiga-ui/core'
-import { filter, from, merge, Subject } from 'rxjs'
+import { PatchDB } from 'patch-db-client'
+import { filter, map } from 'rxjs'
import { FormComponent } from 'src/app/routes/portal/components/form.component'
import { ApiService } from 'src/app/services/api/embassy-api.service'
import { FormDialogService } from 'src/app/services/form-dialog.service'
+import { DataModel } from 'src/app/services/patch-db/data-model'
import { TitleDirective } from 'src/app/services/title.service'
import { configBuilderToSpec } from 'src/app/utils/configBuilderToSpec'
+import { sshKeyRows } from 'src/app/utils/ssh-keys'
import { SSHTableComponent } from './table.component'
@Component({
@@ -35,7 +39,7 @@ import { SSHTableComponent } from './table.component'
>
- @let keys = keys$ | async;
+ @let keys = this.keys();
{{ 'SSH Access' | i18n }}
@@ -55,7 +59,7 @@ import { SSHTableComponent } from './table.component'
class="delete"
size="xs"
appearance="primary-destructive"
- (click)="remove(keys || [])"
+ (click)="remove()"
>
{{ 'Remove' | i18n }}
@@ -65,13 +69,13 @@ import { SSHTableComponent } from './table.component'
size="xs"
iconStart="@tui.plus"
[style.margin]="'0 0.5rem 0 auto'"
- (click)="add(keys || [])"
+ (click)="add()"
>
{{ 'Add' | i18n }}
}
-
+
`,
styles: `
@@ -100,13 +104,18 @@ export default class SystemSSHComponent {
private readonly i18n = inject(i18nPipe)
private readonly dialogs = inject(DialogService)
- private readonly local$ = new Subject()
+ protected readonly keys = toSignal(
+ inject>(PatchDB).watch$('sshPubkeys').pipe(
+ // Cached snapshots can predate `sshPubkeys`.
+ filter(Boolean),
+ map(sshKeyRows),
+ ),
+ { initialValue: null },
+ )
+ protected readonly tableKeys =
+ viewChild>('table')
- readonly keys$ = merge(from(this.api.rpc.ssh.list({})), this.local$)
-
- protected tableKeys = viewChild>('table')
-
- async add(all: readonly T.SshKeyResponse[]) {
+ async add() {
const spec = ISB.InputSpec.of({
key: ISB.Value.text({
name: this.i18n.transform('Public Key'),
@@ -131,8 +140,7 @@ export default class SystemSSHComponent {
text: this.i18n.transform('Save'),
handler: async ({ key }: typeof spec._TYPE) =>
this.tasks.run(async () => {
- const newKey = await this.api.rpc.ssh.add({ key })
- this.local$.next([newKey, ...all])
+ await this.api.rpc.ssh.add({ key })
}, 'Saving'),
},
],
@@ -140,13 +148,13 @@ export default class SystemSSHComponent {
})
}
- remove(all: readonly T.SshKeyResponse[]) {
+ remove() {
this.dialogs
.openConfirm({ label: 'Are you sure?', size: 's' })
.pipe(filter(Boolean))
.subscribe(async () => {
const selected = this.tableKeys()?.selected() || []
- const fingerprints = selected.map(s => s.fingerprint) || []
+ const fingerprints = selected.map(s => s.fingerprint)
this.tasks.run(async () => {
await Promise.all(
@@ -154,9 +162,6 @@ export default class SystemSSHComponent {
this.api.rpc.ssh.remove({ fingerprint }),
),
)
- this.local$.next(
- all.filter(s => !fingerprints.includes(s.fingerprint)),
- )
this.tableKeys()?.selected.set([])
}, 'Removing')
})
diff --git a/projects/start-os/web/ui/src/app/routes/portal/routes/updates/item.component.ts b/projects/start-os/web/ui/src/app/routes/portal/routes/updates/item.component.ts
index a36fbddb9f..fa41723a9c 100644
--- a/projects/start-os/web/ui/src/app/routes/portal/routes/updates/item.component.ts
+++ b/projects/start-os/web/ui/src/app/routes/portal/routes/updates/item.component.ts
@@ -182,7 +182,12 @@ import UpdatesComponent from './updates.component'
@@ -364,12 +369,11 @@ export class UpdatesItemComponent {
if (trust && !(await this.alerts.alertUntrusted())) return
const pkg = this.item()
- const { preDownloadAlert } = pkg
const url = this.parent.current()?.url || ''
if (
!(await this.alerts.alertPreDownload(
- preDownloadAlert,
+ pkg,
this.local().stateInfo.manifest.version,
))
) {
diff --git a/projects/start-os/web/ui/src/app/services/api/api.fixures.ts b/projects/start-os/web/ui/src/app/services/api/api.fixures.ts
index 91a74f3194..ba645b050c 100644
--- a/projects/start-os/web/ui/src/app/services/api/api.fixures.ts
+++ b/projects/start-os/web/ui/src/app/services/api/api.fixures.ts
@@ -290,6 +290,7 @@ export namespace Mock {
}
export const RegistryInfo: T.RegistryInfo = {
+ defaultLocale: 'en_US',
trustSigners: {
'start9-signer': {
name: 'Start9',
@@ -386,6 +387,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
}
@@ -443,6 +445,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
}
@@ -486,6 +489,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: ['url-v0'],
}
@@ -536,6 +540,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
}
@@ -608,6 +613,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
'#knots:26.1.20240325:0': {
@@ -646,6 +652,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -694,6 +701,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
'#knots:26.1.20240325:0': {
@@ -732,6 +740,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -785,6 +794,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -836,6 +846,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -888,6 +899,7 @@ export namespace Mock {
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -1012,6 +1024,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
'#knots:27.1.0:0': {
@@ -1050,6 +1063,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -1101,6 +1115,7 @@ For the full changelog, see https://github.com/bitcoin/bitcoin/blob/v27.0.0/doc/
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
@@ -1158,6 +1173,7 @@ Full changelog: https://github.com/Kixunil/btc-rpc-proxy/blob/master/CHANGELOG.m
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
'#test:0.5.0:0': {
@@ -1195,6 +1211,7 @@ Full changelog: https://github.com/Kixunil/btc-rpc-proxy/blob/master/CHANGELOG.m
userspaceFilesystems: false,
virtualNetworking: false,
hardwareVirtualization: false,
+ opticalDrives: false,
plugins: [],
},
},
diff --git a/projects/start-os/web/ui/src/app/services/api/embassy-mock-api.service.ts b/projects/start-os/web/ui/src/app/services/api/embassy-mock-api.service.ts
index 34211a0cd5..1605444bf9 100644
--- a/projects/start-os/web/ui/src/app/services/api/embassy-mock-api.service.ts
+++ b/projects/start-os/web/ui/src/app/services/api/embassy-mock-api.service.ts
@@ -65,6 +65,7 @@ import { toAuthorityUrl } from 'src/app/utils/acme'
import { getCurrentManifest, getManifest } from 'src/app/utils/get-package-data'
import { getDriveName } from 'src/app/utils/get-drive-name'
import { parsePemPublicKey, parsePublicKeys } from 'src/app/utils/public-keys'
+import { sshKeyRows } from 'src/app/utils/ssh-keys'
import { BackupRun } from 'src/app/routes/portal/routes/system/routes/backups/backup.types'
import { Mock } from './api.fixures'
import { BTC_ICON, LND_ICON, PROXY_ICON } from './api-icons'
@@ -921,16 +922,32 @@ export class MockApiService extends ApiService implements StartupApiService {
await pauseFor(2000)
return null
},
- 'ssh.list': async params => {
+ 'ssh.list': async () => {
await pauseFor(2000)
- return Mock.SshKeys
+ return sshKeyRows(mockPatchData.sshPubkeys)
},
- 'ssh.add': async params => {
+ 'ssh.add': async ({ key }) => {
await pauseFor(2000)
- return Mock.SshKey
+ const fingerprint = Mock.SshKey.fingerprint
+ const existing = mockPatchData.sshPubkeys[fingerprint]
+ const now = new Date().toISOString()
+ const stored = {
+ created_at: existing?.created_at ?? now,
+ updated_at: now,
+ value: key,
+ }
+ mockPatchData.sshPubkeys[fingerprint] = stored
+ await this.mockRevision([
+ { op: PatchOp.ADD, path: `/sshPubkeys/${fingerprint}`, value: stored },
+ ])
+ return sshKeyRows({ [fingerprint]: stored })[0]!
},
- 'ssh.remove': async params => {
+ 'ssh.remove': async ({ fingerprint }) => {
await pauseFor(2000)
+ delete mockPatchData.sshPubkeys[fingerprint]
+ await this.mockRevision([
+ { op: PatchOp.REMOVE, path: `/sshPubkeys/${fingerprint}` },
+ ])
return null
},
'volumes.create': async ({ name, source }) => {
diff --git a/projects/start-os/web/ui/src/app/services/api/mock-patch.ts b/projects/start-os/web/ui/src/app/services/api/mock-patch.ts
index 4f94f9b481..ff70e1a51d 100644
--- a/projects/start-os/web/ui/src/app/services/api/mock-patch.ts
+++ b/projects/start-os/web/ui/src/app/services/api/mock-patch.ts
@@ -97,11 +97,22 @@ export function mockOsUpdateCache(
versions: sameUrl(registry, defaultRegistries.community)
? {}
: Mock.RegistryOSUpdate,
+ defaultLocale: 'en_US',
status: 'connected',
}
}
export const mockPatchData: DataModel = {
+ sshPubkeys: Object.fromEntries(
+ Mock.SshKeys.map(key => [
+ key.fingerprint,
+ {
+ created_at: key.createdAt,
+ updated_at: key.createdAt,
+ value: `${key.alg} mock ${key.hostname}`,
+ },
+ ]),
+ ),
registryCache: {
[defaultRegistries.start9]: mockRegistryCache(
defaultRegistries.start9,
diff --git a/projects/start-os/web/ui/src/app/services/os.service.ts b/projects/start-os/web/ui/src/app/services/os.service.ts
index 1f95531096..6c04beb201 100644
--- a/projects/start-os/web/ui/src/app/services/os.service.ts
+++ b/projects/start-os/web/ui/src/app/services/os.service.ts
@@ -64,6 +64,7 @@ export class OSService {
.map(([version, info]) => ({
version,
notes: info.releaseNotes,
+ defaultLocale: cache?.defaultLocale,
squashfs: info.squashfs,
}))
}),
diff --git a/projects/start-os/web/ui/src/app/services/patch-db/data-model.ts b/projects/start-os/web/ui/src/app/services/patch-db/data-model.ts
index 44c8175cba..e3760a45db 100644
--- a/projects/start-os/web/ui/src/app/services/patch-db/data-model.ts
+++ b/projects/start-os/web/ui/src/app/services/patch-db/data-model.ts
@@ -1,7 +1,10 @@
import { FullKeyboard, Languages } from '@start9labs/shared'
import { T } from '@start9labs/start-core'
-export type DataModel = Pick & {
+export type DataModel = Pick<
+ T.Public,
+ 'registryCache' | 'osUpdateCache' | 'sshPubkeys'
+> & {
ui: UIData
serverInfo: T.ServerInfo & {
language: Languages
diff --git a/projects/start-os/web/ui/src/app/utils/ssh-keys.ts b/projects/start-os/web/ui/src/app/utils/ssh-keys.ts
new file mode 100644
index 0000000000..bad136606b
--- /dev/null
+++ b/projects/start-os/web/ui/src/app/utils/ssh-keys.ts
@@ -0,0 +1,18 @@
+import { T } from '@start9labs/start-core'
+
+// Stored lines retain `authorized_keys` options, including quoted spaces.
+export function sshKeyRows(keys: T.SshKeys): T.SshKeyResponse[] {
+ return Object.entries(keys).map(([fingerprint, key]) => {
+ const [, alg = '', hostname = ''] =
+ key.value.match(
+ /^(?:(?:[^\s"\\]|\\.|"(?:[^"\\]|\\.)*")+\s+)*?((?:sk-)?(?:ssh-|ecdsa-)\S+)\s+[A-Za-z0-9+/]+={0,2}(?:\s(.*))?$/s,
+ ) ?? []
+
+ return {
+ fingerprint,
+ alg,
+ hostname,
+ createdAt: key.created_at,
+ }
+ })
+}
diff --git a/projects/start-registry/ARCHITECTURE.md b/projects/start-registry/ARCHITECTURE.md
index ec83ef1f81..8174b7ba14 100644
--- a/projects/start-registry/ARCHITECTURE.md
+++ b/projects/start-registry/ARCHITECTURE.md
@@ -58,12 +58,30 @@ Subcommands (same module), each available over RPC and to the `start-registry` C
### Registry index subscriptions
-The public `db.subscribe` RPC accepts optional `pointer` and `osVersion` parameters. The pointer
+The public `db.subscribe` RPC accepts optional `pointer`, `osVersion` and `language` parameters. The pointer
may select `/index` or any descendant; omitting it or passing `null` selects `/index`. Without
`rpcstream` opt-in, the response contains an initial `{ id, value }` dump and a continuation
`guid`. Connecting to `/rpc/v2/` streams revisions relative to the selected subtree. This
contract also applies to ordinary calls on the shared WebSocket.
+`language` resolves every `LocaleString` in the view with `LocaleString::localize_for`:
+the exact or same-language translation, else the owner's declared default locale
+(`PackageMetadata::default_locale` for package text, `FullIndex::default_locale` for
+registry text, set by `info set-default-locale`), else an arbitrary stored one. The
+requested language is first matched against the locales in the reader's visible index
+(`best_locale`); a language matching none of them shares the default view, where
+every string resolves to its owner's default, so requests cannot create views beyond
+the index's own languages.
+`IndexLocaleTracker` (`registry/locales.rs`) holds those locales per package. It
+captures the database and locale metadata together, recomputing the locales when
+`/index` changes. A subscription with `language` waits for a snapshot at or after its initiating
+database revision and resolves both reader access and language against that snapshot,
+without walking the index. Root revisions also advance snapshot freshness when
+permissions outside `/index` change. Each distinct reader, `osVersion`
+compatibility and `language` combination is an `IndexView` served by a lazily
+created in-memory PatchDB mirror (`registry/mirror.rs`), shared by its
+subscribers and dropped with the last of them.
+
With `rpcstream: "1.0"` on `/rpc/v2`, the same method returns the dump directly as its initiating
result and sends subsequent `Revision` events under that request ID. Closing a stream releases
its subscription; ordinary calls and other subscriptions retain the connection.
diff --git a/projects/start-registry/Cargo.toml b/projects/start-registry/Cargo.toml
index 655a512c10..8eabfb7581 100644
--- a/projects/start-registry/Cargo.toml
+++ b/projects/start-registry/Cargo.toml
@@ -3,7 +3,7 @@ edition = "2024"
license = "MIT"
name = "start-registry"
repository = "https://github.com/Start9Labs/start-technologies"
-version = "1.6.0" # VERSION_BUMP
+version = "1.7.0" # VERSION_BUMP
[[bin]]
name = "registrybox"
diff --git a/projects/start-registry/README.md b/projects/start-registry/README.md
index 1503a7c1be..14b96aadd7 100644
--- a/projects/start-registry/README.md
+++ b/projects/start-registry/README.md
@@ -97,7 +97,7 @@ Configuration is read from CLI flags and a config file (`-c `; default sea
| `-c, --config ` | config file |
| `--mirror-of ` | mirror another registry's index (read-only index) |
-Clients synchronize registry metadata through `db.subscribe`: `rpcstream` opt-in uses the shared `/rpc/v2` socket, while ordinary requests retain the GUID WebSocket continuation. StartOS authenticates and encrypts this shared connection through signed ephemeral DH. Streaming requires encrypted admission and `rpcstream`, with the client's selected URL host configured on the registry. A legacy HTTP 200 response without upgrading, or HTTP 404/405/501, selects signed HTTP polling every 15 minutes; each cycle retries upgrade support. Polls retrieve full package versions/revisions, registry info and the selected OS index through the same cache/trust owners. Authorization, transport and failed encrypted admission errors never downgrade. A subscription's optional `osVersion` selects a lazily shared backward-compatible index view; omitted versions retain the canonical format. StartOS maintains package, signer, and OS-update caches independently of open browser sessions. OS releases marked `security` generate notifications on compatible StartOS servers using that registry for updates.
+Clients synchronize registry metadata through `db.subscribe`: `rpcstream` opt-in uses the shared `/rpc/v2` socket, while ordinary requests retain the GUID WebSocket continuation. StartOS authenticates and encrypts this shared connection through signed ephemeral DH. Streaming requires encrypted admission and `rpcstream`, with the client's selected URL host configured on the registry. A legacy HTTP 200 response without upgrading, or HTTP 404/405/501, selects signed HTTP polling every 15 minutes; each cycle retries upgrade support. Polls retrieve full package versions/revisions, registry info and the selected OS index through the same cache/trust owners. Authorization, transport and failed encrypted admission errors never downgrade. A subscription's optional `osVersion` selects a lazily shared backward-compatible index view, and its optional `language` a lazily shared view with every translated field resolved to that locale; omitting them retains the canonical format. StartOS maintains package, signer, and OS-update caches independently of open browser sessions. OS releases marked `security` generate notifications on compatible StartOS servers using that registry for updates.
## Mirroring another registry
diff --git a/projects/start-registry/changelog/minor-added-localized-index-subscriptions.md b/projects/start-registry/changelog/minor-added-localized-index-subscriptions.md
new file mode 100644
index 0000000000..b67475dc20
--- /dev/null
+++ b/projects/start-registry/changelog/minor-added-localized-index-subscriptions.md
@@ -0,0 +1,6 @@
+---
+release-notes: false
+---
+
+- Index subscriptions accept an optional `language` and receive registry, category, package and OS text already translated for that locale. A language with no translation falls back to each package's declared default locale.
+- `start-registry info set-default-locale` sets the locale the registry's own text falls back to.
diff --git a/projects/start-registry/man/start-registry-info-set-default-locale.1 b/projects/start-registry/man/start-registry-info-set-default-locale.1
new file mode 100644
index 0000000000..f94db642d4
--- /dev/null
+++ b/projects/start-registry/man/start-registry-info-set-default-locale.1
@@ -0,0 +1,19 @@
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.TH start-registry-info-set-default-locale 1 "set-default-locale "
+.SH NAME
+start\-registry\-info\-set\-default\-locale \- Set the locale the registry\*(Aqs own text falls back to
+.SH SYNOPSIS
+\fBstart\-registry info set\-default\-locale\fR [\fB\-\-clear\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIDEFAULT_LOCALE\fR]
+.SH DESCRIPTION
+Set the locale the registry\*(Aqs own text falls back to
+.SH OPTIONS
+.TP
+\fB\-\-clear\fR
+Remove the registry default locale
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print help
+.TP
+[\fIDEFAULT_LOCALE\fR]
+Locale the registry\*(Aqs own text falls back to, such as en_US
diff --git a/projects/start-registry/man/start-registry-info.1 b/projects/start-registry/man/start-registry-info.1
index f124017230..16f1ffca41 100644
--- a/projects/start-registry/man/start-registry-info.1
+++ b/projects/start-registry/man/start-registry-info.1
@@ -16,6 +16,9 @@ View or edit registry information
Print help
.SH SUBCOMMANDS
.TP
+start\-registry\-info\-set\-default\-locale(1)
+Set the locale the registry\*(Aqs own text falls back to
+.TP
start\-registry\-info\-set\-description(1)
Set the registry description
.TP
diff --git a/projects/start-registry/man/start-registry.1 b/projects/start-registry/man/start-registry.1
index 1c1486bc08..76de40be1c 100644
--- a/projects/start-registry/man/start-registry.1
+++ b/projects/start-registry/man/start-registry.1
@@ -1,6 +1,6 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
-.TH start-registry 1 "start-registry 1.6.0"
+.TH start-registry 1 "start-registry 1.7.0"
.SH NAME
start\-registry
.SH SYNOPSIS
@@ -72,4 +72,4 @@ Commands related to OS assets and versions
start\-registry\-package(1)
Commands to index, add, or get packages
.SH VERSION
-v1.6.0
+v1.7.0
diff --git a/projects/start-sdk/ARCHITECTURE.md b/projects/start-sdk/ARCHITECTURE.md
index 27fcad91a6..356872b43f 100644
--- a/projects/start-sdk/ARCHITECTURE.md
+++ b/projects/start-sdk/ARCHITECTURE.md
@@ -309,6 +309,8 @@ The unified `SubContainer` interface widens `rootfs` / `guid` / `subpath()` t
sdk.Mounts.of().mountVolume({ volumeId: 'main', subpath: null, mountpoint: '/data', readonly: false }).mountAssets({ subpath: 'scripts', mountpoint: '/scripts' }).mountDependency({ dependencyId: 'bitcoind', volumeId: 'main', subpath: null, mountpoint: '/bitcoin-data', readonly: true })
```
+`SubContainer` delegates shared volumes through one `mount-shared-volume` request, like host-owned dependency mounts. StartOS authorizes the grant, installs a permanent inaccessible read-only placeholder, attaches the mapped source and retains its mount descriptor. Read-only staging is internal to the host; the SDK receives only a mounted/unavailable outcome. Host and ordinary CLI binds reuse the common detached-mount policy. Missing source directories are never created. Per-target work shares `PathQueue` with filesystem access serialization, and in-flight mounts hold their subcontainer until completion. Grant changes detach incompatible SDK binds even in manually managed subcontainers. Independent aliases and open handles can remain usable.
+
### Health Checks (`lib/health/`)
```
@@ -406,7 +408,7 @@ const manifest = setupManifest({
// ...
})
-export default buildManifest(versionGraph, manifest, dependencies)
+export default buildManifest({ versionGraph, manifest, dependencies, i18n })
```
`buildManifest()` finalizes the manifest with the current SDK version, OS version compatibility, migration version ranges, and dependency definitions from the same builder that runs during init.
diff --git a/projects/start-sdk/README.md b/projects/start-sdk/README.md
index 74a3c5488d..52681aba2d 100644
--- a/projects/start-sdk/README.md
+++ b/projects/start-sdk/README.md
@@ -25,6 +25,7 @@ It lives at `projects/start-sdk/` inside the [start-technologies monorepo](https
```typescript
import { setupManifest, buildManifest, Dependencies } from '@start9labs/start-sdk'
import { versionGraph } from './versions'
+import { i18n } from './i18n'
const manifest = setupManifest({
id: 'my-service',
@@ -33,7 +34,12 @@ const manifest = setupManifest({
// ...
})
-export default buildManifest(versionGraph, manifest, Dependencies.of())
+export default buildManifest({
+ versionGraph,
+ manifest,
+ dependencies: Dependencies.of(),
+ i18n,
+})
```
The primary entry point is the `StartSdk` facade:
diff --git a/projects/start-sdk/changelog/major-changed-build-manifest-default-locale.md b/projects/start-sdk/changelog/major-changed-build-manifest-default-locale.md
new file mode 100644
index 0000000000..ddfcd65afb
--- /dev/null
+++ b/projects/start-sdk/changelog/major-changed-build-manifest-default-locale.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- `buildManifest` takes named arguments, `{ versionGraph, manifest, dependencies, i18n }`, and now requires the package's `setupI18n` result. Its default language becomes the manifest's `defaultLocale`, the locale StartOS and registries fall back to when a reader's language is missing.
diff --git a/projects/start-sdk/changelog/minor-added-optical-drives.md b/projects/start-sdk/changelog/minor-added-optical-drives.md
new file mode 100644
index 0000000000..91098d2789
--- /dev/null
+++ b/projects/start-sdk/changelog/minor-added-optical-drives.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Set `opticalDrives: true` in the manifest to grant a service the server's optical drives. The capability needs a StartOS release that supports it.
diff --git a/projects/start-sdk/changelog/minor-added-shared-volumes.md b/projects/start-sdk/changelog/minor-added-shared-volumes.md
index edf9a46586..7cbb6632b7 100644
--- a/projects/start-sdk/changelog/minor-added-shared-volumes.md
+++ b/projects/start-sdk/changelog/minor-added-shared-volumes.md
@@ -4,4 +4,5 @@ release-notes: true
- Declare support for shared volumes, read user-granted IDs, names and access modes reactively, and choose optional mount outcomes or essential workload mounts. The capability requires StartOS 0.4.3 and a volume-capable Start CLI 3.0.0 or later. Packaging rejects outputs that lose volume support.
- Dynamic daemon sets refresh shared-volume consumers and their dependents when sources change, including private connection changes that leave metadata unchanged. Unrelated containers remain running; nested reactive reads reconcile in place. Optional mounts added later do not restart for earlier source changes.
+- Shared sources use host-owned staging and registered native data binds, with read-only empty placeholders beneath data mounts. Grant changes deny future unauthorized mounts and detach incompatible SDK-managed binds, including in manually managed subcontainers. Independently created aliases and open handles can retain access.
- Services opting in run backups in an isolated runtime without shared mounts or initialization hooks; read backup configuration from persistent state.
diff --git a/projects/start-sdk/changelog/minor-changed-backup-prunes-stale-data.md b/projects/start-sdk/changelog/minor-changed-backup-prunes-stale-data.md
new file mode 100644
index 0000000000..cf37ef8c3c
--- /dev/null
+++ b/projects/start-sdk/changelog/minor-changed-backup-prunes-stale-data.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Backups no longer keep stale data: syncs with `delete` (the default) also remove paths matching `exclude` from the target, and a backup removes volumes no longer in the backup set from the target being updated.
diff --git a/projects/start-sdk/changelog/patch-fixed-health-deadlines.md b/projects/start-sdk/changelog/patch-fixed-health-deadlines.md
new file mode 100644
index 0000000000..5faba25123
--- /dev/null
+++ b/projects/start-sdk/changelog/patch-fixed-health-deadlines.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Release unused timeout timers after port, URL and script health checks finish.
diff --git a/projects/start-sdk/changelog/patch-security-action-input-undeclared-keys.md b/projects/start-sdk/changelog/patch-security-action-input-undeclared-keys.md
new file mode 100644
index 0000000000..423de639c9
--- /dev/null
+++ b/projects/start-sdk/changelog/patch-security-action-input-undeclared-keys.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- An action's handler receives only the fields its input form declares; any other key in a submitted input is dropped, at every nesting level. A union field's input carries only its selected variant.
diff --git a/projects/start-sdk/check-cli.mjs b/projects/start-sdk/check-cli.mjs
index c5bab59c45..109ad797fb 100644
--- a/projects/start-sdk/check-cli.mjs
+++ b/projects/start-sdk/check-cli.mjs
@@ -10,6 +10,10 @@ const { manifest } = createRequire(import.meta.url)(
resolve('javascript/index.js'),
)
export const requiresSharedVolumes = !!manifest.sharedVolumes
+// Capabilities a start-cli that predates them silently drops while packing.
+export const preservedCapabilities = ['sharedVolumes', 'opticalDrives'].filter(
+ (key) => manifest[key] === true,
+)
function checkCli() {
if (!requiresSharedVolumes) return
diff --git a/projects/start-sdk/docs/package-template/.forgejo/workflows/release.yml b/projects/start-sdk/docs/package-template/.forgejo/workflows/release.yml
index b7f79e3b6a..2613e93970 100644
--- a/projects/start-sdk/docs/package-template/.forgejo/workflows/release.yml
+++ b/projects/start-sdk/docs/package-template/.forgejo/workflows/release.yml
@@ -7,9 +7,6 @@ name: Release
jobs:
release:
uses: https://github.com/Start9Labs/start-technologies/.forgejo/workflows/release.yml@master
- with:
- RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
- S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
diff --git a/projects/start-sdk/docs/package-template/.forgejo/workflows/tagAndRelease.yml b/projects/start-sdk/docs/package-template/.forgejo/workflows/tagAndRelease.yml
index 74637996f5..def6c3f01c 100644
--- a/projects/start-sdk/docs/package-template/.forgejo/workflows/tagAndRelease.yml
+++ b/projects/start-sdk/docs/package-template/.forgejo/workflows/tagAndRelease.yml
@@ -12,10 +12,6 @@ concurrency:
jobs:
tag:
uses: https://github.com/Start9Labs/start-technologies/.forgejo/workflows/tagAndRelease.yml@master
- with:
- REFERENCE_REGISTRY: ${{ vars.REFERENCE_REGISTRY }}
- RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
- S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
diff --git a/projects/start-sdk/docs/package-template/.github/workflows/release.yml b/projects/start-sdk/docs/package-template/.github/workflows/release.yml
index 6dcef4a36a..4cd94c8866 100644
--- a/projects/start-sdk/docs/package-template/.github/workflows/release.yml
+++ b/projects/start-sdk/docs/package-template/.github/workflows/release.yml
@@ -8,9 +8,6 @@ on:
jobs:
release:
uses: Start9Labs/start-technologies/.github/workflows/release.yml@master
- with:
- RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
- S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
diff --git a/projects/start-sdk/docs/package-template/.github/workflows/tagAndRelease.yml b/projects/start-sdk/docs/package-template/.github/workflows/tagAndRelease.yml
index f0008516f1..bfc0a69056 100644
--- a/projects/start-sdk/docs/package-template/.github/workflows/tagAndRelease.yml
+++ b/projects/start-sdk/docs/package-template/.github/workflows/tagAndRelease.yml
@@ -12,10 +12,6 @@ concurrency:
jobs:
tag:
uses: Start9Labs/start-technologies/.github/workflows/tagAndRelease.yml@master
- with:
- REFERENCE_REGISTRY: ${{ vars.REFERENCE_REGISTRY }}
- RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
- S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
diff --git a/projects/start-sdk/docs/package-template/package.json b/projects/start-sdk/docs/package-template/package.json
index c73a1867d8..fed3cb9cc9 100644
--- a/projects/start-sdk/docs/package-template/package.json
+++ b/projects/start-sdk/docs/package-template/package.json
@@ -1,7 +1,7 @@
{
"name": "{{id}}-startos",
"dependencies": {
- "@start9labs/start-sdk": "4.2.0"
+ "@start9labs/start-sdk": "5.0.0"
},
"overrides": {
"@start9labs/start-sdk": "$@start9labs/start-sdk"
diff --git a/projects/start-sdk/docs/package-template/startos/index.ts b/projects/start-sdk/docs/package-template/startos/index.ts
index e8825763a1..d22745b167 100644
--- a/projects/start-sdk/docs/package-template/startos/index.ts
+++ b/projects/start-sdk/docs/package-template/startos/index.ts
@@ -9,4 +9,10 @@ import { buildManifest } from '@start9labs/start-sdk'
import { manifest as sdkManifest } from './manifest'
import { versionGraph } from './versions'
import { dependencies } from './dependencies'
-export const manifest = buildManifest(versionGraph, sdkManifest, dependencies)
+import { i18n } from './i18n'
+export const manifest = buildManifest({
+ versionGraph,
+ manifest: sdkManifest,
+ dependencies,
+ i18n,
+})
diff --git a/projects/start-sdk/docs/src/agent-context.md b/projects/start-sdk/docs/src/agent-context.md
index fd0ff0cee2..50319fafbc 100644
--- a/projects/start-sdk/docs/src/agent-context.md
+++ b/projects/start-sdk/docs/src/agent-context.md
@@ -132,6 +132,7 @@ The full rules are in `start-technologies/projects/start-sdk/docs/src/workflow.m
- **Keep `README.md` and `instructions.md` in sync.** `README.md` is the package's technical reference — how it works, what its actions do, how to diagnose it — and the only technical file an AI support or administering agent reads; `instructions.md` is the user's guide to the service as it is now — never a record of what changed, which belongs in `releaseNotes`. Update each in the same change as the code that makes it wrong. Content rules: `writing-readmes.md`, `writing-instructions.md`.
- **A package's `AGENTS.md` restates nothing `README.md` or `instructions.md` says.** Its one reader has both, so it carries only what has no home in them: repo mechanics, a change that looks right and is not (the imperative plus the one clause that says why), extension points, naming traps, and build or test invocations particular to the repo. A fact the README already states does not become a rule by being repeated here. Most packages need one to four bullets; a simple one needs none. (`project-structure.md` § AGENTS.md and CLAUDE.md)
- **Iterate with a dirty tree; commit once.** The `-modified` pack-hash suffix is informational — don't commit between test attempts. One clean commit when the package works; `git reset --soft HEAD~N` collapses accumulated fixups.
+- **Squash a feature branch's PR; give a long-lived branch's PR a merge commit.** `next`, a release line and a `sync-next/` branch take `gh pr merge --merge`, or the next sync conflicts with commits the base already holds in squashed form. (`maintaining-a-package.md` § Merge a long-lived branch with a merge commit, never a squash)
- **Bump to the latest SDK before opening a PR.** Check `npm view @start9labs/start-sdk version` against the pin; if newer, bump and re-verify before you push. (`publishing.md` § Pre-Publish Checklist, `maintaining-a-package.md` § Bumping the SDK)
- **Pre-existing errors are still errors.** A red `tsc`, test, or pack step means the package doesn't pass, even if unrelated to your change. Fix it or flag it; never report green when a check was red.
- **Don't create unnecessary version files.** The latest version always lives in `startos/versions/current.ts`; most bumps just edit that file in place. A new file is spun off only when the version already in `current.ts` carries a migration, meaning an `up` whose body does work (the template's empty `up` with `down: IMPOSSIBLE` carries none). That migration stays with the version that introduced it and is never carried forward into a successor, idempotent or not, while **a version having been released is not a reason to declare it.** `VersionGraph` synthesizes a range vertex beneath `current`, so any lower installed version migrates up in one hop without its own node; `canMigrateFrom` is derived from that graph, not authored. See `versions.md` (When to Create a New Version File, Why Released Versions Don't Need to Be Declared, Release Notes).
diff --git a/projects/start-sdk/docs/src/dependencies.md b/projects/start-sdk/docs/src/dependencies.md
index 1423f62348..e5e28abce7 100644
--- a/projects/start-sdk/docs/src/dependencies.md
+++ b/projects/start-sdk/docs/src/dependencies.md
@@ -19,7 +19,7 @@ const bitcoin = sdk.Dependency.required('bitcoind', {
export const dependencies = sdk.Dependencies.of().addDependency(bitcoin)
```
-Pass `dependencies` to `buildManifest(versionGraph, sdkManifest, dependencies)` in `startos/index.ts` and to `sdk.setupInit(..., dependencies, ...)` in `startos/init/index.ts`.
+Pass `dependencies` to `buildManifest({ versionGraph, manifest, dependencies, i18n })` in `startos/index.ts` and to `sdk.setupInit(..., dependencies, ...)` in `startos/init/index.ts`.
The base is serializable at pack time, without effects: every dependency needs a description (which may be `null`), inline title and icon, version range, kind, and health checks when `kind` is `running`. Write `'*'` when any version is accepted. Name multi-flavor dependencies generically: for `bitcoind`, use **Bitcoin**, not Bitcoin Core or Bitcoin Knots. The base is the loosest requirement the service accepts in any configuration.
diff --git a/projects/start-sdk/docs/src/host-registry-administration.md b/projects/start-sdk/docs/src/host-registry-administration.md
index 59ce3c1ac2..0e5a7c1096 100644
--- a/projects/start-sdk/docs/src/host-registry-administration.md
+++ b/projects/start-sdk/docs/src/host-registry-administration.md
@@ -23,9 +23,15 @@ The registry returns the signer's ID. Use that ID with `start-cli registry admin
To grant a signer admin privileges (or revoke them), use `start-cli registry admin add ` / `... admin remove `.
+A registry keeps a package signature only while its key belongs to a registered signer. Signatures from any other key are dropped when a package is indexed and on each startup. Register a key before you rely on the signatures it makes.
+
+The exception is a read-only registry configured with `mirror-of`: it preserves its upstream's signatures, including across restarts. Removing `mirror-of` enables signature pruning on the next startup.
+
+Revoking a key, with `admin signer edit --remove-key ` or by deleting its signer with `admin signer remove `, removes it from every signer that holds it and deletes its signatures from indexed packages. Adding the key back does not restore those signatures; [cosign](#cosigning) the affected versions again.
+
## Offering signing keys to users
-Registry 1.4.0 and start-cli 2.7.0 support selecting registered signers whose keys the registry offers to StartOS 0.4.1.2 and later. New and upgraded registries start with no selection; registering an administrator or authorizing a package publisher does not select them.
+A registry can offer the keys of selected registered signers to the StartOS servers that connect it. It starts with no selection; registering an administrator or authorizing a package publisher does not select them.
As an administrator, list your registered signers and use the [trust-signer selection command](/start-os/cli-reference.html#start-cli-registry-info-set-trust-signers-signer) to select their IDs. Each call replaces the entire selection; passing no IDs clears it. The registry offers all keys belonging to the selected signers, along with their names and contact details. Select the signers whose signatures users should accept, not every identity allowed to upload.
@@ -58,9 +64,9 @@ start-cli s9pk publish myservice_1.2.0_x86_64.s9pk
`publish` uploads the original file to the configured S3 bucket and adds its URL and identity-key endorsement to the configured registry index. Configure the S3 destination and registry before publishing. To index an already hosted file, use `start-cli registry package add --url `.
-For package add and add-mirror, the CLI submits verified endorsements from `` separately from the authenticated uploader's signature. The registry verifies every submitted endorsement against the indexed package's exact Merkle root, signed bound, and `s9pk` context before adding it to the asset signature map. An invalid entry rejects the request atomically. The hosted file may contain only the base archive, and its bytes remain unchanged. Promotion forwards the indexed signature map to the destination registry.
+For package add and add-mirror, the CLI submits verified endorsements from `` separately from the authenticated uploader's signature. The registry verifies every submitted endorsement against the indexed package's exact Merkle root, signed bound, and `s9pk` context before adding it to the asset signature map, then keeps only signatures from registered signers. An invalid entry rejects the request atomically. The hosted file may contain only the base archive, and its bytes remain unchanged. Promotion forwards the indexed signature map to the destination registry, which keeps only the signatures from its own registered signers.
-Supplemental keys do not become registered signers, proposed trust keys, or authorized uploaders. Publishing authorization remains tied to the registered uploader.
+Supplemental keys do not become registered signers, proposed trust keys, or authorized uploaders, so register a supplemental key as a signer if its endorsement should stay in the index. Publishing authorization remains tied to the registered uploader.
### Promoting a package
diff --git a/projects/start-sdk/docs/src/host-registry-setup.md b/projects/start-sdk/docs/src/host-registry-setup.md
index 4780a774ff..d7ca803610 100644
--- a/projects/start-sdk/docs/src/host-registry-setup.md
+++ b/projects/start-sdk/docs/src/host-registry-setup.md
@@ -1,20 +1,22 @@
# Setup
-The packaged `startos-registry` service is the supported way to run a registry. Install it from any registry that carries it (the Start9 registry does), complete two first-run actions, and you're ready to publish.
+The packaged `startos-registry` service is the supported way to run a registry. Install it from any registry that carries it (the Start9 registry does), name the registry and register an administrator, and you're ready to publish.
## 1. Install the service
From StartOS, open the Marketplace, find **StartOS Registry**, and install. The service has no external dependencies. Once installed, start it.
-On first install, StartOS surfaces two setup tasks under the service. **Both must be completed before the registry is usable.**
+A fresh install starts one registry, and StartOS surfaces two setup tasks under the service: **Manage Registries** and **Manage Signers**. They don't block the service from starting, but nobody can publish to the registry until Manage Signers has registered an administrator.
-## 2. Configure Registry
+## 2. Name and describe the registry
-Run the **Configure Registry** action to set the registry's display name (max 32 characters), an optional icon, and an optional description. This is what users will see when they browse your registry from another StartOS device; the description appears above the registry's services and may use markdown.
+Run the **Manage Registries** action to name the registry (1–32 characters). This is what users see when they browse your registry from another StartOS device. The same action can add more registries to the service, each with its own catalog, signers, and addresses.
+
+Then run **Configure Registry**, choose the registry by name, and set an optional icon and description for it. The description appears above the registry's services and may use markdown.
Use the description to identify who runs the registry, how to contact them, what packages it carries, and what support users can expect. Include a link to your package-signing public keys and instructions for verifying them.
-The registry's hostnames, listen address, Tor proxy, and data directory are managed by StartOS automatically — you don't configure them by hand. As the service's network addresses change (e.g. you add a clearnet domain to the API interface), the configured hostnames update to match.
+The registry's hostnames, listen address, Tor proxy, and data directory are managed by StartOS automatically — you don't configure them by hand. As the service's network addresses change (e.g. you add a clearnet domain to the registry's **Web API — _registry name_** interface), the configured hostnames update to match.
### Publish signing keys
@@ -42,7 +44,9 @@ it added. Manage package trust under System → Trusted Keys; see
## 3. Add the first administrator
-Run **Add Administrator** to register the first admin. You'll need a PEM-encoded Ed25519 public key, a label, and contact info (email or Matrix handle). Admins can manage signers, publish packages, register OS versions, and edit categories.
+Run **Manage Signers**, expand the section bearing the registry's name, and add an entry to its **Signers** list. Give it a label and paste your public key into **Public Keys**: a PEM-encoded Ed25519 public key, or a complete armored GPG export of an Ed25519 key. Contacts (email addresses, Matrix usernames, or URLs) are optional. Turn on **Admin**. Admins can manage signers, publish packages, register OS versions, and edit categories.
+
+**Offer for Trust**, on the same entry, is separate from **Admin**: it offers the signer's keys to users who connect the registry. See [Offering signing keys to users](host-registry-administration.md#offering-signing-keys-to-users) before turning it on.
To generate a key on your workstation:
@@ -51,7 +55,7 @@ start-cli init-key
start-cli pubkey
```
-`init-key` creates an Ed25519 keypair at `~/.startos/id.key.pem` (or `/run/startos/id.key.pem` if running on a StartOS device). `pubkey` prints the public half — that's what you paste into the **Public Key** field of the Add Administrator action.
+`init-key` creates an Ed25519 keypair at `~/.startos/id.key.pem` (or `/run/startos/id.key.pem` if running on a StartOS device). `pubkey` prints the public half — that's what you paste into the **Public Keys** field in Manage Signers.
Treat the private key like an SSH key: it authenticates every admin and publish action you take against the registry. Back it up.
@@ -59,20 +63,20 @@ To keep the key in gpg-agent instead, skip `init-key` and point `start-cli` at a
## 4. Point `start-cli` at the registry
-All registry operations go through `start-cli registry` (or `start-cli s9pk publish` for uploading packages). Pass the registry's URL with `--registry`:
+All registry operations go through `start-cli registry` (or `start-cli s9pk publish` for uploading packages). Pass the registry's URL with `--registry`, using an address listed on its **Web API — _registry name_** interface: authenticated requests are signed for that hostname. It is a top-level flag, so it goes before the subcommand:
```sh
-start-cli registry --registry https://my-registry.example.com index
+start-cli --registry https://my-registry.example.com registry index
```
-If you're working inside a packaging workspace, add the registry to its `.startos/config.yaml` under `registry:` as a named profile, then refer to it with `-r `:
+If you're working inside a packaging workspace, add the registry to its `.startos/config.yaml` under `registry:` as a named profile, then refer to it with `-r `, also placed before the subcommand:
```yaml
registry:
default: https://my-registry.example.com
```
-Now `start-cli registry -r default index` works, and because it's named `default` you can drop the flag entirely (`-r` uses the `default` profile when omitted). Outside a workspace, keep passing `--registry ` on each command.
+Because it's named `default`, `start-cli registry index` now uses it with no flag. Give any other registry its own name and select it with `start-cli -r registry index`. Outside a workspace, keep passing `--registry ` on each command.
## 5. Smoke-test
@@ -83,6 +87,6 @@ start-cli registry index
start-cli registry admin list
```
-The first lists registry metadata and packages (empty on a fresh install). The second should show the administrator you added in step 3. If either fails, check that the service is running, the API interface is reachable from your workstation, and your identity key matches the public key you registered.
+The first lists registry metadata and packages (empty on a fresh install). The second should show the administrator you added in step 3. If either fails, check that the service is running, the registry's **Web API — _registry name_** interface is reachable from your workstation, and your identity key matches the public key you registered.
You're now ready to add signers, publish packages, and register StartOS versions. Before inviting users to connect, [select which signing keys your registry offers](host-registry-administration.md#offering-signing-keys-to-users). See [Administration](host-registry-administration.md) for these operations.
diff --git a/projects/start-sdk/docs/src/interfaces.md b/projects/start-sdk/docs/src/interfaces.md
index afc966b578..6237df826f 100644
--- a/projects/start-sdk/docs/src/interfaces.md
+++ b/projects/start-sdk/docs/src/interfaces.md
@@ -752,7 +752,7 @@ const userTokens = (await storeJson.read(s => s.apiKeys).const(effects)) ?? []
await sdk.MultiHost.of(effects, apiHostId).bindPort(apiPort, {
protocol: 'http',
- addSsl: {
+ proxy: {
auth: {
type: 'bearer',
tokens: [...(apiKey ? [apiKey] : []), ...userTokens.map(k => k.token)],
@@ -768,7 +768,7 @@ await sdk.MultiHost.of(effects, apiHostId).bindPort(apiPort, {
if (apiKey) {
const apiOrigin = await sdk.MultiHost.of(effects, apiKeyHostId).bindPort(apiPort, {
protocol: 'http',
- addSsl: { auth: { type: 'bearer', tokens: [apiKey], realm: null } },
+ proxy: { auth: { type: 'bearer', tokens: [apiKey], realm: null } },
})
receipts.push(await apiOrigin.export([api])) // `type: 'api'`
}
diff --git a/projects/start-sdk/docs/src/manifest.md b/projects/start-sdk/docs/src/manifest.md
index c9c8f493eb..c45daf1143 100644
--- a/projects/start-sdk/docs/src/manifest.md
+++ b/projects/start-sdk/docs/src/manifest.md
@@ -27,6 +27,11 @@ export const long = {
}
```
+If neither the requested locale nor a same-language translation is available,
+StartOS and registries use the package's default locale: the `DEFAULT_LANG` given
+to `setupI18n` in `startos/i18n`. `buildManifest()` reads it from the `i18n`
+passed in `startos/index.ts`.
+
### How long each one may be
| | limit |
@@ -350,6 +355,24 @@ The device appears only on a server whose CPU supports virtualization and whose
> [!WARNING]
> `/dev/kvm` is a direct interface to the host kernel's hypervisor, so it widens the kernel attack surface reachable from the service. Enable it only for a service that genuinely runs virtual machines.
+### Optical Drives
+
+For services that read discs, such as ripping or archiving tools, set `opticalDrives: true` at the manifest top level:
+
+```typescript
+opticalDrives: true,
+```
+
+When set, StartOS exposes the server's optical drives inside the service's container: the block node `/dev/srN` and its SCSI generic node `/dev/sgN`. A drive connected while the service runs appears within a few seconds, and the nodes of a drive that is disconnected are removed. Other disks, even on the same controller, are never exposed. The capability requires StartOS 0.4.3; `buildManifest` rejects an explicit older `osVersion`.
+
+The numbers are not stable: a drive that is unplugged and plugged in again can come back as `/dev/sr1` and `/dev/sg1`. Look for `/dev/sr*` and `/dev/sg*` instead of hard-coding `sr0`.
+
+> [!IMPORTANT]
+> Like `/dev/kvm`, the nodes belong to the container's root with mode `0660`. **Run the process that opens them as root.**
+
+> [!WARNING]
+> The SCSI generic node accepts any command the drive understands, including firmware writes. Enable `opticalDrives` only for a service that genuinely reads or writes discs.
+
### Multiple Images
Services can define multiple images. Each image needs its own `arch` field:
@@ -391,4 +414,4 @@ To support user-managed local folders, attached drives and network shares, decla
## Dependencies
-Define dependencies in `startos/dependencies.ts` with `sdk.Dependency.required` or `sdk.Dependency.optional`, and pass the resulting `sdk.Dependencies.of()` builder to `buildManifest(versionGraph, sdkManifest, dependencies)`. See [Dependencies](dependencies.md) for base requirements and runtime narrowing.
+Define dependencies in `startos/dependencies.ts` with `sdk.Dependency.required` or `sdk.Dependency.optional`, and pass the resulting `sdk.Dependencies.of()` builder to `buildManifest({ versionGraph, manifest, dependencies, i18n })`. See [Dependencies](dependencies.md) for base requirements and runtime narrowing.
diff --git a/projects/start-sdk/docs/src/project-structure.md b/projects/start-sdk/docs/src/project-structure.md
index 126d4c9240..5869bf9a0c 100644
--- a/projects/start-sdk/docs/src/project-structure.md
+++ b/projects/start-sdk/docs/src/project-structure.md
@@ -189,10 +189,6 @@ concurrency:
jobs:
tag:
uses: Start9Labs/start-technologies/.github/workflows/tagAndRelease.yml@master
- with:
- REFERENCE_REGISTRY: ${{ vars.REFERENCE_REGISTRY }}
- RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
- S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
@@ -201,6 +197,8 @@ jobs:
contents: write
```
+The reusable workflows read `REFERENCE_REGISTRY`, `RELEASE_REGISTRY`, `S3_S9PKS_BASE_URL` and `REGISTRY_PROXY` from the calling repository's variables, including organization variables. Set them there; pass an input of the same name under `with:` only to override one for a single repo's workflow. Secrets are not read this way and must still be passed.
+
**release.yml** -- publishes on manual tag push, for re-releases or testing. This workflow only triggers on manually pushed tags — tags created by tagAndRelease (via `GITHUB_TOKEN`) do not trigger it:
```yaml
@@ -214,9 +212,6 @@ on:
jobs:
release:
uses: Start9Labs/start-technologies/.github/workflows/release.yml@master
- with:
- RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
- S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
@@ -225,6 +220,8 @@ jobs:
contents: write
```
+To publish to registries served over Tor, run a Tor SOCKS proxy the runners can reach and set `REGISTRY_PROXY` to its URL, such as `socks5h://tor-proxy.example:9050`. The `socks5h` scheme resolves names through the proxy, which `.onion` addresses require. Both workflows then route every `start-cli` registry request through it. The workflows do not start a proxy themselves.
+
**syncNext.yml** -- carries every change that lands on the base branch onto the paired `next` iteration branch, so `next` never falls behind what has already shipped:
```yaml
@@ -243,7 +240,7 @@ jobs:
pull-requests: write
```
-The paired branch is derived rather than configured: an explicit `next/` is used where one exists — that is how the multi-branch packages keep one iteration branch per major line or flavor — and otherwise the repo's default branch pairs with a plain `next`. **A repo with no `next` gets one created at the base tip on the first run**, so a package never has to be seeded by hand.
+The paired branch is derived rather than configured: a repo with any `next/` branch pairs every base with its own `next/` — that is how the multi-branch packages keep one iteration branch per major line or flavor, including a new line that just became the default branch — and otherwise the repo's default branch pairs with a plain `next`. **A repo with no `next` gets one created at the base tip on the first run**, so a package never has to be seeded by hand.
Neither `next` nor the base branch is force-pushed or rewritten. `next` is fast-forwarded when it is merely behind, given a merge commit when it carries unmerged work, and left untouched with a pull request opened for a human only when that merge conflicts. That pull request is headed by a throwaway `sync-next/` branch rather than the base itself, so resolving its conflicts in GitHub's web editor — which commits to the head branch — cannot land on the base. **Merge it with a merge commit rather than a squash**, so `next` comes out with the base as an ancestor; a squash leaves equivalent content under a fresh commit and the following sync conflicts all over again. `workflow_dispatch` is there so a package can be brought into line without waiting for its next merge.
diff --git a/projects/start-sdk/docs/src/recipe-backups.md b/projects/start-sdk/docs/src/recipe-backups.md
index 46faddc056..47418e0a19 100644
--- a/projects/start-sdk/docs/src/recipe-backups.md
+++ b/projects/start-sdk/docs/src/recipe-backups.md
@@ -4,9 +4,9 @@ Every StartOS package must define a backup strategy. The SDK provides builders f
## Solution
-Use `sdk.setupBackups()` with the appropriate builder. `sdk.Backups.ofVolumes('main')` for simple volume snapshots. `sdk.Backups.withPgDump()` for PostgreSQL (handles dump and restore). `sdk.Backups.withMysqlDump()` and `sdk.Backups.withMariadbDump()` dump MySQL and MariaDB, though a copied volume is usually the better choice for those (see [Databases](#databases-copy-the-volume-or-dump-it)). Chain `.addVolume('name')` for additional volumes. Use `.addSync({ dataPath, backupPath })` to select paths within a volume rather than copying the whole volume. Both forms use incremental rsync and skip unchanged files.
+Use `sdk.setupBackups()` with the appropriate builder. `sdk.Backups.ofVolumes('main')` for simple volume snapshots. `sdk.Backups.withPgDump()` for PostgreSQL (handles dump and restore). `sdk.Backups.withMysqlDump()` and `sdk.Backups.withMariadbDump()` dump MySQL and MariaDB, though a copied volume is usually the better choice for those (see [Databases](#databases-copy-the-volume-or-dump-it)). Chain `.addVolume('name')` for additional volumes. Use `.addSync({ dataPath, backupPath })` to select paths within a volume rather than copying the whole volume. Both forms use incremental rsync and skip unchanged files. To leave out a regenerable cache, pass `backupOptions: { exclude: ['/cache/'] }` on the sync; patterns are rsync patterns relative to `dataPath`. The next backup to a target removes excluded paths, and volumes no longer in the backup set, left there by an earlier backup.
-A restore installs the s9pk stored in the backup, so it runs that version's own backup and restore code; the current version's migrations run on the update after it. Changing the backup set never affects backups taken before the change.
+A restore installs the s9pk stored in the backup, so it runs that version's own backup and restore code; the current version's migrations run on the update after it. Backups on other targets and retained read-only snapshots keep their original contents.
> [!NOTE]
> Because the service is stopped for the duration of the backup, your backup logic runs against a quiescent volume — nothing is writing to the data while it is copied or dumped. StartOS restarts the service automatically once the backup finishes, but only if it was running when the backup began; a service that was already stopped stays stopped.
diff --git a/projects/start-sdk/docs/src/recipe-dependent-auth.md b/projects/start-sdk/docs/src/recipe-dependent-auth.md
index 94622ce036..b1a72801db 100644
--- a/projects/start-sdk/docs/src/recipe-dependent-auth.md
+++ b/projects/start-sdk/docs/src/recipe-dependent-auth.md
@@ -1,6 +1,6 @@
# Let Dependents Through a Proxy Auth Gate
-A binding gated with `addSsl.auth` challenges every client on every address, the plaintext bridge address included. A service that depends on it gets `401` unless it sends a credential the gate accepts. Both sides of the dependency take part: the gated service publishes a machine key, and its dependents read it and send it.
+A binding gated with `proxy.auth` challenges every client on every address, the plaintext bridge address included. A service that depends on it gets `401` unless it sends a credential the gate accepts. Both sides of the dependency take part: the gated service publishes a machine key, and its dependents read it and send it.
## Solution
diff --git a/projects/start-sdk/docs/src/recipes.md b/projects/start-sdk/docs/src/recipes.md
index d3b9c3d65d..20582c7f8c 100644
--- a/projects/start-sdk/docs/src/recipes.md
+++ b/projects/start-sdk/docs/src/recipes.md
@@ -62,13 +62,13 @@ If you're using [Claude Code](https://claude.com/claude-code) (recommended), poi
## Dependencies
-| Recipe | Description |
-| -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
-| [Depend on Another Service](recipe-dependency.md) | Declare a dependency, read its connection info, and auto-configure |
-| [Enforce Settings on a Dependency](recipe-enforce-dependency.md) | Create a cross-service task that requires specific dependency configuration |
-| [Mount Volumes from Another Service](recipe-mount-dependency.md) | Read-only access to a dependency's data volume |
-| [Let Dependents Through a Proxy Auth Gate](recipe-dependent-auth.md) | Publish a key on a `public` volume so dependents pass an `addSsl.auth` gate, and read it on the other side |
-| [Support Alternative Dependencies](recipe-alternative-deps.md) | Let users choose between backends (e.g., LND vs CLN) |
+| Recipe | Description |
+| -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
+| [Depend on Another Service](recipe-dependency.md) | Declare a dependency, read its connection info, and auto-configure |
+| [Enforce Settings on a Dependency](recipe-enforce-dependency.md) | Create a cross-service task that requires specific dependency configuration |
+| [Mount Volumes from Another Service](recipe-mount-dependency.md) | Read-only access to a dependency's data volume |
+| [Let Dependents Through a Proxy Auth Gate](recipe-dependent-auth.md) | Publish a key on a `public` volume so dependents pass a `proxy.auth` gate, and read it on the other side |
+| [Support Alternative Dependencies](recipe-alternative-deps.md) | Let users choose between backends (e.g., LND vs CLN) |
## Data & Health
diff --git a/projects/start-sdk/docs/src/service-to-service.md b/projects/start-sdk/docs/src/service-to-service.md
index 12c4506ac9..1c3a2c4ad7 100644
--- a/projects/start-sdk/docs/src/service-to-service.md
+++ b/projects/start-sdk/docs/src/service-to-service.md
@@ -67,7 +67,7 @@ When a dependency [retires](interfaces.md#retiring-a-host-or-binding) the host o
### Reaching a gated dependency
-A binding with [`addSsl.auth`](interfaces.md#authenticating-at-the-proxy) challenges its bridge address like any other, so dialing it without a credential gets `401`. A dependency that [admits dependents](interfaces.md#admitting-dependent-services) publishes a key at `credentials.json` → `apiKey` on its `public` volume and exports the id of the host that accepts it. Resolve **that** host, not the browser one:
+A binding with [`proxy.auth`](interfaces.md#authenticating-at-the-proxy) challenges its bridge address like any other, so dialing it without a credential gets `401`. A dependency that [admits dependents](interfaces.md#admitting-dependent-services) publishes a key at `credentials.json` → `apiKey` on its `public` volume and exports the id of the host that accepts it. Resolve **that** host, not the browser one:
```typescript
import { apiKeyHostId, apiPort } from 'llama-cpp-startos/startos/utils'
diff --git a/projects/start-sdk/docs/src/shared-volumes.md b/projects/start-sdk/docs/src/shared-volumes.md
index a17d0bf641..c38f78cc1c 100644
--- a/projects/start-sdk/docs/src/shared-volumes.md
+++ b/projects/start-sdk/docs/src/shared-volumes.md
@@ -6,7 +6,7 @@ Shared volumes are user-owned local folders, folders on attached drives or CIFS/
## Declare support
-Use Start SDK 4.2.0 or later. Add this property to `setupManifest`:
+Use Start SDK 5.0.0 or later. Add this property to `setupManifest`:
```ts
sharedVolumes: true,
@@ -20,7 +20,7 @@ This enables the service's **Shared Volumes** controls in StartOS; it requests n
const grants = await sdk.getSharedVolumes(effects).const()
```
-Each grant contains `id`, `name`, `readonly` and `availability`. Store the stable GUID `id` in service configuration and use the editable `name` in user-facing choices. Names are neither identities nor paths. The API returns neither host paths nor network credentials. Attached-drive mounts translate ownership through StartOS's existing service UID/GID mapping without changing on-disk owners. Linux mount metadata can reveal the CIFS account name to a granted service; its password remains private.
+Each grant contains `id`, `name`, `readonly` and `availability`. Store the stable GUID `id` in service configuration and use the editable `name` in user-facing choices. Names are neither identities nor paths. The catalog returns neither host paths nor network credentials. Local and attached-drive mounts use the same service UID/GID mapping as package-owned volumes; attaching does not rewrite their on-disk owners. A CIFS volume's files appear owned by `nobody`, with mode `0666` for files and `0777` for directories. A service can read, write and create files there but cannot change their owner or mode. Linux mount metadata can reveal the CIFS account name to a granted service; its password remains private.
The reader supports `.once()`, `.const()`, `.watch()` and the other [reactive reader methods](file-models.md). Reactive reads are invalidated only when one of the service's own granted volumes changes in a way its mounts depend on: a grant is added or revoked, its access mode changes, it becomes available or unavailable (a status reset to unknown does not count), or its source changes, including updated CIFS connection details. Renames and changes to other volumes do not invalidate them, so a returned name can be stale until the next read. Updating a CIFS share's connection details does not change an existing mount, which keeps the source it opened until the service mounts the volume again. An offline granted volume remains listed; revocation removes it. Availability is the host's last observation, not a mount preflight or a guarantee of continued connectivity.
@@ -58,7 +58,7 @@ export async function indexOptionalVolume(effects: T.Effects, id: string) {
}
```
-An unavailable source returns `{ kind: 'unavailable', reason: 'sourceUnavailable' | 'timeout' }`. Authorization, invalid paths and internal errors reject instead. Do not catch every rejection as an optional outage. An unavailable source or successful revocation leaves its tracked mountpoint inaccessible and read-only.
+An unavailable source returns `{ kind: 'unavailable', reason: 'sourceUnavailable' | 'timeout' }`. Authorization, invalid paths and internal errors reject instead. Do not catch every rejection as an optional outage. An unavailable source leaves a read-only, inaccessible placeholder beneath the mountpoint; replacing a successful mount cannot expose the writable directory below it.
Mount outside package-owned and dependency volumes, on the subcontainer's own filesystem. A directory created inside a persistent package volume survives later starts even when nothing mounts there; writes can then land in that directory instead of the shared source. Use the stable volume ID rather than its editable name when deriving paths. If a persistent mountpoint is necessary, remove stale empty directories at startup before launching the workload.
@@ -82,7 +82,9 @@ Unavailability rejects construction with the volume ID, mountpoint and reason. A
Grants do not pass through dependency mounts. A service reading another service's package volume sees the underlying directory, not shared-volume attachments nested inside it. Each consuming service needs its own grant and mount.
-StartOS checks the manifest capability, current grant, access mode and confined paths when attaching. Read-only access cannot be escalated by requesting read/write. Subpaths must remain within the granted source. Revocation detaches the service's attachments without detaching other consumers; applications must respond through their reactive configuration and normal workload lifecycle.
+StartOS checks the manifest capability, current grant, access mode and confined paths before staging a source. The SDK makes one host mount request. StartOS creates the placeholder and data bind using the shared native bind machinery and retains the data mount for detachment. Read-only sources remain read-only in the service's user namespace, including independently created bind aliases. Subpaths must remain within the granted source.
+
+Revocation is best-effort. Grant changes govern future mount requests and detach incompatible SDK-managed binds and staging sources, including in manually managed subcontainers. Independently created aliases and open handles can remain usable. Persisted grants describe authorization intent, not proof that earlier access has ended. Reactive consumers refresh through the ordinary workload lifecycle described above. Removing a volume detaches its SDK-managed binds and stages across its consumers.
## Backup ownership
diff --git a/projects/start-sdk/docs/src/versions.md b/projects/start-sdk/docs/src/versions.md
index dd57e76ad4..084d4a751f 100644
--- a/projects/start-sdk/docs/src/versions.md
+++ b/projects/start-sdk/docs/src/versions.md
@@ -212,7 +212,7 @@ When making changes to the StartOS wrapper without upstream changes:
`releaseNotes` renders as markdown in the StartOS UI. **Describe what changed in the release.** Read the upstream release notes / changelog for the bumped range, pull out the highlights that matter to a user (notable features, important fixes, security patches, breaking changes / required actions), and summarize them. Then link to the complete upstream release notes or changelog so the user can read the full detail. If the upstream release is genuinely trivial (e.g. a dependency-only patch), say that explicitly.
-**Say what a user observes, never how it was done.** Name the difference someone running the service will notice: a feature, a fix described by its symptom, a required action. Leave out the mechanism (the module, flag or config key that changed), the package's internals (an SDK bump, a refactor, a dependency refresh) and the history of a defect ("introduced in 2.37.0", "previously…"); they belong in the commit message and the PR body. A wrapper change nobody can observe gets no line of its own. Every instruction must be one a StartOS user can carry out from the StartOS UI or the service itself — never a host command (`sysctl`, `apt`) and never a pointer to guidance the note doesn't link.
+**Say what a user observes, never how it was done.** Name the difference someone running the service will notice: a feature, a fix described by its symptom, a required action. Leave out the mechanism (the module, flag or config key that changed), the package's internals (an SDK bump, a refactor, a dependency refresh) and the history of a defect ("introduced in 2.37.0", "previously…"); they belong in the commit message and the PR body. A wrapper change nobody can observe gets no line of its own. Never state the minimum StartOS version: only a server that already meets it is shown the notes, and StartOS offers the update to no other. Every instruction must be one a StartOS user can carry out from the StartOS UI or the service itself — never a host command (`sysctl`, `apt`) and never a pointer to guidance the note doesn't link.
**Release notes are the only home for what an update asks of the user.** A step to take before or after updating, a warning, a credential to rotate, a client to upgrade: each goes here and nowhere else. `instructions.md` and `README.md` describe the service as it is to someone who never ran an older version, so an update adds nothing to them unless it changes that description ([Writing Instructions — What does not belong](./writing-instructions.md#what-does-not-belong-in-instructions)).
diff --git a/projects/start-sdk/lib/backup/Backups.ts b/projects/start-sdk/lib/backup/Backups.ts
index f6e61ef88e..e024eb9e46 100644
--- a/projects/start-sdk/lib/backup/Backups.ts
+++ b/projects/start-sdk/lib/backup/Backups.ts
@@ -1,6 +1,7 @@
import * as T from '@start9labs/start-core/types'
import * as child_process from 'child_process'
import * as fs from 'fs/promises'
+import * as path from 'path'
import { Affine, asError } from '../util'
import { InitKind, InitScript } from '@start9labs/start-core/inits'
import { CommandOptions, SubContainer, execFile } from '../util/SubContainer'
@@ -11,6 +12,7 @@ import {
} from '@start9labs/start-core/util/FullProgressTracker'
const BACKUP_HOST_PATH = '/media/startos/backup'
+const BACKUP_VOLUMES_PATH = `${BACKUP_HOST_PATH}/volumes`
const BACKUP_CONTAINER_MOUNT = '/backup-target'
const MARIADB_SHUTDOWN_TIMEOUT = 120_000
@@ -1005,6 +1007,11 @@ export class Backups implements InitScript {
phase.complete()
}
+ await pruneBackupVolumes(
+ BACKUP_VOLUMES_PATH,
+ this.backupSet.map(s => s.backupPath),
+ )
+
const dataVersion = await effects.getDataVersion()
if (dataVersion)
await fs.writeFile('/media/startos/backup/dataVersion.txt', dataVersion, {
@@ -1105,6 +1112,56 @@ export class Backups implements InitScript {
}
}
+/**
+ * Removes entries of the backup's volumes directory disjoint from every backup path.
+ * Leaves a volumes root that is not a real directory untouched.
+ */
+export async function pruneBackupVolumes(
+ volumesDir: string,
+ backupPaths: string[],
+) {
+ const kept = new Set()
+ for (const backupPath of backupPaths) {
+ const parts = path.posix.relative(volumesDir, backupPath).split('/')
+ const volume = parts[0]!
+ if (volume === '' || parts.every(part => part === '..')) return
+ if (volume !== '..') kept.add(volume)
+ }
+ const metadata = await fs.lstat(volumesDir).catch(e => {
+ if (e?.code === 'ENOENT') return undefined
+ throw e
+ })
+ if (!metadata?.isDirectory()) return
+ const entries = await fs.readdir(volumesDir)
+ for (const entry of entries) {
+ if (!kept.has(entry)) {
+ await fs.rm(path.posix.join(volumesDir, entry), {
+ recursive: true,
+ force: true,
+ })
+ }
+ }
+}
+
+export function rsyncArgs(
+ srcPath: string,
+ dstPath: string,
+ options: T.SyncOptions,
+) {
+ return [
+ ...(options.delete ? ['--delete', '--delete-excluded'] : []),
+ ...options.exclude.map(x => `--exclude=${x}`),
+ '-rlptgoAXH',
+ '--partial',
+ '--inplace',
+ '--timeout=300',
+ '--info=progress2',
+ // --no-inc-recursive's full pre-scan times out large backups.
+ srcPath,
+ dstPath,
+ ]
+}
+
async function runRsync(rsyncOptions: {
srcPath: string
dstPath: string
@@ -1118,23 +1175,11 @@ async function runRsync(rsyncOptions: {
await fs.mkdir(dstPath, { recursive: true })
- const command = 'rsync'
- const args: string[] = []
- if (options.delete) {
- args.push('--delete')
- }
- for (const exclude of options.exclude) {
- args.push(`--exclude=${exclude}`)
- }
- args.push('-rlptgoAXH')
- args.push('--partial')
- args.push('--inplace')
- args.push('--timeout=300')
- args.push('--info=progress2')
- // --no-inc-recursive's full pre-scan times out large backups.
- args.push(srcPath)
- args.push(dstPath)
- const spawned = child_process.spawn(command, args, { detached: true })
+ const spawned = child_process.spawn(
+ 'rsync',
+ rsyncArgs(srcPath, dstPath, options),
+ { detached: true },
+ )
let percentage = 0.0
spawned.stdout.on('data', (data: unknown) => {
const lines = String(data).replace(/\r/g, '\n').split('\n')
diff --git a/projects/start-sdk/lib/health/checkFns/checkPortListening.ts b/projects/start-sdk/lib/health/checkFns/checkPortListening.ts
index cf003a1e56..ed02a539c7 100644
--- a/projects/start-sdk/lib/health/checkFns/checkPortListening.ts
+++ b/projects/start-sdk/lib/health/checkFns/checkPortListening.ts
@@ -1,6 +1,7 @@
import { Effects } from '@start9labs/start-core/types'
import { HealthCheckResult } from './HealthCheckResult'
import * as fs from 'node:fs/promises'
+import { timeoutPromise } from './index'
/** `TCP_LISTEN` in the state column of `/proc/net/tcp{,6}`. */
const TCP_LISTEN = 0x0a
@@ -59,6 +60,9 @@ export async function checkPortListening(
timeout?: number
},
): Promise {
+ const deadline = timeoutPromise(options.timeout ?? 1_000, {
+ message: options.timeoutMessage || `Timeout trying to check port ${port}`,
+ })
return Promise.race([
Promise.resolve().then(async () => {
const hasAddress =
@@ -88,16 +92,6 @@ export async function checkPortListening(
message: options.errorMessage,
}
}),
- new Promise(resolve => {
- setTimeout(
- () =>
- resolve({
- result: 'failure',
- message:
- options.timeoutMessage || `Timeout trying to check port ${port}`,
- }),
- options.timeout ?? 1_000,
- )
- }),
- ])
+ deadline.catch(error => ({ result: 'failure', message: error.message })),
+ ]).finally(deadline.cancel)
}
diff --git a/projects/start-sdk/lib/health/checkFns/checkWebUrl.ts b/projects/start-sdk/lib/health/checkFns/checkWebUrl.ts
index 8d68112ed0..95e08e5eaf 100644
--- a/projects/start-sdk/lib/health/checkFns/checkWebUrl.ts
+++ b/projects/start-sdk/lib/health/checkFns/checkWebUrl.ts
@@ -25,7 +25,9 @@ export const checkWebUrl = async (
errorMessage = `Error while fetching URL: ${url}`,
} = {},
): Promise => {
- return Promise.race([fetch(url), timeoutPromise(timeout)])
+ const deadline = timeoutPromise(timeout)
+ return Promise.race([fetch(url), deadline])
+ .finally(deadline.cancel)
.then(
x =>
({
diff --git a/projects/start-sdk/lib/health/checkFns/index.ts b/projects/start-sdk/lib/health/checkFns/index.ts
index c493171d5b..b65d8c6008 100644
--- a/projects/start-sdk/lib/health/checkFns/index.ts
+++ b/projects/start-sdk/lib/health/checkFns/index.ts
@@ -9,11 +9,15 @@ export { checkWebUrl } from './checkWebUrl'
*
* @param ms - Timeout duration in milliseconds
* @param options.message - Custom error message (defaults to "Timed out")
- * @returns A promise that never resolves, only rejects after the timeout
+ * @returns A rejecting deadline; `cancel()` clears an unused timer.
*/
export function timeoutPromise(ms: number, { message = 'Timed out' } = {}) {
- return new Promise((resolve, reject) =>
- setTimeout(() => reject(new Error(message)), ms),
+ let timer!: ReturnType
+ return Object.assign(
+ new Promise((_, reject) => {
+ timer = setTimeout(() => reject(new Error(message)), ms)
+ }),
+ { cancel: () => clearTimeout(timer) },
)
}
export { runHealthScript }
diff --git a/projects/start-sdk/lib/health/checkFns/runHealthScript.ts b/projects/start-sdk/lib/health/checkFns/runHealthScript.ts
index d945e05252..56378419e1 100644
--- a/projects/start-sdk/lib/health/checkFns/runHealthScript.ts
+++ b/projects/start-sdk/lib/health/checkFns/runHealthScript.ts
@@ -26,15 +26,15 @@ export const runHealthScript = async (
`Have ran script ${runCommand} and the result: ${res}`,
} = {},
): Promise => {
- const res = await Promise.race([
- subcontainer.execFail(runCommand),
- timeoutPromise(timeout),
- ]).catch(e => {
- console.warn(errorMessage)
- console.warn(JSON.stringify(e))
- console.warn(e.toString())
- throw { result: 'failure', message: errorMessage } as HealthCheckResult
- })
+ const deadline = timeoutPromise(timeout)
+ const res = await Promise.race([subcontainer.execFail(runCommand), deadline])
+ .finally(deadline.cancel)
+ .catch(e => {
+ console.warn(errorMessage)
+ console.warn(JSON.stringify(e))
+ console.warn(e.toString())
+ throw { result: 'failure', message: errorMessage } as HealthCheckResult
+ })
return {
result: 'success',
message: message(res.stdout.toString()),
diff --git a/projects/start-sdk/lib/i18n/index.ts b/projects/start-sdk/lib/i18n/index.ts
index 4367cb9f8a..239e058e61 100644
--- a/projects/start-sdk/lib/i18n/index.ts
+++ b/projects/start-sdk/lib/i18n/index.ts
@@ -35,7 +35,8 @@ function firstUsableLocale(...candidates: string[]): string | undefined {
* @param defaultDict - The default language dictionary mapping strings to numeric indices
* @param translations - Translation dictionaries for each supported locale
* @param defaultLang - The default language code (e.g., 'en_US')
- * @returns A typed i18n function that accepts dictionary keys and optional parameters
+ * @returns A typed i18n function that accepts dictionary keys and optional parameters,
+ * carrying the default language as `defaultLang` for `buildManifest`
*/
export function setupI18n<
Dict extends Record,
@@ -78,10 +79,7 @@ export function setupI18n<
return value
}
- return function i18n(
- key: keyof Dict,
- params?: Record,
- ): string {
+ function i18n(key: keyof Dict, params?: Record): string {
let result = translation
? translation[defaultDict[key as string]]
: (key as string)
@@ -94,4 +92,6 @@ export function setupI18n<
return result
}
+
+ return Object.assign(i18n, { defaultLang })
}
diff --git a/projects/start-sdk/lib/manifest/setupManifest.ts b/projects/start-sdk/lib/manifest/setupManifest.ts
index c385aa3259..1769a5d3fc 100644
--- a/projects/start-sdk/lib/manifest/setupManifest.ts
+++ b/projects/start-sdk/lib/manifest/setupManifest.ts
@@ -44,6 +44,7 @@ export function setupManifest<
}
const sharedVolumeOsVersion = '0.4.3'
+const opticalDriveOsVersion = '0.4.3'
function manifestOsVersion(manifest: SDKManifest): string {
const required = manifest.sharedVolumes ? sharedVolumeOsVersion : OSVersion
@@ -55,6 +56,17 @@ function manifestOsVersion(manifest: SDKManifest): string {
) {
throw new Error(`Shared volumes require StartOS ${required} or later`)
}
+ // An older StartOS ignores the flag, so the service would install and silently get no drive.
+ if (
+ manifest.opticalDrives &&
+ StartOsVersion.parse(requested).compare(
+ StartOsVersion.parse(opticalDriveOsVersion),
+ ) === 'less'
+ ) {
+ throw new Error(
+ `Optical drives require StartOS ${opticalDriveOsVersion} or later`,
+ )
+ }
return requested
}
@@ -63,8 +75,10 @@ function manifestOsVersion(manifest: SDKManifest): string {
* with version graph metadata, OS version, SDK version, and computed fields
* (migration ranges, hardware requirements, etc.).
*
- * @param versions - The service's VersionGraph, used to extract the current version, release notes, and migration ranges
- * @param manifest - The SDK manifest definition (from `setupManifest`)
+ * @param options.versionGraph - The service's VersionGraph, used to extract the current version, release notes, and migration ranges
+ * @param options.manifest - The SDK manifest definition (from `setupManifest`)
+ * @param options.dependencies - The service's `Dependencies` builder
+ * @param options.i18n - The package's own `setupI18n` result; its default language becomes `defaultLocale`
* @returns A fully resolved Manifest ready for packaging
*/
export function buildManifest<
@@ -78,11 +92,17 @@ export function buildManifest<
images: Record
volumes: VolumesTypes[]
},
->(
- versions: VersionGraph,
- manifest: SDKManifest & Manifest,
- dependencies: Dependencies,
-): Manifest & T.Manifest {
+>({
+ versionGraph: versions,
+ manifest,
+ dependencies,
+ i18n,
+}: {
+ versionGraph: VersionGraph
+ manifest: SDKManifest & Manifest
+ dependencies: Dependencies
+ i18n: { readonly defaultLang: string }
+}): Manifest & T.Manifest {
const images = Object.entries(manifest.images).reduce(
(images, [k, v]) => {
v.arch = v.arch ?? ['aarch64', 'x86_64', 'riscv64']
@@ -95,6 +115,7 @@ export function buildManifest<
)
return {
...manifest,
+ defaultLocale: i18n.defaultLang,
dependencies: dependencies.manifestDependencies(),
gitHash: null,
osVersion: manifestOsVersion(manifest),
@@ -131,6 +152,7 @@ export function buildManifest<
userspaceFilesystems: manifest.userspaceFilesystems ?? false,
virtualNetworking: manifest.virtualNetworking ?? false,
hardwareVirtualization: manifest.hardwareVirtualization ?? false,
+ opticalDrives: manifest.opticalDrives ?? false,
sharedVolumes: manifest.sharedVolumes ?? false,
plugins: manifest.plugins ?? [],
}
diff --git a/projects/start-sdk/lib/test/backup.sync.test.ts b/projects/start-sdk/lib/test/backup.sync.test.ts
new file mode 100644
index 0000000000..18d4945e59
--- /dev/null
+++ b/projects/start-sdk/lib/test/backup.sync.test.ts
@@ -0,0 +1,127 @@
+import { execFileSync } from 'child_process'
+import {
+ existsSync,
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ rmSync,
+ symlinkSync,
+ writeFileSync,
+} from 'fs'
+import { readdir } from 'fs/promises'
+import { tmpdir } from 'os'
+import { join } from 'path'
+import {
+ DEFAULT_OPTIONS,
+ pruneBackupVolumes,
+ rsyncArgs,
+} from '../backup/Backups'
+
+describe('rsyncArgs exclusions', () => {
+ let root: string
+ let src: string
+ let dst: string
+
+ beforeEach(() => {
+ root = mkdtempSync(join(tmpdir(), 'rsync-args-'))
+ src = join(root, 'src') + '/'
+ dst = join(root, 'dst') + '/'
+ for (const dir of [src, dst]) {
+ mkdirSync(join(dir, 'cache'), { recursive: true })
+ writeFileSync(join(dir, 'cache', 'thumb'), 'x')
+ }
+ writeFileSync(join(src, 'data'), 'x')
+ })
+
+ afterEach(() => rmSync(root, { recursive: true, force: true }))
+
+ const sync = (options: Partial) =>
+ execFileSync(
+ 'rsync',
+ rsyncArgs(src, dst, { ...DEFAULT_OPTIONS, ...options }),
+ )
+
+ it('removes an excluded path already in the target', () => {
+ sync({ exclude: ['/cache/'] })
+ expect(existsSync(join(dst, 'data'))).toBe(true)
+ expect(existsSync(join(dst, 'cache'))).toBe(false)
+ })
+
+ it('leaves the target untouched without delete', () => {
+ sync({ exclude: ['/cache/'], delete: false })
+ expect(existsSync(join(dst, 'data'))).toBe(true)
+ expect(existsSync(join(dst, 'cache'))).toBe(true)
+ })
+})
+
+describe('pruneBackupVolumes', () => {
+ let volumes: string
+
+ beforeEach(() => {
+ volumes = join(mkdtempSync(join(tmpdir(), 'backup-volumes-')), 'volumes')
+ for (const v of ['main', 'db', 'removed']) {
+ mkdirSync(join(volumes, v), { recursive: true })
+ writeFileSync(join(volumes, v, 'file'), 'x')
+ }
+ })
+
+ afterEach(() => rmSync(join(volumes, '..'), { recursive: true, force: true }))
+
+ it('removes volumes no backup path lies within', async () => {
+ await pruneBackupVolumes(volumes, [
+ `${volumes}/main/`,
+ `${volumes}/db/pgdata/`,
+ `${join(volumes, '..')}/other/`,
+ ])
+ expect((await readdir(volumes)).sort()).toEqual(['db', 'main'])
+ })
+
+ it('keeps every volume when a backup path is the volumes directory', async () => {
+ await pruneBackupVolumes(volumes, [`${volumes}/`])
+ expect((await readdir(volumes)).sort()).toEqual(['db', 'main', 'removed'])
+ })
+
+ it('keeps every volume when a sync targets the backup root', async () => {
+ await pruneBackupVolumes(volumes, [join(volumes, '..')])
+ expect((await readdir(volumes)).sort()).toEqual(['db', 'main', 'removed'])
+ expect(readFileSync(join(volumes, 'main', 'file'), 'utf8')).toBe('x')
+ })
+
+ it('keeps a custom volume target whose name starts with two dots', async () => {
+ const custom = join(volumes, '..cache')
+ mkdirSync(custom)
+ writeFileSync(join(custom, 'file'), 'current')
+
+ await pruneBackupVolumes(volumes, [`${custom}/`])
+
+ expect(await readdir(volumes)).toEqual(['..cache'])
+ expect(readFileSync(join(custom, 'file'), 'utf8')).toBe('current')
+ })
+
+ it('prunes every volume when a sync targets a sibling directory', async () => {
+ await pruneBackupVolumes(volumes, [`${volumes}-archive/`])
+ expect(await readdir(volumes)).toEqual([])
+ })
+
+ it('prunes every volume when no sync selects one', async () => {
+ await pruneBackupVolumes(volumes, [])
+ expect(await readdir(volumes)).toEqual([])
+ })
+
+ it('leaves a symlink volumes root and its target untouched', async () => {
+ const liveData = join(volumes, '..', 'live-data')
+ mkdirSync(liveData)
+ writeFileSync(join(liveData, 'file'), 'keep')
+ rmSync(volumes, { recursive: true, force: true })
+ symlinkSync(liveData, volumes, 'dir')
+
+ await pruneBackupVolumes(volumes, [])
+ expect(readFileSync(join(liveData, 'file'), 'utf8')).toBe('keep')
+ })
+
+ it('tolerates a backup with no volumes directory', async () => {
+ await expect(
+ pruneBackupVolumes(join(volumes, 'missing'), []),
+ ).resolves.toBeUndefined()
+ })
+})
diff --git a/projects/start-sdk/lib/test/health.readyCheck.test.ts b/projects/start-sdk/lib/test/health.readyCheck.test.ts
index 1498f4ba59..7e0e1e270b 100644
--- a/projects/start-sdk/lib/test/health.readyCheck.test.ts
+++ b/projects/start-sdk/lib/test/health.readyCheck.test.ts
@@ -48,7 +48,13 @@ describe('checkPortListening', () => {
const procNet = (tcp: string) => (path: string) =>
Promise.resolve(path === '/proc/net/tcp' ? tcp : header)
- afterEach(() => readFile.mockReset())
+ beforeEach(() => jest.useFakeTimers())
+ afterEach(() => {
+ const timers = jest.getTimerCount()
+ jest.useRealTimers()
+ readFile.mockReset()
+ expect(timers).toBe(0)
+ })
it('is not satisfied by connections left behind after the listener exits', async () => {
readFile.mockImplementation(procNet(leftoverConnections))
@@ -56,6 +62,27 @@ describe('checkPortListening', () => {
expect(result).toEqual({ result: 'failure', message: 'not listening' })
})
+ it('releases the deadline when reading the socket table fails', async () => {
+ readFile.mockRejectedValue(new Error('unreadable'))
+ await expect(
+ checkPortListening({} as never, 50001, options),
+ ).rejects.toThrow('unreadable')
+ })
+
+ it('reports the configured timeout when a socket-table read remains pending', async () => {
+ readFile.mockReturnValue(new Promise(() => {}))
+ const result = checkPortListening({} as never, 50001, {
+ ...options,
+ timeout: 5,
+ timeoutMessage: 'slow',
+ })
+ await jest.advanceTimersByTimeAsync(5)
+ await expect(result).resolves.toEqual({
+ result: 'failure',
+ message: 'slow',
+ })
+ })
+
it('is satisfied by a listening socket', async () => {
readFile.mockImplementation(procNet(listening))
const result = await checkPortListening({} as never, 50001, options)
diff --git a/projects/start-sdk/lib/test/health.timeouts.test.ts b/projects/start-sdk/lib/test/health.timeouts.test.ts
new file mode 100644
index 0000000000..6f51b3085a
--- /dev/null
+++ b/projects/start-sdk/lib/test/health.timeouts.test.ts
@@ -0,0 +1,51 @@
+import {
+ checkWebUrl,
+ runHealthScript,
+ timeoutPromise,
+} from '../health/checkFns'
+
+beforeEach(() => {
+ jest.useFakeTimers()
+ jest.spyOn(console, 'warn').mockImplementation(() => {})
+ jest.spyOn(console, 'error').mockImplementation(() => {})
+})
+afterEach(() => {
+ const timers = jest.getTimerCount()
+ jest.useRealTimers()
+ jest.restoreAllMocks()
+ expect(timers).toBe(0)
+})
+
+test('a caller can retire an unused deadline', () => {
+ const deadline = timeoutPromise(30_000)
+ expect(jest.getTimerCount()).toBe(1)
+ deadline.cancel()
+})
+
+test('web checks retire deadlines on response and rejection', async () => {
+ const fetch = jest.spyOn(globalThis, 'fetch')
+ fetch.mockResolvedValueOnce({} as Response)
+ await expect(
+ checkWebUrl({} as never, 'https://example.invalid'),
+ ).resolves.toMatchObject({ result: 'success' })
+ expect(jest.getTimerCount()).toBe(0)
+ fetch.mockRejectedValueOnce(new Error('offline'))
+ await expect(
+ checkWebUrl({} as never, 'https://example.invalid'),
+ ).resolves.toMatchObject({ result: 'failure' })
+})
+
+test('script checks retire deadlines on completion and rejection', async () => {
+ const execFail = jest
+ .fn()
+ .mockResolvedValueOnce({ stdout: Buffer.from('ready') })
+ const subcontainer = { execFail } as never
+ await expect(runHealthScript(['probe'], subcontainer)).resolves.toMatchObject(
+ { result: 'success' },
+ )
+ expect(jest.getTimerCount()).toBe(0)
+ execFail.mockRejectedValueOnce(new Error('failed'))
+ await expect(runHealthScript(['probe'], subcontainer)).rejects.toMatchObject({
+ result: 'failure',
+ })
+})
diff --git a/projects/start-sdk/lib/test/pathQueue.test.ts b/projects/start-sdk/lib/test/pathQueue.test.ts
new file mode 100644
index 0000000000..aaa83d44a2
--- /dev/null
+++ b/projects/start-sdk/lib/test/pathQueue.test.ts
@@ -0,0 +1,22 @@
+import { PathQueue } from '../util/PathQueue'
+
+test('same-path work remains ordered after rejection while other paths proceed', async () => {
+ const queue = new PathQueue()
+ const events: string[] = []
+ let release!: () => void
+ const barrier = new Promise(resolve => (release = resolve))
+ const first = queue.run('/one', async () => {
+ events.push('first')
+ await barrier
+ throw new Error('failed')
+ })
+ const failure = expect(first).rejects.toThrow('failed')
+ const second = queue.run('/one', async () => events.push('second'))
+ await queue.run('/two', async () => events.push('other'))
+ expect(events).toEqual(['first', 'other'])
+ release()
+ await failure
+ await second
+ expect(events).toEqual(['first', 'other', 'second'])
+ await expect(queue.run('/one', async () => 'ready')).resolves.toBe('ready')
+})
diff --git a/projects/start-sdk/lib/test/setupManifest.test.ts b/projects/start-sdk/lib/test/setupManifest.test.ts
index 770f963cbf..2c64af7386 100644
--- a/projects/start-sdk/lib/test/setupManifest.test.ts
+++ b/projects/start-sdk/lib/test/setupManifest.test.ts
@@ -2,6 +2,9 @@ import { buildManifest, setupManifest } from '../manifest/setupManifest'
import { Dependencies, Dependency } from '../dependencies'
import { VersionGraph } from '../version/VersionGraph'
import { VersionInfo } from '../version/VersionInfo'
+import { setupI18n } from '../i18n'
+
+const i18n = setupI18n({}, {}, 'en_US')
const versions = VersionGraph.of({
current: VersionInfo.of<'1.0.0:0'>({
@@ -41,14 +44,24 @@ function manifest(emulateMissing?: boolean) {
}
test('defaults to the binding transport enforcement compatibility floor', () => {
- expect(buildManifest(versions, manifest(), Dependencies.of()).osVersion).toBe(
- '0.4.3',
- )
+ expect(
+ buildManifest({
+ versionGraph: versions,
+ manifest: manifest(),
+ dependencies: Dependencies.of(),
+ i18n,
+ }).osVersion,
+ ).toBe('0.4.3')
})
test('pre-download alert is included in the built manifest', () => {
expect(
- buildManifest(versions, manifest(), Dependencies.of()).preDownloadAlert,
+ buildManifest({
+ versionGraph: versions,
+ manifest: manifest(),
+ dependencies: Dependencies.of(),
+ i18n,
+ }).preDownloadAlert,
).toEqual({
message: {
en_US: 'Back up before updating',
@@ -68,7 +81,12 @@ test('the builder publishes its complete base dependency requirements', () => {
healthChecks: ['bitcoin-rest'],
}),
)
- const built = buildManifest(versions, manifest(), dependencies)
+ const built = buildManifest({
+ versionGraph: versions,
+ manifest: manifest(),
+ dependencies: dependencies,
+ i18n,
+ })
expect(built.dependencies.bitcoind).toEqual({
description: 'Blockchain data',
optional: false,
@@ -80,14 +98,24 @@ test('the builder publishes its complete base dependency requirements', () => {
})
test('images emulate missing architectures by default', () => {
- const built = buildManifest(versions, manifest(), Dependencies.of())
+ const built = buildManifest({
+ versionGraph: versions,
+ manifest: manifest(),
+ dependencies: Dependencies.of(),
+ i18n,
+ })
expect(built.images.main.emulateMissing).toBe(true)
expect(built.hardwareRequirements.arch).toBeNull()
})
test('images can require a native architecture', () => {
- const built = buildManifest(versions, manifest(false), Dependencies.of())
+ const built = buildManifest({
+ versionGraph: versions,
+ manifest: manifest(false),
+ dependencies: Dependencies.of(),
+ i18n,
+ })
expect(built.images.main.emulateMissing).toBe(false)
expect(built.hardwareRequirements.arch).toEqual(['aarch64'])
@@ -95,10 +123,20 @@ test('images can require a native architecture', () => {
test('shared-volume capability defaults to false and preserves explicit opt-in', () => {
expect(
- buildManifest(versions, manifest(), Dependencies.of()).sharedVolumes,
+ buildManifest({
+ versionGraph: versions,
+ manifest: manifest(),
+ dependencies: Dependencies.of(),
+ i18n,
+ }).sharedVolumes,
).toBe(false)
const optedIn = setupManifest({ ...manifest(), sharedVolumes: true })
- const built = buildManifest(versions, optedIn, Dependencies.of())
+ const built = buildManifest({
+ versionGraph: versions,
+ manifest: optedIn,
+ dependencies: Dependencies.of(),
+ i18n,
+ })
expect(built.sharedVolumes).toBe(true)
expect(built.osVersion).toBe('0.4.3')
})
@@ -106,22 +144,77 @@ test('shared-volume capability defaults to false and preserves explicit opt-in',
test('an explicit compatibility override cannot understate shared-volume support', () => {
for (const osVersion of ['0.4.2', '0.4.1.1']) {
expect(() =>
- buildManifest(
- versions,
- setupManifest({ ...manifest(), sharedVolumes: true, osVersion }),
- Dependencies.of(),
- ),
+ buildManifest({
+ versionGraph: versions,
+ manifest: setupManifest({
+ ...manifest(),
+ sharedVolumes: true,
+ osVersion,
+ }),
+ dependencies: Dependencies.of(),
+ i18n,
+ }),
).toThrow('Shared volumes require StartOS 0.4.3 or later')
}
expect(
- buildManifest(
- versions,
- setupManifest({
+ buildManifest({
+ versionGraph: versions,
+ manifest: setupManifest({
...manifest(),
sharedVolumes: true,
osVersion: '0.4.3',
}),
- Dependencies.of(),
- ).osVersion,
+ dependencies: Dependencies.of(),
+ i18n,
+ }).osVersion,
).toBe('0.4.3')
})
+
+test('optical-drive capability defaults to false and preserves explicit opt-in', () => {
+ expect(
+ buildManifest({
+ versionGraph: versions,
+ manifest: manifest(),
+ dependencies: Dependencies.of(),
+ i18n,
+ }).opticalDrives,
+ ).toBe(false)
+ const built = buildManifest({
+ versionGraph: versions,
+ manifest: setupManifest({ ...manifest(), opticalDrives: true }),
+ dependencies: Dependencies.of(),
+ i18n,
+ })
+ expect(built.opticalDrives).toBe(true)
+ expect(built.osVersion).toBe('0.4.3')
+})
+
+test('an explicit compatibility override cannot understate optical-drive support', () => {
+ for (const osVersion of ['0.4.2', '0.4.1.1']) {
+ expect(() =>
+ buildManifest({
+ versionGraph: versions,
+ manifest: setupManifest({
+ ...manifest(),
+ opticalDrives: true,
+ osVersion,
+ }),
+ dependencies: Dependencies.of(),
+ i18n,
+ }),
+ ).toThrow('Optical drives require StartOS 0.4.3 or later')
+ }
+})
+
+test('the default locale is the given package i18n default language', () => {
+ const own = setupI18n({}, {}, 'fr_FR')
+ setupI18n({}, {}, 'de_DE')
+ expect(
+ buildManifest({
+ versionGraph: versions,
+ manifest: manifest(),
+ dependencies: Dependencies.of(),
+ i18n: own,
+ }).defaultLocale,
+ ).toBe('fr_FR')
+})
diff --git a/projects/start-sdk/lib/test/sharedVolumes.test.ts b/projects/start-sdk/lib/test/sharedVolumes.test.ts
index bb492f61b4..7487f74354 100644
--- a/projects/start-sdk/lib/test/sharedVolumes.test.ts
+++ b/projects/start-sdk/lib/test/sharedVolumes.test.ts
@@ -242,6 +242,127 @@ test.each(['eager', 'lazy'] as const)(
},
)
+test('shared data and placeholders are owned by one host request, unlike package volume binds', async () => {
+ const effects = context()
+ const sub = await SubContainer.eager(
+ effects,
+ { imageId: 'main' },
+ Mounts.of().mountVolume({
+ volumeId: 'main',
+ mountpoint: '/data',
+ subpath: null,
+ readonly: false,
+ }),
+ 'test',
+ )
+ try {
+ await sub.tryMountSharedVolume(options)
+ const binds = jest
+ .mocked(subcontainers.execFile)
+ .mock.calls.filter(
+ ([command, args]) =>
+ command === 'start-container' && args?.[0] === 'bind-mount',
+ )
+ expect(binds).toHaveLength(1)
+ expect(binds[0][1]).toEqual(
+ expect.arrayContaining([
+ '--source',
+ '/media/startos/volumes/main/',
+ '--target',
+ '/rootfs/data',
+ ]),
+ )
+ expect(effects.mountSharedVolume).toHaveBeenCalledTimes(1)
+ expect(effects.mountSharedVolume).toHaveBeenCalledWith({
+ ...options,
+ subcontainer: 'guid',
+ })
+ } finally {
+ await sub.destroy()
+ }
+})
+
+test('each shared remount delegates once without SDK binds or unmounts', async () => {
+ const effects = context()
+ jest
+ .mocked(effects.mountSharedVolume)
+ .mockResolvedValueOnce({ kind: 'mounted' })
+ .mockResolvedValueOnce({ kind: 'unavailable', reason: 'sourceUnavailable' })
+ .mockResolvedValueOnce({ kind: 'mounted' })
+ const sub = await SubContainer.eager(
+ effects,
+ { imageId: 'main' },
+ null,
+ 'test',
+ )
+ try {
+ await sub.tryMountSharedVolume(options)
+ await sub.tryMountSharedVolume({
+ ...options,
+ mountpoint: '/media//./music',
+ })
+ await sub.tryMountSharedVolume(options)
+ const calls = jest.mocked(subcontainers.execFile).mock.calls
+ const binds = calls.filter(
+ ([command, args]) =>
+ command === 'start-container' && args?.[0] === 'bind-mount',
+ )
+ expect(binds).toEqual([])
+ expect(effects.mountSharedVolume).toHaveBeenCalledTimes(3)
+ expect(calls.filter(([command]) => command === 'umount')).toEqual([])
+ } finally {
+ await sub.destroy()
+ }
+})
+
+test('an in-flight shared bind holds the subcontainer until it completes', async () => {
+ const effects = context()
+ let release!: (value: T.SharedVolumeMountResult) => void
+ let started!: () => void
+ const ready = new Promise(resolve => (started = resolve))
+ jest.mocked(effects.mountSharedVolume).mockImplementation(() => {
+ started()
+ return new Promise(resolve => (release = resolve))
+ })
+ const sub = await SubContainer.eager(
+ effects,
+ { imageId: 'main' },
+ null,
+ 'test',
+ )
+ const mounting = sub.tryMountSharedVolume(options)
+ await ready
+ await sub.destroy()
+ expect(effects.subcontainer.destroyFs).not.toHaveBeenCalled()
+ release({ kind: 'mounted' })
+ await mounting
+ expect(effects.subcontainer.destroyFs).toHaveBeenCalledWith({ guid: 'guid' })
+})
+
+test('a rejected host request never falls back to an SDK bind', async () => {
+ const effects = context()
+ const revoked = new Error('shared-volume grant revoked')
+ jest.mocked(effects.mountSharedVolume).mockRejectedValue(revoked)
+ const sub = await SubContainer.eager(
+ effects,
+ { imageId: 'main' },
+ null,
+ 'test',
+ )
+ try {
+ await expect(sub.tryMountSharedVolume(options)).rejects.toBe(revoked)
+ const binds = jest
+ .mocked(subcontainers.execFile)
+ .mock.calls.filter(
+ ([command, args]) =>
+ command === 'start-container' && args?.[0] === 'bind-mount',
+ )
+ expect(binds).toEqual([])
+ } finally {
+ await sub.destroy()
+ }
+})
+
test.each(['sourceUnavailable', 'timeout'] as const)(
'optional %s is an outcome and the affected workload is not launched',
async reason => {
diff --git a/projects/start-sdk/lib/util/PathQueue.ts b/projects/start-sdk/lib/util/PathQueue.ts
new file mode 100644
index 0000000000..4eb17a53aa
--- /dev/null
+++ b/projects/start-sdk/lib/util/PathQueue.ts
@@ -0,0 +1,16 @@
+export class PathQueue {
+ private readonly tails = new Map>()
+
+ run(path: string, operation: () => Promise): Promise {
+ const result = (this.tails.get(path) ?? Promise.resolve()).then(operation)
+ const tail = result.then(
+ () => {},
+ () => {},
+ )
+ this.tails.set(path, tail)
+ void tail.then(() => {
+ if (this.tails.get(path) === tail) this.tails.delete(path)
+ })
+ return result
+ }
+}
diff --git a/projects/start-sdk/lib/util/SubContainer.ts b/projects/start-sdk/lib/util/SubContainer.ts
index 24de6bd955..86d8883ba4 100644
--- a/projects/start-sdk/lib/util/SubContainer.ts
+++ b/projects/start-sdk/lib/util/SubContainer.ts
@@ -3,12 +3,14 @@ import * as T from '@start9labs/start-core/types'
import * as cp from 'child_process'
import { promisify } from 'util'
import { Buffer } from 'node:buffer'
+import { posix } from 'node:path'
import { once } from '@start9labs/start-core/util/once'
import { Drop } from '@start9labs/start-core/util/Drop'
import { logErrorOnce } from '@start9labs/start-core/util/logErrorOnce'
import { Mounts } from '../mainFn/Mounts'
import { FileMounts } from './fileMounts'
import { jsonEnv } from './jsonEnv'
+import { PathQueue } from './PathQueue'
export const execFile = promisify(cp.execFile)
const False = () => false
@@ -441,6 +443,7 @@ export class SubContainerEager<
private readonly fileMounts = new FileMounts()
private sharedMounts = false
private sharedVolumeDependency = false
+ private readonly sharedVolumeQueue = new PathQueue()
private leader: cp.ChildProcess
private leaderExited: boolean = false
@@ -597,11 +600,7 @@ export class SubContainerEager<
options.readonly,
)
if (isFile) {
- if (!this.sharedMounts) {
- // Exec namespaces become slaves of this tree and receive its rebinds.
- await execFile('mount', ['--make-rshared', this.rootfs])
- this.sharedMounts = true
- }
+ await this.shareMounts()
let staged = false
await this.fileMounts.add(from, path, async signal => {
if (!staged) {
@@ -660,6 +659,13 @@ export class SubContainerEager<
return this
}
+ private async shareMounts(): Promise {
+ if (!this.sharedMounts) {
+ await execFile('mount', ['--make-rshared', this.rootfs])
+ this.sharedMounts = true
+ }
+ }
+
/** @internal Includes unsuccessful optional shared-volume mount attempts. */
get dependsOnSharedVolumes(): boolean {
return this.sharedVolumeDependency
@@ -678,11 +684,20 @@ export class SubContainerEager<
)
}
this.sharedVolumeDependency = true
- await prepBind(null, this.subpath(options.mountpoint), 'directory')
- return this.effects.mountSharedVolume({
- ...options,
- subcontainer: this.guid,
- })
+ const release = this.hold()
+ const target = posix.join(this.rootfs, options.mountpoint)
+ try {
+ return await this.sharedVolumeQueue.run(target, async () => {
+ await prepBind(null, target, 'directory')
+ await this.shareMounts()
+ return this.effects.mountSharedVolume({
+ ...options,
+ subcontainer: this.guid,
+ })
+ })
+ } finally {
+ await release()
+ }
}
/**
diff --git a/projects/start-sdk/lib/util/fileAccess.ts b/projects/start-sdk/lib/util/fileAccess.ts
index 32712c70d1..c8fd4f5af3 100644
--- a/projects/start-sdk/lib/util/fileAccess.ts
+++ b/projects/start-sdk/lib/util/fileAccess.ts
@@ -4,8 +4,9 @@ import { promisify } from 'node:util'
import { randomBytes } from 'node:crypto'
import * as fs from 'node:fs/promises'
import { basename, dirname, resolve } from 'node:path'
+import { PathQueue } from './PathQueue'
-const queues = new Map>()
+const queue = new PathQueue()
const heldLocks = new AsyncLocalStorage<
{
target: string
@@ -65,7 +66,7 @@ export async function withFileQueue(
if (outer.some(lock => lock.held && lock.target === target)) {
return operation(target, signal)
}
- const result = (queues.get(target) ?? Promise.resolve()).then(async () => {
+ const result = queue.run(target, async () => {
signal.throwIfAborted()
const holder = { target, held: true, flocked: false, signal }
try {
@@ -76,14 +77,6 @@ export async function withFileQueue(
holder.held = false
}
})
- const tail = result.then(
- () => {},
- () => {},
- )
- queues.set(target, tail)
- void tail.then(() => {
- if (queues.get(target) === tail) queues.delete(target)
- })
return waitForFileOperation(result, signal)
}
diff --git a/projects/start-sdk/pack.mjs b/projects/start-sdk/pack.mjs
index 7717886c34..a2bb8df613 100644
--- a/projects/start-sdk/pack.mjs
+++ b/projects/start-sdk/pack.mjs
@@ -1,14 +1,14 @@
#!/usr/bin/env node
import { execFileSync } from 'node:child_process'
import { rmSync } from 'node:fs'
-import { requiresSharedVolumes } from './check-cli.mjs'
+import { preservedCapabilities } from './check-cli.mjs'
const [output, ...args] = process.argv.slice(2)
try {
execFileSync('start-cli', ['s9pk', 'pack', ...args, '-o', output], {
stdio: 'inherit',
})
- if (requiresSharedVolumes) {
+ if (preservedCapabilities.length) {
const manifest = JSON.parse(
execFileSync(
'start-cli',
@@ -18,10 +18,12 @@ try {
},
),
)
- if (manifest.sharedVolumes !== true)
- throw new Error(
- 'The packer did not preserve sharedVolumes. Upgrade start-cli to a volume-capable build.',
- )
+ for (const key of preservedCapabilities) {
+ if (manifest[key] !== true)
+ throw new Error(
+ `The packer did not preserve ${key}. Upgrade start-cli to a build that supports it.`,
+ )
+ }
}
} catch (error) {
rmSync(output, { force: true })
diff --git a/projects/start-sdk/package-lock.json b/projects/start-sdk/package-lock.json
index 878aba5d14..27c6ff0650 100644
--- a/projects/start-sdk/package-lock.json
+++ b/projects/start-sdk/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@start9labs/start-sdk",
- "version": "4.2.0",
+ "version": "5.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@start9labs/start-sdk",
- "version": "4.2.0",
+ "version": "5.0.0",
"bundleDependencies": [
"@start9labs/start-core"
],
diff --git a/projects/start-sdk/package.json b/projects/start-sdk/package.json
index 297119e0b7..d70b381795 100644
--- a/projects/start-sdk/package.json
+++ b/projects/start-sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "@start9labs/start-sdk",
- "version": "4.2.0",
+ "version": "5.0.0",
"description": "Software development kit to facilitate packaging services for StartOS",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
diff --git a/projects/start-sdk/release-notes/5.0.0.md b/projects/start-sdk/release-notes/5.0.0.md
new file mode 100644
index 0000000000..6d963c242e
--- /dev/null
+++ b/projects/start-sdk/release-notes/5.0.0.md
@@ -0,0 +1,3 @@
+## Important
+
+- When upgrading a package to SDK 5.0.0, update `buildManifest` in `startos/index.ts` to take named arguments and the package's `i18n`: add `import { i18n } from './i18n'`, then call `buildManifest({ versionGraph, manifest: sdkManifest, dependencies, i18n })`. The package template already does this.
diff --git a/projects/start-tunnel/changelog/patch-security-device-names.md b/projects/start-tunnel/changelog/patch-security-device-names.md
new file mode 100644
index 0000000000..ed719eb3d9
--- /dev/null
+++ b/projects/start-tunnel/changelog/patch-security-device-names.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Subnet and device names must be 1–64 characters with no control characters.
diff --git a/projects/start-tunnel/docs/src/published-ports.md b/projects/start-tunnel/docs/src/published-ports.md
index 1a579d990e..684d562f5e 100644
--- a/projects/start-tunnel/docs/src/published-ports.md
+++ b/projects/start-tunnel/docs/src/published-ports.md
@@ -51,4 +51,6 @@ SNI hostnames can share the enabled admin UI's listen port. Connections with an
A device can access its own service through its published SNI hostname or the shared port's fallback. For these hairpin connections, the service sees StartTunnel's in-tunnel address as the client. Connections from other devices retain their original client address.
-Connected devices can also create SNI hostname routes **automatically**, the same way they open automatic ports. A device asks over PCP (preferred) or, when PCP can't get through, over a UPnP vendor action the tunnel advertises (`X_START9_AddHostnameMapping`). Either way the route appears in the **Automatic** table, carries a lease, and expires on its own if the device stops renewing it — and, like every automatic mapping, it can only point at the requesting device's own address.
+The admin UI listens on `8443` by default. If you move it to `443`, a domain with no hostname route there reaches the admin UI instead of your server, so Let's Encrypt cannot validate it, even though a port test still finds something answering.
+
+Connected devices can also create SNI hostname routes **automatically**, the same way they open automatic ports. A device asks over PCP (preferred) or, when PCP can't get through, over a UPnP vendor action the tunnel advertises (`X_START9_AddHostnameMapping`). Either way the route appears in the **Automatic** table, carries a lease, and expires on its own if the device stops renewing it — and, like every automatic mapping, it can only point at the requesting device's own address. A StartOS server requests a `443` hostname route this way for each of its Let's Encrypt domains, so the domain appears in the **Automatic** table with `443` as its port; see [Configure Port Forwarding](/start-os/clearnet.html#configure-port-forwarding).
diff --git a/projects/start-wrt/AGENTS.md b/projects/start-wrt/AGENTS.md
index ec9f6136c0..3c1f13d363 100644
--- a/projects/start-wrt/AGENTS.md
+++ b/projects/start-wrt/AGENTS.md
@@ -298,6 +298,12 @@ and retain their selected `PROFILE`.
| `make start-wrt-update STARTWRT_REMOTE=root@IP` | deploy binary over SSH (default `root@192.168.0.1`) |
| `make start-wrt-clean` | remove start-wrt build artifacts |
+`make start-wrt-ca-test` checks the built image's certificate stores: they must exclude
+emSign ECC Root CA - G3 and keep ISRG Root X1. It needs a completed `make start-wrt-image`
+and OpenSSL; image CI runs it after the build. A failed incremental build can leave the
+previous rootfs; the check verifies its certificates, not image freshness.
+`STARTWRT_CA_ROOTFS` selects an unpacked image root for artifact verification.
+
The OpenWrt image build needs a consistent environment — Docker is recommended; native builds
on some distros fail silently.
@@ -356,7 +362,7 @@ rebuilds. Every setup run:
3. Rsyncs [`openwrt-overlay/`](openwrt-overlay/) over the tree — the _added_ files
(mirroring upstream layout): `target/linux/spacemit/` (the K1 target, including its
`patches-6.18/` kernel patches), `package/boot/{opensbi,uboot}-spacemit/`, the generic
- 6.18 kernel stubs, one mac80211 build patch, and a wireless-regdb patch. Additions live as plain files, not
+ 6.18 kernel stubs, one mac80211 build patch, a wireless-regdb patch, and a ca-certificates patch. Additions live as plain files, not
patches, so upstream bumps can never conflict with them. Most of this tree comes from
SpaceMiT's BSP and from OpenWrt, and it is GPL-2.0-only rather than MIT — see
[`openwrt-overlay/README.md`](openwrt-overlay/README.md) before editing it.
diff --git a/projects/start-wrt/backend/ARCHITECTURE.md b/projects/start-wrt/backend/ARCHITECTURE.md
index db47137f2d..54fdb9c3e4 100644
--- a/projects/start-wrt/backend/ARCHITECTURE.md
+++ b/projects/start-wrt/backend/ARCHITECTURE.md
@@ -38,7 +38,7 @@ pub trait CtrlContext: Context + Clone {
- **`ServerContext`**: always reads `/etc/config/`, always reloads services. Holds `start-core`'s `RpcContinuations` for long-running operations and the auth state (enrolled keys, nonce cache). `ServerContext::default()` carries an in-memory auth state that enrolls nothing; only the daemon opens `/etc/startwrt/auth.db`. The daemon loads its separate server identity from `serverIdentityKey` in `/etc/startwrt/auth.db` through `start-core`'s instance-key loader; sysupgrade keeps that database. In-memory contexts generate an ephemeral server identity. The daemon-local setup flash gate is shared by typed RPC and legacy NDJSON. Its owned mutex guard stays with accepted work on start-core's `make_send` runtime; observer cancellation cannot release it or abort provisioning. Actual worker results supply typed terminals or legacy Complete/Error events. Shared blocking work participates in the daemon's existing 60-second runtime shutdown grace; forced termination or reboot can still interrupt writes. Optional immutable `SecureSession` provenance belongs to each context clone rather than the shared auth state; WebSocket continuation creators capture it independently of revocation and resource policy.
- **`CliContext`**: configurable root (`--config-root`), calls the daemon when needed. The identity at `~/.startwrt/id.key.pem` signs a fresh ephemeral-DH hello through the shared opaque signer before transport deadlines. Local tokens take precedence, restricted to loopback hosts; token and missing-key calls use the existing SessionClient's unpersisted proof identity without enrollment. Malformed keys fail closed. The ordinary HTTP client retains its network policy; an HTTP/1-only, nonredirecting upgrade client uses the shared encrypted transport. Login retry and command output stay in the CLI owner. Log/update commands return their existing GUID values rather than consuming the streams; browser continuation owners redeem secure-origin GUIDs through fresh same-peer exchanges.
-The single binary `startwrt` uses `MultiExecutable` to dispatch based on the symlink name (`startwrt-ctrld` or `startwrt-cli`) or the first argument.
+The single binary `startwrt` uses `MultiExecutable` to dispatch based on the symlink name (`startwrt-ctrld`, `startwrt-cli`, or `startwrt-fdl-reset`) or the first argument.
### CLI Arguments
@@ -227,6 +227,7 @@ Low-level UCI, file, and shell access. These are vestigial — all features now
| `sign/` | ed25519 signature + commitment verification |
| `progress.rs` | Progress reporting, wire-compatible with start-os |
| `eeprom.rs` | EEPROM TLV read (ONIE blob; WiFi PMK in tag 0x2F) |
+| `fdl_button.rs` | Factory reset from the FDL button, watched for the life of the system; runs as `startwrt startwrt-fdl-reset` |
| `wg.rs` | WireGuard key management types |
| `device_names.rs` | Persistent cache of auto-learned device hostnames |
| `verify.rs` | Factory QC checks (firmware integrity, EEPROM password, SSID broadcast) |
diff --git a/projects/start-wrt/backend/ctrl/Cargo.toml b/projects/start-wrt/backend/ctrl/Cargo.toml
index 3a89c9b565..977436de61 100644
--- a/projects/start-wrt/backend/ctrl/Cargo.toml
+++ b/projects/start-wrt/backend/ctrl/Cargo.toml
@@ -2,7 +2,7 @@
edition = "2021"
license = "MIT"
name = "startwrt-core"
-version = "1.4.1" # VERSION_BUMP
+version = "1.5.0" # VERSION_BUMP
[lib]
name = "startwrt"
@@ -47,9 +47,12 @@ macaddr = "1.0.0"
mime_guess = "2"
nix = { version = "0.29.0", features = [
"fs",
+ "ioctl",
"net",
+ "poll",
"signal",
"socket",
+ "time",
"uio",
] }
num_enum = "0.7"
diff --git a/projects/start-wrt/backend/ctrl/src/bin/startwrt.rs b/projects/start-wrt/backend/ctrl/src/bin/startwrt.rs
index 79c2a64306..109980d9d4 100644
--- a/projects/start-wrt/backend/ctrl/src/bin/startwrt.rs
+++ b/projects/start-wrt/backend/ctrl/src/bin/startwrt.rs
@@ -4,6 +4,7 @@ fn main() {
MultiExecutable::default()
.enable_daemon()
.enable_cli()
+ .enable_fdl_reset()
.set_default("startwrt-cli")
.execute()
}
diff --git a/projects/start-wrt/backend/ctrl/src/bins/fdl_reset.rs b/projects/start-wrt/backend/ctrl/src/bins/fdl_reset.rs
new file mode 100644
index 0000000000..0391e98436
--- /dev/null
+++ b/projects/start-wrt/backend/ctrl/src/bins/fdl_reset.rs
@@ -0,0 +1,18 @@
+use std::collections::VecDeque;
+use std::ffi::OsString;
+
+use crate::{fdl_button, init_logging};
+
+pub fn main(_args: VecDeque) {
+ init_logging("startwrt-fdl-reset");
+ let result = tokio::runtime::Builder::new_current_thread()
+ .enable_all()
+ .build()
+ .expect("failed to build tokio runtime")
+ .block_on(fdl_button::watch());
+ if let Err(e) = result {
+ fdl_button::restore_status_led();
+ tracing::error!("FDL button: {e}");
+ std::process::exit(1);
+ }
+}
diff --git a/projects/start-wrt/backend/ctrl/src/bins/mod.rs b/projects/start-wrt/backend/ctrl/src/bins/mod.rs
index 960ef3efbd..80e48c67c3 100644
--- a/projects/start-wrt/backend/ctrl/src/bins/mod.rs
+++ b/projects/start-wrt/backend/ctrl/src/bins/mod.rs
@@ -1,5 +1,6 @@
pub mod cli;
pub mod daemon;
+pub mod fdl_reset;
use std::collections::{HashMap, VecDeque};
use std::ffi::OsString;
@@ -32,6 +33,11 @@ impl MultiExecutable {
self
}
+ pub fn enable_fdl_reset(&mut self) -> &mut Self {
+ self.handlers.insert("startwrt-fdl-reset", fdl_reset::main);
+ self
+ }
+
pub fn set_default(&mut self, name: &'static str) -> &mut Self {
self.default = Some(name);
self
diff --git a/projects/start-wrt/backend/ctrl/src/dns_inject.rs b/projects/start-wrt/backend/ctrl/src/dns_inject.rs
index e8418473f5..dd0ec3009e 100644
--- a/projects/start-wrt/backend/ctrl/src/dns_inject.rs
+++ b/projects/start-wrt/backend/ctrl/src/dns_inject.rs
@@ -181,9 +181,9 @@ struct HostName {
#[derive(Clone, Debug, Default, PartialEq, Eq)]
struct HostNames {
entries: Vec,
- /// Profile → lowercase names its own leases carry. That profile's
- /// instance serves them itself and refuses a lease a name it already has
- /// at another address.
+ /// Profile → lowercase names its own leases carry, counting only each
+ /// device's newest lease. That profile's instance serves them itself and
+ /// refuses a lease a name it already has at another address.
leased: BTreeMap>,
}
@@ -474,22 +474,25 @@ fn host_names(snapshot: &NetSnapshot, leases: &[crate::devices::DhcpLease]) -> H
let Ok(ip) = lease.ip.parse::() else {
continue;
};
- if let Some(p) = profile_for(&snapshot.profiles, ip) {
- if lease.instance.as_deref() == Some(format!("dns_{}", p.interface).as_str())
- && valid(&lease.hostname)
- {
- hosts
- .leased
- .entry(p.interface.clone())
- .or_default()
- .insert(lease.hostname.to_ascii_lowercase());
- }
- }
let held = newest.entry(lease.mac.as_str()).or_insert((lease, ip));
if expiry(lease) > expiry(held.0) {
*held = (lease, ip);
}
}
+ for (lease, ip) in newest.values() {
+ let Some(p) = profile_for(&snapshot.profiles, *ip) else {
+ continue;
+ };
+ if lease.instance.as_deref() == Some(format!("dns_{}", p.interface).as_str())
+ && valid(&lease.hostname)
+ {
+ hosts
+ .leased
+ .entry(p.interface.clone())
+ .or_default()
+ .insert(lease.hostname.to_ascii_lowercase());
+ }
+ }
let macs: BTreeSet<&str> = newest
.keys()
.copied()
@@ -2556,6 +2559,43 @@ mod tests {
);
}
+ #[test]
+ fn a_moved_device_resolves_at_its_new_lease_from_its_old_profile() {
+ let (snapshot, _) = name_fixture();
+ let reach = BTreeSet::from([
+ ("lan".into(), "vlan_guest".into()),
+ ("vlan_guest".into(), "lan".into()),
+ ]);
+ let moved = |lan_expires, guest_expires| {
+ [
+ lease(
+ "dns_lan",
+ "EE:00:00:00:00:01",
+ Ipv4Addr::new(192, 168, 1, 110),
+ "debian",
+ lan_expires,
+ ),
+ lease(
+ "dns_guest",
+ "EE:00:00:00:00:01",
+ Ipv4Addr::new(192, 168, 101, 110),
+ "debian",
+ guest_expires,
+ ),
+ ]
+ };
+ assert_eq!(
+ rendered_names(&snapshot, &reach, &moved(1_000_000_000, 2_000_000_000))[..2],
+ ["192.168.101.110 debian.lan\n".to_string(), String::new()],
+ "lan's older lease of the device yields the name to its guest lease"
+ );
+ assert_eq!(
+ rendered_names(&snapshot, &reach, &moved(2_000_000_000, 1_000_000_000))[..2],
+ [String::new(), "192.168.1.110 debian.lan\n".to_string()],
+ "moved back: lan's lease is the newest again and serves the name itself"
+ );
+ }
+
/// The rendered files encode the directory, so a refresh wakes the
/// renderer even when no record changed.
#[tokio::test]
diff --git a/projects/start-wrt/backend/ctrl/src/fdl_button.rs b/projects/start-wrt/backend/ctrl/src/fdl_button.rs
new file mode 100644
index 0000000000..54b9d17456
--- /dev/null
+++ b/projects/start-wrt/backend/ctrl/src/fdl_button.rs
@@ -0,0 +1,326 @@
+//! Factory reset from the FDL button.
+//!
+//! The kernel's `gpio-keys` driver reports the button as an input device. A
+//! press held for [`HOLD`] blinks the status LED. The release wipes the overlay
+//! and reboots, keeping the BootROM's download strap low across the reset.
+//! Releasing before the LED cue cancels, even when the event is processed late.
+//! Lost input history cancels the hold; procd restarts observation from live key state.
+
+use std::fs::{self, File};
+use std::io::Read;
+use std::os::fd::{AsFd, AsRawFd};
+use std::path::PathBuf;
+use std::time::Duration;
+
+use nix::poll::{poll, PollFd, PollFlags, PollTimeout};
+use nix::time::{clock_gettime, ClockId};
+
+use crate::prelude::*;
+
+const HOLD: Duration = Duration::from_secs(10);
+
+const INPUT_DEVICE_NAME: &str = "gpio-keys";
+const STATUS_LED: &str = "/sys/class/leds/sys-led";
+
+const EV_SYN: u16 = 0x00;
+const EV_KEY: u16 = 0x01;
+const SYN_DROPPED: u16 = 0x03;
+const KEY_RESTART: u16 = 0x198;
+const KEY_STATE_BYTES: usize = 0x300 / 8;
+const EVENT_SIZE: usize = std::mem::size_of::();
+const EVENT_TYPE_OFFSET: usize = EVENT_SIZE - 8;
+const EVENT_TIME_WORD_SIZE: usize = std::mem::size_of::();
+
+nix::ioctl_read_buf!(eviocgkey, b'E', 0x18, u8);
+nix::ioctl_write_ptr!(eviocsclockid, b'E', 0xa0, libc::c_int);
+
+#[derive(Debug, PartialEq, Eq)]
+enum Action {
+ Wait(Option),
+ Blink,
+ Wipe,
+}
+
+#[derive(Default)]
+struct Button {
+ held_since: Option,
+ armed_at: Option,
+}
+
+impl Button {
+ fn key(&mut self, pressed: bool, at: Duration) {
+ if !pressed {
+ if self.armed_at.is_some_and(|armed| at < armed) {
+ self.armed_at = None;
+ }
+ self.held_since = None;
+ } else if self.held_since.is_none() {
+ self.held_since = Some(at);
+ }
+ }
+
+ fn blinked(&mut self, at: Duration) {
+ self.armed_at = Some(at);
+ }
+
+ fn step(&self, now: Duration) -> Action {
+ match (self.armed_at, self.held_since) {
+ (Some(_), None) => Action::Wipe,
+ (Some(_), Some(_)) | (None, None) => Action::Wait(None),
+ (None, Some(since)) if now >= since + HOLD => Action::Blink,
+ (None, Some(since)) => Action::Wait(Some(since + HOLD - now)),
+ }
+ }
+}
+
+fn find_device() -> Result