mirror of
https://github.com/shadoll/redmine-mcp.git
synced 2026-08-28 03:27:56 +00:00
Refactor environment variable validation in config.py for improved error messaging; update Docker Compose restart policy to on-failure
This commit is contained in:
+5
-4
@@ -5,7 +5,8 @@ REDMINE_API_KEY = os.environ.get("REDMINE_API_KEY", "")
|
|||||||
|
|
||||||
|
|
||||||
def validate():
|
def validate():
|
||||||
if not REDMINE_URL or not REDMINE_API_KEY:
|
missing = [name for name, val in [("REDMINE_URL", REDMINE_URL), ("REDMINE_API_KEY", REDMINE_API_KEY)] if not val]
|
||||||
raise RuntimeError(
|
if missing:
|
||||||
"REDMINE_URL and REDMINE_API_KEY environment variables must be set."
|
print(f"ERROR: Required environment variable(s) not set: {', '.join(missing)}")
|
||||||
)
|
print("Set them in your .env file or pass via -e flags. Exiting.")
|
||||||
|
raise SystemExit(0)
|
||||||
|
|||||||
+1
-1
@@ -9,4 +9,4 @@ services:
|
|||||||
MCP_TRANSPORT: http
|
MCP_TRANSPORT: http
|
||||||
MCP_HOST: 0.0.0.0
|
MCP_HOST: 0.0.0.0
|
||||||
MCP_PORT: 8000
|
MCP_PORT: 8000
|
||||||
restart: unless-stopped
|
restart: on-failure
|
||||||
|
|||||||
Reference in New Issue
Block a user