Skip to content

Commit 2e71d60

Browse files
authored
fix: publish verified installer through the stable endpoint
Publish the signed snapshot-channel installer contract, atomic recovery flow, cross-platform fault acceptance, and the verified immutable stable endpoint.
1 parent cb9512c commit 2e71d60

7 files changed

Lines changed: 1054 additions & 57 deletions

File tree

.github/workflows/phase-acceptance.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,29 @@ jobs:
5555
run: >-
5656
node -e "const f=require('fs'),c=require('child_process');const r=c.spawnSync(process.execPath,['--test','test/installer-runtime.test.js'],{encoding:'utf8',windowsHide:true});const out=(r.stdout||'')+(r.stderr||'');f.writeFileSync('installer-runtime.tap',out);process.stdout.write(out);process.exit(r.status===null?1:r.status)"
5757
58+
- name: Run the full installer fault matrix with PowerShell 7
59+
if: runner.os == 'Windows'
60+
env:
61+
CONTEXA_TEST_POWERSHELL: pwsh.exe
62+
run: >-
63+
node -e "const f=require('fs'),c=require('child_process');const r=c.spawnSync(process.execPath,['--test','test/installer-runtime.test.js'],{encoding:'utf8',windowsHide:true});const out=(r.stdout||'')+(r.stderr||'');f.writeFileSync('installer-runtime-pwsh.tap',out);process.stdout.write(out);process.exit(r.status===null?1:r.status)"
64+
65+
- name: Run installer source and release-contract acceptance
66+
run: node --test test/installers.test.js
67+
5868
- name: Publish installer test failure detail
5969
if: failure()
6070
shell: bash
6171
run: |
62-
node -e "const f=require('fs');const p='installer-runtime.tap';const s=f.existsSync(p)?f.readFileSync(p,'utf8').slice(-12000):'installer TAP output is missing';const e=s.replace(/%/g,'%25').replace(/\r/g,'%0D').replace(/\n/g,'%0A');console.log('::error file=test/installer-runtime.test.js,line=1,title=Installer runtime failure::'+e)"
72+
node -e "const f=require('fs');const paths=['installer-runtime.tap','installer-runtime-pwsh.tap'];const s=paths.map(p=>f.existsSync(p)?p+'\n'+f.readFileSync(p,'utf8'):'').join('\n').slice(-12000)||'installer TAP output is missing';const e=s.replace(/%/g,'%25').replace(/\r/g,'%0D').replace(/\n/g,'%0A');console.log('::error file=test/installer-runtime.test.js,line=1,title=Installer runtime failure::'+e)"
6373
6474
- uses: actions/upload-artifact@v4
6575
if: always()
6676
with:
6777
name: installer-runtime-evidence-${{ matrix.os }}
68-
path: installer-runtime.tap
78+
path: |
79+
installer-runtime.tap
80+
installer-runtime-pwsh.tap
6981
7082
- name: Resolve current and previous prerelease tags
7183
env:
@@ -132,6 +144,9 @@ jobs:
132144
"$CONTEXA_INSTALL_DIR/contexa" init --yes --dir "$fixture"
133145
"$CONTEXA_INSTALL_DIR/contexa" reset --yes --dir "$fixture"
134146
test ! -f "$fixture/contexa/manifest.json"
147+
CONTEXA_INSTALL_ACTION=uninstall sh ./install.sh
148+
test ! -e "$CONTEXA_INSTALL_DIR/contexa"
149+
test ! -e "$CONTEXA_INSTALL_DIR/contexa.previous"
135150
136151
- name: Verify actual install, update, no-op, rollback and init/reset (Windows)
137152
if: runner.os == 'Windows'
@@ -174,3 +189,7 @@ jobs:
174189
& $binary init --yes --dir $fixture
175190
& $binary reset --yes --dir $fixture
176191
if (Test-Path -LiteralPath (Join-Path $fixture 'contexa\manifest.json')) { throw 'reset left manifest behind' }
192+
$env:CONTEXA_INSTALL_ACTION = 'uninstall'
193+
& .\install.ps1
194+
if (Test-Path -LiteralPath $binary) { throw 'uninstall left the final binary behind' }
195+
if (Test-Path -LiteralPath ($binary + '.previous')) { throw 'uninstall left the previous binary behind' }

api/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = (req, res) => {
1717
const fileName = immutableMatch[2].toLowerCase();
1818
res.statusCode = 302;
1919
res.setHeader('Location', `https://raw.githubusercontent.com/contexa-security/install-ctxa/${tag}/${fileName}`);
20+
res.setHeader('Content-Type', 'text/plain; charset=utf-8');
2021
res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');
2122
res.setHeader('X-Content-Type-Options', 'nosniff');
2223
res.send('');
@@ -43,6 +44,7 @@ module.exports = (req, res) => {
4344
}
4445
res.statusCode = 302;
4546
res.setHeader('Location', `https://raw.githubusercontent.com/contexa-security/install-ctxa/${stableRef}/${fileName}`);
47+
res.setHeader('Content-Type', 'text/plain; charset=utf-8');
4648
res.setHeader('Cache-Control', 'no-store');
4749
res.setHeader('X-Content-Type-Options', 'nosniff');
4850
res.send('');

0 commit comments

Comments
 (0)