Skip to content

publish flatpak package#8014

Open
overcuriousity wants to merge 7 commits intosleuthkit:developfrom
overcuriousity:develop
Open

publish flatpak package#8014
overcuriousity wants to merge 7 commits intosleuthkit:developfrom
overcuriousity:develop

Conversation

@overcuriousity
Copy link
Copy Markdown

@overcuriousity overcuriousity commented May 4, 2026

This PR introduces a guthub action and yaml build files which allow the application to be built as a flatpak application, complementing the existing snap package. This provides an option to get a bundled easy install option for users who cannot use snap.

Building the flatpak bundle was tested on a machine running Fedora 43, produced a working flatpak application which could be installed with the KDE discover flatpak wrapper.

Summary by CodeRabbit

  • New Features

    • Autopsy is now available as a Flatpak bundle on Linux with desktop integration (launcher, AppStream metadata) and an app wrapper for correct runtime behavior.
    • CI now builds and packages Flatpak bundles on release tags and supports manual bundle creation (downloadable artifact or release asset).
  • Documentation

    • Linux install guide updated to recommend Flatpak and link Flatpak install instructions.
    • Added detailed Flatpak documentation covering build, bundle, install, runtime behavior, and release maintenance.
  • Chores

    • Ignore Flatpak build artifacts in repository ignore rules.

overcuriousity and others added 3 commits April 29, 2026 16:40
Introduces org.sleuthkit.Autopsy.yaml (flatpak-builder manifest) and
supporting files to produce a distributable .flatpak bundle without
Flathub involvement, mirroring how the Snap is released as a GitHub
Release asset.

Key design choices:
- Runtime: org.freedesktop.Platform//25.08 + openjdk17 SDK extension
- All 5 forensics libs (libewf-legacy, libafflib, libvmdk, libvhdi,
  libvslvm) and testdisk built from source with release tarballs
- Sleuth Kit built offline: all 13 Maven deps + case-uco deps declared
  as manifest sources with verified SHA256 checksums
- Autopsy ant build-zip requires --share=network (NetBeans platform
  download is too large to pre-bundle); resulting bundle installs offline
- TSK_HOME stub persisted to /app/tsk-build/ so the autopsy module can
  find the TSK JARs across module boundaries
- Requires ≥20 GB free disk space on the build machine

Remaining open issue: the Autopsy ZIP extraction step ran out of space
in the previous test run; fixed by extracting to /app/ directly instead
of /tmp/ (which has limited space in the flatpak overlay).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix CI runtime mismatch: workflow installed 24.08 but manifest requires 25.08
- Add /app/jdk symlink in openjdk module: install.sh puts JDK at /app/jre but
  jdkhome/JAVA_HOME env vars point to /app/jdk; without the symlink the app
  exits immediately with "Cannot find java"
- Fix metainfo: remove placeholder <screenshots> block (no image URL); update
  release entry to 4.21.0 with a real GitHub release URL
- Fix desktop file: use System;Security; categories to silence desktop-file-validate
  hint (Security is an XDG additional category that pairs with System/Settings)
- Add Flatpak install section to Running_Linux_OSX.md alongside Snap entry
- Add version-update instructions to flatpak/README.md for maintainers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
unix_setup.sh checks for photorec via `command -v photorec`. The testdisk
module installs photorec to /app/bin, but the global build PATH only included
/usr/lib/sdk/openjdk17/bin, /app/ant/bin, /usr/bin, and /bin — so the check
failed and the autopsy module exited with code 1. Adding /app/bin fixes it.

Verified: clean flatpak-builder run completes successfully and the installed
Flatpak launches the GUI without errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 4, 2026 12:54
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1c8bebdb-1e74-4f6d-97bd-1650cc85b4af

📥 Commits

Reviewing files that changed from the base of the PR and between bda2b89 and 65cb8a9.

📒 Files selected for processing (3)
  • flatpak/org.sleuthkit.Autopsy.desktop
  • flatpak/org.sleuthkit.Autopsy.metainfo.xml
  • org.sleuthkit.Autopsy.yaml
✅ Files skipped from review due to trivial changes (2)
  • flatpak/org.sleuthkit.Autopsy.desktop
  • flatpak/org.sleuthkit.Autopsy.metainfo.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • org.sleuthkit.Autopsy.yaml

📝 Walkthrough

Walkthrough

Adds Flatpak packaging and distribution: a complete Flatpak manifest and modules to build native deps and Autopsy, runtime integration files (wrapper, desktop entry, AppStream metainfo, icon), CI workflow to build and upload a single-file .flatpak, .gitignore entries, and user-facing Flatpak documentation and install instructions.

Changes

Flatpak Packaging for Autopsy

Layer / File(s) Summary
App Manifest / Identity
org.sleuthkit.Autopsy.yaml
New Flatpak manifest: app id, org.freedesktop.Platform 25.08, org.freedesktop.Sdk, OpenJDK17 extension; command set to autopsywrapper.sh; build-time network and sandbox permissions; runtime env vars.
Build modules / Data staging
org.sleuthkit.Autopsy.yaml
Adds modules: openjdk, ant, native libs (libewf, libafflib, libvmdk, libvhdi, libvslvm), testdisk, sleuthkit-4.15.0 with staged Ivy/Maven jars for offline build, perl staging, and autopsy packaging.
Build implementation / Tooling
org.sleuthkit.Autopsy.yaml
Module steps: install/symlink JDK, extract/install Ant, autotools/configure/make for native libs, Sleuth Kit configure with --enable-java --enable-offline, Ant builds, patch ExtractRegistry.java, run unix_setup.sh, copy artifacts into /app.
Runtime wiring / Integration files
flatpak/autopsywrapper.sh, flatpak/org.sleuthkit.Autopsy.desktop, flatpak/org.sleuthkit.Autopsy.metainfo.xml, flatpak/*
Adds wrapper script creating ${XDG_RUNTIME_DIR:-/tmp}/autopsy-tmp and execing /app/autopsy/bin/autopsy; desktop entry and AppStream metainfo with permissions notes, categories, keywords, release entry and known limitations.
CI / Automation
.github/workflows/build-flatpak.yml
New GitHub Actions workflow Build Flatpak Bundle: triggers on push.tags autopsy-* and workflow_dispatch; installs Flatpak tooling, adds Flathub remote, installs Platform/SDK + OpenJDK17 extension, runs flatpak-builder (--user --force-clean --repo=repo), creates autopsy.flatpak with embedded runtime repo, and conditionally uploads as Release asset (tag) or 14-day workflow artifact (manual).
Packaging / Ignore rules
.gitignore
Adds ignore patterns: build-dir/, .flatpak-builder/, *.flatpak.
Documentation
flatpak/README.md, Running_Linux_OSX.md
Adds flatpak/README.md with build/bundle/install/run/release notes, limitations, and CI behavior; updates Running_Linux_OSX.md to prioritize Flatpak install flow and link to Flatpak docs.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub Actions
    participant Runner as Runner (ubuntu-latest)
    participant Flatpak as Flatpak tooling
    participant Flathub as Flathub remote
    participant Release as GitHub Releases / Artifact store

    Dev->>GH: push tag autopsy-* or trigger workflow_dispatch
    GH->>Runner: start build job
    Runner->>Flatpak: apt-get install flatpak & flatpak-builder
    Runner->>Flathub: add flathub remote (user scope)
    Runner->>Flatpak: install Platform/SDK and openjdk17 extension
    Runner->>Flatpak: flatpak-builder --user --force-clean --repo=repo build-dir org.sleuthkit.Autopsy.yaml
    Flatpak-->>Runner: produce build-dir and repo
    Runner->>Flatpak: flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo repo autopsy.flatpak
    alt tag build
        Runner->>Release: upload autopsy.flatpak to GitHub Release
    else manual run
        Runner->>Release: upload autopsy.flatpak as workflow artifact (14d)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hop through manifests, jars, and shell,

Bundling sleuthing magic in a single shell.
CI hums, tags leap, a Flatpak snug and tight —
Run Autopsy safe within its sandboxed light.
Hop on, dear devs, and test it through the night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title "publish flatpak package" is concise and clearly describes the main change—adding Flatpak packaging support as an alternative to Snap. It summarizes the primary objective of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 6/8 reviews remaining, refill in 7 minutes and 58 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
flatpak/README.md (1)

31-46: ⚡ Quick win

The build and bundle commands don't produce/use the same repo.

flatpak-builder only exports to a repository when you pass --repo (or installs locally with --install). As written, readers build into build-dir and then immediately try to bundle ~/.local/share/flatpak/repo, which this sequence never populated. Mirror the workflow here and bundle the repo you just exported. (docs.flatpak.org)

Suggested doc fix
- flatpak-builder --force-clean build-dir org.sleuthkit.Autopsy.yaml
+ flatpak-builder --force-clean --repo=repo build-dir org.sleuthkit.Autopsy.yaml
- flatpak build-bundle ~/.local/share/flatpak/repo autopsy.flatpak org.sleuthkit.Autopsy
+ flatpak build-bundle repo autopsy.flatpak org.sleuthkit.Autopsy
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@flatpak/README.md` around lines 31 - 46, The README shows flatpak-builder
writing to build-dir but build-bundle using ~/.local/share/flatpak/repo; update
the workflow so the same repo is produced and consumed: run flatpak-builder with
--repo <repo-path> (or use --install) when creating the build output (instead of
only writing to build-dir), and then call build-bundle against that same
<repo-path> (or document the --install alternative) so the build-bundle command
(autopsy.flatpak, org.sleuthkit.Autopsy) points to the repository actually
produced by flatpak-builder.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-flatpak.yml:
- Around line 13-15: The workflow job named "build" (name: Build Flatpak bundle)
currently uses runs-on: ubuntu-latest which only provides ~14GB and will exhaust
during the Flatpak build; either change the runs-on to a self-hosted runner with
≥20GB available or add explicit pre-build disk cleanup steps to free space
(e.g., remove apt cache, prune Docker images/containers, delete large temp
files) before the Flatpak download/compile steps so the NetBeans platform and
Autopsy compilation have ≥20GB free.
- Around line 47-48: The flatpak bundle created by the existing flatpak
build-bundle command (the "Create single-file bundle" step invoking flatpak
build-bundle repo autopsy.flatpak org.sleuthkit.Autopsy) won’t allow runtime
resolution on first install on a clean system; modify that invocation to include
the --runtime-repo option (pointing at the same repo) so Flatpak can fetch
missing runtimes during installation (e.g., add --runtime-repo=repo to the
flatpak build-bundle command that produces autopsy.flatpak).

---

Nitpick comments:
In `@flatpak/README.md`:
- Around line 31-46: The README shows flatpak-builder writing to build-dir but
build-bundle using ~/.local/share/flatpak/repo; update the workflow so the same
repo is produced and consumed: run flatpak-builder with --repo <repo-path> (or
use --install) when creating the build output (instead of only writing to
build-dir), and then call build-bundle against that same <repo-path> (or
document the --install alternative) so the build-bundle command
(autopsy.flatpak, org.sleuthkit.Autopsy) points to the repository actually
produced by flatpak-builder.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92663d61-f27c-4a88-b697-0cbd12e0e451

📥 Commits

Reviewing files that changed from the base of the PR and between a1e8629 and 24ab985.

📒 Files selected for processing (8)
  • .github/workflows/build-flatpak.yml
  • .gitignore
  • Running_Linux_OSX.md
  • flatpak/README.md
  • flatpak/autopsywrapper.sh
  • flatpak/org.sleuthkit.Autopsy.desktop
  • flatpak/org.sleuthkit.Autopsy.metainfo.xml
  • org.sleuthkit.Autopsy.yaml

Comment thread .github/workflows/build-flatpak.yml
Comment thread .github/workflows/build-flatpak.yml Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

The freedesktop Platform runtime 25.08 does not include perl; it is only
in the SDK. ExtractRegistry.java checks /usr/bin/perl and /usr/local/bin/perl
and throws "perl not found" if neither exists, aborting ingest.

Fix:
- Add a perl module that copies the binary, libperl.so, and stdlib from the
  SDK into /app/bin/ and /app/lib/ at build time
- Add PERL5LIB finish-arg so perl finds its standard modules at runtime
- Patch ExtractRegistry.java before the ant build to also check /app/bin/perl

regripper's Parse::Win32Registry module is already bundled in the rr/
directory and loaded via -I, so no additional CPAN modules are needed.

Removes "Recent Activity module is non-functional" from known limitations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
org.sleuthkit.Autopsy.yaml (3)

125-145: 💤 Low value

Consider consolidating hardcoded version strings.

The Sleuth Kit version 4.15.0 and dependency versions appear in multiple places throughout this module (tag on line 130, filenames on lines 238-244, etc.). When upgrading, each location must be updated manually, which is error-prone.

Since YAML anchors aren't well-suited for string interpolation in Flatpak manifests, consider adding a version reference comment at the top of the sleuthkit module listing all versions that must stay synchronized, to ease future updates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@org.sleuthkit.Autopsy.yaml` around lines 125 - 145, The sleuthkit module has
multiple hardcoded version strings (e.g., tag: sleuthkit-4.15.0 and artifact
filenames ivy-2.5.0.jar, joda-time-2.13.1.jar, guava-33.4.0-jre.jar); add a
single, clearly labeled comment block at the top of the sleuthkit module listing
each required version (SLEUTHKIT, IVY, JODA_TIME, GUAVA) so maintainers can
update them in one place and cross-check updates against the tag and
dest-filename entries (leave the code unchanged, just add the comment with the
canonical version values).

42-42: 💤 Low value

Perl version hardcoded in PERL5LIB path.

The Perl version 5.42 is hardcoded here and must match the SDK's Perl version. If org.freedesktop.Sdk updates to a newer Perl version, this path will break silently at runtime (Perl won't find its standard modules).

Consider extracting the version dynamically or documenting this dependency prominently in the README so future SDK updates don't cause hard-to-debug failures.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@org.sleuthkit.Autopsy.yaml` at line 42, The PERL5LIB entry currently
hardcodes "5.42" which will break if org.freedesktop.Sdk's Perl changes; update
the YAML so PERL5LIB is constructed dynamically (or omits the versioned
directories) instead of embedding "5.42", e.g. derive the Perl version from the
build environment/SDK or use an environment variable (e.g. PERL_VERSION) during
image build, and update README to document the required SDK/Perl contract;
locate the PERL5LIB string in the YAML and replace the hardcoded segments with a
dynamic substitution or non-versioned paths and add a short note in the README
about the Perl version requirement.

246-255: 💤 Low value

Perl version coupling with SDK.

The paths on lines 252-253 hardcode Perl version 5.42. This must stay synchronized with the PERL5LIB environment variable on line 42 and the SDK's actual Perl version.

The comment on lines 246-247 is helpful context. Consider adding a note about the version coupling so future maintainers know to check all three locations (PERL5LIB, libperl.so path, perl5 stdlib path) when the SDK updates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@org.sleuthkit.Autopsy.yaml` around lines 246 - 255, The YAML currently
hardcodes Perl version "5.42" in the libperl.so and stdlib paths which will
drift from the PERL5LIB env var; update the perl package block to avoid a
hardcoded version by introducing and using a single PERL_VERSION variable (or
template token) for the paths used in the install commands (so the lib path and
the /usr/lib/perl5/ stdlib path both reference PERL_VERSION), ensure PERL5LIB is
set from that same PERL_VERSION, and add a clear comment in the perl section
noting the coupling between PERL5LIB, the libperl.so path, and the perl5 stdlib
path so future maintainers update all three (PERL_VERSION, PERL5LIB, and the two
install paths) when the SDK Perl version changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@org.sleuthkit.Autopsy.yaml`:
- Around line 125-145: The sleuthkit module has multiple hardcoded version
strings (e.g., tag: sleuthkit-4.15.0 and artifact filenames ivy-2.5.0.jar,
joda-time-2.13.1.jar, guava-33.4.0-jre.jar); add a single, clearly labeled
comment block at the top of the sleuthkit module listing each required version
(SLEUTHKIT, IVY, JODA_TIME, GUAVA) so maintainers can update them in one place
and cross-check updates against the tag and dest-filename entries (leave the
code unchanged, just add the comment with the canonical version values).
- Line 42: The PERL5LIB entry currently hardcodes "5.42" which will break if
org.freedesktop.Sdk's Perl changes; update the YAML so PERL5LIB is constructed
dynamically (or omits the versioned directories) instead of embedding "5.42",
e.g. derive the Perl version from the build environment/SDK or use an
environment variable (e.g. PERL_VERSION) during image build, and update README
to document the required SDK/Perl contract; locate the PERL5LIB string in the
YAML and replace the hardcoded segments with a dynamic substitution or
non-versioned paths and add a short note in the README about the Perl version
requirement.
- Around line 246-255: The YAML currently hardcodes Perl version "5.42" in the
libperl.so and stdlib paths which will drift from the PERL5LIB env var; update
the perl package block to avoid a hardcoded version by introducing and using a
single PERL_VERSION variable (or template token) for the paths used in the
install commands (so the lib path and the /usr/lib/perl5/ stdlib path both
reference PERL_VERSION), ensure PERL5LIB is set from that same PERL_VERSION, and
add a clear comment in the perl section noting the coupling between PERL5LIB,
the libperl.so path, and the perl5 stdlib path so future maintainers update all
three (PERL_VERSION, PERL5LIB, and the two install paths) when the SDK Perl
version changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d42225a-dc3b-4624-bec0-a4d303749a6d

📥 Commits

Reviewing files that changed from the base of the PR and between 24ab985 and bcf3c5e.

📒 Files selected for processing (3)
  • flatpak/README.md
  • flatpak/org.sleuthkit.Autopsy.metainfo.xml
  • org.sleuthkit.Autopsy.yaml
✅ Files skipped from review due to trivial changes (1)
  • flatpak/org.sleuthkit.Autopsy.metainfo.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • flatpak/README.md

overcuriousity and others added 3 commits May 4, 2026 20:30
Add jlumbroso/free-disk-space step so the NetBeans platform download and
Autopsy compilation fit on ubuntu-latest's ~14 GB volume. Pass
--runtime-repo=flathub to flatpak build-bundle so first-time installs on
clean systems can fetch org.freedesktop.Platform//25.08.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Silences GitHub Actions Node.js 20 deprecation warnings ahead of the
forced upgrade in June 2026.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Exec=org.sleuthkit.Autopsy is invalid: Flatpak rewrites the host-exported
.desktop Exec to "flatpak run --command=<first-token> ... <app-id>", and
there is no command literally named org.sleuthkit.Autopsy in the sandbox.
Terminal "flatpak run" worked because it used the manifest's command:
field directly.

Set Exec to autopsywrapper.sh, symlink it into /app/bin so it resolves on
the runtime PATH, and update command: to match.

Also bump metainfo to 4.23.0 (matches app.version in nbproject).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants