fix: resolve read-only file system issues for Nix packaging

- Add config_paths.py for XDG-compliant path resolution
- Update all servers to use user-writable locations (logs, tokens, .env)
- Make .env file optional - server works with environment variables only
- Default paths: ~/.local/share for data, ~/.local/state for logs
- Update Nix wrapper with XDG defaults and helpful postInstall message
- Update README.md with environment variable configuration documentation

Fixes OSError when running in Nix store (read-only filesystem)
This commit is contained in:
m3tm3re
2026-01-21 20:42:05 +01:00
parent a81ea23782
commit 503e97e520
6 changed files with 1424 additions and 1211 deletions

View File

@@ -12,12 +12,12 @@ import threading
from datetime import datetime, timedelta
import logging
# Determine the directory where this script (token_storage.py) is located
from config_paths import get_token_file_path
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
# Allow token file location to be configured via environment variable
# Falls back to oauth_tokens.json in the script directory if not set
TOKEN_FILE = os.environ.get(
"BASECAMP_TOKEN_FILE", os.path.join(SCRIPT_DIR, "oauth_tokens.json")
"BASECAMP_TOKEN_FILE",
str(get_token_file_path()),
)
# Lock for thread-safe operations