Users, SSO & sandbox.
DayMug is built to be shared. This page covers who can sign in, what they can reach, and how to keep one person's agent out of another person's files.
Agents run real shell commands as the user DayMug runs as. Without the bubblewrap sandbox, every agent can read and write everything that user can — including other people's work directories and DayMug's own database. Only share an unsandboxed instance with people you'd give a shell account to.
Users and admins
The first person to open an empty instance creates the first administrator. After that, admins manage everyone under Settings → Administration → Users: create users, reset passwords, set work directories, grant provider accounts and choose each user's sandbox mode — one at a time or in bulk.
From the shell, as the service user:
~/.daymug/daymug user add alice --email [email protected] # prompts for a password
~/.daymug/daymug user add bob --email [email protected] --admin # admin right away
~/.daymug/daymug user passwd alice # reset a password- Work directory — each user starts in
<users.default_home_root>/<username>(default~/.daymug/users/alice). Admins can point a user elsewhere; each conversation can also pick its own folder. - Admin recovery — anyone listed in
admin.bootstrap_usernamesis made admin again on every start. See recipe. - Personal environment — every user can set
KEY=valuelines in Settings → Advanced. They reach all of that user's agents and override the provider account's values of the same name — handy for personal tokens (GITHUB_TOKEN, …). - Concurrency —
users.max_concurrent(default 4) caps how many tasks one person runs at once.
Single sign-on (OIDC)
DayMug speaks standard OpenID Connect (authorization code flow with state and nonce). The examples here use Casdoor; any standards-compliant OpenID Connect provider should work the same way.
-
Register an application at your IdP
Redirect URL:
https://<your DayMug URL>/api/auth/oidc/callback. Grant types: authorization code (+ refresh token). Scopes:openid profile email. Note the client id and secret. -
Add the
oidcblock to config.yamloidc: enabled: true issuer: https://sso.example.com client_id: "daymug" client_secret: "…" redirect_uri: https://chat.example.com/api/auth/oidc/callback scopes: [openid, profile, email] required_groups: [engineering] # who may enter; empty = everyone at the IdP auto_provision: true # create local users on first login button_label: "Sign in with Company SSO" - Restart and test in a private window. DayMug contacts the issuer at startup; if discovery fails the service won't start, and the log says why.
-
Optionally switch off passwords with
auth.password_login_enabled: false— after you've confirmed an SSO admin can sign in.
Who gets in
- Users are matched to local accounts by email.
required_groups,required_roles,required_permissions: a user needs at least one match in at least one non-empty list. With all three empty, anyone who can authenticate at the IdP may enter.auto_provision: falseturns SSO into a closed allow-list: an admin creates the user (with the same email) first.- Claims are read from
groups/roles/permissions; rename withgroup_claim,role_claim,permission_claimif your IdP differs.
Token format JWT-Standard; keep the profile scope, otherwise groups, roles and permissions don't appear on userinfo. A Casdoor Permission named daymug plus required_permissions: [daymug] is a clean way to gate access.
Sandbox (bubblewrap)
On Linux, DayMug can wrap every agent run in a bubblewrap jail. A jailed agent sees its own work directory and the system files it needs to run — not other users' folders, not DayMug's database, not host secrets.
-
Install bwrap
sudo apt install bubblewrap # Debian / Ubuntu sudo dnf install bubblewrap # Fedora / RHEL -
Enable it in config.yaml and restart
sandbox: enabled: true type: bwrap network: true # false = agents run offline extra_ro_binds: [/srv/reference] # everyone may read this extra_rw_binds: [] # everyone may write this — keep it short -
Check the startup log. If
bwrapis missing DayMug still starts — so a missing optional binary can't take you offline — but logs a line beginning withSECURITY:and runs with no isolation.grep SECURITY ~/.daymug/logs/daymug.log - Choose exemptions. In the Users page, each user's Sandbox is Jailed (work dir only) or Unrestricted. Admins always run unwrapped.
The same rule applies on every entry point — browser chat, the
/api/v1 API and IM bots. An agent's jail follows the
person who owns it.
Exposing it safely
- Keep
server.addron127.0.0.1and put TLS in front (your own reverse proxy) — see Install → reach it. - Set
server.public_urlto the HTTPS address. - If your proxy doesn't forward
X-Forwarded-Proto, setauth.cookie_secure: true. - Keep
config.yamlprivate (chmod 600) when it holds an OIDC secret. Provider keys and bot tokens live in the SQLite database under~/.daymug/data/— protect and back up that directory accordingly. - Set guardrails so a looping agent pauses instead of spending all night.