Add JSON API endpoint, CLI tool, and MCP server

- Add /api/finger and /api/finger/<username> JSON endpoints
- Remove hardcoded default credentials from config.py; require BASIC_AUTH_USERS env var
- Add cli/finger.py: query and plan-upload CLI using the JSON API
- Add mcp/server.py: FastMCP server exposing finger_user and upload_plan tools
- All credentials and base URL are read from environment variables
This commit is contained in:
waffle2k
2026-05-07 12:03:23 -07:00
parent 1e53363271
commit 178d3f361c
6 changed files with 227 additions and 14 deletions
+4 -4
View File
@@ -30,12 +30,12 @@ class Config:
SCP_ENABLED = os.environ.get('SCP_ENABLED', 'false').lower() == 'true'
# Basic authentication credentials - multiple users support
# Environment variable format: "user1:pass1,user2:pass2,user3:pass3"
BASIC_AUTH_USERS_STR = os.environ.get('BASIC_AUTH_USERS') or 'admin:password,uploader:upload123,user:user123'
# Environment variable format: "user1:pass1,user2:pass2"
BASIC_AUTH_USERS_STR = os.environ.get('BASIC_AUTH_USERS', '')
# Parse users string into dictionary
BASIC_AUTH_USERS = {}
for user_pass in BASIC_AUTH_USERS_STR.split(','):
if ':' in user_pass:
username, password = user_pass.strip().split(':', 1) # Split only on first colon
username, password = user_pass.strip().split(':', 1)
BASIC_AUTH_USERS[username.strip()] = password.strip()