-
Notifications
You must be signed in to change notification settings - Fork 267
Add Linux support #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux support #528
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,23 +17,46 @@ jobs: | |
| include: | ||
| - platform: macos-latest | ||
| args: "--target aarch64-apple-darwin" | ||
| rust_targets: "aarch64-apple-darwin" | ||
| - platform: macos-latest | ||
| args: "--target x86_64-apple-darwin" | ||
| rust_targets: "x86_64-apple-darwin" | ||
| - platform: ubuntu-22.04 | ||
| args: "" | ||
| rust_targets: "x86_64-unknown-linux-gnu" | ||
| runs-on: ${{ matrix.platform }} | ||
| env: | ||
| RELEASE_TAG: ${{ github.ref_name }} | ||
| # GitHub runners lack FUSE; make linuxdeploy/AppImage tooling extract-and-run. | ||
| APPIMAGE_EXTRACT_AND_RUN: 1 | ||
| # Whether Apple code-signing secrets are configured (forks usually have none). | ||
| # When false the macOS job builds an unsigned app instead of failing. | ||
| HAS_APPLE_CERT: ${{ secrets.APPLE_CERTIFICATE != '' }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ env.RELEASE_TAG }} | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: aarch64-apple-darwin,x86_64-apple-darwin | ||
| targets: ${{ matrix.rust_targets }} | ||
| - uses: swatinem/rust-cache@v2 | ||
|
Comment on lines
36
to
43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify unpinned actions and checkout credential persistence in publish workflow.
rg -n '^\s*-\s*uses:\s*.+@(?!(?:[a-f0-9]{40})$).*' .github/workflows/publish.yml
rg -n -C2 'actions/checkout@' .github/workflows/publish.yml
rg -n 'persist-credentials:\s*false' .github/workflows/publish.ymlRepository: robinebers/openusage Length of output: 520 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/publish.yml"
echo "== publish.yml summary (first 220 lines) =="
nl -ba "$FILE" | sed -n '1,220p'
echo "== All uses: lines with line numbers =="
rg -n '^\s*-\s*uses:\s*' "$FILE"
echo "== uses refs that are tags (not 40-hex SHA) (PCRE2) =="
rg --pcre2 -n '^\s*-\s*uses:\s*([^@]+)@(?!(?:[A-Fa-f0-9]{40})$).*$' "$FILE" || true
echo "== Checkout steps blocks (actions/checkout) with surrounding context =="
rg -n -C3 'actions/checkout@' "$FILE" || true
echo "== persist-credentials occurrences =="
rg -n 'persist-credentials:' "$FILE" || trueRepository: robinebers/openusage Length of output: 169 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/publish.yml"
nl -ba "$FILE" | sed -n '1,220p'
echo "--- uses lines ---"
rg -n '^\s*-\s*uses:\s*' "$FILE"
echo "--- unpinned uses (not exactly 40 hex) ---"
rg --pcre2 -n '^\s*-\s*uses:\s*[^@]+@(?!(?:[A-Fa-f0-9]{40})$).*$' "$FILE" || true
echo "--- checkout blocks ---"
rg -n -C3 'actions/checkout@' "$FILE" || true
echo "--- persist-credentials occurrences ---"
rg -n 'persist-credentials:' "$FILE" || trueRepository: robinebers/openusage Length of output: 107 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/publish.yml"
echo "== publish.yml (with line numbers) =="
awk '{printf "%6d: %s\n", NR, $0}' "$FILE" | sed -n '1,220p'
echo "== All uses: lines with line numbers =="
awk '{if ($0 ~ /^[[:space:]]*-[[:space:]]uses:/) printf "%6d: %s\n", NR, $0}' "$FILE"
echo "== uses refs that are tags (not exactly 40-hex SHA) (PCRE2) =="
rg --pcre2 -n '^\s*-\s*uses:\s*([^@]+)@(?!(?:[A-Fa-f0-9]{40})$).*$' "$FILE" || true
echo "== checkout steps blocks (actions/checkout) with surrounding context (3 lines) =="
rg -n -C3 'uses:\s*actions/checkout@' "$FILE" || true
echo "== persist-credentials occurrences =="
rg -n 'persist-credentials:' "$FILE" || trueRepository: robinebers/openusage Length of output: 8601 Pin publish workflow actions to commit SHAs and set This release workflow uses mutable action tags and checkout does not disable credential persistence, leaving avoidable supply-chain and token exposure risk.
🧰 Tools🪛 zizmor (1.25.2)[warning] 36-38: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 36-36: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 40-40: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 43-43: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 43-43: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default (cache-poisoning) 🤖 Prompt for AI Agents |
||
| with: | ||
| workspaces: "./src-tauri -> target" | ||
|
|
||
| - name: Install Linux dependencies | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| libwebkit2gtk-4.1-dev \ | ||
| libgtk-3-dev \ | ||
| libayatana-appindicator3-dev \ | ||
| librsvg2-dev \ | ||
| patchelf \ | ||
| libsecret-1-dev \ | ||
| build-essential | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: "latest" | ||
|
|
@@ -80,11 +103,16 @@ jobs: | |
| exit 1 | ||
| fi | ||
|
|
||
| - name: Import Apple Developer Certificate | ||
| - name: Import Apple Developer Certificate & enable signing | ||
| if: runner.os == 'macOS' && env.HAS_APPLE_CERT == 'true' | ||
| env: | ||
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | ||
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | ||
| APPLE_ID: ${{ secrets.APPLE_ID }} | ||
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| run: | | ||
| echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 | ||
| security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | ||
|
|
@@ -94,21 +122,24 @@ jobs: | |
| security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign | ||
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain | ||
| rm certificate.p12 | ||
| # Only expose the Apple signing vars to tauri-action when a cert exists. | ||
| # If they are set but empty, Tauri tries to codesign with identity "" and fails; | ||
| # leaving them unset makes Tauri ad-hoc sign, which works for unsigned releases. | ||
| { | ||
| echo "APPLE_SIGNING_IDENTITY=$APPLE_SIGNING_IDENTITY" | ||
| echo "APPLE_ID=$APPLE_ID" | ||
| echo "APPLE_PASSWORD=$APPLE_PASSWORD" | ||
| echo "APPLE_TEAM_ID=$APPLE_TEAM_ID" | ||
| } >> "$GITHUB_ENV" | ||
|
|
||
| - uses: tauri-apps/tauri-action@v0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | ||
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | ||
|
|
||
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | ||
| APPLE_ID: ${{ secrets.APPLE_ID }} | ||
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
|
|
||
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
| # Apple signing vars are injected via $GITHUB_ENV by the step above, | ||
| # and only when a certificate is configured. Do not set them here. | ||
| with: | ||
| tagName: ${{ env.RELEASE_TAG }} | ||
| releaseName: ${{ env.RELEASE_TAG }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,10 +1,23 @@ | ||||||
| (function () { | ||||||
| const STATE_DB = "~/Library/Application Support/Kiro/User/globalStorage/state.vscdb" | ||||||
| // Kiro's app data location varies per OS (VS Code-style layout). | ||||||
| function kiroBase(ctx) { | ||||||
| const platform = ctx.app && ctx.app.platform | ||||||
| if (platform === "linux") return "~/.config/Kiro" | ||||||
| if (platform === "windows") return "~/AppData/Roaming/Kiro" | ||||||
| return "~/Library/Application Support/Kiro" | ||||||
| } | ||||||
| function stateDbPath(ctx) { | ||||||
| return kiroBase(ctx) + "/User/globalStorage/state.vscdb" | ||||||
| } | ||||||
| function logsRoot(ctx) { | ||||||
| return kiroBase(ctx) + "/logs" | ||||||
| } | ||||||
| function profilePath(ctx) { | ||||||
| return kiroBase(ctx) + "/User/globalStorage/kiro.kiroagent/profile.json" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use consistent extension directory casing in profile path. Line 16 uses Suggested fix- return kiroBase(ctx) + "/User/globalStorage/kiro.kiroagent/profile.json"
+ return kiroBase(ctx) + "/User/globalStorage/kiro.kiroAgent/profile.json"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| } | ||||||
| const STATE_KEY = "kiro.kiroAgent" | ||||||
| const LOGS_ROOT = "~/Library/Application Support/Kiro/logs" | ||||||
| const LOG_FILE_NAME = "q-client.log" | ||||||
| const TOKEN_PATH = "~/.aws/sso/cache/kiro-auth-token.json" | ||||||
| const PROFILE_PATH = "~/Library/Application Support/Kiro/User/globalStorage/kiro.kiroagent/profile.json" | ||||||
| const REFRESH_URL = "https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken" | ||||||
| const LIVE_STALE_MS = 15 * 60 * 1000 | ||||||
| const REFRESH_BUFFER_MS = 10 * 60 * 1000 | ||||||
|
|
@@ -77,7 +90,7 @@ | |||||
| function loadProfileArn(ctx, authState) { | ||||||
| const fromToken = authState && authState.token && authState.token.profileArn | ||||||
| if (typeof fromToken === "string" && fromToken) return fromToken | ||||||
| const parsed = readJsonFile(ctx, PROFILE_PATH, "profile") | ||||||
| const parsed = readJsonFile(ctx, profilePath(ctx), "profile") | ||||||
| return parsed && typeof parsed.arn === "string" && parsed.arn.trim() ? parsed.arn.trim() : null | ||||||
| } | ||||||
| function regionFromArn(profileArn) { | ||||||
|
|
@@ -87,7 +100,7 @@ | |||||
| function readStateValue(ctx, key) { | ||||||
| try { | ||||||
| const sql = "SELECT value FROM ItemTable WHERE key = '" + String(key).replace(/'/g, "''") + "' LIMIT 1;" | ||||||
| const rows = ctx.util.tryParseJson(ctx.host.sqlite.query(STATE_DB, sql)) | ||||||
| const rows = ctx.util.tryParseJson(ctx.host.sqlite.query(stateDbPath(ctx), sql)) | ||||||
| return Array.isArray(rows) && rows.length && typeof rows[0].value === "string" ? rows[0].value : null | ||||||
| } catch (e) { | ||||||
| ctx.host.log.warn("Kiro sqlite read failed: " + String(e)) | ||||||
|
|
@@ -186,13 +199,14 @@ | |||||
| } | ||||||
| function loadLoggedState(ctx) { | ||||||
| let sessions = [] | ||||||
| const logs = logsRoot(ctx) | ||||||
| try { | ||||||
| sessions = ctx.host.fs.listDir(LOGS_ROOT).slice().sort().reverse() | ||||||
| sessions = ctx.host.fs.listDir(logs).slice().sort().reverse() | ||||||
| } catch { | ||||||
| return null | ||||||
| } | ||||||
| for (let i = 0; i < sessions.length && i < 12; i += 1) { | ||||||
| const sessionRoot = LOGS_ROOT + "/" + sessions[i] | ||||||
| const sessionRoot = logs + "/" + sessions[i] | ||||||
| let windows = [] | ||||||
| try { | ||||||
| windows = ctx.host.fs.listDir(sessionRoot).slice().sort().reverse() | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 604
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 1077
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 107
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 1782
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 475
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 355
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 319
🏁 Script executed:
Repository: robinebers/openusage
Length of output: 351
Pin CI workflow actions to commit SHAs and disable checkout credential persistence
.github/workflows/ci.ymluses mutable action refs (not commit-SHA pinned):actions/checkout@v4(lines 15, 33),oven-sh/setup-bun@v2(lines 17, 52),dtolnay/rust-toolchain@stable(line 35),swatinem/rust-cache@v2(line 36).actions/checkout@v4steps (lines 15 and 33) omitwith: persist-credentials: false.Suggested hardening patch
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 33-33: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 33-33: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 35-35: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 36-36: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents