8000 feat(packaging): self-contained Synology package (SPK) that runs Lens in Container Manager by adeelahmad · Pull Request #11 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(packaging): self-contained Synology package (SPK) that runs Lens in Container Manager - #11

Merged
adeelahmad merged 6 commits into
mainfrom
claude/synology-spk-ykdkof
Oct 2, 2026
Merged

adeelahmad merged 6 commits into
mainfrom
claude/synology-spk-ykdkof

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 2, 2026 •
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Before: running Lens on a Synology NAS meant copying the compose file over, building or pulling images and setting up the containers by hand in Container Manager.

After: each published GitHub release carries .spk files for x86_64 and 64-bit ARM. To install, use Manual Install in Package Center and answer a three-field wizard (port, address, setup code). Lens then runs and appears in the DSM main menu. Upgrades are another Manual Install, and the data and secrets stay.

The package carries the API/worker, web app and SurrealDB images. It hands them to Container Manager through DSM's docker-project resource (DSM 7.2.1+, Container Manager 1432+), so the NAS pulls nothing and no container is set up by hand.

How. packaging/synology/build.sh does the build:

  • It builds the two Lens images for the chosen architecture (x86_64 or armv8).
  • It saves them with SurrealDB into images/lens-images.tar.gz inside the package.
  • It assembles INFO, the wizard, conf/resource (a lens shared folder plus the docker project) and the scripts.

scripts/postinst runs as the unprivileged package user:

  • It writes lens.conf into the shared folder. The secrets are generated once and kept across upgrades and reinstalls.
  • It renders compose.yaml: docker-compose.prod.yml with built images, bind mounts into the share, and a one-shot permissions container that hands lens/archive to uid 1000.
  • It renders the DSM menu entry.

The Synology package workflow runs when a release is published. It builds both architectures and attaches the .spk files to the release, numbered by run so each one installs as an upgrade. You can also run it by hand from Actions to build the full image or a chosen build number.

Build and install

packaging/synology/build.sh                  # x86_64 → dist/synology/lens-0.3.0-0001-x86_64.spk
ARCH=armv8 packaging/synology/build.sh       # 64-bit ARM models
LENS_TARGET=full packaging/synology/build.sh # with LibreOffice and Chromium

Or publish a release, or use Actions > Synology package > Run workflow, then download the .spk.

On the NAS:

  1. Package Center > Manual Install > the .spk, and accept the third-party warning.
  2. Fill in the wizard.
  3. Open Lens from the main menu and create the admin with the setup code.

Full notes are in packaging/synology/README.md.

Tested

  • The real images couldn't be built in the sandbox: Docker Hub rate-limited it and the proxy blocks ghcr. So I built the SPK with stand-in images and unpacked it into a fake /var/packages/lens.
  • I ran postinst as an unprivileged user with the wizard's answers, docker loaded the bundled tarball and brought the rendered project up:
    • SurrealDB came up healthy on the bind mount, and permissions exited 0.
    • The API wrote to /data as uid 1000.
    • The web app reached the API on the chosen port.
  • Re-running postinst with no wizard answers (an upgrade) left lens.conf untouched.
  • shellcheck and actionlint are clean.
  • Not yet tested: a real DSM install and a real-image build. The workflow does the build, on a release or a manual run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LtuHjBJoEHFFDYrnmYMrGe

…nager

packaging/synology/build.sh builds the API/worker and web app images, saves them
with SurrealDB into the package, and DSM's docker-project resource has Container
Manager load them and run the stack as a project. A short install wizard sets the
port, address and setup code; data and secrets live in a 'lens' shared folder.
A manual workflow builds x86_64 and armv8 packages.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtuHjBJoEHFFDYrnmYMrGe
@adeelahmad adeelahmad self-assigned this Oct 2, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtuHjBJoEHFFDYrnmYMrGe
The Release workflow publishes with GITHUB_TOKEN, which fires no release event, so
it starts this workflow with -f tag=vX.Y.Z instead. The build number defaults to the
run number on every trigger, so dispatched release builds upgrade the last one too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtuHjBJoEHFFDYrnmYMrGe
claude added 2 commits October 2, 2026 12:54
…settings through

- A one-shot cleanup container (docker:27-cli, bundled) removes labelled Lens images
  of earlier versions once the new containers are up.
- The wizard gains an optional mail page; MAIL_* and LENS_* lines in lens.conf reach
  the API and the worker through an env file.
- The image tarball sits at the package root, as in Synology's docker-project example.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtuHjBJoEHFFDYrnmYMrGe
@adeelahmad adeelahmad changed the title Synology package: a self-contained SPK that runs Lens in Container Manager feat(packaging): self-contained Synology package (SPK) that runs Lens in Container Manager Oct 2, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SNbRrpHTCqLewRKdkmd45X
@adeelahmad
adeelahmad marked this pull request as ready for review October 2, 2026 13:31
@adeelahmad
adeelahmad merged commit c05fffc into main Oct 2, 2026
1 of 10 checks passed
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

0