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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user