Sign inSign up

friedrichrehren/resourcespace

By friedrichrehren

•Updated 1 day ago

ResourceSpace DAM, configured via environment variables

Image
0

199

friedrichrehren/resourcespace repository overview

⁠ResourceSpace Docker Image

Ready-to-use container image for the open-source digital asset management system ResourceSpace⁠ – configured entirely through environment variables, no web installer.

Check Upstream Release Sync Docker Hub README

Current Version GHCR Pulls Docker Hub Pulls

⁠Features

FeatureDetails
Official codeResourceSpace from the official SVN release branch (releases/<version>)
No web installerinclude/config.php is generated from environment variables at every start
Automatic first installempty database → tables, default data and super admin are created
Automatic restoreempty database + existing dump in /data/db-dump → dump is imported
Database dumpsmariadb-dump every 6 hours to /data/db-dump/resourcespace.sql.gz
One data volumemedia, dumps and local config live in /data, outside the web root
Reverse proxy readyhonours X-Forwarded-Proto (secure cookies) and X-Forwarded-For
Hardened filestoreno PHP execution and no directory listings inside the filestore (except filestore/plugins/)
Tested before releaseevery image is installed, logged into and restored in CI before it is pushed
linux/amd64 and linux/arm64multi-architecture images

⁠Published Images

TagMeaning
latestnewest revision of the newest release branch
11.0newest revision of the 11.0 release branch
11.0-r12345a specific SVN revision (pin this for reproducible deployments)

⁠What This Project Does

  1. checks the ResourceSpace SVN repository once a day for the newest release branch and its latest revision
  2. builds a new image when that revision is missing on GHCR or Docker Hub
  3. rebuilds once a week to pick up Ubuntu security updates
  4. runs a smoke test (fresh install, admin login, dump, restore) and only then pushes to Docker Hub and GHCR
  5. keeps its scheduled workflows enabled – GitHub would otherwise disable them after 60 days without commits

⁠Quick Start

services:
  mariadb:
    image: mariadb:11.4
    environment:
      MARIADB_RANDOM_ROOT_PASSWORD: "1"
      MARIADB_DATABASE: resourcespace
      MARIADB_USER: resourcespace
      MARIADB_PASSWORD: change-me
    volumes:
      - db:/var/lib/mysql

  resourcespace:
    image: friedrichrehren/resourcespace:latest
    depends_on: [mariadb]
    ports:
      - "8080:80"
    environment:
      RS_BASEURL: http://localhost:8080
      RS_DB_PASSWORD: change-me
      RS_SCRAMBLE_KEY: "<openssl rand -hex 32>"
      RS_API_SCRAMBLE_KEY: "<openssl rand -hex 32>"
      RS_ADMIN_PASSWORD: "<your admin password>"
      RS_ADMIN_EMAIL: [email protected]
      RS_WAIT_FOR_SYNC: "false"
    volumes:
      - data:/data

volumes:
  db:
  data:

A complete Portainer stack with Traefik labels and a two-way SharePoint sync via rclone bisync is in stack/docker-compose.yml⁠.

⁠Environment Variables

VariableDefaultDescription
RS_BASEURL– (required)public URL without trailing slash, e.g. https://photo.example.com
RS_DB_HOSTmariadbdatabase host
RS_DB_PORT–database port, if not 3306
RS_DB_NAMEresourcespacedatabase name
RS_DB_USERresourcespacedatabase user
RS_DB_PASSWORD– (required)database password
RS_SCRAMBLE_KEY– (required)secret, ≥ 32 characters. Never change it – password hashes depend on it
RS_API_SCRAMBLE_KEY– (required)secret for the API, ≥ 32 characters. Never change it
RS_ADMIN_USERNAMEadminsuper admin created on first install
RS_ADMIN_PASSWORD– (required on first install)super admin password. Must not be exactly 32 or 64 characters long (see below)
RS_ADMIN_EMAIL– (required on first install)super admin e-mail, also used for system notifications
RS_ADMIN_FULLNAMEAdmin userdisplay name of the super admin
RS_ADMIN_FORCE_PASSWORDfalsetrue sets the admin password from RS_ADMIN_PASSWORD at every start (lock-out recovery)
RS_APPLICATION_NAMEResourceSpacename shown in the UI
RS_DEFAULT_LANGUAGEdedefault UI language
RS_EMAIL_FROMnoreply@<host>sender address
RS_SMTP_HOST–enables SMTP when set
RS_SMTP_PORT587SMTP port
RS_SMTP_SECUREtlstls or ssl
RS_SMTP_USER / RS_SMTP_PASSWORD–SMTP authentication
RS_WAIT_FOR_SYNCtruewait for /data/.rclone/ready before starting (written by the sync container)
RS_RESTORE_FROM_DUMPtruerestore an empty database from /data/db-dump/resourcespace.sql.gz
RS_DB_DUMP_SCHEDULE0 */6 * * *cron schedule of the database dump
RS_CRON_SCHEDULE30 3 * * *cron schedule of ResourceSpace's batch/cron.php
PHP_UPLOAD_MAX_FILESIZE1Gupload limit (also sets post_max_size)
PHP_MEMORY_LIMIT1GPHP memory limit
PHP_MAX_EXECUTION_TIME300PHP execution time in seconds
TZEurope/BerlinPHP time zone

Secrets can also be passed as files: RS_DB_PASSWORD_FILE, RS_SCRAMBLE_KEY_FILE, RS_API_SCRAMBLE_KEY_FILE, RS_ADMIN_PASSWORD_FILE, RS_SMTP_PASSWORD_FILE.

⁠Passwords with exactly 32 or 64 characters

ResourceSpace refuses every login whose password is exactly 32 or 64 characters long, because such strings look like MD5/SHA-256 hashes (rs_password_verify()). The image therefore rejects such an RS_ADMIN_PASSWORD with a clear error. The same applies to passwords users set later in the UI.

⁠The Data Volume

/data
├── filestore/   originals, previews, slideshow images (served under /filestore)
│   └── plugins/ additional third-party plugins (PHP allowed here only)
├── db-dump/     resourcespace.sql.gz – latest database dump
├── config/      config.local.php – optional, included after the generated config
├── tmp/         temporary files
└── .rclone/     state of the optional sync container

Custom ResourceSpace settings go into /data/config/config.local.php:

docker exec -it <container> nano /data/config/config.local.php
<?php
$plugins[] = 'tms_link';
$watermark = 'gfx/watermark.png';

⁠Additional Plugins

All plugins that ship with ResourceSpace can be activated and configured in the UI as usual. Third-party or custom plugins are placed in the data volume – ResourceSpace loads plugins from filestore/plugins/ in addition to its own plugins/ folder:

docker cp my_plugin <container>:/data/filestore/plugins/
docker exec <container> chown -R www-data:www-data /data/filestore/plugins/my_plugin

Then activate it in the plugin management of the admin area. PHP execution is allowed in filestore/plugins/ only; everything else in the filestore stays blocked.

Anyone who can write to filestore/plugins/ can run code in the container. The example stack therefore excludes this folder from the SharePoint sync.

⁠Restore

Database and media can be restored from the data volume alone: start the container with the restored /data and an empty database. The entrypoint imports db-dump/resourcespace.sql.gz before ResourceSpace starts. Changes made after the last dump (at most 6 hours by default) are lost; the media files are not.

RS_SCRAMBLE_KEY must be the same as before, otherwise no password matches.

⁠Differences to the Official Image

The official resourcespace/docker⁠ repository only provides a Dockerfile; its GHCR package is not public. This image keeps the same Ubuntu base and runtime packages, but

  • does not ship build tools, Subversion, Postfix or OpenCV (facial recognition is deprecated upstream) – configure SMTP instead of local mail
  • keeps the application code read-only; additional plugins go into /data/filestore/plugins/ (see below)
  • replaces the web installer with environment variables

⁠Repository Setup

⁠Workflows
WorkflowTriggerPurpose
check-upstream.ymldaily, weekly (forced), push to main, manualpublishes new SVN revisions (<release>-r<revision>, <release>, latest)
deploy.ymlcalled by check-upstream.ymlbuilds, smoke-tests and pushes the image
sync-dockerhub-readme.ymlREADME change, after releases, manualcopies this README to Docker Hub
keepalive.ymlweekly, manualre-enables all scheduled workflows so GitHub does not disable them
⁠Secrets and Variables
SecretPurpose
DOCKERHUB_USERNAMEDocker Hub user
DOCKERHUB_TOKENDocker Hub access token, scope Read & Write (image push)
DOCKERHUB_README_TOKENoptional: token with scope Read, Write, Delete – Docker Hub requires it to update the repository description. Falls back to DOCKERHUB_TOKEN

Optional repository variable RS_RELEASE pins the release branch (e.g. 11.0); default is the newest branch.

After the first run, set the GHCR package visibility to public (Package settings → Change visibility), otherwise pulls without login fail.

Tag summary

Content type

Image

Digest

sha256:cee8968c3…

Size

414.2 MB

Last updated

1 day ago

docker pull friedrichrehren/resourcespace