Package: drumee-schemas
Directory: schemas/
Debian package: drumee-schemas
Current version: 2.6.99
Helper source: git@github.com:drumee/setup-schemas → /var/lib/drumee/setup-schemas/
Purpose
Bootstraps the Drumee database layer. The post-install script (bin/install) restores a MariaDB snapshot from seeds, creates system accounts (nobody, guest, system, admin), provisions the initial hubs and media filesystem, imports wallpapers and tutorials, generates the RSA key pair, and sends a welcome email with the admin password-reset link.
Source Repos
| Repo | Branch | Destination |
|---|---|---|
setup-schemas | main | /var/lib/drumee/setup-schemas/ |
schemas | preview | /var/lib/drumee/schemas/ |
Build Prerequisites
Seeds archive required. The build looks for a seeds archive in this order:
schemas/var/tmp/drumee/seeds.tgz— pre-existing archive in the repo$SEEDS_DIR/directory (default:$HOME/docker/data/seeds/) — packed from a live MariaDB instance
If neither exists, the build exits. Seeds are a mariabackup snapshot of the base Drumee database needed to bootstrap a fresh instance.
schemas/seeds/ is gitignored — it contains large MariaDB binary files (aria_log, ibdata1) unsuitable for version control.
Creating seeds.tgz from a live instance
SEEDS_DIR=/path/to/mariabackup/snapshot schemas/build.sh
schemas/Dockerfile
Provides a containerised build environment for producing seeds without a local MariaDB installation. Uses mariabackup to snapshot and prepare the database.
Build
schemas/build.sh
schemas/build.sh takes no flags — version and email come from schemas/debian/changelog. Set SEEDS_DIR to point at the mariabackup snapshot used to create the seeds archive (see Build Prerequisites). Invoking the script with rebuild in its path forces the existing seeds.tgz to be regenerated.
Installed Paths
/var/lib/drumee/
├── setup-schemas/ # bin/install, populate.js, lib/, templates/
└── schemas/ # schema source (preview branch)
/var/tmp/drumee/
└── seeds.tgz # mariabackup snapshot archive
Dependencies
binutils, nodejs, mariadb-server, mariadb-client
Post-Install: bin/install
Runs as root. Two-phase execution:
Phase 1 — Database restore (bash)
- Sources
/etc/drumee/drumee.shfor environment variables. - Stops MariaDB.
- Manages the DB directory (
$DRUMEE_DB_DIR, default/srv/db):- Archives any existing
run/toorig/<date>/(rollback point). - Creates a fresh
run/directory.
- Archives any existing
- Extracts seeds from
/var/tmp/drumee/seeds.tgz. - Restores via
mariabackup --copy-backinto$DRUMEE_DB_DIR/run/. - Sets ownership (
mysql:mysql) and permissions (750dirs,rwfiles). - Starts MariaDB.
- Creates the system Unix-socket user:
CREATE OR REPLACE USER '$DRUMEE_SYSTEM_USER'@'localhost' IDENTIFIED VIA unix_socket;
GRANT ALL PRIVILEGES ON *.* TO '$DRUMEE_SYSTEM_USER'@'localhost'; - Sets global collation to
utf8mb4_general_ciif supported.
Phase 2 — Schema and account initialisation (node populate.js)
-
DB connectivity check — creates and drops a temporary test database.
-
App user — reads
/etc/drumee/credential/db.json; createsdrumee-appMariaDB user with that password (generates a random password and writes the file if absent). -
Mail user — creates
mailserverMariaDB user from/etc/drumee/credential/postfix.jsonif present. -
org.populate() — writes core rows to the
ypdatabase:sys_conf— system-wide settings (guest_id, nobody_id, public_id, domain, mfs_root, etc.)domain— domain recordvhost— virtual hosts (ns1, ns2, jit, www, smtp,_acme-challenge,_domainkey)organisation— organisation recordsettings— defaults (wallpaper, cache_control, default_privilege)mailserver.domainsandmailserver.aliases
-
System accounts created:
Account UID source Privilege Notes nobodyID_NOBODY(fixed)1 Anonymous placeholder guestget_sysconf('guest_id')1 Unauthenticated visitor system@<domain>generated DOM_OWNER Creates media hub + portal hub admin@<domain>generated DOM_OWNER Creates shareboxes, sets quota, generates reset token -
Hubs created:
Hub vhost Status Media hub <uniqueid>.<domain>system — stores wallpapers and tutorials Portal hub primary domain system — public entry point Admin internal sharebox private — Admin external sharebox (DMZ) — for guest sharing -
Media import — downloads wallpapers from
content.drumee.com/Wallpapersand tutorial content. -
RSA key pair — generates and writes to
/etc/drumee/credential/crypto/public.pemandprivate.pem. -
Welcome page — renders
asset/welcome.htmlwith the password-reset link to<data_dir>/tmp/welcome.html.
Phase 3 — Post-populate
- Sends a welcome email to
$ADMIN_EMAILviabin/acknowledge.js(contains the password-reset link). - Applies any pending schema patches from
/var/lib/drumee/patches/patch-from-manifestif the file exists.
Configuration Sources
| Source | Used for |
|---|---|
/etc/drumee/drumee.sh | Runtime paths and env vars |
/etc/drumee/credential/db.json | MariaDB app user credentials |
/etc/drumee/credential/postfix.json | Mail server DB user credentials |
/etc/drumee/credential/email.json | Outbound email auth |
/etc/drumee/credential/crypto/ | RSA key pair (generated on first install) |
$DRUMEE_DB_DIR | MariaDB data directory (default /srv/db) |
$ADMIN_EMAIL | Recipient for welcome/reset email |
Database Structure
yp — Central system database shared across all entities. Contains sys_conf, domain, vhost, entity, drumate, hub, organisation, settings, privilege, disk_usage, tutorial, and mailserver tables.
Per-entity databases — One database per user and hub, created by the entity_create stored procedure. Contains mfs_* tables, permission, media, and activity tables.
Install Log
/var/log/drumee/seeds.log — records the mariabackup --copy-back output and timestamp.