Config · config.yaml

Editing config.yaml.

DayMug reads one YAML file when it starts. This page shows where that file is and what every field does. Restart the service after editing — the file is only read at startup. Provider accounts, users and bots are not in this file — they are managed from the web UI.

Where the file is

After a one-line install the file is ~/.daymug/config.yaml. DayMug looks for its config in this order and uses the first one that exists:

#SourceExample
1--config flagdaymug serve --config /etc/daymug/config.yaml
2DAYMUG_CONFIG env varDAYMUG_CONFIG=/srv/daymug.yaml daymug serve
3config.yaml next to the binary~/.daymug/config.yaml for ~/.daymug/daymug

If none of them exists DayMug refuses to start instead of guessing. Lost your file? Grab a fresh, fully commented copy:

start from the template
curl -fsSL https://github.com/DayMug/DayMug/releases/latest/download/config.example.yaml -o ~/.daymug/config.yaml

Want to read every field with its comment first? Open config.example.yaml on GitHub — it is the same template. daymug bootstrap keeps an existing config.yaml untouched, so re-running the installer is safe.

Field reference

Every key is optional. The default column is what you get when the key is left out.

server

Where the process listens and how the outside world addresses it.

addr:8080

Listen address. The installer writes 127.0.0.1:8090. Use 127.0.0.1:<port> behind a proxy on the same host, 0.0.0.0:<port> to expose it directly. DAYMUG_ADDR overrides it.

public_urlempty

The URL people open, e.g. https://chat.example.com. Recommended: push notifications build their tap-to-open links from it; empty means pushes arrive but tapping them does nothing.

auth

Browser session lifetime and which login methods are open.

session_ttl720h

How long a login stays valid (720h = 30 days).

cookie_securefalse

Force the Secure cookie flag. The flag is already added automatically for HTTPS requests (direct TLS or X-Forwarded-Proto: https). Set true only when TLS ends at a proxy that drops that header. Turning it on over plain HTTP makes login impossible.

password_login_enabledtrue

Username + password login. Set false when SSO should be the only way in.

admin

Recovery hatch for administrator access.

bootstrap_usernames[]

Usernames promoted to admin on every start. Put your own name here before the first start.

users

Home directories and per-person concurrency.

default_home_root~/.daymug/users

New users get <root>/<username> as their work directory. Must resolve to an absolute path. Admins can override a single user's directory in the Users page; the root itself is config-only.

max_concurrent4

Tasks one person may run at once, across every account and entry point (web, API, IM bots, /compact). Extra tasks queue. Values below 1 mean "use the default".

runner (top-level keys)

How agent processes are supervised. These three keys sit at the top level of the file, not under a section.

runner_stall_timeout10m

After this long with no output, DayMug checks CPU time and session logs for signs of life instead of killing the agent — so a quiet long-running tool survives.

runner_max_silent_timeout2h

Hard ceiling on one silent stretch, even if the agent still looks busy. Must be ≥ runner_stall_timeout.

im_run_timeout0s

Wall-clock cap on one turn started from Slack / 飞书 / Telegram / 微信. 0s = no cap (the watchdog above still catches stuck turns).

guardrails

Soft reminders for unusually expensive user messages. Counts cover the main agent only (sub-agents are not counted) and reset with every new message. The active task always finishes uninterrupted; the next user message gets one reminder and continues normally. Any threshold set to 0 is off; negative values are rejected.

max_model_calls_per_turn50

Model-request threshold for reminding on the next message.

max_tool_calls_per_turn100

Tool-invocation threshold for reminding on the next message.

max_cost_usd_per_turn0

Estimated USD threshold for reminding on the next message. Off by default.

retention

Automatic cleanup of old data. Every key defaults to 0, which turns that cleanup off — nothing is deleted unless you opt in. Conversation sweeps run in the background every 6 hours.

inactive_conversations0

Delete conversations with no activity for this long, as if their owner had deleted them. Pinned conversations are kept. E.g. 336h = 14 days.

deleted_conversations0

Permanently erase deleted users, agents and conversations (with their messages) this long after deletion. E.g. 168h = 7 days.

uploads0

Delete uploaded files older than this, the next time something is uploaded to the same folder. Old chats that show them get broken links. E.g. 720h = 30 days.

context (top-level keys)

When a long session gets compacted or retired. Both are fractions of the model's context window, so one value means the same on a 200k and a 1M window.

auto_compact_ratio0

Run /compact automatically once a finished turn leaves the context at or above this fraction. 0 = manual only. Must be in [0, 1). 0.6–0.7 is a good start.

case_rotate_context_ratio0.70

For agents with case-file mode on: retire an IM thread's session past this fraction and restart it from the case document. Range (0, 1). Here 0 means "use the default", not "off" — turn case mode off on the agent instead.

sandbox

Optional per-process isolation around every agent run.

enabledfalse

Turn isolation on. Only meaningful together with type: bwrap.

typenoop

noop — no isolation; agents can reach whatever the service user can. bwrap — Linux bubblewrap; non-exempt users are confined to their own work directory.

networktrue

bwrap only. Lets jailed agents use the network; false starts them offline.

extra_ro_binds[]

Absolute host paths every jailed agent may read, e.g. a shared assets folder.

extra_rw_binds[]

Absolute host paths every jailed agent may write. Keep this list short.

oidc

Optional single sign-on via Casdoor or any OpenID Connect provider. With enabled: false every other key is ignored. When enabled, a wrong issuer stops startup so mistakes surface immediately.

enabledfalse

Show the SSO button and accept OIDC logins.

issuerrequired*

Issuer URL; endpoints are discovered from /.well-known/openid-configuration.

client_idrequired*

OAuth client ID issued by your identity provider.

client_secretrequired*

OAuth client secret. Keep the file chmod 600.

redirect_urirequired*

Must equal your public URL + /api/auth/oidc/callback, character for character, and be registered at the IdP.

scopesopenid, profile, email

Keep profile — Casdoor puts groups/roles/permissions on userinfo only with it.

group_claim · role_claim · permission_claimgroups · roles · permissions

Claim names to read. Change only if your IdP uses different keys.

required_groups · required_roles · required_permissions[]

Access policy. A user needs at least one match in at least one non-empty list. All empty = any authenticated user may enter.

auto_provisiontrue

Create a local user on first SSO login (matched by email). false = only users an admin created beforehand.

button_labelSign in with SSO

Text of the SSO button on the login page.

* required only when oidc.enabled is true.

upgrade

Self-upgrade watchdog: which service to restart after swapping the binary, and when to roll back.

servicedaymug

Service unit name.

service_modeuser

user uses systemctl --user (and the macOS LaunchAgent); system for a root-level systemd unit.

health_path/api/health

Path polled on localhost after a restart. Must start with /.

health_timeout60s

No healthy answer within this time → the previous binary is restored.

usage

Settings → Usage: which timezone draws the day boundary, and when a conversation gets flagged. Flags only colour the report. guardrails separately schedules a reminder for the user's next message; neither mechanism interrupts a running task.

timezoneAsia/Shanghai

IANA name (Europe/Berlin, America/New_York), UTC or Local. A typo stops startup. Changing it does not re-bucket old rows.

high_model_requests20

Flag a conversation whose busiest turn made more model requests than this.

high_tool_calls30

Same, for tool calls.

high_conversation_cost_usd10

Flag a conversation that cost more than this in the selected range.

context_warning_ratio0.8

Flag a conversation whose context reached this fraction of the window. Between 0 and 1.

Not in this file

The SQLite database is always <binary dir>/data/database.db. Provider accounts, models and prices live in the database and are edited under Providers & models. Users, account bindings and sandbox exemptions are in the Users page; IM bots are attached to agents. An old providers: block in YAML is imported once into an empty database and then ignored — you can delete it.