Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/run-tooling-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function defaultToolingWorkers(parallelism = availableParallelism()) {
}

const portableTests = [
'packaging/cloudron/start-cloudron.test.mjs',
'bin/api-message-surface-order.test.mjs',
'bin/e2e-network-guard.test.mjs',
'scripts/interface-theme.test.mjs',
Expand Down
52 changes: 52 additions & 0 deletions docs/maintainers/catalog-packaging-recovery-137.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Catalog Packaging Recovery — PR #137

PR #137's three original commits were closed without their catalog preparation
files reaching main. This recovery preserves that ancestry and repairs the
candidate deployment contracts against the published v3.72.16 image, pinned to
`sha256:b2bd0d2288898efcdb602f1f4863e86dff3fed1cfba5641d54072ab4702942fa`.

## Repairs

The generic Compose contract binds to loopback by default, persists the complete
configuration directory, runs without root capabilities and uses a read-only
root filesystem with explicit temporary cache locations. Image names and source
links use the canonical organization.

Cloudron stores SQLite and settings in its backed-up localstorage directory.
The manifest declares the SQLite file for consistent backups. The initializer
restores ownership without following stored symlinks and drops root before
loading application modules. Its managed HTTPS origin configures native proxy
support before login. The false published-version descriptor was removed.

The Co-op Cloud recipe mounts an unprivileged startup adapter, validates its
HTTPS origin and configures the same native proxy support. The backend must be
isolated behind the proxy, which must replace caller forwarding headers. SQLite
uses one replica. StartOS preparation links the existing companion repository;
it does not claim that its older package has been updated or qualified.

## Local Qualification

On November 6, 2026, local container checks verified:

- Generic Compose startup, health, a persistent SQLite canary across restart,
and a v3.72.15 to v3.72.16 image upgrade retaining that canary.
- Cloudron read-only startup, UID/GID 1000, zero effective application
capabilities, restored storage permissions and restart. An external-target
symlink probe did not change the target's ownership.
- Cloudron v3.72.16 login through an isolated HTTPS reverse proxy with a Secure,
HttpOnly session cookie; SeerrOrig and SeerrNGJ changes persisted after reload.
- Both startup adapters' origin validation, privilege failure and settings-save
failure cases. The tooling registry includes these tests.
- Co-op Cloud adapter startup from the pinned image and the same isolated HTTPS
login, Secure session cookie, and persisted theme switching checks. Compose
and Docker Stack configuration parsing also passed; no Swarm was deployed.

Evidence is retained under
`/mnt/disks/scratch/task-deliverables/seerrng-catalog-recovery-137-20261106`.
The containers use isolated fixture data and block external provider requests.

These are package candidates. Real Cloudron installation/update/backup restore,
Co-op Cloud Swarm/Traefik deployment, and updating and sideloading the companion
StartOS package remain platform acceptance work before marketplace publication.
No marketplace submission, wishlist issue or email was sent. YunoHost remains
retired under the owner's separate directive.
24 changes: 24 additions & 0 deletions packaging/catalogs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Self-hosting Catalog Deployment

The Compose contract pins the public, published v3.72.16 multi-architecture
image by digest. It needs no registry login and supports Linux amd64 and arm64.
Future pin updates must use a published image and repeat runtime verification.

```sh
docker compose -f packaging/catalogs/compose.yaml config
docker compose -f packaging/catalogs/compose.yaml up -d
```

The web UI binds to `127.0.0.1:5055` by default for a host reverse proxy. Set
`SEERRNG_BIND_ADDRESS` and `SEERRNG_HTTP_PORT` to change that mapping. Configure
TLS before remote browser authentication. Persist the named `/app/config`
volume; keep the provided writable cache and temporary mounts with the read-only
image. The optional built-in HTTPS listener uses container port 5056 only when
configured; add its port mapping if that listener is used instead of a proxy.

The files in `cloudron` and `coop-cloud` prepare platform-specific deployment.
The `startos` directory records the separate wrapper handoff. These files do
not establish marketplace acceptance or live-platform qualification. The
[release matrix](../../docs/maintainers/release-matrix.md) remains authoritative
for published support. Unraid is maintained separately. YunoHost publishing is
retired and is not restored by this recovery.
30 changes: 30 additions & 0 deletions packaging/catalogs/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
services:
seerrng:
image: ghcr.io/snapetech-org/seerrng:v3.72.16@sha256:b2bd0d2288898efcdb602f1f4863e86dff3fed1cfba5641d54072ab4702942fa
restart: unless-stopped
init: true
user: '1000:1000'
read_only: true
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
environment:
LOG_LEVEL: info
HOST: 0.0.0.0
PORT: '5055'
CONFIG_DIRECTORY: /app/config
ports:
- '${SEERRNG_BIND_ADDRESS:-127.0.0.1}:${SEERRNG_HTTP_PORT:-5055}:5055/tcp'
volumes:
- seerrng-config:/app/config
tmpfs:
- /tmp:rw,noexec,nosuid,nodev,size=64m,uid=1000,gid=1000,mode=1777
- /app/.next/cache:rw,noexec,nosuid,nodev,size=256m,uid=1000,gid=1000,mode=0700
healthcheck:
test: [CMD, node, /app/scripts/healthcheck.mjs]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s

volumes:
seerrng-config:
4 changes: 4 additions & 0 deletions packaging/cloudron/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!Dockerfile
!start-cloudron.cjs
!CloudronManifest.json
26 changes: 26 additions & 0 deletions packaging/cloudron/CloudronManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "tech.snapetech.seerrng",
"title": "SeerrNG",
"description": "Self-hosted media requests and discovery for Plex, Jellyfin, and Emby across movies, TV, music, ebooks, and audiobooks.",
"tagline": "Media requests and discovery across movies, TV, music, and books",
"version": "0.1.0",
"upstreamVersion": "v3.72.16",
"healthCheckPath": "/api/v1/status",
"httpPort": 5055,
"addons": {
"localstorage": {
"sqlite": {
"paths": ["/app/data/db/db.sqlite3"]
}
}
},
"manifestVersion": 2,
"website": "https://github.com/snapetech-org/seerrng",
"documentationUrl": "https://snapetech-org.github.io/seerrng/",
"packageUrl": "https://github.com/snapetech-org/seerrng/tree/main/packaging/cloudron",
"iconUrl": "https://raw.githubusercontent.com/snapetech-org/seerrng/main/public/android-chrome-512x512.png",
"tags": ["media", "requests", "plex", "jellyfin", "emby"],
"minBoxVersion": "10.0.0",
"packagerName": "Snapetech",
"packagerUrl": "https://github.com/snapetech-org"
}
8 changes: 8 additions & 0 deletions packaging/cloudron/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ghcr.io/snapetech-org/seerrng:v3.72.16@sha256:b2bd0d2288898efcdb602f1f4863e86dff3fed1cfba5641d54072ab4702942fa

USER root
RUN rm -rf /app/.next/cache && \
ln -s /tmp/seerrng-next-cache /app/.next/cache
COPY start-cloudron.cjs /app/start-cloudron.cjs
ENV CONFIG_DIRECTORY=/app/data HOST=0.0.0.0 PORT=5055
CMD ["node", "/app/start-cloudron.cjs"]
33 changes: 33 additions & 0 deletions packaging/cloudron/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Cloudron Community Package Candidate

This adapter builds from the published v3.72.16 image pinned by digest. It is a
local package candidate, not an advertised marketplace release. No published
`CloudronVersions.json` is provided until a built package has actually passed
installation, update and backup/restore verification on Cloudron.

```sh
cd packaging/cloudron
docker build -t seerrng-cloudron:0.1.0 .
```

On a Cloudron 10 or newer test server, use `cloudron install` from this directory.
The CLI builds and installs the source. Use `cloudron update` for the update
cycle. Registry-based installation and community publication follow the
[official tutorial](https://docs.cloudron.io/packaging/tutorial/).

The localstorage addon owns `/app/data`; it contains configuration and the
SQLite database. The manifest declares the SQLite file for consistent backups.
The short startup initializer restores ownership without following stored
symlinks, then drops to UID/GID 1000 before loading SeerrNG. The root filesystem
stays read-only; Next's cache uses `/tmp`. Cloudron terminates browser TLS and
proxies to HTTP port 5055. Its HTTPS `CLOUDRON_APP_ORIGIN` configures the
native application URL and single-hop proxy support at startup. The backend
port must remain reachable only through the managed proxy.

This candidate uses SQLite. External PostgreSQL backup integration is not
configured by this manifest. Platform installation, update, permissions after
restore, login, and an actual backup/restore cycle remain required before
community publication. Local container qualification is recorded separately.

References: [localstorage](https://docs.cloudron.io/packaging/addons/#localstorage),
[manifest](https://docs.cloudron.io/packaging/manifest/).
59 changes: 59 additions & 0 deletions packaging/cloudron/start-cloudron.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'use strict';

const { execFileSync } = require('node:child_process');
const { lstatSync, mkdirSync, chownSync, chmodSync } = require('node:fs');

// Cloudron restores storage permissions on restart. Keep privileged setup
// confined to these fixed locations, then load the application without root.
const data = '/app/data';
const cache = '/tmp/seerrng-next-cache';
for (const directory of [data, cache]) {
mkdirSync(directory, { recursive: true });
if (!lstatSync(directory).isDirectory()) {
throw new Error('Cloudron storage must be a directory, not a symlink.');
}
}
if (process.getuid() === 0) {
// -h does not follow stored symlinks; never change their external targets.
execFileSync('/bin/chown', ['-hR', '1000:1000', data]);
chownSync(cache, 1000, 1000);
process.setgroups([]);
process.setgid(1000);
process.setuid(1000);
}
if (process.getuid() !== 1000 || process.getgid() !== 1000) {
throw new Error('SeerrNG must run as its unprivileged container user.');
}
chmodSync(data, 0o700);
chmodSync(cache, 0o700);
process.env.CONFIG_DIRECTORY = data;
process.chdir('/app');
(async () => {
if (process.env.CLOUDRON_APP_ORIGIN) {
let origin;
try {
origin = new URL(process.env.CLOUDRON_APP_ORIGIN);
} catch {
throw new Error('Cloudron must supply a valid HTTPS application origin.');
}
if (
origin.protocol !== 'https:' ||
origin.username ||
origin.password ||
origin.pathname !== '/' ||
origin.search ||
origin.hash
) {
throw new Error('Cloudron must supply a valid HTTPS application origin.');
}
// Cloudron's managed proxy owns the external origin. Configure the native
// single-hop proxy support before serving secure cookies or OAuth callbacks.
const settings = await require('/app/dist/lib/settings')
.getSettings()
.load();
settings.main.applicationUrl = origin.origin;
settings.network = { ...settings.network, trustProxy: true };
await settings.save();
}
require('/app/dist/index.js');
})();
Loading
Loading