diff --git a/.github/scripts/latest-json.test.ts b/.github/scripts/latest-json.test.ts new file mode 100644 index 0000000..661655d --- /dev/null +++ b/.github/scripts/latest-json.test.ts @@ -0,0 +1,137 @@ +import { describe, expect, test } from "bun:test"; +import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { build, installerName, type Inputs } from "./latest-json"; + +// A real minisign signature made with `tauri signer sign --app-version 0.4.0` and a throwaway key, over PAYLOAD. +const SIGNATURE = + "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbVl0WTluQkE2MHVvZGtISU5WQXQrS2QwbUZiSWwwRElGc0dWTVE4OTF6RHVUdm9JNTlRV3hnallFY2ZRWUVhT1BuVjlZUElpdVdFT29zWncxN2RZOEZyTXJWMGpHbmdVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1NDcwMDcwCWZpbGU6cGF5bG9hZC5iaW4JdmVyc2lvbjowLjQuMApDWUVjbVFHRHhtV3cvbUoxMVNNc1ArRmZic0JWcCs2dDQxcE1ZRVR3RWR1UEtYSFY0eE1UOEVoQ0hxcHRwc3A2YkVFU1NyMXhSaTFoVnArQTRsTnJEZz09Cg=="; + +// The bytes that were signed, and the public key (the .pub file, base64) of the throwaway key that signed them. +const PAYLOAD = Buffer.from("Not a real installer: bytes for the updater signature test."); +const PUBKEY = + "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEQyM0ExMDlDM0RENjYyMjYKUldRbVl0WTluQkE2MHBHSWZiK0lwY3gzRVpkQVVPNzkyU3ZKMXBvV0dUY0QwSDFoQUVOV1V2S1oK"; +// The public key of a second throwaway key, as if the owner had run `signer generate` twice. +const OTHER_PUBKEY = + "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDk1RjZBNUFCRERCNjAxRDIKUldUU0FiYmRxNlgybFNnS3VldWU0NXhhRmxZQ1Rodjk3K1JQVytBdm1HcEVkN0ZRcW5CMXd4K2gK"; + +const ok: Inputs = { + version: "0.4.0", + installer: installerName("0.4.0"), + installerBytes: PAYLOAD, + signature: SIGNATURE, + pubkey: PUBKEY, + repo: "Page011/LocalTugboat", + date: "2026-11-24T10:00:00Z", +}; + +const b64 = (s: string) => Buffer.from(s, "utf8").toString("base64"); + +describe("latest.json", () => { + test("has the shape the updater reads, with the signature of that exact file and the download URL of the release", () => { + const m = JSON.parse(build(ok)); + expect(m).toEqual({ + version: "0.4.0", + notes: "Local Tugboat 0.4.0 - https://github.com/Page011/LocalTugboat/releases/tag/v0.4.0", + pub_date: "2026-11-24T10:00:00Z", + platforms: { + "windows-x86_64": { + signature: SIGNATURE, + url: "https://github.com/Page011/LocalTugboat/releases/download/v0.4.0/LocalTugboat_0.4.0_x64-setup.exe", + }, + }, + }); + expect(m.notes).not.toContain("\n"); + }); + + test("a .sig file's trailing newline is dropped, never written into the signature", () => { + expect(JSON.parse(build({ ...ok, signature: `${SIGNATURE}\r\n` })).platforms["windows-x86_64"].signature).toBe(SIGNATURE); + }); + + test("a signature made for another version is refused", () => { + expect(() => build({ ...ok, version: "0.4.1", installer: installerName("0.4.1") })).toThrow("made for version 0.4.0, not 0.4.1"); + }); + + test("a signature that does not name its version, or is not a signature, is refused", () => { + const unversioned = b64("untrusted comment: signature from tauri secret key\nRUQabc\ntrusted comment: timestamp:1\tfile:x\nabc\n"); + expect(() => build({ ...ok, signature: unversioned })).toThrow("does not say which version"); + expect(() => build({ ...ok, signature: b64("hello") })).toThrow("not a minisign signature"); + expect(() => build({ ...ok, signature: "" })).toThrow("empty"); + expect(() => build({ ...ok, signature: "two\nlines" })).toThrow("one line"); + }); + + test("a signature made with another key than plugins.updater.pubkey is refused", () => { + expect(() => build({ ...ok, pubkey: OTHER_PUBKEY })).toThrow("different key than plugins.updater.pubkey"); + }); + + test("a signature that does not cover the installer bytes is refused", () => { + expect(() => build({ ...ok, installerBytes: Buffer.from("Not a real installer: other bytes.") })).toThrow("does not match the installer"); + expect(() => build({ ...ok, installerBytes: Buffer.alloc(0) })).toThrow("does not match the installer"); + }); + + test("a signature with the right key id but forged bytes is refused", () => { + const lines = Buffer.from(SIGNATURE, "base64").toString("utf8").split("\n"); + const sig = Buffer.from(lines[1]!, "base64"); + sig[40] = sig[40]! ^ 1; + lines[1] = sig.toString("base64"); + expect(() => build({ ...ok, signature: b64(lines.join("\n")) })).toThrow("does not match the installer"); + }); + + test("an altered trusted comment is refused (the signed comment carries the version)", () => { + const text = Buffer.from(SIGNATURE, "base64").toString("utf8").replace("file:payload.bin", "file:payload.exe"); + expect(() => build({ ...ok, signature: b64(text) })).toThrow("trusted comment was altered"); + }); + + test("a public key that is not a minisign public key is refused", () => { + expect(() => build({ ...ok, pubkey: "UPDATER_PUBKEY_MISSING" })).toThrow("public key"); + expect(() => build({ ...ok, pubkey: b64("untrusted comment: x\nnot-a-key\n") })).toThrow("public key"); + expect(() => build({ ...ok, pubkey: "" })).toThrow("public key"); + }); + + test("the installer name, version, repository and date are checked", () => { + expect(() => build({ ...ok, installer: "Local Tugboat_0.4.0_x64-setup.exe" })).toThrow("must be named LocalTugboat_0.4.0_x64-setup.exe"); + expect(() => build({ ...ok, version: "v0.4.0" })).toThrow("bad version"); + expect(() => build({ ...ok, version: "null" })).toThrow("bad version"); + expect(() => build({ ...ok, repo: "Page011" })).toThrow("bad repository"); + expect(() => build({ ...ok, date: "yesterday" })).toThrow("bad date"); + expect(() => build({ ...ok, date: "2026-13-45T10:00:00Z" })).toThrow("bad date"); + }); + + test("the script runs on files: writes the manifest, and on bad input writes nothing and exits 1", () => { + const dir = mkdtempSync(join(tmpdir(), "latest-json-")); + try { + const sig = join(dir, "setup.exe.sig"); + writeFileSync(sig, `${SIGNATURE}\n`); + const exe = join(dir, installerName("0.4.0")); + writeFileSync(exe, PAYLOAD); + const script = join(import.meta.dir, "latest-json.ts"); + const run = (extra: string[], out: string) => + Bun.spawnSync([process.execPath, script, ...extra, "--version", "0.4.0", "--installer", installerName("0.4.0"), "--sig", sig, "--installer-file", exe, "--pubkey", PUBKEY, "--repo", "Page011/LocalTugboat", "--out", out]); + + const out = join(dir, "latest.json"); + const good = run(["--date", "2026-11-24T10:00:00Z"], out); + expect(good.exitCode).toBe(0); + expect(JSON.parse(readFileSync(out, "utf8")).version).toBe("0.4.0"); + + const withDefaultDate = join(dir, "dated.json"); + expect(run([], withDefaultDate).exitCode).toBe(0); + expect(JSON.parse(readFileSync(withDefaultDate, "utf8")).pub_date).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/); + + // A key from another `signer generate`: the script fails and writes nothing. + const mismatched = join(dir, "mismatched.json"); + const wrongKey = run(["--pubkey", OTHER_PUBKEY], mismatched); + expect(wrongKey.exitCode).toBe(1); + expect(wrongKey.stderr.toString()).toContain("different key than plugins.updater.pubkey"); + expect(existsSync(mismatched)).toBe(false); + + const bad = join(dir, "bad.json"); + const failed = run(["--date", "never"], bad); + expect(failed.exitCode).toBe(1); + expect(failed.stderr.toString()).toContain("bad date"); + expect(existsSync(bad)).toBe(false); + } finally { + rmSync(dir, { recursive: true, force: true }); + } + }); +}); diff --git a/.github/scripts/latest-json.ts b/.github/scripts/latest-json.ts new file mode 100644 index 0000000..ba8b1f1 --- /dev/null +++ b/.github/scripts/latest-json.ts @@ -0,0 +1,139 @@ +// Writes latest.json, the file the desktop app's update check reads from the latest GitHub release. +// +// bun .github/scripts/latest-json.ts --version 0.3.1 --installer LocalTugboat_0.3.1_x64-setup.exe \ +// --installer-file out/LocalTugboat_0.3.1_x64-setup.exe --pubkey "" \ +// --sig "Local Tugboat_0.3.1_x64-setup.exe.sig" --repo Page011/LocalTugboat --out out/latest.json +// +// --sig is the .sig that `tauri signer sign` wrote for the installer. A signature covers the file's bytes, not its +// name, so the installer can be renamed after the build (the release workflow does) and keep working. +// --installer is the published file name; --installer-file is the local file the signature is checked against. +// --pubkey is plugins.updater.pubkey from tauri.conf.json: the signature must verify against it, because an +// installed app would reject any other and never update. --date is optional (RFC 3339, default now). +// Any problem with the inputs is an error and writes nothing. + +import { createHash, createPublicKey, verify } from "node:crypto"; +import { readFileSync, writeFileSync } from "node:fs"; + +const SEMVER = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/; +const REPO = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/; +const RFC3339 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/; +const BASE64 = /^[A-Za-z0-9+/]+={0,2}$/; +const TRUSTED_PREFIX = "trusted comment: "; + +export interface Inputs { + version: string; + /** File name of the installer as published (no folder). */ + installer: string; + /** The installer's bytes: what the signature must verify against. */ + installerBytes: Uint8Array; + /** Contents of the .sig file. */ + signature: string; + /** plugins.updater.pubkey: the base64 of the .pub file. */ + pubkey: string; + /** owner/name of the GitHub repository. */ + repo: string; + /** RFC 3339. */ + date: string; +} + +export function installerName(version: string): string { + return `LocalTugboat_${version}_x64-setup.exe`; +} + +function decode(text: string, what: string): Buffer { + if (!BASE64.test(text)) throw new Error(`${what} is not base64`); + return Buffer.from(text, "base64"); +} + +/** A minisign key line: 2 algorithm bytes, an 8 byte key id, then the 32 byte Ed25519 public key. */ +function parsePublicKey(pubkey: string): { keyId: Buffer; raw: Buffer } { + const lines = decode(pubkey.trim(), "the public key").toString("utf8").split(/\r?\n/); + if (!lines[0]?.startsWith("untrusted comment:") || !lines[1]) throw new Error("plugins.updater.pubkey is not a minisign public key"); + const bytes = decode(lines[1].trim(), "the public key line"); + if (bytes.length !== 42 || bytes.subarray(0, 2).toString("latin1") !== "Ed") throw new Error("plugins.updater.pubkey is not a minisign public key"); + return { keyId: bytes.subarray(2, 10), raw: bytes.subarray(10) }; +} + +/** + * The signature must be a minisign signature made for exactly this version, with the key in plugins.updater.pubkey, + * over exactly these installer bytes. Minisign "prehashed" form (what tauri writes): Ed25519 over the BLAKE2b-512 of + * the file, then a second Ed25519 signature over the first one plus the trusted comment. + */ +function checkSignature(signature: string, version: string, pubkey: string, installerBytes: Uint8Array): void { + if (!signature) throw new Error("the signature is empty"); + if (/\s/.test(signature)) throw new Error("the signature must be one line (the contents of the .sig file)"); + if (!BASE64.test(signature)) throw new Error("the signature is not base64"); + const lines = Buffer.from(signature, "base64").toString("utf8").split(/\r?\n/); + if (!lines[0]?.startsWith("untrusted comment:")) throw new Error("the signature is not a minisign signature"); + const trusted = lines.find((l) => l.startsWith(TRUSTED_PREFIX)); + if (!trusted) throw new Error("the signature has no trusted comment"); + const signed = trusted.split("\t").find((f) => f.startsWith("version:"))?.slice("version:".length); + if (signed === undefined) throw new Error("the signature does not say which version it was made for (sign with --app-version)"); + if (signed !== version) throw new Error(`the signature was made for version ${signed}, not ${version}`); + + const key = parsePublicKey(pubkey); + const sig = decode((lines[1] ?? "").trim(), "the signature line"); + const global = decode((lines[3] ?? "").trim(), "the trusted comment signature"); + if (sig.length !== 74 || sig.subarray(0, 2).toString("latin1") !== "ED" || global.length !== 64) throw new Error("the signature is not a prehashed minisign signature"); + if (!sig.subarray(2, 10).equals(key.keyId)) throw new Error("the signature was made with a different key than plugins.updater.pubkey"); + const publicKey = createPublicKey({ key: { kty: "OKP", crv: "Ed25519", x: key.raw.toString("base64url") }, format: "jwk" }); + const digest = createHash("blake2b512").update(installerBytes).digest(); + if (!verify(null, digest, publicKey, sig.subarray(10))) throw new Error("the signature does not match the installer (other bytes, or a different key than plugins.updater.pubkey)"); + const signedComment = Buffer.concat([sig.subarray(10), Buffer.from(trusted.slice(TRUSTED_PREFIX.length), "utf8")]); + if (!verify(null, signedComment, publicKey, global)) throw new Error("the signature's trusted comment was altered"); +} + +export function build(i: Inputs): string { + if (!SEMVER.test(i.version)) throw new Error(`bad version '${i.version}'`); + if (i.installer !== installerName(i.version)) throw new Error(`the installer must be named ${installerName(i.version)}, got '${i.installer}'`); + if (!REPO.test(i.repo)) throw new Error(`bad repository '${i.repo}' (want owner/name)`); + if (!RFC3339.test(i.date) || Number.isNaN(Date.parse(i.date))) throw new Error(`bad date '${i.date}' (want RFC 3339)`); + const signature = i.signature.trim(); + checkSignature(signature, i.version, i.pubkey, i.installerBytes); + const manifest = { + version: i.version, + notes: `Local Tugboat ${i.version} - https://github.com/${i.repo}/releases/tag/v${i.version}`, + pub_date: i.date, + platforms: { + "windows-x86_64": { + signature, + url: `https://github.com/${i.repo}/releases/download/v${i.version}/${i.installer}`, + }, + }, + }; + return `${JSON.stringify(manifest, null, 2)}\n`; +} + +function arg(args: string[], name: string): string | undefined { + const at = args.indexOf(`--${name}`); + return at >= 0 ? args[at + 1] : undefined; +} + +function main(args: string[]): void { + const need = (name: string): string => { + const v = arg(args, name); + if (!v) throw new Error(`missing --${name}`); + return v; + }; + const out = need("out"); + const json = build({ + version: need("version"), + installer: need("installer"), + installerBytes: readFileSync(need("installer-file")), + signature: readFileSync(need("sig"), "utf8"), + pubkey: need("pubkey"), + repo: need("repo"), + date: arg(args, "date") ?? new Date().toISOString().replace(/\.\d{3}Z$/, "Z"), + }); + writeFileSync(out, json); + console.log(`wrote ${out}`); +} + +if (import.meta.main) { + try { + main(process.argv.slice(2)); + } catch (e) { + console.error(`latest.json: ${e instanceof Error ? e.message : String(e)}`); + process.exit(1); + } +} diff --git a/.github/scripts/release-workflow.test.ts b/.github/scripts/release-workflow.test.ts new file mode 100644 index 0000000..6b4e1c9 --- /dev/null +++ b/.github/scripts/release-workflow.test.ts @@ -0,0 +1,55 @@ +import { describe, expect, test } from "bun:test"; +import { readFileSync } from "node:fs"; +import { join } from "node:path"; + +interface Step { + name?: string; + if?: string; + env?: Record; + run?: string; +} + +const text = readFileSync(join(import.meta.dir, "..", "workflows", "release.yml"), "utf8"); +const wf = Bun.YAML.parse(text) as { jobs: Record }; +const steps = wf.jobs.build!.steps; +const step = (name: string): Step => { + const s = steps.find((x) => x.name === name); + if (!s) throw new Error(`no step named ${name}`); + return s; +}; +const TAG_ONLY = "startsWith(github.ref, 'refs/tags/v')"; + +describe("release workflow", () => { + test("the signing key and its password are given to tag runs only, and only to the signing step", () => { + const withSecrets = steps.filter((s) => JSON.stringify(s.env ?? {}).includes("TAURI_SIGNING_PRIVATE_KEY")); + expect(withSecrets.map((s) => s.name)).toEqual(["Update signing is set up", "Sign installer"]); + for (const s of withSecrets) expect(s.if).toBe(TAG_ONLY); + // Nothing else in the build mentions the secrets, not even through a job or workflow level env. + expect(text.match(/secrets\.TAURI_SIGNING_PRIVATE_KEY(_PASSWORD)?/g)).toHaveLength(4); + }); + + test("the build runs without the key and without making updater artifacts", () => { + const build = step("Build installer"); + expect(build.env).toBeUndefined(); + expect(build.run).toContain(`--config '{"bundle":{"createUpdaterArtifacts":false}}'`); + }); + + test("signing and latest.json happen on tag runs only, so other runs upload an unsigned installer and no manifest", () => { + expect(step("Sign installer").if).toBe(TAG_ONLY); + expect(step("Write latest.json").if).toBe(TAG_ONLY); + expect(step("Sign installer").run).toContain("signer sign --app-version"); + }); + + test("latest.json is checked against the configured key and the installer's bytes", () => { + const run = step("Write latest.json").run ?? ""; + expect(run).toContain("--pubkey"); + expect(run).toContain("plugins.updater.pubkey"); + expect(run).toContain("--installer-file"); + }); + + test("a tag with a suffix is published as a pre-release", () => { + const release = wf.jobs.release!.steps.find((s) => s.name === "Create draft release"); + expect(release?.run).toContain("*-*) pre=(--prerelease)"); + expect(release?.run).toMatch(/gh release create .*\$\{pre\[@\]\+"\$\{pre\[@\]\}"\}/); + }); +}); diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 642fd9d..2a0bc86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,15 @@ name: Release -# Tag vX.Y.Z -> checks, build, DRAFT GitHub Release with the Windows installer attached. +# Tag vX.Y.Z -> checks, build, DRAFT GitHub Release with the Windows installer, its .sha256 and latest.json +# (the file the app's update check reads) attached. # Pull request touching this file and manual runs -> same checks and build, installer kept as a # workflow artifact only (no release). +# +# On a tag the installer is signed for the app's update check with the key in the repository secrets +# TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD; the matching public key is +# plugins.updater.pubkey in tauri.conf.json. Only tag runs get the secrets, and only the signing step sees them +# (the build itself runs without the key). Pull request and manual runs build an unsigned installer and write +# no latest.json, so no workflow artifact outside a tag run can ever pass the app's update check. on: push: tags: ["v*"] @@ -38,6 +45,33 @@ jobs: with: persist-credentials: false + # Without the key the installer cannot be signed, and an app whose public key is still the + # placeholder never checks for updates (and could never be updated later). Fail now, not after the build. + - name: Update signing is set up + if: startsWith(github.ref, 'refs/tags/v') + env: + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} + run: | + set -eu + if [ -z "$TAURI_SIGNING_PRIVATE_KEY" ]; then + echo "::error::SECRET TAURI_SIGNING_PRIVATE_KEY IS EMPTY - add the update signing key under Settings, Secrets and variables, Actions (see 'Make a release' in README.md)" + exit 1 + fi + if [ -z "$TAURI_SIGNING_PRIVATE_KEY_PASSWORD" ]; then + echo "::error::SECRET TAURI_SIGNING_PRIVATE_KEY_PASSWORD IS EMPTY - add the password of the update signing key under Settings, Secrets and variables, Actions" + exit 1 + fi + pubkey=$(jq -r '.plugins.updater.pubkey // empty' apps/desktop/src-tauri/tauri.conf.json | tr -d '\r') + if [ -z "$pubkey" ] || [ "$pubkey" = "UPDATER_PUBKEY_MISSING" ]; then + echo "::error::UPDATE PUBLIC KEY MISSING - plugins.updater.pubkey in apps/desktop/src-tauri/tauri.conf.json is still '${pubkey:-empty}'. Put the contents of the .pub file made by 'bun run tauri signer generate' there (see 'Make a release' in README.md)" + exit 1 + fi + if ! printf '%s' "$pubkey" | base64 -d 2>/dev/null | head -n 1 | grep -q '^untrusted comment: minisign public key'; then + echo "::error::UPDATE PUBLIC KEY NOT VALID - plugins.updater.pubkey must be the contents of the .pub file made by 'bun run tauri signer generate'" + exit 1 + fi + - name: Install Rust run: | rustup toolchain install "$RUST_VERSION" --profile minimal --component clippy @@ -100,6 +134,9 @@ jobs: working-directory: apps/desktop run: bun run test + - name: Release script tests + run: bun test ./.github/scripts + - name: Clippy and desktop Rust tests working-directory: apps/desktop run: bun run check:rust @@ -108,9 +145,11 @@ jobs: - name: Rust workspace tests run: cargo test --workspace --exclude tugboat-desktop + # No signing key in this step: vite, every npm package and every build script runs here. createUpdaterArtifacts + # (tauri.conf.json) is switched off for this build; the installer is signed in its own step below. - name: Build installer working-directory: apps/desktop - run: bun run tauri build + run: bun run tauri build --config '{"bundle":{"createUpdaterArtifacts":false}}' - name: Locate installer id: installer @@ -132,8 +171,44 @@ jobs: mkdir out cp "${files[0]}" "out/LocalTugboat_${ver}_x64-setup.exe" (cd out && sha256sum "LocalTugboat_${ver}_x64-setup.exe" > "LocalTugboat_${ver}_x64-setup.exe.sha256") + # Same bytes under the published name: the signature covers the bytes, not the file name. + cmp "${files[0]}" "out/LocalTugboat_${ver}_x64-setup.exe" + echo "nsis=${files[0]}" >> "$GITHUB_OUTPUT" ls -la out + # Tag runs only. The one step that holds the signing key and its password: only the tauri CLI sees them. + # --app-version puts the version in the signed comment (the app refuses a manifest that announces another). + - name: Sign installer + if: startsWith(github.ref, 'refs/tags/v') + working-directory: apps/desktop + env: + NSIS: ${{ steps.installer.outputs.nsis }} + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} + run: | + set -eu + ver=$(jq -r .version src-tauri/tauri.conf.json | tr -d '\r') + bun run tauri signer sign --app-version "$ver" "../../$NSIS" + if [ ! -s "../../$NSIS.sig" ]; then + echo "::error::No update signature next to the installer: '$NSIS.sig' is missing or empty" + exit 1 + fi + + # The file the app's update check downloads: version, release link, and the signature of the installer + # that is attached to this release. The script verifies the signature against plugins.updater.pubkey and the + # installer's bytes, so a key pair that does not match fails the release here, not on every installed PC. + - name: Write latest.json + if: startsWith(github.ref, 'refs/tags/v') + env: + NSIS: ${{ steps.installer.outputs.nsis }} + REPO: ${{ github.repository }} + run: | + set -eu + ver=$(jq -r .version apps/desktop/src-tauri/tauri.conf.json | tr -d '\r') + pubkey=$(jq -r .plugins.updater.pubkey apps/desktop/src-tauri/tauri.conf.json | tr -d '\r') + bun .github/scripts/latest-json.ts --version "$ver" --installer "LocalTugboat_${ver}_x64-setup.exe" --installer-file "out/LocalTugboat_${ver}_x64-setup.exe" --sig "$NSIS.sig" --pubkey "$pubkey" --repo "$REPO" --out out/latest.json + cat out/latest.json + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: windows-installer @@ -170,8 +245,15 @@ jobs: shopt -s nullglob files=(installer/*-setup.exe) sums=(installer/*.sha256) - if [ "${#files[@]}" -ne 1 ] || [ "${#sums[@]}" -ne 1 ]; then - echo "::error::Expected exactly one installer and one .sha256, found ${#files[@]} and ${#sums[@]}" + manifests=(installer/*.json) + if [ "${#files[@]}" -ne 1 ] || [ "${#sums[@]}" -ne 1 ] || [ "${#manifests[@]}" -ne 1 ] || [ "${manifests[0]##*/}" != "latest.json" ]; then + echo "::error::Expected exactly one installer, one .sha256 and one latest.json, found ${#files[@]}, ${#sums[@]} and ${#manifests[@]}" + exit 1 + fi + # latest.json must announce the version of the tag it is attached to. + announced=$(jq -r .version "${manifests[0]}" | tr -d '\r') + if [ "$announced" != "${TAG#v}" ]; then + echo "::error::latest.json announces '$announced' but the tag is $TAG" exit 1 fi st=$(gh api "repos/$GH_REPO/compare/main...$TAG" --jq .status) @@ -196,6 +278,14 @@ jobs: SHA-256: see the .sha256 file. + latest.json is what the app's update check reads: leave it attached. + Android: Google Play (link added when published). EOF - gh release create "$TAG" "${files[0]}" "${sums[0]}" --draft --verify-tag --title "$TAG" --notes-file notes.md + # A tag with a suffix (v0.4.0-rc.1) is a pre-release: GitHub's "latest release" never returns one, so + # installed PCs are not offered it unless the pre-release box is unticked on purpose. + pre=() + case "$TAG" in + *-*) pre=(--prerelease) ;; + esac + gh release create "$TAG" "${files[0]}" "${sums[0]}" "${manifests[0]}" --draft --verify-tag ${pre[@]+"${pre[@]}"} --title "$TAG" --notes-file notes.md diff --git a/Cargo.lock b/Cargo.lock index 121be92..ce66e8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -855,6 +855,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation" version = "0.10.1" @@ -878,9 +888,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" dependencies = [ "bitflags 2.13.2", - "core-foundation", + "core-foundation 0.10.1", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -891,7 +901,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ "bitflags 2.13.2", - "core-foundation", + "core-foundation 0.10.1", "libc", ] @@ -1525,6 +1535,16 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "filetime" +version = "0.2.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1255e7a9f1902190d4c10a75f2f7f495d3d3ce13e9ba26e6c48683a0f4dbed7" +dependencies = [ + "cfg-if", + "libc", +] + [[package]] name = "find-msvc-tools" version = "0.1.15" @@ -1560,6 +1580,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", +] + [[package]] name = "foreign-types" version = "0.5.0" @@ -1567,7 +1596,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared", + "foreign-types-shared 0.3.1", ] [[package]] @@ -1581,6 +1610,12 @@ dependencies = [ "syn 3.0.10", ] +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -2249,6 +2284,22 @@ dependencies = [ "tower-service", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.21" @@ -2268,9 +2319,11 @@ dependencies = [ "percent-encoding", "pin-project-lite", "socket2", + "system-configuration 0.7.0", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] @@ -3141,6 +3194,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "minisign-verify" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871285dc19d8d0ebe0eef3d0e99a205f2a71363b122632cbbfa4a6c370a960ce" + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -3212,7 +3271,7 @@ dependencies = [ "rustc-hash", "rustls", "simple-dns", - "system-configuration", + "system-configuration 0.8.0", "tokio", "tokio-rustls", "tracing", @@ -3273,6 +3332,23 @@ dependencies = [ "slotmap", ] +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "ndk" version = "0.9.0" @@ -3801,6 +3877,18 @@ dependencies = [ "objc2-core-foundation", ] +[[package]] +name = "objc2-osa-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + [[package]] name = "objc2-quartz-core" version = "0.3.2" @@ -3933,12 +4021,49 @@ dependencies = [ "libc", ] +[[package]] +name = "openssl" +version = "0.10.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de8111e94a56adca7ebfe6c365b6d42f99deb69b74b6becacd4204e2f193aa2" +dependencies = [ + "bitflags 2.13.2", + "cfg-if", + "foreign-types 0.3.2", + "libc", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "openssl-probe" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1" +[[package]] +name = "openssl-sys" +version = "0.9.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c413d6ec9ebaf5e1c829d355cb3e9f783778d700f135be0921d52fce3c60ae" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -3970,6 +4095,20 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "osakit" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b" +dependencies = [ + "objc2", + "objc2-foundation", + "objc2-osa-kit", + "serde", + "serde_json", + "thiserror 2.0.21", +] + [[package]] name = "pango" version = "0.18.3" @@ -4558,9 +4697,11 @@ dependencies = [ "http-body-util", "hyper", "hyper-rustls", + "hyper-tls", "hyper-util", "js-sys", "log", + "native-tls", "percent-encoding", "pin-project-lite", "rustls", @@ -4570,6 +4711,7 @@ dependencies = [ "serde_json", "sync_wrapper", "tokio", + "tokio-native-tls", "tokio-rustls", "tokio-util", "tower", @@ -4717,7 +4859,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" dependencies = [ - "core-foundation", + "core-foundation 0.10.1", "core-foundation-sys", "jni 0.22.4", "log", @@ -4869,7 +5011,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ "bitflags 2.13.2", - "core-foundation", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -5553,6 +5695,17 @@ dependencies = [ "syn 3.0.10", ] +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.9.4", + "system-configuration-sys", +] + [[package]] name = "system-configuration" version = "0.8.0" @@ -5560,7 +5713,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "501336eb7ba9e417300a6a0fa985721065467aa83a6dcf0422a8e43e4c0328fa" dependencies = [ "bitflags 2.13.2", - "core-foundation", + "core-foundation 0.10.1", "system-configuration-sys", ] @@ -5595,7 +5748,7 @@ checksum = "d5777b06fe6435126ae8d816eba269e050e1e10d302cf5461e9c49eccabc3548" dependencies = [ "bitflags 2.13.2", "block2", - "core-foundation", + "core-foundation 0.10.1", "core-graphics", "crossbeam-channel", "dbus", @@ -5638,6 +5791,17 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "tar" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.16" @@ -5869,6 +6033,38 @@ dependencies = [ "zbus", ] +[[package]] +name = "tauri-plugin-updater" +version = "2.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b" +dependencies = [ + "base64 0.23.1", + "dirs 7.0.0", + "flate2", + "futures-util", + "http", + "infer", + "libc", + "log", + "minisign-verify", + "osakit", + "percent-encoding", + "reqwest", + "semver", + "serde", + "serde_json", + "tar", + "tauri", + "tauri-plugin", + "tempfile", + "thiserror 2.0.21", + "time", + "tokio", + "url", + "windows-sys 0.61.2", +] + [[package]] name = "tauri-runtime" version = "2.12.3" @@ -6132,6 +6328,16 @@ dependencies = [ "syn 3.0.10", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.6" @@ -6479,6 +6685,7 @@ dependencies = [ "notify", "png", "qrcode", + "semver", "serde", "serde_json", "tauri", @@ -6487,6 +6694,7 @@ dependencies = [ "tauri-plugin-dialog", "tauri-plugin-opener", "tauri-plugin-single-instance", + "tauri-plugin-updater", "tempfile", "thiserror 2.0.21", "tokio", @@ -7676,6 +7884,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "xattr" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "963d6fab92d5504b971dc8bd90ca743c2575e590bc8071ea5bc571598667ae08" +dependencies = [ + "libc", + "rustix", +] + [[package]] name = "yoke" version = "0.8.4" diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index b549562..139ca23 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -27,6 +27,12 @@ tauri-plugin-single-instance = "2.4.5" tauri-plugin-autostart = "2.5.1" tauri-plugin-opener = "2.5.5" tauri-plugin-dialog = "2.7.3" +# native-tls = SChannel on Windows: the HTTPS check trusts the Windows certificate store (so it also works behind a +# company proxy that re-signs HTTPS with its own root). The default rustls backend ships its own roots and would not. +# No "zip" feature: the release asset is the plain installer, not an archive. +tauri-plugin-updater = { version = "2.14.1", default-features = false, features = ["native-tls", "system-proxy"] } +# Already in the tree through the updater: compares the running version with the offered one. +semver = "1" notify = "8.2.1" qrcode = { version = "0.14.1", default-features = false, features = ["svg"] } # windows-native: Credential Manager through the Win32 API, no extra daemon. diff --git a/apps/desktop/src-tauri/gen/schemas/acl-manifests.json b/apps/desktop/src-tauri/gen/schemas/acl-manifests.json index 18ee400..0de9708 100644 --- a/apps/desktop/src-tauri/gen/schemas/acl-manifests.json +++ b/apps/desktop/src-tauri/gen/schemas/acl-manifests.json @@ -1 +1 @@ -{"autostart":{"default_permission":{"identifier":"default","description":"This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n","permissions":["allow-enable","allow-disable","allow-is-enabled"]},"permissions":{"allow-disable":{"identifier":"allow-disable","description":"Enables the disable command without any pre-configured scope.","commands":{"allow":["disable"],"deny":[]}},"allow-enable":{"identifier":"allow-enable","description":"Enables the enable command without any pre-configured scope.","commands":{"allow":["enable"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"deny-disable":{"identifier":"deny-disable","description":"Denies the disable command without any pre-configured scope.","commands":{"allow":[],"deny":["disable"]}},"deny-enable":{"identifier":"deny-enable","description":"Denies the enable command without any pre-configured scope.","commands":{"allow":[],"deny":["enable"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-exit":{"identifier":"allow-exit","description":"Enables the exit command without any pre-configured scope.","commands":{"allow":["exit"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-exit":{"identifier":"deny-exit","description":"Denies the exit command without any pre-configured scope.","commands":{"allow":[],"deny":["exit"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-fullscreen-on-monitor":{"identifier":"allow-set-fullscreen-on-monitor","description":"Enables the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":["set_fullscreen_on_monitor"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-fullscreen-on-monitor":{"identifier":"deny-set-fullscreen-on-monitor","description":"Denies the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen_on_monitor"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"opener":{"default_permission":{"identifier":"default","description":"This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer","permissions":["allow-open-url","allow-reveal-item-in-dir","allow-default-urls"]},"permissions":{"allow-default-urls":{"identifier":"allow-default-urls","description":"This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"url":"mailto:*"},{"url":"tel:*"},{"url":"http://*"},{"url":"https://*"}]}},"allow-open-path":{"identifier":"allow-open-path","description":"Enables the open_path command without any pre-configured scope.","commands":{"allow":["open_path"],"deny":[]}},"allow-open-url":{"identifier":"allow-open-url","description":"Enables the open_url command without any pre-configured scope.","commands":{"allow":["open_url"],"deny":[]}},"allow-reveal-item-in-dir":{"identifier":"allow-reveal-item-in-dir","description":"Enables the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":["reveal_item_in_dir"],"deny":[]}},"deny-open-path":{"identifier":"deny-open-path","description":"Denies the open_path command without any pre-configured scope.","commands":{"allow":[],"deny":["open_path"]}},"deny-open-url":{"identifier":"deny-open-url","description":"Denies the open_url command without any pre-configured scope.","commands":{"allow":[],"deny":["open_url"]}},"deny-reveal-item-in-dir":{"identifier":"deny-reveal-item-in-dir","description":"Denies the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_item_in_dir"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this url with, for example: firefox."},"url":{"description":"A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"","type":"string"}},"required":["url"],"type":"object"},{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this path with, for example: xdg-open."},"path":{"description":"A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"definitions":{"Application":{"anyOf":[{"description":"Open in default application.","type":"null"},{"description":"If true, allow open with any application.","type":"boolean"},{"description":"Allow specific application to open with.","type":"string"}],"description":"Opener scope application."}},"description":"Opener scope entry.","title":"OpenerScopeEntry"}}} \ No newline at end of file +{"autostart":{"default_permission":{"identifier":"default","description":"This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n","permissions":["allow-enable","allow-disable","allow-is-enabled"]},"permissions":{"allow-disable":{"identifier":"allow-disable","description":"Enables the disable command without any pre-configured scope.","commands":{"allow":["disable"],"deny":[]}},"allow-enable":{"identifier":"allow-enable","description":"Enables the enable command without any pre-configured scope.","commands":{"allow":["enable"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"deny-disable":{"identifier":"deny-disable","description":"Denies the disable command without any pre-configured scope.","commands":{"allow":[],"deny":["disable"]}},"deny-enable":{"identifier":"deny-enable","description":"Denies the enable command without any pre-configured scope.","commands":{"allow":[],"deny":["enable"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-exit":{"identifier":"allow-exit","description":"Enables the exit command without any pre-configured scope.","commands":{"allow":["exit"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-exit":{"identifier":"deny-exit","description":"Denies the exit command without any pre-configured scope.","commands":{"allow":[],"deny":["exit"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-fullscreen-on-monitor":{"identifier":"allow-set-fullscreen-on-monitor","description":"Enables the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":["set_fullscreen_on_monitor"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-fullscreen-on-monitor":{"identifier":"deny-set-fullscreen-on-monitor","description":"Denies the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen_on_monitor"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"opener":{"default_permission":{"identifier":"default","description":"This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer","permissions":["allow-open-url","allow-reveal-item-in-dir","allow-default-urls"]},"permissions":{"allow-default-urls":{"identifier":"allow-default-urls","description":"This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"url":"mailto:*"},{"url":"tel:*"},{"url":"http://*"},{"url":"https://*"}]}},"allow-open-path":{"identifier":"allow-open-path","description":"Enables the open_path command without any pre-configured scope.","commands":{"allow":["open_path"],"deny":[]}},"allow-open-url":{"identifier":"allow-open-url","description":"Enables the open_url command without any pre-configured scope.","commands":{"allow":["open_url"],"deny":[]}},"allow-reveal-item-in-dir":{"identifier":"allow-reveal-item-in-dir","description":"Enables the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":["reveal_item_in_dir"],"deny":[]}},"deny-open-path":{"identifier":"deny-open-path","description":"Denies the open_path command without any pre-configured scope.","commands":{"allow":[],"deny":["open_path"]}},"deny-open-url":{"identifier":"deny-open-url","description":"Denies the open_url command without any pre-configured scope.","commands":{"allow":[],"deny":["open_url"]}},"deny-reveal-item-in-dir":{"identifier":"deny-reveal-item-in-dir","description":"Denies the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_item_in_dir"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this url with, for example: firefox."},"url":{"description":"A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"","type":"string"}},"required":["url"],"type":"object"},{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this path with, for example: xdg-open."},"path":{"description":"A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"definitions":{"Application":{"anyOf":[{"description":"Open in default application.","type":"null"},{"description":"If true, allow open with any application.","type":"boolean"},{"description":"Allow specific application to open with.","type":"string"}],"description":"Opener scope application."}},"description":"Opener scope entry.","title":"OpenerScopeEntry"}},"updater":{"default_permission":{"identifier":"default","description":"This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n","permissions":["allow-check","allow-download","allow-install","allow-download-and-install"]},"permissions":{"allow-check":{"identifier":"allow-check","description":"Enables the check command without any pre-configured scope.","commands":{"allow":["check"],"deny":[]}},"allow-download":{"identifier":"allow-download","description":"Enables the download command without any pre-configured scope.","commands":{"allow":["download"],"deny":[]}},"allow-download-and-install":{"identifier":"allow-download-and-install","description":"Enables the download_and_install command without any pre-configured scope.","commands":{"allow":["download_and_install"],"deny":[]}},"allow-install":{"identifier":"allow-install","description":"Enables the install command without any pre-configured scope.","commands":{"allow":["install"],"deny":[]}},"deny-check":{"identifier":"deny-check","description":"Denies the check command without any pre-configured scope.","commands":{"allow":[],"deny":["check"]}},"deny-download":{"identifier":"deny-download","description":"Denies the download command without any pre-configured scope.","commands":{"allow":[],"deny":["download"]}},"deny-download-and-install":{"identifier":"deny-download-and-install","description":"Denies the download_and_install command without any pre-configured scope.","commands":{"allow":[],"deny":["download_and_install"]}},"deny-install":{"identifier":"deny-install","description":"Denies the install command without any pre-configured scope.","commands":{"allow":[],"deny":["install"]}}},"permission_sets":{},"global_scope_schema":null}} \ No newline at end of file diff --git a/apps/desktop/src-tauri/gen/schemas/desktop-schema.json b/apps/desktop/src-tauri/gen/schemas/desktop-schema.json index e6a2791..a01dfdf 100644 --- a/apps/desktop/src-tauri/gen/schemas/desktop-schema.json +++ b/apps/desktop/src-tauri/gen/schemas/desktop-schema.json @@ -2539,6 +2539,60 @@ "type": "string", "const": "opener:deny-reveal-item-in-dir", "markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope." + }, + { + "description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`", + "type": "string", + "const": "updater:default", + "markdownDescription": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`" + }, + { + "description": "Enables the check command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-check", + "markdownDescription": "Enables the check command without any pre-configured scope." + }, + { + "description": "Enables the download command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-download", + "markdownDescription": "Enables the download command without any pre-configured scope." + }, + { + "description": "Enables the download_and_install command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-download-and-install", + "markdownDescription": "Enables the download_and_install command without any pre-configured scope." + }, + { + "description": "Enables the install command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-install", + "markdownDescription": "Enables the install command without any pre-configured scope." + }, + { + "description": "Denies the check command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-check", + "markdownDescription": "Denies the check command without any pre-configured scope." + }, + { + "description": "Denies the download command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-download", + "markdownDescription": "Denies the download command without any pre-configured scope." + }, + { + "description": "Denies the download_and_install command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-download-and-install", + "markdownDescription": "Denies the download_and_install command without any pre-configured scope." + }, + { + "description": "Denies the install command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-install", + "markdownDescription": "Denies the install command without any pre-configured scope." } ] }, diff --git a/apps/desktop/src-tauri/gen/schemas/windows-schema.json b/apps/desktop/src-tauri/gen/schemas/windows-schema.json index e6a2791..a01dfdf 100644 --- a/apps/desktop/src-tauri/gen/schemas/windows-schema.json +++ b/apps/desktop/src-tauri/gen/schemas/windows-schema.json @@ -2539,6 +2539,60 @@ "type": "string", "const": "opener:deny-reveal-item-in-dir", "markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope." + }, + { + "description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`", + "type": "string", + "const": "updater:default", + "markdownDescription": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`" + }, + { + "description": "Enables the check command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-check", + "markdownDescription": "Enables the check command without any pre-configured scope." + }, + { + "description": "Enables the download command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-download", + "markdownDescription": "Enables the download command without any pre-configured scope." + }, + { + "description": "Enables the download_and_install command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-download-and-install", + "markdownDescription": "Enables the download_and_install command without any pre-configured scope." + }, + { + "description": "Enables the install command without any pre-configured scope.", + "type": "string", + "const": "updater:allow-install", + "markdownDescription": "Enables the install command without any pre-configured scope." + }, + { + "description": "Denies the check command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-check", + "markdownDescription": "Denies the check command without any pre-configured scope." + }, + { + "description": "Denies the download command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-download", + "markdownDescription": "Denies the download command without any pre-configured scope." + }, + { + "description": "Denies the download_and_install command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-download-and-install", + "markdownDescription": "Denies the download_and_install command without any pre-configured scope." + }, + { + "description": "Denies the install command without any pre-configured scope.", + "type": "string", + "const": "updater:deny-install", + "markdownDescription": "Denies the install command without any pre-configured scope." } ] }, diff --git a/apps/desktop/src-tauri/src/backend.rs b/apps/desktop/src-tauri/src/backend.rs index 2aca7f4..187b35b 100644 --- a/apps/desktop/src-tauri/src/backend.rs +++ b/apps/desktop/src-tauri/src/backend.rs @@ -35,6 +35,7 @@ use crate::{ paths::{self, Paths}, qr, tray::{self, TrayState}, + updates, }; /// Event names the webview listens for (apps/desktop/src/lib/api.ts mirrors these). @@ -55,6 +56,8 @@ pub mod ev { pub const DROP_PROGRESS: &str = "drop-progress"; /// `DropReport`: what the drop did. pub const DROP_RESULT: &str = "drop-result"; + /// `UpdateReady`: a newer version is downloaded and verified. + pub const UPDATE_READY: &str = "update-ready"; } /// Where backend events go: the Tauri window, or a list in a test. @@ -116,6 +119,9 @@ struct Shared { worker: Arc>>, tray: Mutex>, pairing_open: AtomicBool, + /// A linked device refused this PC because it is the older side ("Update Tugboat on the PC"): the update + /// check looks for a newer version soon (see `updates::decide`). Cleared when a check starts. + update_hint: AtomicBool, } fn lock(m: &Mutex) -> MutexGuard<'_, T> { @@ -142,7 +148,12 @@ impl Shared { fn on_core_event(&self, e: &Event) { match e { - Event::Sync(s) => self.set_tray(s), + Event::Sync(s) => { + if updates::needs_pc_update(s) { + self.update_hint.store(true, Ordering::SeqCst); + } + self.set_tray(s); + } Event::ItemsChanged { .. } | Event::FoldersChanged => { if let Some(w) = lock(&self.worker).as_ref() { w.poke(); @@ -185,6 +196,8 @@ pub struct Backend { drag: Mutex, /// One drop copies at a time; a second waits its turn. drop_run: Mutex<()>, + /// The library thread and the network are stopped for an update install (see `quiesce`). + quiesced: AtomicBool, } impl Backend { @@ -209,7 +222,13 @@ impl Backend { let (core, rx) = Core::open(core_cfg, Arc::new(SystemClock), place.clone()).map_err(|e| format!("{e}"))?; let worker: Arc>> = Arc::new(Mutex::new(None)); - let shared = Arc::new(Shared { emitter: emitter.clone(), worker: worker.clone(), tray: Mutex::new(None), pairing_open: AtomicBool::new(false) }); + let shared = Arc::new(Shared { + emitter: emitter.clone(), + worker: worker.clone(), + tray: Mutex::new(None), + pairing_open: AtomicBool::new(false), + update_hint: AtomicBool::new(false), + }); let notify_shared = shared.clone(); let library = Library::open( core.clone(), @@ -240,6 +259,7 @@ impl Backend { drop_view: Mutex::new(None), drag: Mutex::new(Drag::default()), drop_run: Mutex::new(()), + quiesced: AtomicBool::new(false), }); // A quit during a drop leaves its temp copy in `.tugboat`, one during a cross-drive move a `.tugboat-move` @@ -273,6 +293,39 @@ impl Backend { self.core.stop_network().await; } + /// Stop the library thread (it finishes the file it is placing) and the network (the phone sees a clean + /// disconnect, no transfer is cut half way), right before the update installer takes over. Quitting any other + /// way just exits; the installer must not find files or a session in use. Undone by `resume` when the installer + /// does not start (the user declined the Windows prompt). + pub async fn quiesce(&self) { + if self.quiesced.swap(true, Ordering::SeqCst) { + return; + } + lock(&self.worker).take(); // drop joins the thread + self.core.stop_network().await; + tracing::info!("sync stopped for the update install"); + } + + /// Start what `quiesce` stopped. Does nothing when `quiesce` did not run. + pub async fn resume(&self) { + if !self.quiesced.swap(false, Ordering::SeqCst) { + return; + } + self.restart_worker(); + self.restart_network().await; + tracing::info!("sync running again"); + } + + /// True when a linked device refused this PC as the older side since the last update check began. + pub fn update_hint(&self) -> bool { + self.shared.update_hint.load(Ordering::SeqCst) + } + + /// An update check is starting: the refusal it was waiting for is being answered. + pub fn clear_update_hint(&self) { + self.shared.update_hint.store(false, Ordering::SeqCst); + } + /// (Re)start the network from the saved port and the bind override. A failure is stored /// and emitted, never dropped. pub async fn restart_network(&self) { @@ -646,3 +699,43 @@ async fn firewall_loop(slot: Arc>, shared: Arc, core tokio::time::sleep(Duration::from_secs(300)).await; } } + +#[cfg(test)] +mod tests { + use super::*; + use tugboat_core::events::SyncState; + + struct Quiet; + impl Emitter for Quiet { + fn emit(&self, _event: &str, _payload: serde_json::Value) {} + fn tray(&self, _state: TrayState, _tooltip: &str) {} + } + + fn shared() -> Shared { + Shared { + emitter: Arc::new(Quiet), + worker: Arc::new(Mutex::new(None)), + tray: Mutex::new(None), + pairing_open: AtomicBool::new(false), + update_hint: AtomicBool::new(false), + } + } + + fn sync(state: SyncState, message: Option<&str>) -> Event { + Event::Sync(SyncStatus { state, peer_name: None, last_synced_at: None, waiting: 0, downloading: 0, storage_low: false, message: message.map(Into::into), devices: Vec::new() }) + } + + /// The update check is told when a linked device refused this PC as the older side, and only then. + #[test] + fn a_refusal_that_names_the_pc_sets_the_update_hint() { + let s = shared(); + s.on_core_event(&sync(SyncState::Synced, None)); + s.on_core_event(&sync(SyncState::Refused, Some("Update Tugboat on the phone"))); + assert!(!s.update_hint.load(Ordering::SeqCst), "the phone must update, not this PC"); + s.on_core_event(&sync(SyncState::Refused, Some("Update Tugboat on the PC"))); + assert!(s.update_hint.load(Ordering::SeqCst)); + // A later status does not clear it: only a started check does. + s.on_core_event(&sync(SyncState::Offline, None)); + assert!(s.update_hint.load(Ordering::SeqCst)); + } +} diff --git a/apps/desktop/src-tauri/src/bindings.rs b/apps/desktop/src-tauri/src/bindings.rs index 7f0630c..6ce974b 100644 --- a/apps/desktop/src-tauri/src/bindings.rs +++ b/apps/desktop/src-tauri/src/bindings.rs @@ -20,6 +20,7 @@ use crate::{ firewall::{FirewallInfo, FirewallStatus}, library::{LibraryHealth, LibraryStatus, NotSyncedFile}, tray::TrayState, + updates::UpdateReady, }; fn export_all(dir: &Path) { @@ -50,6 +51,7 @@ fn export_all(dir: &Path) { DropProgress, DropLine, DropReport, + UpdateReady, ); } diff --git a/apps/desktop/src-tauri/src/commands.rs b/apps/desktop/src-tauri/src/commands.rs index 78e21de..db00fd5 100644 --- a/apps/desktop/src-tauri/src/commands.rs +++ b/apps/desktop/src-tauri/src/commands.rs @@ -17,6 +17,7 @@ use crate::{ error::{CmdError, CmdResult}, firewall::FirewallInfo, library::LibraryStatus, + updates::{self, UpdateReady, Updates}, }; pub const MAIN: &str = "main"; @@ -35,6 +36,7 @@ fn allow(window: &WebviewWindow) -> CmdResult<()> { } type Be<'a> = State<'a, Arc>; +type Upd<'a> = State<'a, Arc>; #[tauri::command(async)] pub fn app_info(window: WebviewWindow, be: Be) -> CmdResult { @@ -253,6 +255,37 @@ pub fn autostart_set(window: WebviewWindow, app: AppHandle, enabled: bool) -> Cm r.map_err(|e| CmdError::new("autostart", e.to_string())) } +/// The "Check for updates" switch (on by default; kept on this PC only). +#[tauri::command(async)] +pub fn update_check_get(window: WebviewWindow, up: Upd) -> CmdResult { + allow(&window)?; + Ok(up.enabled()) +} + +#[tauri::command(async)] +pub fn update_check_set(window: WebviewWindow, up: Upd, enabled: bool) -> CmdResult<()> { + allow(&window)?; + up.set_enabled(enabled) +} + +/// The downloaded and verified update waiting to be installed, if any. +#[tauri::command(async)] +pub fn update_ready(window: WebviewWindow, up: Upd) -> CmdResult> { + allow(&window)?; + Ok(up.ready()) +} + +/// [Install] on the update banner. Resolves to false when the user said no to the Windows prompt (nothing changed, +/// the banner stays). When the installer starts, this app exits and the installer starts it again. +#[tauri::command] +pub async fn update_install(window: WebviewWindow, app: AppHandle, up: Upd<'_>) -> CmdResult { + allow(&window)?; + let up: Arc = up.inner().clone(); + tauri::async_runtime::spawn_blocking(move || updates::install(&app, &up)) + .await + .map_err(|e| CmdError::new("update", format!("UPDATE NOT INSTALLED - {e}")))? +} + /// Quit for real (closing the window only hides it to the tray). #[tauri::command(async)] pub fn quit_app(window: WebviewWindow, app: AppHandle) -> CmdResult<()> { diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 53b82e5..424e167 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -18,6 +18,7 @@ pub mod qr; pub mod shell; pub mod thumbs; pub mod tray; +pub mod updates; pub mod winfs; pub mod zipdrop; @@ -44,6 +45,7 @@ pub fn run() { .plugin(tauri_plugin_autostart::init(tauri_plugin_autostart::MacosLauncher::LaunchAgent, Some(vec![shell::MINIMIZED_FLAG]))) .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_updater::Builder::new().build()) .register_uri_scheme_protocol(shell::THUMB_SCHEME, shell::thumb_response) .on_window_event(shell::on_window_event) .setup(|app| { @@ -82,17 +84,20 @@ pub fn run() { shell::watch_display(&handle); let emitter = Arc::new(shell::TauriEmitter { app: handle.clone() }); let started = tauri::async_runtime::block_on(Backend::start(opts, &store, emitter)); - match started { + let after_update = match started { Ok(backend) => { first_run_autostart(&handle, &backend); - app.manage(backend); + let after_update = updates::take_show_after_update(&backend); + app.manage(backend.clone()); + updates::start(&handle, backend); + after_update } Err(e) => { fatal(&handle, "Tugboat cannot start", format!("{e}\n\nFix the problem, then start Tugboat again.")); return Ok(()); } - } - if !std::env::args().any(|a| a == shell::MINIMIZED_FLAG) { + }; + if updates::show_window_at_start(std::env::args().any(|a| a == shell::MINIMIZED_FLAG), after_update) { shell::show_main(&handle); } Ok(()) @@ -132,6 +137,10 @@ pub fn run() { commands::firewall_fix, commands::autostart_get, commands::autostart_set, + commands::update_check_get, + commands::update_check_set, + commands::update_ready, + commands::update_install, commands::quit_app, ]) .run(tauri::generate_context!()) diff --git a/apps/desktop/src-tauri/src/shell.rs b/apps/desktop/src-tauri/src/shell.rs index 1c1c6c0..8a00173 100644 --- a/apps/desktop/src-tauri/src/shell.rs +++ b/apps/desktop/src-tauri/src/shell.rs @@ -15,6 +15,7 @@ use crate::{ commands::MAIN, drop::NativeDrop, tray::{self, TrayState}, + updates, }; pub const TRAY_ID: &str = "tugboat"; @@ -155,10 +156,43 @@ pub fn watch_display(app: &AppHandle) { #[cfg(not(windows))] pub fn watch_display(_app: &AppHandle) {} -pub fn build_tray(app: &AppHandle) -> tauri::Result<()> { +/// The tray menu: Open, Quit, and "Install update X.Y.Z" between them while a verified update waits. +fn tray_menu(app: &AppHandle, update: Option<&str>) -> tauri::Result> { let open = MenuItem::with_id(app, "open", "Open Tugboat", true, None::<&str>)?; let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?; - let menu = Menu::with_items(app, &[&open, &quit])?; + match update { + Some(version) => { + let install = MenuItem::with_id(app, "install_update", updates::tray_item_text(version), true, None::<&str>)?; + Menu::with_items(app, &[&open, &install, &quit]) + } + None => Menu::with_items(app, &[&open, &quit]), + } +} + +/// Show (Some) or remove (None) the "Install update" item. +pub fn set_update_item(app: &AppHandle, version: Option<&str>) { + let Some(tray) = app.tray_by_id(TRAY_ID) else { return }; + match tray_menu(app, version) { + Ok(menu) => { + if let Err(e) = tray.set_menu(Some(menu)) { + tracing::warn!("tray menu not updated: {e}"); + } + } + Err(e) => tracing::warn!("tray menu not built: {e}"), + } +} + +/// Hide or show the tray icon (hidden for the moment the update installer takes over). +pub fn set_tray_visible(app: &AppHandle, visible: bool) { + if let Some(tray) = app.tray_by_id(TRAY_ID) { + if let Err(e) = tray.set_visible(visible) { + tracing::warn!("tray icon visibility not changed: {e}"); + } + } +} + +pub fn build_tray(app: &AppHandle) -> tauri::Result<()> { + let menu = tray_menu(app, None)?; TrayIconBuilder::with_id(TRAY_ID) .icon(tray_image(app, TrayState::Offline).ok_or_else(|| tauri::Error::InvalidIcon(std::io::Error::other("tray icon missing")))?) .tooltip("Tugboat") @@ -167,6 +201,7 @@ pub fn build_tray(app: &AppHandle) -> tauri::Result<()> { .on_menu_event(|app, e| match e.id.as_ref() { "open" => show_main(app), "quit" => app.exit(0), + "install_update" => updates::install_from_tray(app), _ => {} }) .on_tray_icon_event(|tray, e| { diff --git a/apps/desktop/src-tauri/src/updates.rs b/apps/desktop/src-tauri/src/updates.rs new file mode 100644 index 0000000..70bf6c1 --- /dev/null +++ b/apps/desktop/src-tauri/src/updates.rs @@ -0,0 +1,961 @@ +//! Update check: once a day the PC asks GitHub whether a newer version is published, downloads it in the +//! background, checks its signature and offers it (a banner and a tray item). It sends nothing about the +//! user or the files: one ordinary HTTPS request for `latest.json`, then one for the installer. +//! +//! - The pure part (`decide`, `is_newer`, `overrides`, `needs_pc_update`, `classify`) has no Tauri types and is +//! unit tested. +//! - `fetch` is generic over the Tauri runtime, so the whole check + download + verify runs in a test against a +//! local server. +//! - `Updates` is the managed state: the switch, the last check time, the downloaded update and the schedule. +//! +//! TLS: the plugin is built with its `native-tls` feature (SChannel on Windows), so HTTPS trusts the Windows +//! certificate store. That is what makes it work behind a company proxy that re-signs HTTPS with its own root. +//! +//! The key and the endpoint live in `tauri.conf.json` (`plugins.updater`). While the key is still the placeholder +//! the app never checks. Debug builds only: `TUGBOAT_UPDATE_URL` and `TUGBOAT_UPDATE_PUBKEY` replace the +//! endpoint and the key for tests; a release build never reads them. + +use std::{ + fmt, + future::Future, + sync::{ + atomic::{AtomicBool, AtomicI64, Ordering}, + Arc, Mutex, + }, + time::{Duration, Instant, SystemTime, UNIX_EPOCH}, +}; + +use serde::{Deserialize, Serialize}; +use tauri::{AppHandle, Emitter as _, Manager, Runtime}; +use tauri_plugin_updater::{Update, UpdaterExt}; +use tokio::sync::Notify; +use tugboat_core::events::{Event, SyncState, SyncStatus}; +use ts_rs::TS; + +use crate::{ + backend::{ev, Backend}, + commands::MAIN, + error::{CmdError, CmdResult}, + shell, +}; + +/// What `plugins.updater.pubkey` holds until the owner makes the signing key. +pub const PLACEHOLDER_PUBKEY: &str = "UPDATER_PUBKEY_MISSING"; +/// Debug builds only: use this endpoint instead of the one in `tauri.conf.json`. +pub const URL_ENV: &str = "TUGBOAT_UPDATE_URL"; +/// Debug builds only: use this public key instead of the one in `tauri.conf.json`. +pub const KEY_ENV: &str = "TUGBOAT_UPDATE_PUBKEY"; +/// Whether the two variables above are read at all: debug builds only. +pub const OVERRIDES_ALLOWED: bool = cfg!(debug_assertions); + +/// Core setting key (local to this PC, never synced): "false" = checks off. Missing = on. +pub const SETTING_KEY: &str = "check_updates"; +/// Core setting key: unix seconds of the last check that went out. +pub const LAST_CHECK_KEY: &str = "update_last_check"; +/// Core setting key: the version a check found and downloaded, kept until it is installed or gone. After a restart +/// the update is fetched and verified again soon after start, so a declined prompt is not forgotten for a day. +pub const FOUND_KEY: &str = "update_found"; +/// Core setting key: set just before an install starts from the window or the tray. The installer restarts the +/// app with the arguments of the running one (including `--minimized` after a start with Windows), so the next +/// start shows the window regardless. +pub const SHOW_AFTER_KEY: &str = "show_after_update"; + +/// No check in the first two minutes after start (measured on the monotonic clock, not the wall clock). +pub const WARMUP: Duration = Duration::from_secs(120); +/// A check at most this often (and at least this often while the app runs). +pub const DAILY_SECS: i64 = 24 * 60 * 60; +/// A peer's refusal brings the next check forward, but never within this long of the last one. +pub const REFUSAL_GAP_SECS: i64 = 60 * 60; +/// How often the schedule looks at the clock. No request goes out unless `decide` says so. +pub const TICK: Duration = Duration::from_secs(60); +/// The `latest.json` request. +pub const CHECK_TIMEOUT: Duration = Duration::from_secs(30); +/// The installer download, start to finish. +pub const DOWNLOAD_TIMEOUT: Duration = Duration::from_secs(30 * 60); + +/// What the webview is told when a verified update is waiting. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, TS)] +pub struct UpdateReady { + pub version: String, +} + +// ---------- pure rules ---------- + +/// A key the plugin can use: not empty and not the placeholder. +pub fn key_usable(key: &str) -> bool { + let k = key.trim(); + !k.is_empty() && k != PLACEHOLDER_PUBKEY +} + +#[derive(Debug, Default, Clone, PartialEq, Eq)] +pub struct Overrides { + pub url: Option, + pub pubkey: Option, +} + +/// The test overrides from an environment lookup. `allowed` false (a release build) never even asks the environment. +pub fn overrides(allowed: bool, env: &dyn Fn(&str) -> Option) -> Overrides { + if !allowed { + return Overrides::default(); + } + let get = |k: &str| env(k).map(|v| v.trim().to_string()).filter(|v| !v.is_empty()); + Overrides { url: get(URL_ENV), pubkey: get(KEY_ENV) } +} + +pub fn overrides_from_env() -> Overrides { + overrides(OVERRIDES_ALLOWED, &|k| std::env::var(k).ok()) +} + +/// Strictly newer. Equal, lower and unreadable versions are never installed. +pub fn is_newer(current: &str, offered: &str) -> bool { + let parse = |v: &str| semver::Version::parse(v.trim().trim_start_matches('v')).ok(); + match (parse(current), parse(offered)) { + (Some(c), Some(o)) => o > c, + _ => false, + } +} + +const PC_UPDATE_TEXT: &str = "Update Tugboat on the PC"; + +fn refuses_old_pc(message: Option<&str>) -> bool { + message.is_some_and(|m| m.trim().starts_with(PC_UPDATE_TEXT)) +} + +/// A linked device refused this PC because the PC is the older side. ("Update Tugboat on the phone" means the +/// other side must update: a newer PC would not help.) +pub fn needs_pc_update(s: &SyncStatus) -> bool { + (s.state == SyncState::Refused && refuses_old_pc(s.message.as_deref())) || s.devices.iter().any(|d| d.state == SyncState::Refused && refuses_old_pc(d.message.as_deref())) +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Inputs { + /// A usable public key (see `key_usable`). + pub key_ok: bool, + /// TUGBOAT_PROFILE is set: a QA run. + pub qa_profile: bool, + /// A debug-build endpoint override is set. + pub override_url: bool, + /// The Settings switch. + pub enabled: bool, + /// A verified update is already waiting. + pub update_ready: bool, + /// Unix seconds. + pub now: i64, + /// The warm-up after start is over. + pub warmup_over: bool, + pub last_check: Option, + /// An update was found before the last restart and has not been fetched again yet. + pub found_pending: bool, + /// A device refused this PC as the older side and no check has answered it yet. + pub refusal_hint: bool, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Skip { + NoKey, + QaProfile, + Off, + UpdateReady, + Warmup, + NotDue, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Why { + Daily, + Refused, + /// An update was found before the last restart. + Found, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Decision { + Skip(Skip), + Check(Why), +} + +/// Should a check go out now? The one place the schedule is decided. +pub fn decide(i: &Inputs) -> Decision { + if !i.key_ok { + return Decision::Skip(Skip::NoKey); + } + if i.qa_profile && !i.override_url { + return Decision::Skip(Skip::QaProfile); + } + if !i.enabled { + return Decision::Skip(Skip::Off); + } + if i.update_ready { + return Decision::Skip(Skip::UpdateReady); + } + // A time in the future (the clock was set back) counts as long ago: the next check re-stamps it. + let waited = |secs: i64| i.last_check.is_none_or(|t| t > i.now || i.now - t >= secs); + if i.refusal_hint && waited(REFUSAL_GAP_SECS) { + return Decision::Check(Why::Refused); + } + if !i.warmup_over { + return Decision::Skip(Skip::Warmup); + } + if i.found_pending { + return Decision::Check(Why::Found); + } + if waited(DAILY_SECS) { + Decision::Check(Why::Daily) + } else { + Decision::Skip(Skip::NotDue) + } +} + +pub fn now_secs() -> i64 { + SystemTime::now().duration_since(UNIX_EPOCH).map_or(0, |d| i64::try_from(d.as_secs()).unwrap_or(i64::MAX)) +} + +/// Whether a missing-information line (see `Failure::NoRelease`) is new today. `last_day` is the day number of the +/// last line written in this run of failures, -1 when the last check did not fail that way. +pub fn no_release_is_news(last_day: i64, now: i64) -> bool { + last_day != now.div_euclid(DAILY_SECS) +} + +/// Whether the window opens at start. A start with `--minimized` (Windows autostart) stays in the tray, except right +/// after an update: the person who clicked Install expects to see the app come back. +pub fn show_window_at_start(minimized: bool, after_update: bool) -> bool { + !minimized || after_update +} + +/// Run `work`, but give up at once (dropping it, which stops a request or download in flight) when the switch goes +/// off, and drop its result when the switch went off while it ran. `None` = stopped. `off` is notified by +/// `Updates::set_enabled(false)`. +pub async fn until_off(off: &Notify, enabled: impl Fn() -> bool, work: impl Future) -> Option { + // Registered before the switch is read, so a switch-off between the two cannot be missed. + let notified = off.notified(); + tokio::pin!(notified); + notified.as_mut().enable(); + if !enabled() { + return None; + } + tokio::select! { + out = work => enabled().then_some(out), + () = &mut notified => None, + } +} + +/// Tray menu text for a waiting update. +pub fn tray_item_text(version: &str) -> String { + format!("Install update {version}") +} + +// ---------- failures ---------- + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Stage { + Check, + Download, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Failure { + /// The endpoint has no usable answer (404 before the first release carries `latest.json`, or an error status). + NoRelease, + Offline, + Timeout, + /// The server answered the download with an error status. + Server, + /// The signature or the version it was signed for did not match, or the file is not an installer. + Rejected, + Other, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Failed { + pub stage: Stage, + pub kind: Failure, +} + +impl fmt::Display for Failed { + /// One line for the log: no address, no file name. + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let what = match self.stage { + Stage::Check => "update check", + Stage::Download => "update download", + }; + match self.kind { + Failure::NoRelease => write!(f, "{what}: no update information (not published, or the server refused the request)"), + Failure::Offline => write!(f, "{what} failed: no connection"), + Failure::Timeout => write!(f, "{what} failed: timed out"), + Failure::Server => write!(f, "{what} failed: the server answered with an error"), + Failure::Rejected => write!(f, "{what} rejected: the signature or the file did not check out"), + Failure::Other => write!(f, "{what} failed: unexpected error"), + } + } +} + +pub fn classify(e: &tauri_plugin_updater::Error) -> Failure { + use tauri_plugin_updater::Error as E; + match e { + E::ReleaseNotFound => Failure::NoRelease, + E::Reqwest(r) if r.is_timeout() => Failure::Timeout, + E::Reqwest(r) if r.is_connect() => Failure::Offline, + E::Network(_) => Failure::Server, + E::Minisign(_) | E::Base64(_) | E::SignatureUtf8(_) | E::SignedVersionMismatch { .. } | E::MissingSignedVersion | E::InvalidUpdaterFormat => Failure::Rejected, + _ => Failure::Other, + } +} + +/// The installer did not start because the user said no to the Windows administrator prompt (ShellExecute reports +/// that as "access denied"). +pub fn is_declined(e: &tauri_plugin_updater::Error) -> bool { + use tauri_plugin_updater::Error as E; + matches!(e, E::Io(io) if io.kind() == std::io::ErrorKind::PermissionDenied || matches!(io.raw_os_error(), Some(5 | 1223))) +} + +// ---------- check, download, verify ---------- + +/// A downloaded update whose signature checked out. +#[derive(Clone)] +pub struct Pending { + pub version: String, + update: Update, + bytes: Arc>, +} + +impl fmt::Debug for Pending { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Pending").field("version", &self.version).field("bytes", &self.bytes.len()).finish() + } +} + +#[derive(Debug)] +pub enum Checked { + /// The newest published version is not newer than this one. + NoUpdate, + Ready(Box), +} + +/// Runs just before the installer starts. +pub type BeforeExit = Arc; + +/// Ask the endpoint, and when it offers a strictly newer version, download it and verify the signature. Only a +/// verified download comes back as `Ready`. One attempt: the caller decides when to try again. +pub async fn fetch(app: &AppHandle, ov: &Overrides, before_exit: Option) -> Result { + let check = |kind: Failure| Failed { stage: Stage::Check, kind }; + // Always "strictly newer", whatever `allowDowngrades` says in the config. + let mut builder = app.updater_builder().timeout(CHECK_TIMEOUT).version_comparator(|current, release| release.version > current); + if let Some(raw) = &ov.url { + let endpoint = match raw.parse() { + Ok(u) => u, + Err(_) => return Err(check(Failure::Other)), + }; + builder = builder.endpoints(vec![endpoint]).map_err(|e| check(classify(&e)))?; + } + if let Some(key) = &ov.pubkey { + builder = builder.pubkey(key.clone()); + } + if let Some(hook) = before_exit { + builder = builder.on_before_exit(move || hook()); + } + let updater = builder.build().map_err(|e| check(classify(&e)))?; + let mut update = match updater.check().await { + Ok(Some(u)) => u, + Ok(None) => return Ok(Checked::NoUpdate), + Err(e) => return Err(check(classify(&e))), + }; + // The plugin applied the same rule; this one stands on its own. + if !is_newer(&update.current_version, &update.version) { + return Ok(Checked::NoUpdate); + } + update.timeout = Some(DOWNLOAD_TIMEOUT); + // `download` verifies the signature against the public key and the version it was signed for. + let bytes = update.download(|_, _| {}, || {}).await.map_err(|e| Failed { stage: Stage::Download, kind: classify(&e) })?; + Ok(Checked::Ready(Box::new(Pending { version: update.version.clone(), update, bytes: Arc::new(bytes) }))) +} + +// ---------- state ---------- + +/// The managed update state. +pub struct Updates { + backend: Arc, + enabled: AtomicBool, + /// Unix seconds, 0 = never. + last_check: AtomicI64, + /// Monotonic: a clock set back after start must not stretch the warm-up. + started: Instant, + ready: Mutex>, + installing: AtomicBool, + /// The day number of the last "no update information" line, -1 after any other outcome: a run of the same + /// failure is logged once a day, not once a check. + no_release_day: AtomicI64, + /// An update was found before the last restart: fetch it again once the warm-up is over. + found_pending: AtomicBool, + /// Notified when the switch goes off, to stop a check or download in flight. + off: Notify, +} + +fn lock(m: &Mutex) -> std::sync::MutexGuard<'_, T> { + m.lock().unwrap_or_else(|e| e.into_inner()) +} + +/// Core has no delete: an empty value counts as not set. +fn clear_value(backend: &Backend, key: &str) { + if let Ok(Some(v)) = backend.core.get_value(key) { + if !v.trim().is_empty() { + if let Err(e) = backend.core.set_value(key, "") { + tracing::warn!("setting {key} not cleared: {e}"); + } + } + } +} + +/// True once after an install that was started from this app: clears the mark, so only the one start shows the window. +pub fn take_show_after_update(backend: &Backend) -> bool { + let set = matches!(backend.core.get_value(SHOW_AFTER_KEY), Ok(Some(v)) if !v.trim().is_empty()); + if set { + clear_value(backend, SHOW_AFTER_KEY); + tracing::info!("started after an update: showing the window"); + } + set +} + +impl Updates { + /// Reads the switch, the last check time and the version found before the last restart from Core's local + /// settings. `current_version` is the running version. + pub fn new(backend: Arc, current_version: &str) -> Updates { + let enabled = match backend.core.get_value(SETTING_KEY) { + Ok(v) => v.as_deref().map(str::trim) != Some("false"), + Err(e) => { + tracing::warn!("update setting not read, checks stay on: {e}"); + true + } + }; + let last = match backend.core.get_value(LAST_CHECK_KEY) { + Ok(v) => v.and_then(|t| t.trim().parse::().ok()).unwrap_or(0), + Err(e) => { + tracing::warn!("last update check time not read: {e}"); + 0 + } + }; + let found = match backend.core.get_value(FOUND_KEY) { + Ok(v) => v.map(|s| s.trim().to_string()).filter(|s| !s.is_empty()), + Err(e) => { + tracing::warn!("found update not read: {e}"); + None + } + }; + // An update that is no longer newer (installed by hand since) is forgotten. + let found_pending = found.as_deref().is_some_and(|v| is_newer(current_version, v)); + if found.is_some() && !found_pending { + clear_value(&backend, FOUND_KEY); + } + Updates { + backend, + enabled: AtomicBool::new(enabled), + last_check: AtomicI64::new(last), + started: Instant::now(), + ready: Mutex::new(None), + installing: AtomicBool::new(false), + no_release_day: AtomicI64::new(-1), + found_pending: AtomicBool::new(found_pending), + off: Notify::new(), + } + } + + /// An update found before the last restart is waiting to be fetched again. + pub fn found_pending(&self) -> bool { + self.found_pending.load(Ordering::SeqCst) + } + + pub fn enabled(&self) -> bool { + self.enabled.load(Ordering::SeqCst) + } + + pub fn set_enabled(&self, on: bool) -> CmdResult<()> { + self.backend.core.set_value(SETTING_KEY, if on { "true" } else { "false" })?; + self.enabled.store(on, Ordering::SeqCst); + if !on { + self.off.notify_waiters(); + } + tracing::info!("update check switched {}", if on { "on" } else { "off" }); + Ok(()) + } + + /// Unix seconds of the last check that went out, if any. + pub fn last_check(&self) -> Option { + let t = self.last_check.load(Ordering::SeqCst); + (t > 0).then_some(t) + } + + pub fn ready(&self) -> Option { + lock(&self.ready).as_ref().map(|p| UpdateReady { version: p.version.clone() }) + } + + fn inputs(&self, key_ok: bool, override_url: bool) -> Inputs { + Inputs { + key_ok, + qa_profile: self.backend.paths_profile_active(), + override_url, + enabled: self.enabled(), + update_ready: lock(&self.ready).is_some(), + now: now_secs(), + warmup_over: self.started.elapsed() >= WARMUP, + last_check: self.last_check(), + found_pending: self.found_pending(), + refusal_hint: self.backend.update_hint(), + } + } + + fn stamp(&self, now: i64) { + self.last_check.store(now, Ordering::SeqCst); + if let Err(e) = self.backend.core.set_value(LAST_CHECK_KEY, &now.to_string()) { + // The next start would check again: one extra request, never a stuck update. + tracing::warn!("last update check time not saved: {e}"); + } + } + + /// One scheduled or hinted check, start to finish. Every outcome ends in one log line. + async fn run_check(&self, app: &AppHandle, ov: &Overrides, why: Why) { + self.stamp(now_secs()); + self.backend.clear_update_hint(); + self.found_pending.store(false, Ordering::SeqCst); + match why { + Why::Daily => tracing::info!("update check: daily check"), + Why::Refused => tracing::info!("update check: a linked device needs a newer version here"), + Why::Found => tracing::info!("update check: an update was found before the last restart"), + } + // Switching the check off stops the request or the download at once and drops its result. + let Some(outcome) = until_off(&self.off, || self.enabled(), fetch(app, ov, Some(self.exit_hook(app)))).await else { + tracing::info!("update check stopped: switched off"); + return; + }; + match outcome { + Ok(Checked::NoUpdate) => { + self.no_release_day.store(-1, Ordering::SeqCst); + clear_value(&self.backend, FOUND_KEY); + tracing::info!("update check: this version is the newest"); + } + Ok(Checked::Ready(p)) => { + self.no_release_day.store(-1, Ordering::SeqCst); + tracing::info!("update check: version {} downloaded and verified", p.version); + let version = p.version.clone(); + if let Err(e) = self.backend.core.set_value(FOUND_KEY, &version) { + tracing::warn!("found update not saved: {e}"); + } + *lock(&self.ready) = Some(*p); + announce(app, &version); + } + Err(f) if f.kind == Failure::NoRelease => { + clear_value(&self.backend, FOUND_KEY); + if no_release_is_news(self.no_release_day.swap(now_secs().div_euclid(DAILY_SECS), Ordering::SeqCst), now_secs()) { + tracing::info!("{f}"); + } + } + Err(f) => { + self.no_release_day.store(-1, Ordering::SeqCst); + tracing::warn!("{f}"); + } + } + } + + /// Before the installer starts: hide the tray icon (the process exits right after, which would leave a dead icon + /// until the mouse passes over it) and stop sync. `install` undoes both if the installer does not start. + fn exit_hook(&self, app: &AppHandle) -> BeforeExit { + let backend = self.backend.clone(); + let app = app.clone(); + Arc::new(move || { + shell::set_tray_visible(&app, false); + tauri::async_runtime::block_on(backend.quiesce()); + }) + } +} + +fn announce(app: &AppHandle, version: &str) { + if let Err(e) = app.emit_to(MAIN, ev::UPDATE_READY, UpdateReady { version: version.to_string() }) { + tracing::warn!("update banner not delivered: {e}"); + } + shell::set_update_item(app, Some(version)); +} + +/// `plugins.updater.pubkey` from `tauri.conf.json`; empty when missing. +fn configured_pubkey(app: &AppHandle) -> String { + app.config().plugins.0.get("updater").and_then(|v| v.get("pubkey")).and_then(|v| v.as_str()).unwrap_or("").to_string() +} + +/// Make the update state and start the schedule. The state exists even when checks cannot run (placeholder key), so +/// the Settings switch and the commands always work. +pub fn start(app: &AppHandle, backend: Arc) -> Arc { + let ov = overrides_from_env(); + let key = ov.pubkey.clone().unwrap_or_else(|| configured_pubkey(app)); + let state = Arc::new(Updates::new(backend, &app.package_info().version.to_string())); + app.manage(state.clone()); + if !key_usable(&key) { + tracing::info!("update check off: this build has no update key"); + return state; + } + let (app, st) = (app.clone(), state.clone()); + tauri::async_runtime::spawn(async move { + loop { + tokio::time::sleep(TICK).await; + if let Decision::Check(why) = decide(&st.inputs(true, ov.url.is_some())) { + st.run_check(&app, &ov, why).await; + } + } + }); + state +} + +// ---------- install ---------- + +/// Install the waiting update. Blocking: call off the UI thread. +/// +/// On Windows the plugin writes the installer to a temp folder, runs `before_exit` (hide the tray, stop sync), starts +/// the installer in passive mode through ShellExecute (Windows asks for administrator rights: the install is per +/// machine) and, once it started, exits this process with code 0; the installer restarts the app when it is done. +/// So a call that returns means the installer did not start. `Ok(false)`: the user said no to the Windows prompt, +/// nothing changed and the update stays waiting. Any other failure is an error for the UI. +pub fn install(app: &AppHandle, st: &Updates) -> CmdResult { + let Some(p) = lock(&st.ready).clone() else { + return Err(CmdError::new("update", "NO UPDATE READY")); + }; + if st.installing.swap(true, Ordering::SeqCst) { + return Ok(true); // the Windows prompt from the first click is still open + } + tracing::info!("update install: starting version {}", p.version); + // The installer restarts the app with this run's arguments (--minimized after a start with Windows): mark that + // the next start shows the window. A call that returns means no installer started, so the mark goes again. + if let Err(e) = st.backend.core.set_value(SHOW_AFTER_KEY, "1") { + tracing::warn!("restart mark not saved: {e}"); + } + let result = p.update.install(&p.bytes[..]); + clear_value(&st.backend, SHOW_AFTER_KEY); + st.installing.store(false, Ordering::SeqCst); + // Only here when the installer did not start: put back what the hook stopped. + tauri::async_runtime::block_on(st.backend.resume()); + shell::set_tray_visible(app, true); + match result { + Ok(()) => Ok(true), + Err(e) if is_declined(&e) => { + tracing::info!("update install: Windows did not allow the installer to start"); + Ok(false) + } + Err(e) => { + tracing::warn!("update install failed: {}", Failed { stage: Stage::Download, kind: classify(&e) }); + Err(CmdError::new("update", "UPDATE NOT INSTALLED - the installer did not start")) + } + } +} + +/// The tray item. Errors have no window to land in: show it, then tell it. +pub fn install_from_tray(app: &AppHandle) { + let app = app.clone(); + tauri::async_runtime::spawn_blocking(move || { + let Some(st) = app.try_state::>() else { return }; + if let Err(e) = install(&app, &st) { + shell::show_main(&app); + match serde_json::to_value(Event::Error { kind: e.kind, message: e.message }) { + Ok(v) => { + let _ = app.emit_to(MAIN, ev::CORE, v); + } + Err(err) => tracing::warn!("update error not delivered: {err}"), + } + } + }); +} + +#[cfg(test)] +mod tests { + use super::*; + use tugboat_core::events::DeviceStatus; + + const T0: i64 = 1_800_000_000; + + fn base() -> Inputs { + Inputs { key_ok: true, qa_profile: false, override_url: false, enabled: true, update_ready: false, now: T0 + 10_000, warmup_over: true, last_check: None, found_pending: false, refusal_hint: false } + } + + #[test] + fn a_never_checked_pc_checks_once_the_warmup_is_over() { + let mut i = base(); + i.warmup_over = false; + assert_eq!(decide(&i), Decision::Skip(Skip::Warmup), "never in the first two minutes"); + i.warmup_over = true; + assert_eq!(decide(&i), Decision::Check(Why::Daily)); + } + + #[test] + fn the_warmup_is_not_measured_on_the_wall_clock() { + // A start with the clock hours ahead that is then set back: the wall clock says "negative time since start", + // the check still runs once the real two minutes are over. + let mut i = base(); + i.now = T0 - 6 * 3600; + i.last_check = None; + assert_eq!(decide(&i), Decision::Check(Why::Daily)); + assert_eq!(WARMUP, Duration::from_secs(120)); + } + + #[test] + fn an_update_found_before_a_restart_is_fetched_again_once_the_warmup_is_over() { + let mut i = base(); + i.found_pending = true; + i.last_check = Some(i.now - 3600); // checked an hour ago: not due by the daily rule + assert_eq!(decide(&i), Decision::Check(Why::Found)); + i.warmup_over = false; + assert_eq!(decide(&i), Decision::Skip(Skip::Warmup), "not before the warm-up"); + i.warmup_over = true; + i.enabled = false; + assert_eq!(decide(&i), Decision::Skip(Skip::Off), "never while the switch is off"); + i.enabled = true; + i.key_ok = false; + assert_eq!(decide(&i), Decision::Skip(Skip::NoKey)); + i.key_ok = true; + i.found_pending = false; + assert_eq!(decide(&i), Decision::Skip(Skip::NotDue), "without the mark an hour is not due"); + } + + #[test] + fn a_missing_information_line_is_written_once_a_day() { + let now = 1_800_000_000; + assert!(no_release_is_news(-1, now), "first failure of a run"); + assert!(!no_release_is_news(now.div_euclid(DAILY_SECS), now + 60), "same day: silent"); + assert!(no_release_is_news(now.div_euclid(DAILY_SECS), now + DAILY_SECS), "next day: written again"); + } + + #[test] + fn a_start_from_autostart_stays_in_the_tray_except_right_after_an_update() { + assert!(show_window_at_start(false, false), "a normal start shows the window"); + assert!(!show_window_at_start(true, false), "start with Windows stays in the tray"); + assert!(show_window_at_start(true, true), "the installer restarted the app: show it"); + assert!(show_window_at_start(false, true)); + } + + #[tokio::test] + async fn switching_off_stops_the_work_at_once() { + let off = Arc::new(Notify::new()); + let on = Arc::new(AtomicBool::new(true)); + let (o, flag) = (off.clone(), on.clone()); + let flip = tokio::spawn(async move { + tokio::time::sleep(Duration::from_millis(50)).await; + flag.store(false, Ordering::SeqCst); + o.notify_waiters(); + }); + let started = Instant::now(); + let out = until_off(&off, || on.load(Ordering::SeqCst), std::future::pending::()).await; + flip.await.unwrap(); + assert_eq!(out, None); + assert!(started.elapsed() < Duration::from_secs(5), "did not wait for the work"); + } + + #[tokio::test] + async fn work_that_finishes_while_the_switch_is_on_keeps_its_result() { + let off = Notify::new(); + assert_eq!(until_off(&off, || true, async { 7 }).await, Some(7)); + } + + #[tokio::test] + async fn a_result_is_dropped_when_the_switch_went_off_before_or_during_the_work() { + let off = Notify::new(); + assert_eq!(until_off(&off, || false, async { 7 }).await, None, "already off: never started"); + // Off by the time the work is done, with no notification seen: still dropped. + let on = AtomicBool::new(true); + let out = until_off(&off, || on.load(Ordering::SeqCst), async { + on.store(false, Ordering::SeqCst); + 7 + }) + .await; + assert_eq!(out, None); + } + + #[test] + fn a_saved_check_time_keeps_restarts_to_one_check_a_day() { + let mut i = base(); + i.last_check = Some(i.now - DAILY_SECS + 1); + assert_eq!(decide(&i), Decision::Skip(Skip::NotDue), "a restart one second short of a day ago does not check"); + i.last_check = Some(i.now - DAILY_SECS); + assert_eq!(decide(&i), Decision::Check(Why::Daily)); + i.last_check = Some(i.now - 3 * DAILY_SECS); + assert_eq!(decide(&i), Decision::Check(Why::Daily)); + } + + #[test] + fn a_check_time_in_the_future_does_not_stall_the_schedule() { + let mut i = base(); + i.last_check = Some(i.now + 5 * DAILY_SECS); + assert_eq!(decide(&i), Decision::Check(Why::Daily)); + } + + #[test] + fn the_switch_off_the_placeholder_key_and_a_qa_profile_never_check() { + let mut i = base(); + i.enabled = false; + assert_eq!(decide(&i), Decision::Skip(Skip::Off)); + i.refusal_hint = true; + assert_eq!(decide(&i), Decision::Skip(Skip::Off), "a refusal does not override the switch"); + let mut i = base(); + i.key_ok = false; + assert_eq!(decide(&i), Decision::Skip(Skip::NoKey)); + i.enabled = false; + assert_eq!(decide(&i), Decision::Skip(Skip::NoKey), "no key is reported first"); + let mut i = base(); + i.qa_profile = true; + assert_eq!(decide(&i), Decision::Skip(Skip::QaProfile)); + i.refusal_hint = true; + assert_eq!(decide(&i), Decision::Skip(Skip::QaProfile)); + i.override_url = true; + assert_eq!(decide(&i), Decision::Check(Why::Refused), "a QA run with a test endpoint may check"); + i.refusal_hint = false; + assert_eq!(decide(&i), Decision::Check(Why::Daily)); + } + + #[test] + fn a_waiting_update_stops_further_checks() { + let mut i = base(); + i.update_ready = true; + assert_eq!(decide(&i), Decision::Skip(Skip::UpdateReady)); + } + + #[test] + fn a_refusal_brings_the_check_forward_but_at_most_once_an_hour() { + let mut i = base(); + i.refusal_hint = true; + i.warmup_over = false; // inside the warmup: a refusal does not wait for it + i.last_check = None; + assert_eq!(decide(&i), Decision::Check(Why::Refused)); + i.warmup_over = true; + i.last_check = Some(i.now - REFUSAL_GAP_SECS + 1); + assert_eq!(decide(&i), Decision::Skip(Skip::NotDue), "a check an hour less a second ago blocks it"); + i.last_check = Some(i.now - REFUSAL_GAP_SECS); + assert_eq!(decide(&i), Decision::Check(Why::Refused)); + // Without a refusal the same last check is not due. + i.refusal_hint = false; + assert_eq!(decide(&i), Decision::Skip(Skip::NotDue)); + } + + #[test] + fn only_a_strictly_newer_version_is_an_update() { + assert!(is_newer("0.3.0", "0.3.1")); + assert!(is_newer("0.3.0", "0.10.0"), "compared as numbers, not text"); + assert!(is_newer("0.3.0-rc.1", "0.3.0")); + assert!(is_newer("0.3.0", "v0.4.0")); + assert!(!is_newer("0.3.0", "0.3.0"), "equal is not an update"); + assert!(!is_newer("0.3.1", "0.3.0"), "a lower version is never installed"); + assert!(!is_newer("0.3.0", "0.3.0-rc.1")); + assert!(!is_newer("0.3.0", "latest")); + assert!(!is_newer("0.3.0", "")); + assert!(!is_newer("junk", "0.4.0")); + } + + #[test] + fn the_placeholder_and_an_empty_key_are_not_usable() { + assert!(!key_usable(PLACEHOLDER_PUBKEY)); + assert!(!key_usable(&format!(" {PLACEHOLDER_PUBKEY}\n"))); + assert!(!key_usable("")); + assert!(!key_usable(" ")); + assert!(key_usable("dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDEyMzQ=")); + } + + #[test] + fn a_release_build_never_asks_the_environment_for_the_test_overrides() { + let panics = |k: &str| -> Option { panic!("the environment was read for {k}") }; + assert_eq!(overrides(false, &panics), Overrides::default()); + // The real switch is the build profile: a release build compiles it to false. + assert_eq!(OVERRIDES_ALLOWED, cfg!(debug_assertions)); + #[cfg(not(debug_assertions))] + assert_eq!(overrides_from_env(), Overrides::default()); + } + + #[test] + fn a_debug_build_reads_both_overrides_and_trims_them() { + let env = |k: &str| match k { + URL_ENV => Some(" http://127.0.0.1:9/latest.json ".to_string()), + KEY_ENV => Some(" ".to_string()), + _ => None, + }; + let o = overrides(true, &env); + assert_eq!(o.url.as_deref(), Some("http://127.0.0.1:9/latest.json")); + assert_eq!(o.pubkey, None, "a blank value is no override"); + } + + fn device(state: SyncState, message: Option<&str>) -> DeviceStatus { + DeviceStatus { + id: "a".repeat(64), + name: "Pixel".into(), + state, + message: message.map(Into::into), + paired_at: None, + last_seen_at: None, + last_synced_at: None, + waiting: 0, + downloading: 0, + unlinking: false, + } + } + + fn status(state: SyncState, message: Option<&str>, devices: Vec) -> SyncStatus { + SyncStatus { state, peer_name: None, last_synced_at: None, waiting: 0, downloading: 0, storage_low: false, message: message.map(Into::into), devices } + } + + #[test] + fn only_a_refusal_that_says_this_pc_is_old_asks_for_a_check() { + assert!(needs_pc_update(&status(SyncState::Refused, Some("Update Tugboat on the PC"), vec![]))); + assert!(!needs_pc_update(&status(SyncState::Refused, Some("Update Tugboat on the phone"), vec![])), "the phone must update, not this PC"); + assert!(!needs_pc_update(&status(SyncState::Refused, Some("NOT PAIRED - pair the devices again"), vec![]))); + assert!(!needs_pc_update(&status(SyncState::Synced, Some("Update Tugboat on the PC"), vec![])), "only while refused"); + assert!(!needs_pc_update(&status(SyncState::Synced, None, vec![]))); + // With several linked devices the refusal can sit on one device row only. + let devices = vec![device(SyncState::Synced, None), device(SyncState::Refused, Some("Update Tugboat on the PC"))]; + assert!(needs_pc_update(&status(SyncState::Synced, None, devices))); + } + + #[test] + fn failure_lines_name_no_address_and_no_file() { + use tauri_plugin_updater::Error as E; + for (e, want) in [ + (E::ReleaseNotFound, Failure::NoRelease), + (E::Network("Download request failed with status: 404 Not Found".into()), Failure::Server), + (E::MissingSignedVersion, Failure::Rejected), + (E::SignedVersionMismatch { signed: "1.0.0".into(), announced: "2.0.0".into() }, Failure::Rejected), + (E::InvalidUpdaterFormat, Failure::Rejected), + (E::EmptyEndpoints, Failure::Other), + ] { + assert_eq!(classify(&e), want, "{e}"); + } + let none = Failed { stage: Stage::Check, kind: Failure::NoRelease }.to_string(); + assert!(none.contains("server refused"), "an error status looks like missing information: say both ({none})"); + for kind in [Failure::NoRelease, Failure::Offline, Failure::Timeout, Failure::Server, Failure::Rejected, Failure::Other] { + for stage in [Stage::Check, Stage::Download] { + let line = Failed { stage, kind }.to_string(); + assert!(!line.contains('\n') && !line.contains("http") && !line.contains(".json") && !line.contains(".exe"), "{line}"); + } + } + } + + #[test] + fn a_declined_windows_prompt_is_told_apart_from_a_real_failure() { + use tauri_plugin_updater::Error as E; + assert!(is_declined(&E::Io(std::io::Error::from_raw_os_error(5))), "ShellExecute: access denied"); + assert!(is_declined(&E::Io(std::io::Error::from_raw_os_error(1223))), "operation cancelled by the user"); + assert!(is_declined(&E::Io(std::io::Error::new(std::io::ErrorKind::PermissionDenied, "x")))); + assert!(!is_declined(&E::Io(std::io::Error::from_raw_os_error(2))), "file not found is a failure"); + assert!(!is_declined(&E::InvalidUpdaterFormat)); + } + + #[test] + fn the_tray_item_names_the_version() { + assert_eq!(tray_item_text("0.3.1"), "Install update 0.3.1"); + } + + #[test] + fn the_updater_is_configured_for_this_app() { + let conf: serde_json::Value = serde_json::from_str(include_str!("../tauri.conf.json")).unwrap(); + let up = &conf["plugins"]["updater"]; + assert_eq!(up["endpoints"], serde_json::json!(["https://github.com/Page011/LocalTugboat/releases/latest/download/latest.json"])); + assert_eq!(up["windows"]["installMode"], "passive"); + assert_eq!(up["requireSignedVersion"], true, "a manifest cannot pair a new version number with an old signed file"); + assert_eq!(conf["bundle"]["createUpdaterArtifacts"], true); + assert!(up["pubkey"].is_string()); + } + + /// The window can never call the plugin's own commands: only this module's wrappers, which check the caller. + #[test] + fn the_webview_has_no_permission_for_the_updater_plugin() { + let caps = include_str!("../capabilities/main.json"); + assert!(!caps.contains("updater"), "an updater permission in the main window's capability would let the page install anything the plugin accepts"); + } +} diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 5f6b9c4..645c09d 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -27,8 +27,17 @@ "csp": "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: http://snapthumb.localhost; connect-src ipc: http://ipc.localhost" } }, + "plugins": { + "updater": { + "pubkey": "UPDATER_PUBKEY_MISSING", + "endpoints": ["https://github.com/Page011/LocalTugboat/releases/latest/download/latest.json"], + "requireSignedVersion": true, + "windows": { "installMode": "passive" } + } + }, "bundle": { "active": true, + "createUpdaterArtifacts": true, "targets": ["nsis"], "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.ico"], "windows": { diff --git a/apps/desktop/src-tauri/tests/backend_e2e.rs b/apps/desktop/src-tauri/tests/backend_e2e.rs index 21a30a8..30fc930 100644 --- a/apps/desktop/src-tauri/tests/backend_e2e.rs +++ b/apps/desktop/src-tauri/tests/backend_e2e.rs @@ -23,6 +23,7 @@ use tugboat_desktop_lib::{ library::LibraryOptions, paths::Paths, tray::TrayState, + updates::{take_show_after_update, Updates, FOUND_KEY, LAST_CHECK_KEY, SETTING_KEY, SHOW_AFTER_KEY}, }; struct MemKeys(Mutex>); @@ -533,3 +534,97 @@ async fn delete_forever_of_a_file_still_in_the_library_leaves_nothing_to_import( ph.stop_network().await; be.shutdown().await; } + +// The update install stops the library thread and the network first and starts them again when the installer does +// not run (the user said no to the Windows prompt). The call comes from a blocking thread, as in the app. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn stopping_sync_for_an_update_install_is_undone_when_the_installer_does_not_start() { + let pc = start_pc().await; + let be = pc.be.clone(); + let tmp = tempfile::tempdir().unwrap(); + let ph = link_phone(&pc, tmp.path()).await; + + // resume without a quiesce does nothing. + let bind = be.app_info().bind; + be.resume().await; + assert_eq!(be.app_info().bind, bind); + assert_eq!(be.status().state, SyncState::Synced); + + let rt = tokio::runtime::Handle::current(); + let (b, r) = (be.clone(), rt.clone()); + tokio::task::spawn_blocking(move || { + r.block_on(b.quiesce()); + r.block_on(b.quiesce()); // twice is the same as once + }) + .await + .unwrap(); + until("the phone sees the PC go", 20, || ph.status().state != SyncState::Synced).await; + + let (b, r) = (be.clone(), rt); + tokio::task::spawn_blocking(move || r.block_on(b.resume())).await.unwrap(); + assert_eq!(be.app_info().network_error, None); + until("synced again", 40, || be.status().state == SyncState::Synced && ph.status().state == SyncState::Synced).await; + + // The library thread is back too: a file dropped into the folder reaches the phone. + std::fs::write(pc.root.join("after_quiesce.jpg"), jpeg(5, 2500)).unwrap(); + until("the phone received the file", 30, || ph.items(&ItemQuery { limit: 100, ..Default::default() }).unwrap().rows.iter().any(|r| r.name == "after_quiesce.jpg")).await; + + ph.stop_network().await; + be.shutdown().await; +} + +// The "Check for updates" switch and the last check time live in Core's local settings (this PC only): they survive +// a restart, the switch is on until it is turned off, and a stored value that is not "false" keeps it on. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn the_update_switch_and_the_last_check_time_are_kept_on_this_pc() { + let pc = start_pc().await; + let be = pc.be.clone(); + + let up = Updates::new(be.clone(), "0.3.0"); + assert!(up.enabled(), "on by default"); + assert_eq!(up.last_check(), None); + + up.set_enabled(false).unwrap(); + assert_eq!(be.core.get_value(SETTING_KEY).unwrap().as_deref(), Some("false")); + assert!(!Updates::new(be.clone(), "0.3.0").enabled(), "still off after a restart"); + // The Core Settings the phone also knows are untouched by it. + assert_eq!(be.settings().unwrap(), Settings { udp_port: be.settings().unwrap().udp_port, ..Settings::default() }); + + up.set_enabled(true).unwrap(); + assert!(Updates::new(be.clone(), "0.3.0").enabled()); + + be.core.set_value(SETTING_KEY, "garbage").unwrap(); + assert!(Updates::new(be.clone(), "0.3.0").enabled(), "only an explicit false turns it off"); + + be.core.set_value(LAST_CHECK_KEY, "1800000000").unwrap(); + assert_eq!(Updates::new(be.clone(), "0.3.0").last_check(), Some(1_800_000_000), "the saved time is read back after a restart"); + be.core.set_value(LAST_CHECK_KEY, "not a number").unwrap(); + assert_eq!(Updates::new(be.clone(), "0.3.0").last_check(), None, "an unreadable time means never checked"); + + be.shutdown().await; +} + +// A version found and downloaded before a restart is checked again soon after start, but only while it is still newer +// than the running version; the mark that makes the window show after an install is taken exactly once. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_found_update_survives_a_restart_and_the_window_mark_is_taken_once() { + let pc = start_pc().await; + let be = pc.be.clone(); + + assert!(!Updates::new(be.clone(), "0.3.0").found_pending(), "nothing found yet"); + be.core.set_value(FOUND_KEY, "0.4.0").unwrap(); + assert!(Updates::new(be.clone(), "0.3.0").found_pending(), "newer than the running version: fetch it again"); + assert!(Updates::new(be.clone(), "0.3.9").found_pending()); + // Installed by hand since (same or newer): forgotten, and the stored value is cleared. + assert!(!Updates::new(be.clone(), "0.4.0").found_pending()); + assert_eq!(be.core.get_value(FOUND_KEY).unwrap().as_deref().map(str::trim), Some("")); + be.core.set_value(FOUND_KEY, "junk").unwrap(); + assert!(!Updates::new(be.clone(), "0.3.0").found_pending(), "an unreadable version is never fetched"); + + assert!(!take_show_after_update(&be), "no mark: a start with Windows stays in the tray"); + be.core.set_value(SHOW_AFTER_KEY, "1").unwrap(); + assert!(take_show_after_update(&be), "the start after an install shows the window"); + assert!(!take_show_after_update(&be), "only that one start"); + + be.shutdown().await; +} diff --git a/apps/desktop/src-tauri/tests/updater_flow.rs b/apps/desktop/src-tauri/tests/updater_flow.rs new file mode 100644 index 0000000..e7156cc --- /dev/null +++ b/apps/desktop/src-tauri/tests/updater_flow.rs @@ -0,0 +1,253 @@ +//! The update check, download and signature check against a local server on 127.0.0.1 (nothing leaves the PC), +//! through the real updater plugin on Tauri's mock runtime. The installer itself is never started. +//! +//! The key pairs are throwaway ones made for these tests (the private halves were discarded). `SIGNATURE` signs +//! `PAYLOAD` for version 0.4.0 under `PUBKEY`; it was made by `tauri signer sign --app-version 0.4.0`, the same +//! signer a release build uses. +//! +//! One test, `the_real_endpoint_answers`, goes to the internet and is ignored by default: +//! `cargo test -p tugboat-desktop --test updater_flow -- --ignored`. + +#![cfg(all(windows, target_arch = "x86_64"))] + +use std::{ + collections::HashMap, + io::{Read, Write}, + net::{TcpListener, TcpStream}, + sync::{Arc, Mutex}, + thread, +}; + +use serde_json::json; +use tauri::test::{mock_builder, mock_context, noop_assets, MockRuntime}; +use tugboat_desktop_lib::updates::{fetch, Checked, Failed, Failure, Overrides, Stage}; + +const PUBKEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEQyM0ExMDlDM0RENjYyMjYKUldRbVl0WTluQkE2MHBHSWZiK0lwY3gzRVpkQVVPNzkyU3ZKMXBvV0dUY0QwSDFoQUVOV1V2S1oK"; +const OTHER_PUBKEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDk1RjZBNUFCRERCNjAxRDIKUldUU0FiYmRxNlgybFNnS3VldWU0NXhhRmxZQ1Rodjk3K1JQVytBdm1HcEVkN0ZRcW5CMXd4K2gK"; +const PAYLOAD: &[u8] = b"Not a real installer: bytes for the updater signature test."; +const SIGNATURE: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbVl0WTluQkE2MHVvZGtISU5WQXQrS2QwbUZiSWwwRElGc0dWTVE4OTF6RHVUdm9JNTlRV3hnallFY2ZRWUVhT1BuVjlZUElpdVdFT29zWncxN2RZOEZyTXJWMGpHbmdVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1NDcwMDcwCWZpbGU6cGF5bG9hZC5iaW4JdmVyc2lvbjowLjQuMApDWUVjbVFHRHhtV3cvbUoxMVNNc1ArRmZic0JWcCs2dDQxcE1ZRVR3RWR1UEtYSFY0eE1UOEVoQ0hxcHRwc3A2YkVFU1NyMXhSaTFoVnArQTRsTnJEZz09Cg=="; +/// The installer is published under a different name than the one the signature's comment records. +const INSTALLER_PATH: &str = "/LocalTugboat_0.4.0_x64-setup.exe"; + +type Routes = HashMap)>; + +struct Server { + port: u16, + hits: Arc>>, +} + +impl Server { + fn url(&self, path: &str) -> String { + format!("http://127.0.0.1:{}{path}", self.port) + } + + fn hits(&self) -> Vec { + self.hits.lock().unwrap().clone() + } +} + +fn answer(mut s: TcpStream, routes: &Routes, hits: &Mutex>) { + let mut buf = [0u8; 4096]; + let mut seen = Vec::new(); + while !seen.windows(4).any(|w| w == b"\r\n\r\n") { + match s.read(&mut buf) { + Ok(0) | Err(_) => return, + Ok(n) => seen.extend_from_slice(&buf[..n]), + } + } + let line = String::from_utf8_lossy(&seen).lines().next().unwrap_or("").to_string(); + let path = line.split_whitespace().nth(1).unwrap_or("/").to_string(); + hits.lock().unwrap().push(path.clone()); + let (status, body) = routes.get(&path).cloned().unwrap_or((404, b"not found".to_vec())); + let head = format!("HTTP/1.1 {status} X\r\nContent-Length: {}\r\nContent-Type: application/octet-stream\r\nConnection: close\r\n\r\n", body.len()); + let _ = s.write_all(head.as_bytes()); + let _ = s.write_all(&body); +} + +/// Bind first (the manifest needs the port), then serve `routes(port)` until the test process ends. +fn serve(routes: impl FnOnce(u16) -> Routes) -> Server { + let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + let port = listener.local_addr().unwrap().port(); + let routes = Arc::new(routes(port)); + let hits = Arc::new(Mutex::new(Vec::new())); + let h = hits.clone(); + thread::spawn(move || { + for stream in listener.incoming().flatten() { + let (routes, hits) = (routes.clone(), h.clone()); + thread::spawn(move || answer(stream, &routes, &hits)); + } + }); + Server { port, hits } +} + +fn manifest(version: &str, port: u16) -> Vec { + json!({ + "version": version, + "notes": "test", + "pub_date": "2026-11-24T10:00:00Z", + "platforms": { "windows-x86_64": { "signature": SIGNATURE, "url": format!("http://127.0.0.1:{port}{INSTALLER_PATH}") } } + }) + .to_string() + .into_bytes() +} + +/// A normal release: `latest.json` announcing `version`, and the installer. +fn release(version: &'static str, installer: Vec) -> Server { + serve(move |port| { + let mut r = Routes::new(); + r.insert("/latest.json".into(), (200, manifest(version, port))); + r.insert(INSTALLER_PATH.into(), (200, installer)); + r + }) +} + +/// A mock app running this version with the updater plugin configured like `tauri.conf.json`. +fn app(current: &str, endpoint: Option<&str>) -> tauri::App { + let mut ctx = mock_context(noop_assets()); + ctx.package_info_mut().version = current.parse().expect("test version"); + ctx.config_mut().plugins.0.insert( + "updater".into(), + json!({ + "pubkey": PUBKEY, + "endpoints": endpoint.map(|e| vec![e.to_string()]).unwrap_or_default(), + "requireSignedVersion": true, + "dangerousInsecureTransportProtocol": true, + "windows": { "installMode": "passive" } + }), + ); + mock_builder().plugin(tauri_plugin_updater::Builder::new().build()).build(ctx).expect("mock app") +} + +fn ov(s: &Server) -> Overrides { + Overrides { url: Some(s.url("/latest.json")), pubkey: None } +} + +fn run(app: &tauri::App, o: &Overrides) -> Result { + tauri::async_runtime::block_on(fetch(app.handle(), o, None)) +} + +#[test] +fn a_newer_signed_release_is_downloaded_and_verified() { + let s = release("0.4.0", PAYLOAD.to_vec()); + match run(&app("0.3.0", None), &ov(&s)) { + Ok(Checked::Ready(p)) => assert_eq!(p.version, "0.4.0"), + other => panic!("expected a verified update, got {other:?}"), + } + assert_eq!(s.hits(), ["/latest.json", INSTALLER_PATH]); +} + +/// Minisign signs the file's bytes. The name in the signature's trusted comment (`payload.bin`) is only text, so +/// the installer can be renamed after signing (the release workflow renames it) without breaking the signature. +#[test] +fn renaming_the_installer_after_signing_does_not_break_the_signature() { + let sig = String::from_utf8(base64_decode(SIGNATURE)).unwrap(); + assert!(sig.contains("file:payload.bin"), "the signed comment names another file than the one published"); + assert!(!INSTALLER_PATH.contains("payload.bin")); + let s = release("0.4.0", PAYLOAD.to_vec()); + assert!(matches!(run(&app("0.3.0", None), &ov(&s)), Ok(Checked::Ready(_)))); +} + +fn base64_decode(s: &str) -> Vec { + const ALPHABET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + let mut out = Vec::new(); + let (mut acc, mut bits) = (0u32, 0u32); + for c in s.bytes().filter(|c| *c != b'=') { + acc = (acc << 6) | ALPHABET.iter().position(|a| *a == c).expect("base64") as u32; + bits += 6; + if bits >= 8 { + bits -= 8; + out.push((acc >> bits) as u8); + acc &= (1 << bits) - 1; + } + } + out +} + +#[test] +fn the_same_or_an_older_version_is_never_downloaded() { + for offered in ["0.3.0", "0.2.9", "0.1.0"] { + let s = release(offered, PAYLOAD.to_vec()); + let r = run(&app("0.3.0", None), &ov(&s)); + assert!(matches!(r, Ok(Checked::NoUpdate)), "offered {offered}: {r:?}"); + assert_eq!(s.hits(), ["/latest.json"], "offered {offered}: the installer was requested"); + } +} + +#[test] +fn a_changed_download_is_rejected() { + let mut bad = PAYLOAD.to_vec(); + bad[0] ^= 1; + let s = release("0.4.0", bad); + let e = run(&app("0.3.0", None), &ov(&s)).unwrap_err(); + assert_eq!(e, Failed { stage: Stage::Download, kind: Failure::Rejected }); +} + +#[test] +fn a_signature_from_another_key_is_rejected() { + let s = release("0.4.0", PAYLOAD.to_vec()); + let o = Overrides { pubkey: Some(OTHER_PUBKEY.into()), ..ov(&s) }; + let e = run(&app("0.3.0", None), &o).unwrap_err(); + assert_eq!(e, Failed { stage: Stage::Download, kind: Failure::Rejected }); +} + +/// The manifest is not signed: it must not be able to pair a newer version number with an older signed file. +#[test] +fn a_manifest_that_announces_another_version_than_the_signed_one_is_rejected() { + let s = release("0.5.0", PAYLOAD.to_vec()); + let e = run(&app("0.3.0", None), &ov(&s)).unwrap_err(); + assert_eq!(e, Failed { stage: Stage::Download, kind: Failure::Rejected }); +} + +#[test] +fn a_404_for_the_manifest_means_nothing_is_published_yet() { + let s = serve(|_| Routes::new()); + let e = run(&app("0.3.0", None), &ov(&s)).unwrap_err(); + assert_eq!(e, Failed { stage: Stage::Check, kind: Failure::NoRelease }); + assert_eq!(s.hits(), ["/latest.json"], "one request, no retry loop"); +} + +#[test] +fn a_download_that_fails_is_a_server_failure() { + let s = serve(|port| { + let mut r = Routes::new(); + r.insert("/latest.json".into(), (200, manifest("0.4.0", port))); + r.insert(INSTALLER_PATH.into(), (500, b"oops".to_vec())); + r + }); + let e = run(&app("0.3.0", None), &ov(&s)).unwrap_err(); + assert_eq!(e, Failed { stage: Stage::Download, kind: Failure::Server }); +} + +#[test] +fn nothing_listening_is_offline() { + // A port that was just free and has no listener: the connection is refused. + let port = TcpListener::bind("127.0.0.1:0").unwrap().local_addr().unwrap().port(); + let o = Overrides { url: Some(format!("http://127.0.0.1:{port}/latest.json")), pubkey: None }; + let e = run(&app("0.3.0", None), &o).unwrap_err(); + assert_eq!(e, Failed { stage: Stage::Check, kind: Failure::Offline }); +} + +#[test] +fn a_malformed_manifest_is_a_failure_not_an_update() { + let s = serve(|_| { + let mut r = Routes::new(); + r.insert("/latest.json".into(), (200, b"{\"version\": \"not a version\"}".to_vec())); + r + }); + assert!(run(&app("0.3.0", None), &ov(&s)).is_err()); +} + +/// Real HTTPS to GitHub, endpoint from the plugin config (no override). Until a release carries `latest.json` the +/// answer is a 404, which is "no update information", not a failure. Run on a normal PC and behind a company proxy +/// that re-signs HTTPS: the Windows certificate store decides, not a bundled list of roots. +#[test] +#[ignore = "needs the internet"] +fn the_real_endpoint_answers() { + let endpoint = "https://github.com/Page011/LocalTugboat/releases/latest/download/latest.json"; + let r = run(&app("0.0.1", Some(endpoint)), &Overrides::default()); + println!("real endpoint: {r:?}"); + match r { + Err(Failed { kind: Failure::NoRelease, .. }) | Ok(_) => {} + Err(e) => panic!("the real endpoint did not answer cleanly: {e}"), + } +} diff --git a/apps/desktop/src/lib/Banners.svelte b/apps/desktop/src/lib/Banners.svelte index 634105d..ad9aca2 100644 --- a/apps/desktop/src/lib/Banners.svelte +++ b/apps/desktop/src/lib/Banners.svelte @@ -1,13 +1,14 @@