Skip to content

Configuration

HyScribe reads its settings from .env in the hyscribe/ folder, next to the binary. The setup wizard writes it; .env.example in the archive lists every key with a comment.

  • One KEY=value per line; # starts a comment. Values may be double quoted, as the wizard writes them
  • .env must be readable by its owner only (chmod 600 .env). Any group or other permission bit stops the start
  • Real environment variables override .env, key by key, so a container or a supervisor can inject a setting
  • No .env and no DB_NAME in the environment means the site is not set up: the binary starts the setup wizard instead of the site
  • A key set to an empty value counts as not set
  • Every yes or no key (BEHIND_PROXY, REST_PUBLIC_USERS, HTTP_OUTBOUND, EXTENSION_UPDATE_CHECK and the WordPress constants below) takes true, yes, on or 1, and false, no, off or 0, in any case
  • A value that cannot be used (a port of 0, MODE=read, BEHIND_PROXY=maybe) stops the start with an error naming the key. Secret values are never printed
  • Settings are read once at start. After editing .env, run ./hyscribe service restart

Check a configuration without starting anything:

./hyscribe config check the .env next to the binary
./hyscribe config check --dir /path the .env in another folder

It prints a summary with no passwords, keys or salts, or the first problem it finds, and exits with 1 on a problem.

The default is what HyScribe uses when the key is missing or empty. A test in crates/hyscribe-config fails when a key the loader reads is missing from this table, when the table names a key the loader does not read, or when a default here differs from the loader’s.

KeyDefaultWhat it does
DB_HOSTlocalhostDatabase server, as DB_HOST in wp-config.php. A Unix socket is written localhost:/run/mysqld/mysqld.sock; only localhost takes a socket, as for PHP’s mysqli
DB_PORT3306Database port, 1 to 65535. Not used with a socket
DB_NAMErequiredDatabase name
DB_USERrequiredDatabase user. In primary mode it needs the rights PHP WordPress’s user has
DB_PASSWORDnot setIts password
DB_PREFIXwp_$table_prefix from wp-config.php. Letters, digits and underscores only
DB_CHARSETutf8mb4Connection character set. The wizard turns utf8 from wp-config.php into utf8mb4, as WordPress does
DB_READ_USERnot setOptional user granted only SELECT. When set, every read and all of shadow mode use it, so a fault in a read cannot write. Without it, reads use DB_USER on a read only session
DB_READ_PASSWORDnot setIts password. Setting it without DB_READ_USER stops the start

TLS to the database server is not supported yet: HyScribe connects over TCP or a Unix socket without TLS.

KeyDefaultWhat it does
BIND_HOST127.0.0.1IP address to listen on. The default keeps the site private until a proxy is in front. A host name is refused
PORT8080Port to listen on, 1 to 65535. Ports below 1024 need CAP_NET_BIND_SERVICE, and HyScribe refuses to run as root
BEHIND_PROXYfalsetrue when a reverse proxy is in front: the last X-Forwarded-For address then names the client for login limits, comment flood checks, mail limits, the registration cap and a comment’s stored address, when the connection comes from a peer in TRUSTED_PROXIES
TRUSTED_PROXIES127.0.0.1,::1With BEHIND_PROXY on, the peers X-Forwarded-For is believed from: up to 256 comma separated IP addresses or CIDR ranges, such as 10.0.0.0/8 or fd00::/8. A connection from any other peer counts as its own address, whatever header it sends, so a client that reaches the port directly cannot name its address. An invalid entry stops the start
REQUEST_TIME_LIMIT30Seconds a request may run, from 1 to 86400. A request still running past it answers 503 and its unfinished write rolls back, so a write is never left half done. Cron and the mail queue run outside requests and are not cut by it
KeyDefaultWhat it does
MODEshadowshadow serves the site read only and never writes. primary serves and writes. Logins and hs-admin work in primary mode only
WP_HOMEnot setOverrides the home option, as the constant in wp-config.php does. Useful to try a copy of a site on another address
WP_SITEURLnot setOverrides the siteurl option, as the constant does. An https: address marks login cookies secure
UPLOADS_DIRnot setAn existing site’s uploads folder, left where it is. Uploads are written there and served at /wp-content/uploads/; without it, in uploads/ in the installation’s folder
REST_PUBLIC_USERSonon answers visitors at /wp-json/wp/v2/users as WordPress does, listing every user with published posts. off answers visitors as a site where no user has published posts
HTTP_OUTBOUNDoffon lets the server fetch from other sites, to public addresses only (see Security). off makes no outbound request at all
EMBED_ALLOWED_HOSTSprovidersWhere embeds may fetch from. providers (also unset or empty): WordPress’s oEmbed providers only. providers,media.example.org: the providers and these hosts, whose pages are also searched for an oEmbed link. Host names alone (no providers): only those hosts. none: no embed fetches. Names are comma separated, without scheme, port or path, matched exactly. A URL outside the list stays a plain link, nothing is fetched and no _oembed_ row is written. Fetching also needs HTTP_OUTBOUND=on
EXTENSION_TRUSTED_KEYSnot setminisign public keys trusted for extension packages you build yourself, comma separated: hyscribe plugin install <file> takes a package whose signature <file>.minisig one of them made. A key that does not read refuses the install. These keys never stand in for the hosted registry
EXTENSION_REGISTRYnot setThe hosted registry’s base URL, https: only (an http: URL stops the start): a mirror or a registry of your own. hyscribe plugin install <name> and hyscribe plugin update fetch from it whatever HTTP_OUTBOUND says; what they install is still checked against the root keys compiled into the binary, so a mirror can withhold files but forge none. Not set, the commands say so, until the project’s own registry has its address
EXTENSION_UPDATE_CHECKoffon makes the service fetch the registry’s key list and index at its start and every 12 hours, verify them against the root keys compiled into the binary, keep them in registry/ and stop any installed extension the registry has revoked. It installs nothing: the Plugins screen shows the updates, and hyscribe plugin update <id> installs them. Nothing about the site is sent. Needs HTTP_OUTBOUND=on and EXTENSION_REGISTRY; without either the start log says the check is off
RSS_ALLOWED_HOSTSnot setThe hosts the RSS block may fetch feeds from, comma separated host names (no scheme, port or path), matched exactly. Empty: every RSS block shows WordPress’s error for a feed it cannot reach. Fetching also needs HTTP_OUTBOUND=on
UPLOAD_MAX_SIZE64MThe largest upload, in place of PHP’s upload_max_filesize and post_max_size: whole bytes, or a number with K, M or G (either case), at least one byte. hs-admin shows it where WordPress shows its upload limit
IMAGE_MAX_BYTES64MThe largest image whose sizes are made, as a size like UPLOAD_MAX_SIZE. A larger image is kept with no sizes
IMAGE_MAX_WIDTH32000The widest image whose sizes are made, in pixels, from 1 to 4294967295
IMAGE_MAX_HEIGHT32000The tallest image whose sizes are made, in pixels, from 1 to 4294967295
IMAGE_MAX_AREA256000000The most pixels an image whose sizes are made may have
IMAGE_MAX_MEMORY1GThe most memory decoding one image may take, as a size. The defaults are the PHP oracle’s ImageMagick policy

The wizard copies these from wp-config.php when they are literal values there. A missing key takes the safer value, which for DISALLOW_UNFILTERED_HTML differs from a default WordPress install.

KeyDefaultWhat it does
DISALLOW_UNFILTERED_HTMLtrueNo one, administrators included, may save unfiltered HTML. Set false for WordPress’s own behaviour
ALLOW_UNFILTERED_UPLOADSfalseAs the WordPress constant
MULTISITEfalsetrue stops the start: multisite networks are not supported
EMPTY_TRASH_DAYS30Days posts and comments stay in the trash. 0 deletes them at once, and hs-admin and the REST API then offer only permanent deletes, as WordPress does
MEDIA_TRASHfalseWhether media files go to the trash before they are deleted, as wp-config.php’s constant of the same name. hs-admin’s Media screens, the edit screens and the General settings answer 501 while it is true
DISABLE_WP_CRONfalsetrue stops the service’s once a minute run of WordPress’s scheduled core jobs (publishing scheduled posts, emptying the trash, deleting expired transients and old auto-drafts and exports, failing stale privacy requests). Run ./hyscribe cron run from the system’s cron instead. Same values as above
ALTERNATE_WP_CRONfalseAccepted and ignored, with a line in the log: HyScribe makes no loopback request to replace. Same values

HyScribe’s own; PHP WordPress has none. Details in Security.

KeyDefaultWhat it does
LOGIN_LIMIT_ADDRESS5Wrong passwords from one client address within the window before that address is refused. 1 to 1000
LOGIN_LIMIT_ACCOUNT10Wrong passwords at one account within the window before it is refused, except from its recent login addresses. 1 to 1000
LOGIN_LIMIT_WINDOW900The window, in seconds. 1 to 86400
REGISTRATION_LIMIT_ADDRESS3Accounts one client address may create by registration in an hour, 0 to 1000. Past it, registration answers WordPress’s own registration error and writes nothing. -1 turns the cap off. Only accounts really created count

HyScribe sends mail to an SMTP relay you name, never through a local sendmail (ADR 0016). Without SMTP_HOST no mail is sent: each message is logged as not sent, the start log says mail is off, and users cannot reset their own passwords, as on a PHP host whose mail is broken. The relay’s certificate must match SMTP_HOST and is checked against the host’s certificate store; there is no setting to skip the check.

KeyDefaultWhat it does
SMTP_HOSTnot setThe relay’s host name or IP address. Unset sends no mail
SMTP_PORTnot setThe relay’s port: 587 for starttls, 465 for tls and 25 for none when unset
SMTP_TLSstarttlsstarttls requires STARTTLS (a relay that does not offer it fails the send, never falling back to plain text), tls speaks TLS from the first byte, none is plain text and only for a relay on this machine (localhost, 127.0.0.1 or ::1)
SMTP_USERnot setThe login for SMTP AUTH; unset logs in as no one. Refused with SMTP_TLS=none, so credentials never travel unencrypted
SMTP_PASSWORDnot setIts password. Never logged
MAIL_FROMnot setThe sender address of every message, one plain address such as wordpress@example.com. Unset uses WordPress’s default sender, wordpress@ and the site’s host without www.. A plugin or a message’s From header changes only the name shown

Limits (HyScribe’s own; PHP WordPress has none): at most 3 password reset mails per account and 10 per client address in an hour, refused past that as a failed send; at most 60 messages a minute in all, the rest waiting in a queue of 1,000 that refuses only when full. A password reset waits up to 30 seconds for its mail; other messages are sent in the background. Each message is logged on one line with its kind, the recipient’s domain, the outcome, the relay’s reply code and the time taken, never its subject, body or full address.

The eight keys and salts of wp-config.php. Copy them from the existing site so its users’ logins keep working; the wizard copies them, and generates any it cannot copy. A key that is not set falls back to the one stored in the database options (auth_key and so on), as WordPress does; with neither, logins fail.

KeyDefaultWhat it does
AUTH_KEYnot setAs in wp-config.php
SECURE_AUTH_KEYnot setAs in wp-config.php
LOGGED_IN_KEYnot setAs in wp-config.php
NONCE_KEYnot setAs in wp-config.php
AUTH_SALTnot setAs in wp-config.php
SECURE_AUTH_SALTnot setAs in wp-config.php
LOGGED_IN_SALTnot setAs in wp-config.php
NONCE_SALTnot setAs in wp-config.php
  • The request line limit (8,191 bytes, as Apache) and the 30 second header timeout
  • Log rotation size and count

WordPress is a registered trademark of the WordPress Foundation. HyScribe is an independent project and is not affiliated with, sponsored by or endorsed by the WordPress Foundation or Automattic.

Code under AGPL-3.0-or-later. The HyScribe name and logo are not covered by that licence. HyScribe is a product of HyScaler.