Skip to content

CLI and configuration

Mockifyr has no configuration file. Every setting is a command-line flag on the host process.

The host builds its configuration with the standard .NET configuration builder, so every flag is also readable as an environment variable of the same name. That is why this works:

Terminal window
docker run -p 8080:8080 -e admin-user=alice -e admin-pass='s3cret' ghcr.io/omercelikdev/mockifyr

Command-line arguments win over environment variables when both supply the same key.

Flags

Listeners

FlagDefaultEffect
--port <n>8080Mock-serving HTTP port. 0 picks an ephemeral port.
--https-port <n>unset (no HTTPS listener)Enables the TLS listener. Both listeners then negotiate HTTP/1.1 and HTTP/2.
--https-keystore <path>unset → ephemeral self-signed RSA-2048 certificatePFX/PKCS#12 server certificate.
--https-keystore-password <p>nonePassword for the keystore.
--https-require-client-authfalseRequires a client certificate (mTLS). Applies to the HTTPS listener only.
--https-truststore <path>unsetCA anchor the client certificate must chain to. With none set, any well-formed client certificate is accepted.
--https-truststore-password <p>nonePassword for the truststore. If empty, the file is loaded as a plain certificate.

See HTTPS, HTTP/2 and mTLS.

Files and the dashboard

FlagDefaultEffect
--root-dir <dir>unsetLoads <dir>/mappings/*.json at startup, persists stub mutations there, and provides <dir>/__files, <dir>/grpc/*.dsc, <dir>/environments/ and <dir>/outbound-trust.json.
--dashboard <dir>unsetServes the built dashboard under /__mockifyr, only if the directory exists.

Message channels

FlagDefaultEffect
--smtp-port <n>unsetStarts the ESMTP capture listener: real mail in, realistic replies out, everything captured into the tenant inbox. The AUTH username selects the tenant. See Email & SMS mocking.
--sms-profile twiliounsetMounts Twilio’s send-message endpoint on the mock surface — the official SDK works unchanged; every send is captured. A stub on the same URL still wins.
--message-limit <n>1000Per-tenant inbox bound; the oldest message is evicted first.

Admin authentication

FlagDefaultEffect
--admin-user <u>unsetAdmin username.
--admin-pass <p>unsetAdmin password.

Both must be given together. If only one is set, auth stays off — see securing the admin API.

Persistence

FlagDefaultEffect
--litedb <path>unsetLiteDB persistence and loader.
--postgres <connstr>unsetPostgreSQL persistence and loader.
--redis <connstr>unsetRedis persistence and loader.
--change-feedfalseMulti-instance coherence. Only wired when --postgres or --redis is set.

See persistence.

Serving behaviour

FlagDefaultEffect
--global-response-templatingfalseEvery response renders through the templating engine regardless of the per-stub transformers list. See templating.

Outbound calls

FlagDefaultEffect
--outbound-host-fallback <true|false>trueContainer-localhost retry for callbacks and proxies.
--trust-proxy-target <host>noneTrust that host’s certificate on outbound calls. Repeatable, and also accepts a comma- or semicolon-separated list. Exact host match, no wildcards.
--trust-all-proxy-targetsfalseDisables outbound certificate verification entirely.

--webhook-host-fallback is a kept alias for --outbound-host-fallback from v0.8.1. If both are present, the new key wins.

Relevant to proxying and webhooks.

Git sync

FlagDefaultEffect
--git-remote <url>unsetPins Git sync to that remote. Requires --root-dir or startup fails.
--git-branch <name>mainBranch for Git sync.
--git-work-dir <dir><cwd>/mockifyr-dataOverrides the default Git working copy.

Environment variables that are not flags

Two settings exist only as environment variables:

VariablePurpose
MOCKIFYR_GIT_TOKENHTTPS Git credential token.
MOCKIFYR_GIT_USERNAMEHTTPS Git username.

They are supplied to Git through an inline credential helper: never passed in argv, never written to disk.

Reserved URL prefixes

PrefixSurface
/__adminThe admin REST API, and the scope of Basic auth.
/__mockifyrThe dashboard.

Everything else is the mock-serving surface.

Docker

The image is ghcr.io/omercelikdev/mockifyr, built for linux/amd64 and linux/arm64. It exposes 8080 and its baked entrypoint is:

Terminal window
dotnet Mockifyr.Server.dll --port 8080 --dashboard /app/dashboard --root-dir /work

Extra flags appended to docker run are passed through to that entrypoint:

Terminal window
docker run -p 8080:8080 ghcr.io/omercelikdev/mockifyr --global-response-templating

To run engine-only with no dashboard, override the entrypoint so that --dashboard is dropped.

Without Docker

Requires the .NET 10 SDK:

Terminal window
dotnet run --project src/Mockifyr.Server -- --port 8080 --root-dir .