site: the build attestations are kept on R2 beside the release files (ArcticLampyrid on X)
The SLSA attestations live behind GitHub's API only, so with GitHub down they could not be fetched while the mirrored files could. The five-minute cron now also asks api.github.com/.../attestations/sha256:<digest> for every file of a release from v0.1.3891 on and, once every file has one, writes <tag>/attestations.jsonl to R2 (a Sigstore bundle per line, deduped), served at usemagpie.ai/files/<tag>/attestations.jsonl. It is written only whole, so a file with no attestation yet is asked again next run, and it is pruned with its tag. `gh attestation verify <file> -R yetone/magpie-releases --bundle attestations.jsonl` checks a download with it. It is not a release asset: the GitHub release keeps its 17 assets and release CI is unchanged. start (en, zh, ja), llms-full.txt and reference.md say where it is and how to verify. The updater does not read it yet. Run (mote): node --test site/*.test.mjs 118/118; gofmt n/a. New tests: bundles land once and only whole; pre-0.1.3891 release not asked. Broken by hand: ATTESTED set to 9.9.9 turns the bundles test red. Not tried yet: the real cron run and the file on R2 (after deploy), the updater reading it from R2, gh --bundle on a real downloaded file.
This commit is contained in:
@@ -3441,6 +3441,15 @@ since the signature has held; the log says the file went unattested. A
|
||||
(`gh attestation trusted-root`, first line) when Sigstore rotates its public
|
||||
good keys; until then a new chain fails as "not attested".
|
||||
|
||||
The same bundles are kept on R2 (`site/files.js`, `keepBundles`): the five-minute
|
||||
cron asks that API for each file's digest of a release from v0.1.3891 on and,
|
||||
once every file has one, writes `<tag>/attestations.jsonl` (a bundle to a line),
|
||||
served at `https://usemagpie.ai/files/<tag>/attestations.jsonl` and checked with
|
||||
`gh attestation verify <file> -R yetone/magpie-releases --bundle
|
||||
attestations.jsonl`. It is not a release asset (the release's count is
|
||||
unchanged), is written only whole, and is pruned with its tag. The updater does
|
||||
not read it yet; it still asks GitHub's API (ArcticLampyrid on X).
|
||||
|
||||
The feed hands the app that `SHA256SUMS` and signature (`signed`). The app
|
||||
checks the signature against its key, takes every file's SHA-256 from the
|
||||
signed list, and refuses the update when the signature is missing or does not
|
||||
|
||||
+51
-2
@@ -10,6 +10,14 @@
|
||||
// R2 only for files it has with that hash, so nothing is ever only on R2.
|
||||
// The app checks every file against the feed's hash wherever it came from.
|
||||
//
|
||||
// The build provenance goes the same way. Release CI attests every file
|
||||
// (SLSA, Sigstore; v0.1.3891 on) and GitHub keeps the bundles behind its
|
||||
// API, which can be down when the files are not. The cron copies them into
|
||||
// R2 as one file per release, <tag>/attestations.jsonl, a bundle to a line,
|
||||
// which `gh attestation verify <file> -R yetone/magpie-releases --bundle
|
||||
// attestations.jsonl` takes offline (ArcticLampyrid on X). It is not a
|
||||
// release asset, so the release's file count is unchanged.
|
||||
//
|
||||
// Each release is about 1 GB; the tags the feeds name and the KEEP newest
|
||||
// besides are kept, the rest deleted (prune), and an older tag's files go
|
||||
// to GitHub.
|
||||
@@ -19,6 +27,10 @@ const KEEP = 4;
|
||||
// minutes on) doesn't copy the same file beside it
|
||||
const BUDGET = 4 * 60e3;
|
||||
|
||||
// the first release whose files carry a build attestation
|
||||
const ATTESTED = "0.1.3891";
|
||||
export const BUNDLES = "attestations.jsonl";
|
||||
|
||||
export function githubFile(repo, tag, name) {
|
||||
return `https://github.com/${repo}/releases/download/${tag}/${name}`;
|
||||
}
|
||||
@@ -110,8 +122,10 @@ export function onR2(rel, have, repo, site) {
|
||||
// mirror copies into R2 each file of rels (the feeds' releases, with
|
||||
// their hashes) it doesn't hold yet, then prunes. open(name, asset, tag)
|
||||
// is the file's bytes from GitHub (a Response), null when GitHub won't
|
||||
// give them. Returns {copied, failed}.
|
||||
export async function mirror(env, rels, open, now = Date.now) {
|
||||
// give them. attest(sha256) is the attestation bundles GitHub holds for a
|
||||
// digest (an array of objects), null when it can't say. Returns {copied,
|
||||
// failed}.
|
||||
export async function mirror(env, rels, open, now = Date.now, attest = null) {
|
||||
const done = { copied: [], failed: [] };
|
||||
if (!env.RELEASES) return done;
|
||||
const until = now() + BUDGET;
|
||||
@@ -129,11 +143,46 @@ export async function mirror(env, rels, open, now = Date.now) {
|
||||
if (await copy(env, tag, name, a, open)) done.copied.push(`${tag}/${name}`);
|
||||
else done.failed.push(`${tag}/${name}`);
|
||||
}
|
||||
if (attest && !(BUNDLES in have) && byVersion(tag, "v" + ATTESTED) >= 0 && now() <= until) {
|
||||
if (await keepBundles(env, tag, rel, attest)) done.copied.push(`${tag}/${BUNDLES}`);
|
||||
else done.failed.push(`${tag}/${BUNDLES}`);
|
||||
}
|
||||
}
|
||||
await prune(env, tags);
|
||||
return done;
|
||||
}
|
||||
|
||||
// keepBundles puts every attestation GitHub has for rel's files in R2 as
|
||||
// <tag>/attestations.jsonl. It writes nothing unless every file has one, so
|
||||
// the next run asks again rather than keep a list with holes in it.
|
||||
async function keepBundles(env, tag, rel, attest) {
|
||||
const lines = new Set();
|
||||
for (const [name, a] of Object.entries(rel.assets)) {
|
||||
if (!a.sha256) continue;
|
||||
let got = null;
|
||||
try {
|
||||
got = await attest(a.sha256);
|
||||
} catch (e) {
|
||||
console.log("r2 attest: github", tag, name, String(e));
|
||||
}
|
||||
if (!Array.isArray(got) || !got.length) {
|
||||
console.log("r2 attest: none for", tag, name);
|
||||
return false;
|
||||
}
|
||||
for (const b of got) lines.add(JSON.stringify(b));
|
||||
}
|
||||
if (!lines.size) return false;
|
||||
try {
|
||||
await env.RELEASES.put(`${tag}/${BUNDLES}`, [...lines].join("\n") + "\n", {
|
||||
httpMetadata: { contentType: "application/jsonl", contentDisposition: `attachment; filename="${BUNDLES}"` },
|
||||
});
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.log("r2 attest: put", tag, String(e));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function copy(env, tag, name, a, open) {
|
||||
let res = null;
|
||||
try {
|
||||
|
||||
@@ -151,3 +151,38 @@ test("mirror: without the bucket, or with R2 failing, nothing is copied and noth
|
||||
env.RELEASES.fail = true;
|
||||
assert.deepEqual(await mirror(env, [{ version: "1", assets: { a: { sha256: "x" } } }], async () => new Response("a")), { copied: [], failed: [] });
|
||||
});
|
||||
|
||||
test("mirror: a release's attestation bundles land in R2 as attestations.jsonl, once, and only whole (ArcticLampyrid on X)", async () => {
|
||||
const env = { RELEASES: bucket() };
|
||||
const rel = { version: "0.1.3891", assets: { a: { sha256: sha("A") }, b: { sha256: sha("B") } } };
|
||||
const open = async (name) => new Response(name === "a" ? "A" : "B");
|
||||
const asked = [];
|
||||
let missing = sha("B");
|
||||
const attest = async (h) => {
|
||||
asked.push(h);
|
||||
return h === missing ? null : [{ mediaType: "bundle", for: h }];
|
||||
};
|
||||
// one file has none yet: nothing is written, the next run asks again
|
||||
let done = await mirror(env, [rel], open, Date.now, attest);
|
||||
assert.deepEqual(done.failed, ["v0.1.3891/attestations.jsonl"]);
|
||||
assert.equal(env.RELEASES.objs.has("v0.1.3891/attestations.jsonl"), false);
|
||||
missing = "";
|
||||
done = await mirror(env, [rel], open, Date.now, attest);
|
||||
assert.deepEqual(done.copied, ["v0.1.3891/attestations.jsonl"]);
|
||||
const res = await ask(env, "/files/v0.1.3891/attestations.jsonl");
|
||||
assert.equal(res.status, 200);
|
||||
const lines = (await res.text()).trimEnd().split("\n").map((l) => JSON.parse(l));
|
||||
assert.deepEqual(lines.map((l) => l.for).sort(), [sha("A"), sha("B")].sort());
|
||||
// held: it is not asked for again
|
||||
asked.length = 0;
|
||||
await mirror(env, [rel], open, Date.now, attest);
|
||||
assert.deepEqual(asked, []);
|
||||
});
|
||||
|
||||
test("mirror: a release from before the attestations is not asked for any", async () => {
|
||||
const env = { RELEASES: bucket() };
|
||||
const rel = { version: "0.1.3890", assets: { a: { sha256: sha("A") } } };
|
||||
let asked = 0;
|
||||
await mirror(env, [rel], async () => new Response("A"), Date.now, async () => (asked++, []));
|
||||
assert.equal(asked, 0);
|
||||
});
|
||||
|
||||
@@ -355,7 +355,7 @@ magpie claude group/opus-anywhere <span class="c"># これを使う</span></p
|
||||
<p>インストーラと <code>magpie update</code> にプロキシを渡します:<code>curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --proxy http://127.0.0.1:7890</code>、または <code>magpie update --proxy socks5://127.0.0.1:1080</code>(http・https・socks5・socks5h に対応。<code>HTTPS_PROXY</code> と <code>ALL_PROXY</code> も使われます)。リリースファイルは usemagpie.ai(Cloudflare R2)から取得し、失敗したときは github.com から取得します。<code>--mirror <prefix></code> を付けると、サイトからの取得に失敗したとき、指定した GitHub ダウンロードミラーから <code><prefix>https://github.com/…</code> としてリリースファイルを取得します。<code>magpie update mirror <prefix></code> でアプリ自身の更新を含め毎回使い、<code>magpie update mirror off</code> で解除します。指定しない限りミラーは使われず、ファイルの SHA-256 はミラーではなく常に usemagpie.ai から取得するので、ミラーが書き換えたファイルはインストールされません。アプリ自身の更新は <span class="ui">Settings</span> → <span class="ui">Proxy</span> を通ります。</p>
|
||||
|
||||
<h3 id="verify-download"><a class="anchor" href="#verify-download">ダウンロードしたファイルが GitHub Actions でビルドされたものか確認するには?</a></h3>
|
||||
<p><a href="https://github.com/yetone/magpie-releases/releases">yetone/magpie-releases</a> の各ファイルには SLSA ビルド来歴(build provenance)の証明が付いています。GitHub Actions の実行自身の ID で Sigstore を通して署名されており、こちらの鍵は使いません。<a href="https://cli.github.com">GitHub CLI</a> で確認します:<code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases</code>。ビルドした workflow と実行が表示され、その実行が作っていないファイルは失敗します。yetone/magpie の Releases にあるコピーにも同じコマンドが使えます。v0.1.3891 以降が対象です。証明が指すのは magpie-releases リポジトリとそのコミットで、yetone/magpie のソースのコミットではありません。アプリ自身の更新は両方を検証します:リリースの SHA-256 一覧に付いた ed25519 署名を magpie に組み込まれた鍵で確認し(オフラインでも usemagpie.ai のミラーからでも有効)、v0.1.3891 以降はさらに GitHub からそのファイルの証明を取得して、GitHub に証明が無いファイルや、このリポジトリのリリース workflow によるものではない証明のファイルはインストールしません。GitHub に接続できないときは署名だけで更新を続け、ログに記録します。</p>
|
||||
<p><a href="https://github.com/yetone/magpie-releases/releases">yetone/magpie-releases</a> の各ファイルには SLSA ビルド来歴(build provenance)の証明が付いています。GitHub Actions の実行自身の ID で Sigstore を通して署名されており、こちらの鍵は使いません。<a href="https://cli.github.com">GitHub CLI</a> で確認します:<code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases</code>。ビルドした workflow と実行が表示され、その実行が作っていないファイルは失敗します。yetone/magpie の Releases にあるコピーにも同じコマンドが使えます。v0.1.3891 以降が対象です。証明が指すのは magpie-releases リポジトリとそのコミットで、yetone/magpie のソースのコミットではありません。アプリ自身の更新は両方を検証します:リリースの SHA-256 一覧に付いた ed25519 署名を magpie に組み込まれた鍵で確認し(オフラインでも usemagpie.ai のミラーからでも有効)、v0.1.3891 以降はさらに GitHub からそのファイルの証明を取得して、GitHub に証明が無いファイルや、このリポジトリのリリース workflow によるものではない証明のファイルはインストールしません。GitHub に接続できないときは署名だけで更新を続け、ログに記録します。 同じ証明は usemagpie.ai にも、ミラーしたファイルの隣に置かれており、GitHub が使えないときも取得できます:<code>https://usemagpie.ai/files/v<バージョン>/attestations.jsonl</code> には、そのリリースの全ファイル分のバンドルが 1 行に 1 つ入っています。ファイルと一緒にダウンロードすれば、証明 API を使わずに確認できます:<code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl</code>(バンドルは Sigstore バンドルです。ミラーには新しいリリースだけが残るので、古いものは上のコマンドを使ってください)。</p>
|
||||
|
||||
<h3 id="linux-build"><a class="anchor" href="#linux-build">Linux ではインストーラはどのビルドを入れますか?</a></h3>
|
||||
<p>GTK 3 と WebKitGTK 4.1 が入っていればデスクトップアプリ(ウィンドウ、トレイアイコン、アプリメニューの項目)です。デスクトップがあってもそれらが無いときは、パッケージマネージャー(apt、dnf、pacman、zypper)で <code>sudo</code> を通して WebKitGTK 4.1 を入れ(sudo がパスワードを尋ねます)、それからアプリを入れます。パスワードを尋ねる前に何を入れるかを表示します。端末が無いとき(CI、Dockerfile)、<code>sudo</code> が無いとき、知らないディストリビューションやインストールに失敗したときはターミナル版(<code>magpie tui</code>、<code>magpie web</code> と CLI)を入れ、最後に入れるコマンドを表示します。Debian・Ubuntu なら <code>sudo apt install libwebkit2gtk-4.1-0</code>、Fedora なら <code>sudo dnf install webkit2gtk4.1</code> です。入れたあとインストーラをもう一度実行するとアプリになります。デスクトップ上で実行しても ssh 越しでも、グラフィカルなセッション、あなたのグラフィカルなログイン、ログインできるデスクトップ環境のどれかがあればデスクトップありと判断します。デスクトップの無いサーバーにはターミナル版です。自分で選ぶには <code>--gui</code>(ライブラリを今入れられなくてもアプリ)か <code>--tui</code>(ターミナル版、パッケージは入れない)を付けます:<code>curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --tui</code>。</p>
|
||||
|
||||
@@ -355,7 +355,7 @@ magpie claude group/opus-anywhere <span class="c"># use it</span></pre>
|
||||
<p>Give the installer and <code>magpie update</code> a proxy: <code>curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --proxy http://127.0.0.1:7890</code>, or <code>magpie update --proxy socks5://127.0.0.1:1080</code> (http, https, socks5 and socks5h; <code>HTTPS_PROXY</code> and <code>ALL_PROXY</code> are honoured too). Release files come from usemagpie.ai (Cloudflare R2), and from github.com when that fails. <code>--mirror <prefix></code> fetches the release file from a GitHub download mirror you choose, as <code><prefix>https://github.com/…</code>, when the site’s copy fails; <code>magpie update mirror <prefix></code> keeps it for every update, the app’s too, and <code>magpie update mirror off</code> removes it. No mirror is used unless you give one, and the file’s SHA-256 still comes from usemagpie.ai, never from the mirror: a file the mirror changed is refused. The app’s own updates go through <span class="ui">Settings</span> → <span class="ui">Proxy</span>.</p>
|
||||
|
||||
<h3 id="verify-download"><a class="anchor" href="#verify-download">How do I check that a download was built by GitHub Actions?</a></h3>
|
||||
<p>Every file on <a href="https://github.com/yetone/magpie-releases/releases">yetone/magpie-releases</a> carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the <a href="https://cli.github.com">GitHub CLI</a>: <code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases</code>. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so.</p>
|
||||
<p>Every file on <a href="https://github.com/yetone/magpie-releases/releases">yetone/magpie-releases</a> carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the <a href="https://cli.github.com">GitHub CLI</a>: <code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases</code>. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so. The same attestations are kept on usemagpie.ai, beside the mirrored files, so they are there when GitHub is not: <code>https://usemagpie.ai/files/v<version>/attestations.jsonl</code> holds one bundle per line for every file of the release. Download it with the file and check offline of the attestation API: <code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl</code> (the bundles are Sigstore bundles; a release that is not among the newest on the mirror falls back to the command above).</p>
|
||||
|
||||
<h3 id="linux-build"><a class="anchor" href="#linux-build">Which build does the installer put on Linux?</a></h3>
|
||||
<p>The desktop app (window, tray icon and a menu entry) when GTK 3 and WebKitGTK 4.1 are installed. On a computer with a desktop but without them, the installer installs WebKitGTK 4.1 with your package manager (apt, dnf, pacman or zypper), through <code>sudo</code>, which asks for your password, and then the app; it says what it installs before it asks. Run without a terminal (CI, a Dockerfile), without <code>sudo</code>, on another distribution or when that install fails, it installs the terminal build (<code>magpie tui</code>, <code>magpie web</code> and the CLI) and ends with the command that installs them, such as <code>sudo apt install libwebkit2gtk-4.1-0</code> on Debian and Ubuntu or <code>sudo dnf install webkit2gtk4.1</code> on Fedora; run the installer again afterwards for the app. A desktop counts whether you run it there or over ssh: a graphical session, your graphical login, or a desktop installed to log in to. A server without one gets the terminal build. To choose yourself, add <code>--gui</code> (the app even when its libraries can't be installed now) or <code>--tui</code> (the terminal build, and no package installed): <code>curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --tui</code>.</p>
|
||||
|
||||
@@ -355,7 +355,7 @@ magpie claude group/opus-anywhere <span class="c"># 使用它</span></pre>
|
||||
<p>给安装脚本和 <code>magpie update</code> 加代理:<code>curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --proxy http://127.0.0.1:7890</code>,或 <code>magpie update --proxy socks5://127.0.0.1:1080</code>(支持 http、https、socks5、socks5h;环境变量 <code>HTTPS_PROXY</code>、<code>ALL_PROXY</code> 同样生效)。发布文件从 usemagpie.ai(Cloudflare R2)下载,失败时改从 github.com 下载。<code>--mirror <前缀></code> 在站点下载失败时从你指定的 GitHub 下载镜像取发布文件,即 <code><前缀>https://github.com/…</code>;<code>magpie update mirror <前缀></code> 让之后每次更新(包括应用自己的更新)都用它,<code>magpie update mirror off</code> 取消。不指定就不用任何镜像;文件的 SHA-256 始终来自 usemagpie.ai,而不是镜像,镜像改过的文件会被拒绝安装。应用自己的更新走 <span class="ui">设置</span> → <span class="ui">代理</span>。</p>
|
||||
|
||||
<h3 id="verify-download"><a class="anchor" href="#verify-download">怎么确认下载的文件是 GitHub Actions 构建的?</a></h3>
|
||||
<p><a href="https://github.com/yetone/magpie-releases/releases">yetone/magpie-releases</a> 上的每个文件都带有 SLSA 构建来源证明(build provenance),由 GitHub Actions 运行自身的身份通过 Sigstore 签发,不用我们自己的密钥。用 <a href="https://cli.github.com">GitHub CLI</a> 校验:<code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases</code>。它会显示构建该文件的 workflow 和运行,不是这次运行产出的文件会校验失败。yetone/magpie 的 Releases 页上的副本用同一条命令。从 v0.1.3891 起提供。证明指向的是 magpie-releases 仓库及其提交,而不是 yetone/magpie 里的源码提交。应用自己的更新两层都校验:发布的 SHA-256 清单带有 ed25519 签名,用内置在 magpie 里的公钥校验(离线可用,文件来自 usemagpie.ai 的镜像时同样有效);从 v0.1.3891 起应用还会向 GitHub 取该文件的构建证明,GitHub 没有证明、或证明不是出自本仓库发布 workflow 的文件不会被安装。连不上 GitHub 时,更新仍凭签名继续,并在日志里说明。</p>
|
||||
<p><a href="https://github.com/yetone/magpie-releases/releases">yetone/magpie-releases</a> 上的每个文件都带有 SLSA 构建来源证明(build provenance),由 GitHub Actions 运行自身的身份通过 Sigstore 签发,不用我们自己的密钥。用 <a href="https://cli.github.com">GitHub CLI</a> 校验:<code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases</code>。它会显示构建该文件的 workflow 和运行,不是这次运行产出的文件会校验失败。yetone/magpie 的 Releases 页上的副本用同一条命令。从 v0.1.3891 起提供。证明指向的是 magpie-releases 仓库及其提交,而不是 yetone/magpie 里的源码提交。应用自己的更新两层都校验:发布的 SHA-256 清单带有 ed25519 签名,用内置在 magpie 里的公钥校验(离线可用,文件来自 usemagpie.ai 的镜像时同样有效);从 v0.1.3891 起应用还会向 GitHub 取该文件的构建证明,GitHub 没有证明、或证明不是出自本仓库发布 workflow 的文件不会被安装。连不上 GitHub 时,更新仍凭签名继续,并在日志里说明。 同样的证明也保存在 usemagpie.ai 上、镜像文件的旁边,GitHub 不可用时照样能取:<code>https://usemagpie.ai/files/v<版本号>/attestations.jsonl</code> 每行一个 bundle,覆盖该版本的所有文件。把它和文件一起下载,即可不依赖证明 API 校验:<code>gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl</code>(bundle 是 Sigstore bundle;镜像里保留较新的几个版本,更早的版本请用上面的命令)。</p>
|
||||
|
||||
<h3 id="linux-build"><a class="anchor" href="#linux-build">Linux 上安装脚本装的是哪个版本?</a></h3>
|
||||
<p>装了 GTK 3 和 WebKitGTK 4.1 时装桌面版(窗口、托盘图标和应用菜单项)。有桌面但缺这两个库时,脚本会用系统的包管理器(apt、dnf、pacman 或 zypper)通过 <code>sudo</code> 装上 WebKitGTK 4.1(sudo 会要你的密码),再装桌面版;要密码之前会先说要装什么。没有终端(CI、Dockerfile)、没有 <code>sudo</code>、发行版不认识或者装库失败时,先装终端版(<code>magpie tui</code>、<code>magpie web</code> 和命令行),最后给出装库的命令,比如 Debian、Ubuntu 上是 <code>sudo apt install libwebkit2gtk-4.1-0</code>,Fedora 上是 <code>sudo dnf install webkit2gtk4.1</code>;装好后再运行一次安装脚本就换成桌面版。在桌面上运行还是 ssh 进去运行都算有桌面:有图形会话、你登录着图形界面,或者装了可登录的桌面环境。没有桌面的服务器装终端版。想自己选,加 <code>--gui</code>(库现在装不上也装桌面版)或 <code>--tui</code>(装终端版,不装任何系统包):<code>curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --tui</code>。</p>
|
||||
|
||||
@@ -245,7 +245,7 @@ Give the installer and `magpie update` a proxy: `curl -fsSL https://usemagpie.ai
|
||||
|
||||
### How do I check that a download was built by GitHub Actions?
|
||||
|
||||
Every file on [yetone/magpie-releases](https://github.com/yetone/magpie-releases/releases) carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the [GitHub CLI](https://cli.github.com): `gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases`. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so.
|
||||
Every file on [yetone/magpie-releases](https://github.com/yetone/magpie-releases/releases) carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the [GitHub CLI](https://cli.github.com): `gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases`. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so. The same attestations are kept on usemagpie.ai, beside the mirrored files, so they are there when GitHub is not: `https://usemagpie.ai/files/v<version>/attestations.jsonl` holds one bundle per line for every file of the release. Download it with the file and check offline of the attestation API: `gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl` (the bundles are Sigstore bundles; a release that is not among the newest on the mirror falls back to the command above).
|
||||
|
||||
### Which build does the installer put on Linux?
|
||||
|
||||
|
||||
+8
-1
@@ -519,7 +519,14 @@ async function keepFiles(ctx, env) {
|
||||
const to = a.api && (await located(a.api, env));
|
||||
return to ? fetch(to, { headers: UA }) : res;
|
||||
};
|
||||
const done = await mirror(env, rels, open);
|
||||
// the attestation bundles GitHub holds for a digest, in R2 beside the files
|
||||
const attest = async (sha256) => {
|
||||
const res = await api(`attestations/sha256:${sha256}`, env);
|
||||
if (!res.ok) return null;
|
||||
const j = await res.json();
|
||||
return (j.attestations || []).map((x) => x.bundle).filter(Boolean);
|
||||
};
|
||||
const done = await mirror(env, rels, open, Date.now, attest);
|
||||
if (done.copied.length || done.failed.length) console.log("r2", JSON.stringify(done));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user