mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-09-30 16:09:37 +02:00
feat: add FUZZFORGE_USER_DIR env var to override user-global data dir
This commit is contained in:
1 parent
544569ddbd
commit
976947cf5c
2 files changed
+12
-2
No files matched your search
@@ -177,7 +177,9 @@ def _generate_mcp_config(
|
|||||||
# User-global storage paths for FuzzForge containers.
|
# User-global storage paths for FuzzForge containers.
|
||||||
# Kept under ~/.fuzzforge so images are built once and shared across
|
# Kept under ~/.fuzzforge so images are built once and shared across
|
||||||
# all workspaces — regardless of where `fuzzforge mcp install` is run.
|
# all workspaces — regardless of where `fuzzforge mcp install` is run.
|
||||||
fuzzforge_home = Path.home() / ".fuzzforge"
|
# Override with FUZZFORGE_USER_DIR for isolated testing.
|
||||||
|
user_dir_env = os.environ.get("FUZZFORGE_USER_DIR")
|
||||||
|
fuzzforge_home = Path(user_dir_env).resolve() if user_dir_env else Path.home() / ".fuzzforge"
|
||||||
graphroot = fuzzforge_home / "containers" / "storage"
|
graphroot = fuzzforge_home / "containers" / "storage"
|
||||||
runroot = fuzzforge_home / "containers" / "run"
|
runroot = fuzzforge_home / "containers" / "run"
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ and managing linked MCP hub repositories.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@@ -37,9 +38,16 @@ def get_fuzzforge_user_dir() -> Path:
|
|||||||
repositories, the hub registry, container storage (graphroot/runroot),
|
repositories, the hub registry, container storage (graphroot/runroot),
|
||||||
and the hub workspace volume.
|
and the hub workspace volume.
|
||||||
|
|
||||||
:return: ``Path.home() / ".fuzzforge"``
|
Override with the ``FUZZFORGE_USER_DIR`` environment variable to
|
||||||
|
redirect all user-global data to a custom path — useful for testing
|
||||||
|
a fresh install without touching the real ``~/.fuzzforge/``.
|
||||||
|
|
||||||
|
:return: ``Path.home() / ".fuzzforge"`` or ``$FUZZFORGE_USER_DIR``
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
env_dir = os.environ.get("FUZZFORGE_USER_DIR")
|
||||||
|
if env_dir:
|
||||||
|
return Path(env_dir).resolve()
|
||||||
return Path.home() / ".fuzzforge"
|
return Path.home() / ".fuzzforge"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user