This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Run the full configurator (infra + Jitsi)
./index.js [options]
# Run the Jitsi-only configurator
./jitsi.js [options]
# Publish a new patch version
npm run release # git push + npm publish + npm version patchBoth index.js and jitsi.js accept the same arguments via templates/utils.js.
| Argument | Default | Description |
|---|---|---|
--public-domain |
null | Public-facing domain name |
--private-domain |
null | Private/LAN domain name |
--public-ip4 / --public-ip6 |
null | Override auto-detected public IPs |
--private-ip4 / --private-ip6 |
null | Override auto-detected private IPs |
--chroot / --outdir |
/ |
Output root — all config files are written under this prefix |
--readonly 1 |
0 | Print targets instead of writing files |
--only-infra 1 |
1 | Skip Jitsi config generation |
--no-jitsi 1 |
1 | Same as --only-infra |
--watch 1 |
0 | Configure pm2 to watch endpoint dirs for changes |
--force-install |
0 | Override an existing installation |
--own-certs-dir |
null | Use pre-existing TLS certificates from this directory |
--data-dir |
/data |
User data directory |
--db-dir |
/srv/db |
MariaDB data directory |
| Script | Purpose |
|---|---|
index.js |
Full setup — infra + optional Jitsi |
jitsi.js |
Jitsi-only reconfiguration |
template.js |
Legacy entry point (hardcoded paths, no --chroot) |
index.js flow:
- Reads environment variables and CLI args to assemble a
dataobject viamakeData()/getSysConfigs(). - Auto-detects network interfaces (public/private IPv4/IPv6) via
getAddresses(). - Calls
writeInfraConf(data)(always) and optionallywriteJitsiConf(data). - Writes the resolved config to
/etc/drumee/drumee.json(or--chrootequivalent) and generates random credentials (DB, postfix, email, XMPP passwords) on each run.
jitsi.js flow:
- Seeds from the existing
drumee.jsonviasysEnv()(domain, IPs already configured). - Auto-detects network interfaces via
getAddresses(). - Generates fresh random secrets (TURN, XMPP, Jicofo, JVB, app keys).
- Calls
writeJitsiConf(data)— writes only Jitsi/Prosody/Coturn/nginx-jitsi configs; does not touchdrumee.json, BIND zones, ecosystem, or DB credentials.
Templates use lodash _.template() (ES template literal syntax with <%= %> interpolation). Template files are .tpl files mirroring the target filesystem path under templates/. The chroot() function prefixes all output paths with --outdir / --chroot / DRUMEE_CONF_BASE env var, or / by default.
templates/ mirrors the target system's directory tree:
etc/nginx/— Nginx site and module configsetc/drumee/— Drumee runtime config, SSL, infrastructure routes, credential templatesetc/bind/— BIND9 named configs and zone filesetc/jitsi/— Jicofo, JVB, meet, and SSL configsetc/prosody/— Prosody XMPP server configsetc/postfix/— Postfix mail configsetc/mysql/— MariaDB configsetc/turnserver.conf.tpl— Coturn configsserver/— PM2 ecosystem config templatevar/lib/bind/— DNS zone data templates
Templates exist in public, private, and base variants (e.g., meet.public.conf.tpl, meet.private.conf.tpl, meet.conf.tpl).
configs/etc/ contains static (non-templated) files copied verbatim via copyConfigs():
etc/postfix/master.cfetc/cron.d/drumee
sysEnv()from@drumee/server-essentialsreads the existingdrumee.jsonto seed defaults.makeData(opt)merges env vars, CLI args, andsysEnv()into the template data object.makeConfData(data)adds random secrets (XMPP passwords, TURN secret, app keys) — these are regenerated on every run.writeEcoSystem(data)generates the PM2 ecosystem JSON atetc/drumee/infrastructure/ecosystem.json; it scales worker instances based on available RAM (2 GB → 2, 6 GB → 3, more → 4 instances).hasExistingSettings()intemplates/utils.jsguards against overwriting an existing installation unlessFORCE_INSTALL=1or--force-install.
- If
--public-domainis set: nginx, BIND, postfix, DKIM, and SSL configs for the public side are generated. - If
--private-domainis set (auto-derived as<public>.localif not given): private nginx, BIND, and cert configs are generated. --own-certs-dirsuppresses private domain cert generation and uses the provided directory instead.