Fix wiki dir permissions: run service as invoking user - #17
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 getattempt to write a readonly databaseerrors, making mind-map unusable for MCP clients.Fix
Service config: Set
UserNametoSUDO_USERin 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 -Rit 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