-
Notifications
You must be signed in to change notification settings - Fork 0
Flatpak #3
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
Flatpak #3
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 |
|---|---|---|
|
|
@@ -11,14 +11,27 @@ jobs: | |
| matrix: | ||
| include: | ||
| - os: macos-latest | ||
| target: --mac dmg | ||
| artifact: macos-dmg | ||
| pattern: release/*.dmg | ||
| - os: ubuntu-latest | ||
| target: --linux AppImage | ||
| artifact: linux-appimage | ||
| pattern: release/*.AppImage | ||
| - os: ubuntu-latest | ||
| target: --linux flatpak | ||
| artifact: linux-flatpak | ||
| pattern: release/*.flatpak | ||
| container: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-25.08 | ||
| container-options: --privileged | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| # Ignored if empty | ||
| container: | ||
| image: ${{ matrix.container || '' }} | ||
| options: ${{ matrix.container-options || '' }} | ||
|
Comment on lines
+30
to
+33
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🌐 Web query:
💡 Result: As of June 2026, GitHub Actions does not natively support disabling a job container by setting Citations:
Replace empty-string container config with GitHub Actions does not support disabling containers by setting container: ${{ fromJSON(matrix.container) }}
strategy:
matrix:
include:
- os: ubuntu-latest
container: '{"image": "ubuntu:latest"}'
- os: macos-latest
container: nullThis ensures jobs on non-Linux platforms (macOS, Windows) or jobs intended to run directly on the runner bypass containerization entirely. 🧰 Tools🪛 zizmor (1.25.2)[error] 26-26: unpinned image references (unpinned-images): container image may be unpinned (unpinned-images) 🤖 Prompt for AI Agents |
||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
@@ -39,11 +52,33 @@ jobs: | |
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| # electron-builder always auto-installs the Electron base app via | ||
| # "flatpak install --user". flatpak-github-actions' container only has | ||
| # flathub as a system remote. Work this around by pre-installing | ||
| # (then the bundler just updates it). | ||
| - name: Install Flatpak deps | ||
| if: matrix.artifact == 'linux-flatpak' | ||
| run: flatpak install --system --noninteractive flathub org.electronjs.Electron2.BaseApp//25.08 | ||
|
|
||
| # flatpak-builder's rofiles-fuse doesn't work in containers (no fuse), | ||
| # and electron-builder has no way to pass arguments to flatpak-builder, | ||
| # so make a wrapper. | ||
| - name: Make a flatpak-builder wrapper | ||
| if: matrix.artifact == 'linux-flatpak' | ||
| run: | | ||
| fb="$(command -v flatpak-builder)" | ||
| mv "$fb" "$fb.real" | ||
| printf '#!/bin/sh\nexec "%s" --disable-rofiles-fuse "$@"\n' "$fb.real" >"$fb" | ||
| chmod +x "$fb" | ||
|
|
||
| - name: Build | ||
| run: pnpm run electron:dist | ||
| run: pnpm run electron:dist ${{ matrix.target }} | ||
| env: | ||
| # don't try to codesign / notarize in CI | ||
| CSC_IDENTITY_AUTO_DISCOVERY: false | ||
| # flatpak-bundler pipes flatpak's stdout/stderr through 'debug', | ||
| # hiding all the diagnostics. | ||
| DEBUG: "@malept/flatpak-bundler" | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,14 @@ | ||
| // Generate the electron-builder desktop icons from the glyph SVG, all in this | ||
| // dir: icon.png (full-bleed square, for Linux/Windows) and icon.icns (macOS | ||
| // squircle with Apple's standard padding, since macOS doesn't auto-round). | ||
| // Re-run after changing the glyph: `node assets/desktop-icon/build.mjs`. | ||
| // Requires ImageMagick (`magick`) and, for the .icns, macOS `iconutil`. | ||
| /* Generate the electron-builder desktop icons from the glyph SVG, all in this | ||
| * dir. None of Windows/Linux/macOS auto-round, so generate the icons here: | ||
| * | ||
| * 1. icon.png - full-bleed square for Windows, | ||
| * 2. icon-linux.{svg,png} - Linux squircle (GNOME HIG padding and rounding), | ||
| * 3. icon.icns - macOS squircle with Apple's standard padding. | ||
| * | ||
| * Re-run after changing the glyph: `node assets/desktop-icon/build.mjs`. | ||
| * Requires ImageMagick (`magick`) and, for the .icns, macOS `iconutil`. */ | ||
| import {spawnSync} from 'child_process'; | ||
| import {mkdirSync, readFileSync, rmSync} from 'fs'; | ||
| import {mkdirSync, readFileSync, rmSync, writeFileSync} from 'fs'; | ||
|
Comment on lines
10
to
+11
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. Fix ESLint Line 10, Line 11, and Line 73 violate the configured spacing rule and can break lint-gated checks. Proposed fix-import {spawnSync} from 'child_process';
-import {mkdirSync, readFileSync, rmSync, writeFileSync} from 'fs';
+import { spawnSync } from 'child_process';
+import { mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
...
-const linux = buildSvg({size: GNOME_CONTENT, offset: GNOME_MARGIN, radius: GNOME_RADIUS});
+const linux = buildSvg({ size: GNOME_CONTENT, offset: GNOME_MARGIN, radius: GNOME_RADIUS });Also applies to: 73-73 🧰 Tools🪛 ESLint[error] 10-10: A space is required after '{'. (object-curly-spacing) [error] 10-10: A space is required before '}'. (object-curly-spacing) [error] 11-11: A space is required after '{'. (object-curly-spacing) [error] 11-11: A space is required before '}'. (object-curly-spacing) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| import {dirname, join} from 'path'; | ||
| import {fileURLToPath} from 'url'; | ||
|
|
||
|
|
@@ -18,6 +22,12 @@ const BG_TO = '#D59EFF'; | |
| const MAC_CONTENT = 824; | ||
| const MAC_MARGIN = (SIZE - MAC_CONTENT) / 2; | ||
| const MAC_RADIUS = 185; | ||
| // GNOME app-icon: a 103×103 rounded square (8px corners) centered in the | ||
| // 128 grid. Our icon is 1024x1024, so scaled dimensions are: 824px content, | ||
| // 100px margin, 64px radius (same content box as macOS, softer corners). | ||
| const GNOME_CONTENT = 824; | ||
| const GNOME_MARGIN = (SIZE - GNOME_CONTENT) / 2; | ||
| const GNOME_RADIUS = 64; | ||
|
|
||
| const glyph = readFileSync(join(dir, 'icon.svg'), 'utf8'); | ||
| const viewBox = glyph.match(/viewBox\s*=\s*"\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*"/); | ||
|
|
@@ -57,10 +67,15 @@ function render(svg, out) { | |
| } | ||
|
|
||
| const square = buildSvg({size: SIZE, offset: 0, radius: 0}); | ||
| const pngPath = join(dir, 'icon.png'); | ||
| render(square, pngPath); | ||
| render(square, join(dir, 'icon.png')); | ||
| console.log('wrote assets/desktop-icon/icon.png'); | ||
|
|
||
| const linux = buildSvg({size: GNOME_CONTENT, offset: GNOME_MARGIN, radius: GNOME_RADIUS}); | ||
| writeFileSync(join(dir, 'icon-linux.svg'), linux); | ||
| console.log('wrote assets/desktop-icon/icon-linux.svg'); | ||
| render(linux, join(dir, 'icon-linux.png')); | ||
| console.log('wrote assets/desktop-icon/icon-linux.png'); | ||
|
|
||
| if (process.platform !== 'darwin') { | ||
| console.log('[build-app-icon] skipping .icns (needs macOS iconutil)'); | ||
| process.exit(0); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| appId: desu.inutweb | ||
| # Flatpak requires appId to be a valid D-Bus bus name. A valid D-Bus bus name | ||
| # contains at least 3 segments (intended for reverse dns notation). | ||
| appId: pet.tei.inutweb | ||
|
Comment on lines
+1
to
+3
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🌐 Web query:
💡 Result: Yes, changing the top-level appId property in electron-builder (including in v26) does affect both the macOS bundle identifier and the Windows application identity [1][2][3]. For macOS, the appId serves as the CFBundleIdentifier [1]. It is strongly recommended to set this explicitly; changing it after an initial release can break existing user data paths, such as NSUserDefaults and sandboxed containers [1]. For Windows, the appId is used as the Application User Model ID (AUMID) for the NSIS target [1][4]. Note that this functionality is specific to NSIS and is not supported by Squirrel.Windows [1][4]. Regarding Flatpak, electron-builder does not provide a specific top-level "appId override" key just for Flatpak. While you can configure Flatpak-specific options under the flatpak configuration block, the appId itself is generally handled globally [5]. Flatpak identifiers (often formatted like org.domain.appname) are typically defined within the Flatpak-specific manifest or configuration settings, and you should ensure your application identity aligns with the requirements of the Flatpak ecosystem [6][7]. Citations:
Confirm this is an intentional breaking change; appId migration affects macOS user data and Windows app identity. Changing the top-level 🤖 Prompt for AI Agents |
||
| productName: inutweb | ||
| copyright: abolish copyright law | ||
|
|
||
|
|
@@ -33,9 +35,23 @@ win: | |
|
|
||
| linux: | ||
| category: Network | ||
| icon: assets/desktop-icon/icon.png | ||
| icon: assets/desktop-icon/icon-linux.png | ||
| syncDesktopName: true | ||
| target: | ||
| - AppImage | ||
| - flatpak | ||
|
|
||
| # electron-builder defaults to 20.08 for some reason; it's not even | ||
| # on Flathub anymore. | ||
| flatpak: | ||
| runtimeVersion: "25.08" | ||
| baseVersion: "25.08" | ||
| # electron-builder doesn't add the png icon specified above because it's | ||
| # 1024px, and flatpak target skips anything >512px. | ||
| # Add a proper scalable icon manually. | ||
| files: | ||
| - - assets/desktop-icon/icon-linux.svg | ||
| - /share/icons/hicolor/scalable/apps/pet.tei.inutweb.svg | ||
|
|
||
| nsis: | ||
| oneClick: false | ||
|
|
||
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: teidesu/tweb
Length of output: 2638
🏁 Script executed:
Repository: teidesu/tweb
Length of output: 514
🌐 Web query:
container image pinning by digest security best practice GitHub Actions💡 Result:
Pinning container images by digest (SHA256) is a critical security best practice in GitHub Actions to prevent supply chain attacks and ensure build reproducibility [1][2][3]. Why Pinning by Digest is Necessary Container image tags (e.g.,:latest,:v1, or:18) are mutable, meaning the underlying image content associated with a tag can be changed at any time by the publisher without notice [2][3]. Relying on tags exposes your workflow to several risks: - Supply Chain Attacks: If a registry account is compromised, an attacker can push a malicious image to an existing tag, causing your workflows to execute unauthorized code [2][3]. - Non-reproducible Builds: Because the image can change, different runs of the same workflow version may use different image layers, leading to inconsistent build results [1][2]. - Silent Compromise: There is no inherent indication or warning when the content of a tag changes, making it difficult to detect that your build environment has been altered [2]. Best Practices for Implementation - Use Immutable Digests: Always reference images using the
@sha256:suffix (e.g., node@sha256:a5e0ed...) rather than relying solely on tags [1][2][4]. You can optionally keep the tag for human readability if formatted asimage:tag@sha256:...[2]. - Automate Updates: Manually updating digests is error-prone. Use tools like Dependabot or Renovate to automatically monitor for new digests and open pull requests to update your workflow files [3]. - Verify Image Integrity: Where possible, use technologies like Cosign or Docker Content Trust to verify image signatures alongside digest pinning [4]. - Use Trusted Sources: Whenever possible, pull images from secure, private mirrors or registries that support scanning and policy enforcement before the images are available to CI runners [2][3]. How to Find a Digest You can identify the current digest of a container image using the following commands: - Docker CLI:docker buildx imagetools inspect <image:tag>ordocker inspect --format='{{index .RepoDigests 0}}' <image:tag>[5][3]. - Third-party tools: Utilities likecrane digest <image:tag>can retrieve digests without requiring a local Docker daemon [2][6][5].Citations:
Pin the Flatpak container image by digest.
Line 19 uses a mutable tag in a privileged job container. Pinning to a digest materially reduces CI supply-chain risk. Mutable tags can be reassigned by a registry account compromise, potentially injecting malicious code into privileged builds.
Proposed fix
🤖 Prompt for AI Agents
Source: Linters/SAST tools