Skip to content
Syno Package Land
Language: English

Integrating an existing open-source App

Keep the upstream fork, its full history and the upstream remote. Put every wrapper-owned manifest, adapter, script, notice and document in synology/; never edit upstream README, Dockerfile, source, config, workflows or ignore files. Do not rewrite the App. UI strings added under synology/ follow the UI guide.

For someone else’s project, set maintainer to the original project or owner, metadata.maintainer_url to the upstream repository, and yourself as metadata.distributor / metadata.distributor_url. Only your own Apps use your publisher as maintainer; Syno Package Land is the distributor only when it distributes the App.

Pass --upstream <repo-url> (or keep the upstream remote), a verified --upstream-maintainer <project-team>, and --publisher / --publisher-url (defaults SYNOPKGLAND_PUBLISHER, SYNOPKGLAND_PUBLISHER_URL) to init --upstream-fork. Offline hosts and missing publisher configuration leave maintainer and distributor TODOs. metadata.upstream: {name, url} records the name and HTTPS repository; the fields become SPK INFO fields after an upgrade. check warns, without failing, for missing attribution or a maintainer equal to the distributor, and the fork layout warns without metadata.upstream.

Ask whether the user needs AI control unless they already requested it; otherwise leave the manifest without a ctl block, because packaging an upstream App does not request ctl. When requested, follow the ctl App guide and produce ctl-plan. Cover the main UI reads and writes through existing native APIs; status and service status alone are insufficient. Keep upstream code unchanged, run adapters as the package account, and report unsupported transports or long synchronous operations instead of inventing features or bypassing the Compose ctl restriction.

Container: official image and a matching source tag

Section titled “Container: official image and a matching source tag”

Use the upstream official image, pinned as repository:tag@sha256:digest; for a multi-architecture image pin the index digest so Container Manager can select the NAS architecture. Keep the source fork to match releases and deliver source/license material, including Corresponding Source; a matching tag proves no complete inventory.

Terminal window
git clone <your-fork-url> app
cd app
git remote add upstream <upstream-url>
synopkgland init -t compose --upstream-fork --package MyApp \
--upstream https://github.com/owner/app --upstream-maintainer "Upstream team" \
--publisher "Your team" \
--publisher-url https://example.com --upstream-image owner/app --health-path /actual-readiness --health-status 200 .

Replace owner/app with the verified official repository; init does not guess the publisher. In synology/upstream-recipe.json set repository, the Compose service, and imageTag: tag or version (strip a leading v only if the image spells it that way). Adjust port, storage and the login adapter before committing. Replace the first SELECT_UPSTREAM_TAG marker with a successful upgrade:

Terminal window
bash synology/upgrade.sh v1.2.3 2

The script needs a clean tree, fetches the exact tag into a private ref, verifies ancestry and untouched upstream files, then merges. It updates the tag through synopkgland images pin, recording tag@digest in synology/compose.image.yaml; that override is listed after the base file, so upstream files stay unchanged. The resolver requests OCI index/manifest-list media types: verify the image supports every declared architecture, since a single-platform manifest does not become multi-architecture through a digest. A failed lookup leaves the override unchanged and stops the upgrade.

It then derives version: 1.2.3 and build 0002, records source tag/commit/build in upstream-source.json, and runs check --json and build --json without compiling or publishing an image. Stable [v]X.Y.Z only; build numbers 1–9999 rise globally. Commit synology/ before the next upgrade; no push, Release, NAS install or deployment happens.

Fixed-UID image data directories need an adapter or an upstream-supported writable path under synology/; never add root/chown hooks or substitute a fixed UID.

Native: official release binaries or a source build hook

Section titled “Native: official release binaries or a source build hook”
Terminal window
synopkgland init -t native-go --ui plain --upstream-fork --package MyApp \
--upstream https://github.com/owner/app --upstream-maintainer "Upstream team" \
--publisher "Your team" \
--publisher-url https://example.com .

Native Apps stage official release binaries pinned by SHA-256, or compile the merged tree with a source build hook. OpenList uses the release-binary route: select the binary for the matching tag and architecture and verify its pinned SHA-256 before staging.

Implement synology/build-source.sh as the native payload hook; it fails deliberately until implemented. For release binaries, use it to acquire, verify and stage the payload; for a source build, compile merged source and frontend with pinned toolchains. It receives SPL_UPSTREAM_SOURCE, SPL_UPSTREAM_TAG and SPL_UPSTREAM_COMMIT. The upgrade command merges the tag, derives the version, runs the hook, then checks and builds.

Every integrated App admits DSM administrators directly, without a separate App password, an OIDC/SSO server or upstream source changes. The scaffold declares entry: admin-only; Compose also declares gateway access: dsm-admins. This gates the entry but creates no upstream session. Choose one supported mechanism:

  1. Trusted header / reverse-proxy authentication. Configure gateway header mode and the upstream’s documented proxy-auth setting. FreshRSS supports this through its server-side REMOTE_USER configuration; the synology/ adapter may map admitted DSM administrators to a fixed shared upstream admin. Clear competing identity headers and admit traffic only through the gateway.
  2. Disable native login / allow guests. Enable the supported option and let the DSM administrator gateway protect the sole reachable entry, as Uptime Kuma’s disableAuth does. First bootstrap must complete native setup, enable disableAuth through the upstream UI/API and read the state back before declaring ready. A synology/ adapter generates any one-time secret, uses it for bootstrap only and clears it; never ask users for another App password or a database edit. Verify that later entry, restarts and upgrades stay password-free while anonymous requests and direct upstream ports stay blocked.
  3. Existing SDK token adapter. The SDK supports mode: token with access: dsm-admins and entry: admin-only. OpenList uses its unmodified upstream admin token CLI, while the server is stopped, to obtain the administrator API token; the package stores it in a 0600 file under a 0700 directory. After DSM administrator admission the gateway runs the token adapter and injects Authorization server-side, so client credentials are replaced and the token never reaches the browser, URL, localStorage or page script. All admitted DSM administrators share one upstream admin account, with no per-user isolation. After OpenList Reset Token, restart the package to refresh the credential; failure refuses startup and requests rather than serving anonymous access. WebDAV keeps its own native credentials. Recheck admin token, the API header and /api/me on upgrades.

Health, prerequisites and prototype boundaries

Section titled “Health, prerequisites and prototype boundaries”

Choose the actual unauthenticated health endpoint and its expected 2xx status with both init flags, or fill compose.web.health before check/build; never guess / + 200. Readiness does not follow redirects: a 302 to a dashboard or login is unhealthy even if its destination is 200. A favicon/robots probe proves HTTP availability only; verify database setup and full readiness separately. check is static, not an HTTP or UID/storage probe. A dedicated origin / is supported; automatic subpath rewriting is not.

Public npm availability does not grant anonymous Go SDK access: use authorised source access, an exact matching module cache with original checksums, or SYNOPKGLAND_SDK_DIR with an authorised checkout.

PrototypeReusable lesson and boundary
OpenListOfficial release binary pinned by SHA-256, /ping, SDK server-side token adapter; shared upstream admin, restart after token reset, native WebDAV credentials. Share selection does not grant package ACL or register Local storage.
FreshRSSOfficial image, package-UID Apache/config adapter in synology/, explicit health; supported proxy authentication with fixed admin mapping and header clearing.
Uptime KumaOfficial image, writable-path adapter, nonredirecting health and disableAuth after first bootstrap; WebSocket expiry/revocation need separate tests.

A Linux host proof is not DSM acceptance. Recheck the image, arbitrary UID, persistent data, bootstrap and login boundaries, and preserve complete third-party notices and source correspondence.

Container SPKs omit install_dep_packages=ContainerManager because DSM can report the dependency not-ready while Docker is active. SDK preflight checks fixed Container Manager files plus a listening Docker socket in the kernel inventory, as the package UID without socket/API access or root. It fails before install preparation or project startup with stable translated-message keys and an English instruction to install or start Container Manager from Package Center. DSM’s installer log, startup failure and first-open CGI carry that diagnosis; the CGI returns 503 even when the gateway is down. Availability is not identity attestation. Declare only Container Manager-capable arches/INFO platforms, and verify the missing-package wizard on a device.

  • The original project/team or owner is maintainer, its repository is metadata.maintainer_url / metadata.upstream, and your publisher is the distributor
  • Resolve attribution TODOs and review every check --json warning
  • Inspect the SPK INFO attribution, preserve notices/source correspondence, and verify the upstream release before publishing