Skip to content

feat(photoncam): add PhotonCAM, laser cutting and engraving CAM (io.github.pietini69.photoncam) - #934

Merged
jing2uo merged 4 commits into
flatpark:mainfrom
3ddruck12:add/io.github.pietini69.photoncam
Nov 2, 2026
Merged

jing2uo merged 4 commits into
flatpark:mainfrom
3ddruck12:add/io.github.pietini69.photoncam

Conversation

@3ddruck12

Copy link
Copy Markdown
Contributor

Summary

  • Adds PhotonCAM 1.2.8 (io.github.pietini69.photoncam), a laser cutting and engraving CAM.
  • The payload is the official PhotonCAM-1.2.8-linux-x86_64.tar.gz, unpacked with bsdtar --no-same-owner --no-xattrs. It runs on org.freedesktop.Platform//26.08. The Linux build is not rebuilt.
  • The resolver takes the highest version that ships PhotonCAM-<version>-linux-x86_64.tar.gz. Older LaserBurn-named archives, and the macOS, Windows and Raspberry Pi files on the same release, are skipped.

Sandbox

  • Shared: IPC, Wayland with X11 fallback, GPU, network for the web remote and iPad bridge, and the Documents folder.
  • --device=all is declared under policy.dangerous_permissions. GRBL and Ruida controllers are USB serial ports, and Flatpak has no narrower device for /dev/ttyUSB* and /dev/ttyACM*.
  • Open and Save otherwise go through the file chooser. A project outside Documents is opt-in: flatpak override --user --filesystem=home io.github.pietini69.photoncam.
  • There is no in-app update download.

Tested

  • Descriptor audit, appstreamcli validate --no-net, and the resolver (1.2.8, that tarball). check-apply-extra unpacked the archive as root with no capabilities.
  • publish.sh --verify built the app and installed it from the local signed repo. ldd reported no missing libraries. photoncam -V printed 1.2.8.
  • photoncam demo wrote a LightBurn project. photoncam gcode turned it into 263 lines of GRBL G-code, including M4 and G1 moves. The file was not sent to a controller.
  • The window opened that project. The canvas showed the demo gear, the status line said Disconnected, and the traffic log said no device was connected. WM_CLASS is photoncam.

Flathub

Not published on Flathub. io.github.pietini69.photoncam returns 404 from the Flathub appstream API.

Made with Cursor

@jing2uo jing2uo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the package — the build side looks solid. I read through upstream's v1.2.8 source and found a few runtime issues the diff alone doesn't show. The two that need fixing before merge are settings persistence (~/.config/laser_burn) and the web remote's unauthenticated curl | bash update endpoint, which contradicts the "no in-app update download" claim. Details inline.

… from Exec=

- Grant ~/.config/laser_burn: upstream hardcodes it for settings, the
  material palette and camera calibration, which were lost on restart.
- Grant ~/Documents:create next to xdg-documents: upstream hardcodes
  $HOME/Documents for the material library and traffic log and falls back
  to the tmpfs $HOME on a localized desktop.
- Drop --share=network: it only serves the opt-in web remote, which binds
  0.0.0.0 without auth and exposes a curl | bash update endpoint. Documented
  as an override in the metainfo, with --reset.
- Drop --device=dri (covered by --device=all); disclose cameras.
- apply_extra: take the binary name from the archive's .desktop Exec=.
- resolve-update: reject malformed versions like "1.2." in the regex.
- License is GPL-3.0-only, as upstream states.
@jing2uo

jing2uo commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

I pushed two commits on top of yours that fix everything from the review (aa02f40, bfd0cae):

Sandbox (io.github.pietini69.photoncam.yml)

  • Added --filesystem=~/.config/laser_burn:create. Upstream hardcodes this path for settings, the material palette and camera calibration, so all of it was lost on restart.
  • Added --filesystem=~/Documents:create next to xdg-documents. Upstream hardcodes $HOME/Documents for the material library and traffic log. Without this grant they land in the tmpfs $HOME on a localized desktop.
  • Removed --share=network from the defaults. The default controller link is USB serial. Network is only needed for opt-in features: a controller behind a Raspberry Pi running PhotonCAM Bridge, the web remote and the iPad bridge. The web remote binds 0.0.0.0 without authentication and serves POST /api/system/update (a curl | bash from upstream master). The manifest comment now says this instead of "no in-app update download".
  • Removed --device=dri, which --device=all already covers. The comment now also notes the GPU and the alignment camera.

Metainfo

  • project_license is now GPL-3.0-only, matching what upstream states.
  • The sandbox paragraph now lists what --device=all actually exposes (serial, GPU, cameras), the Documents and ~/.config/laser_burn writes, and that there is no network by default.
  • Added an optional-capabilities list in the org.electerm.Electerm style: --share=network (with the web remote's risk spelled out), --filesystem=home, and --reset.

Scripts

  • apply_extra.sh now takes the binary name from the archive's .desktop Exec= and symlinks it to photoncam/photoncam if the name changes. The wrapper is unchanged.
  • resolve-update.sh: the version regex is now [0-9]+(\.[0-9]+)*, so a malformed name like 1.2. can no longer abort the resolver.

Checked: audit-descriptor.mjs, appstreamcli validate --no-net, the resolver (1.2.8), check-apply-extra.sh (OK as root without capabilities) and publish.sh --verify all pass. I installed the build from the local repo and checked flatpak info --show-permissions: no network. Inside the sandbox, photoncam -V prints 1.2.8, and a write to ~/.config/laser_burn lands on the host. I didn't test the GUI save flow or the network features after an override.

If you'd rather ship the web remote enabled by default, say so and argue for it in the PR body; a broad grant kept in finish-args needs a written justification there. Please also update the PR description, which still says network is granted and there is no in-app update download.

@jing2uo jing2uo left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review: PhotonCAM (io.github.pietini69.photoncam) at 2db11d10

Verdict: PASS. Ready to merge once CI is green on the latest commit.

The only high-risk grant is --device=all. It is declared in policy.dangerous_permissions with a justification and accepted: GRBL and Ruida controllers are on /dev/ttyUSB* and /dev/ttyACM*, and Flatpak has no narrower grant for them. All findings from the first review are fixed in aa02f40 and bfd0cae (summary in the comments above), and their threads are resolved. 2db11d1 grants --share=network by default again, for the Raspberry Pi controller link (see the follow-up comment).

Legend: ✅ pass · ❌ fail · ⚠️ warn · 👤 needs-human · ➖ N/A. Tier: 1 = open source · ★ = all.

# Phase Check Tier Verdict Evidence
0 Safety Static-only; artifacts handled in an isolated dir ★ ✅ Artifact fetched as bytes into a scratch dir, listed before extracting, extracted with --no-same-owner --no-same-permissions --no-xattrs, and analysed statically. Because the maintainer commits change the package, the maintainer also ran the packager-side checks on them: check-apply-extra, publish.sh --verify, and photoncam -V in the sandbox.
1.1 Scope Classified ★ ✅ New app: 8 files, all under registry/io.github.pietini69.photoncam/
1.2 Scope High-scrutiny surface ★ ✅ Nothing under .github/, scripts/ or config/. The resolver is in a brand-new app dir.
2.1 Provenance Submitter ★ ✅ 3ddruck12, account from 2021-05, 34 public repos. Nine merged FlatPark listings (#581, #582, #629, #634, #793, #815, #852, #907, #930).
2.2 Provenance Source repo age, corroboration ★ ⚠️ pietini69/photoncam, not a fork. First commit 2026-10-25, 82 commits from a single author, 3 stars, 7 releases (v1.0.0 to v1.2.8). It was renamed from LaserBurn. The project is young with little outside corroboration, which is informational only: the owner account dates from 2018, history is steady, and the IOC scan is clean.
2.3 Provenance Commit identity ★ ✅ 3ddruck <[email protected]>. The maintainer commits are Komh <[email protected]>.
2.4 Provenance Timeline plausible ★ ✅ Account 2018, then repo 2026-10-25, then v1.2.8 on 2026-10-31 after 82 commits. Not hours apart.
2.5 Provenance Trust tier ★ ✅ Submitter: established. Upstream: unknown-but-plausible.
2.6 Provenance Artifact tier ★ ✅ Tier 1: GPL-3.0, official upstream build
3.1 Manifest Source types ★ ✅ One extra-data source with sha256: f4b76afc…c386f and size: 8104053. The rest are local file sources. No git or archive.
3.1b Manifest Nothing remote in /app ★ ✅ build-commands only install local files (.yml:38-43). The payload is extra-data.
3.2 Manifest finish-args ★ 👤→✅ ipc, wayland, fallback-x11, --device=all (declared and accepted), --share=network (Raspberry Pi controller link, web remote), xdg-documents, ~/Documents:create, ~/.config/laser_burn:create. No escape permissions. Each grant has a comment explaining it.
3.3 Manifest policy: honest ★ ✅ proprietary: false is correct. dangerous_permissions lists --device=all, the only high-risk grant.
3.4 Manifest Install-only, payload unmodified ★ ✅ apply_extra.sh unpacks with bsdtar and moves the folder. It adds a symlink only if upstream renames the binary. The wrapper is a single exec line. No patch, no sed, nothing injected.
3.4b Manifest packaging: ★ ✅ None needed: the wrapper sets nothing, and there is no injected code, host command or sandbox-off. audit-descriptor.mjs exits 0.
3.5 Manifest Genuine upstream ★ ✅ github.com/pietini69/photoncam (fork: false)
3.6 Manifest app-id ★ ✅ io.github.pietini69 matches the GitHub owner. The metainfo labels it an unaffiliated community package.
3.7 Manifest update.command ★ ✅ ./resolve-update.sh
3.8 Manifest Download host ★ ✅ github.com/pietini69/photoncam/releases/download/v1.2.8/PhotonCAM-1.2.8-linux-x86_64.tar.gz
3.9 Manifest Optional caps as overrides ★ ✅ --filesystem=home is an override in the metainfo, with --reset. --share=network stays in finish-args because a Raspberry Pi controller link is one of the two connection types (gui/mod.rs:9008-9015), and --unshare=network is offered for USB-only setups. Justified in the PR thread.
3.10 Manifest PR body: what was tested ★ ⚠️ Thorough: the GUI opened a project, CLI demo → gcode produced 263 lines of G-code, WM_CLASS is photoncam, which matches StartupWMClass. Nothing was sent to a controller, which is stated. The Sandbox section still says "There is no in-app update download", which is wrong.
4.1 Runtime No runtime fetch-and-exec ★ ⚠️ The web remote's POST /api/system/update runs curl … install_pi_bridge.sh | bash from upstream master (src/server/mod.rs:284-292), with no authentication and bound to 0.0.0.0 (:193). It is not a core mechanism. The web remote only runs after the user starts it from the app (web_remote_active defaults to false, gui/mod.rs:506, started only from its button at :9893), and the metainfo discloses the exposure. Worth reporting upstream.
4.2 Runtime Resolver reviewed as code ★ ✅ Read-only GitHub API call (GITHUB_TOKEN sent only as a header to api.github.com), then jq. No eval, no writes, output is JSON on stdout. The version regex was tightened in aa02f40.
4.3 Runtime Endpoints; filesystem×network ★ ✅ Endpoints when network is enabled: raw.githubusercontent.com (the update script above), a UDP connect to 8.8.8.8:80 for local-IP detection with no traffic sent (server/mod.rs:79), a LAN listener, and TCP to the Pi bridge on port 2323. Network is granted alongside --device=all and Documents. Nothing listens until the user starts the web remote, and the app makes no outbound connection otherwise except to a Pi bridge the user configures. Accepted for the Pi controller link.
5.1 Artifact sha256 == pin ★ ✅ Re-fetched: f4b76afc62d36e28e3a9a1eca9513f18986689d809dc884eaff358c09e3c386f, 8104053 bytes. This equals the manifest pin and GitHub's asset digest.
5.2 Artifact Inspected per type ★ ✅ tar.gz with one top-level dir. Entries: photoncam (0755), PhotonCAM.desktop, photoncam.png, ._photoncam.png (AppleDouble), README.txt. No traversal, symlinks or setuid.
5.3 Artifact Nothing injected, no vendor file changed 1 ✅ Files are only moved and the folder renamed, with an optional symlink. The binary is untouched.
5.4 Artifact Shipped == official ★ ✅ Same hash as 5.1. check-apply-extra and publish.sh --verify install that tarball unchanged.
5.5 Artifact Bundled runtimes ★ ➖ Single Rust ELF with no bundled runtime
5.6 Artifact IOC scan ★ ✅ NEEDED: libc, libm, libpthread, libdl, ld-linux only. No RPATH or RUNPATH, no embedded ELF. No persistence, miner or reverse-shell strings. Hardcoded IPs: 8.8.8.8 (see 4.3) and 192.168.68.90, which appears in a unit test and in help text. Spawned commands: bash (the update endpoint), xdg-open, and the macOS-only open, explorer and shortcuts.
6.1 Compliance Purpose ★ ✅ Laser cutting and engraving CAM
6.2 Compliance Non-FOSS not a reason ★ ➖ GPL-3.0
7.1 Verdict Overall ★ ✅ PASS (--device=all accepted by a maintainer)
7.2 Verdict Hard-fail triggers ★ ✅ None
7.3 Verdict Recommendation only ★ ✅ A human merges

Read, file by file

  • flatpark.yml: the descriptor. The policy block covers --device=all, upstream_approved: false.
  • io.github.pietini69.photoncam.yml: runtime org.freedesktop.Platform//26.08, finish-args as in 3.2, install-only module (.yml:38-43), managed extra-data block.
  • apply_extra.sh: offline unpack, one top-level directory, binary name taken from Exec=.
  • photoncam-wrapper: exec /app/extra/photoncam/photoncam "$@".
  • resolve-update.sh: see 4.2.
  • .desktop: Exec=photoncam %f, StartupWMClass=photoncam.
  • .metainfo.xml: passes appstreamcli validate --no-net. Has the community-package line, the sandbox and web-remote disclosure, and the overrides.
  • .png: 512×512 icon.
  • Upstream v1.2.8 source (for runtime behaviour): src/server/mod.rs, src/device/mod.rs, src/material/mod.rs, src/document/mod.rs, src/camera/mod.rs, src/gui/mod.rs, read where they touch paths, the network and spawned processes.

Reproduce

node scripts/audit-descriptor.mjs registry/io.github.pietini69.photoncam/flatpark.yml
flatpak run --command=appstreamcli --filesystem="$PWD" org.flatpak.Builder validate --no-net "$PWD/registry/io.github.pietini69.photoncam/io.github.pietini69.photoncam.metainfo.xml"
(cd registry/io.github.pietini69.photoncam && ./resolve-update.sh)
./scripts/check-apply-extra.sh io.github.pietini69.photoncam
./scripts/publish.sh --verify io.github.pietini69.photoncam
curl -fsSL -o pc.tar.gz https://github.com/pietini69/photoncam/releases/download/v1.2.8/PhotonCAM-1.2.8-linux-x86_64.tar.gz && sha256sum pc.tar.gz && bsdtar -tvf pc.tar.gz

Not covered

  • The app's source was not audited. It was only read where it bears on sandbox behaviour.
  • Untested: sending a job to a real controller, the camera, and the GUI save flow after the new grants. The web remote, iPad bridge and Pi-bridge link were not exercised.
  • CI on the maintainer commits (aa02f40, bfd0cae, 2db11d1) is waiting for maintainer approval of the fork run. The last green run was on f17a1b6.

…ler link

A controller behind a Raspberry Pi running PhotonCAM Bridge is one of the
two connection types, so the network serves the main feature. The web
remote with its unauthenticated update endpoint only runs after the user
starts it; the metainfo keeps that disclosure and offers --unshare=network
for USB-only setups.
@jing2uo

jing2uo commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Follow-up (2db11d1): --share=network is granted by default again, reversing that part of my earlier commit. Two things in the source changed my view:

  • A controller behind a Raspberry Pi running PhotonCAM Bridge is a connection type in its own right. The connection settings offer "USB/serial" and "Network (Raspberry Pi)" side by side (src/gui/mod.rs:9008-9015). The network is needed for the main feature, sending jobs to the laser, not just for an extra.
  • The web remote only runs after the user starts it. web_remote_active defaults to false (src/gui/mod.rs:506), and start_web_remote() is only called from the button in the web remote window (:9893). It doesn't start on launch and isn't restored on the next run. The curl | bash update endpoint is only reachable while the user has it running.

The manifest comment says why network is granted. The metainfo still explains what the web remote exposes while it runs. The network override is replaced by --unshare=network for USB-only setups, next to the existing --filesystem=home override and --reset. audit-descriptor, appstreamcli and publish.sh --verify pass, and flatpak info --show-permissions shows shared=ipc;network;.

The Sandbox section of the PR description is accurate again on network. Only the line "There is no in-app update download" is still wrong.

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