Skip to content

Fix wiki dir permissions: run service as invoking user - #17

Merged
aniongithub merged 1 commit into
mainfrom
fix/wiki-dir-permissions
May 5, 2026
Merged

Fix wiki dir permissions: run service as invoking user#17
aniongithub merged 1 commit into
mainfrom
fix/wiki-dir-permissions

Conversation

@aniongithub

Copy link
Copy Markdown
Owner

Problem

The Linux service runs as root (via sudo), creating wiki files and the SQLite database as root:root. Stdio agents run as the current user and get attempt to write a readonly database errors, making mind-map unusable for MCP clients.

Fix

Service config: Set UserName to SUDO_USER in the systemd unit so the service runs as the invoking user, not root. Both the service and stdio agents now operate as the same user.

Installer: Create the wiki directory before sudo, then chown -R it back to the user after service install to fix ownership of files created during the initial service start.

macOS: Already runs as a user agent (launchd), no change needed.

To fix an existing install

sudo chown -R $(id -u):$(id -g) ~/.mind-map/wiki/

The service runs via sudo on Linux, creating wiki files as root.
Stdio agents run as the current user and can't write to the DB.

Fixes:
- Service config sets UserName to SUDO_USER so systemd runs the
  service as the invoking user, not root
- Installer creates wiki dir before sudo, then chowns it back to
  the user after service install
- macOS already runs as user agent (no change needed)
@aniongithub
aniongithub merged commit d0cfbe1 into main May 5, 2026
1 check passed
@aniongithub
aniongithub deleted the fix/wiki-dir-permissions branch May 5, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant