feat(services): load service plugins from git repos

Allow directories.services entries to be git repo specs (URL/owner-repo/ @branch) alongside local paths: clone + TTL-pull as cache, list-order priority with a duplicate-ignored summary, a refresh-services command that force-syncs and reports the per-service diff, and a dirty-clone guard that protects local edits on the automated path. Adds binaries.Git and a redact_paths config toggle.
This commit is contained in:
imSp4rky
2026-06-24 08:59:03 -06:00
parent 6294566823
commit 66638ead6b
11 changed files with 704 additions and 12 deletions
+12 -2
View File
@@ -77,13 +77,23 @@ def _path_bases() -> list[tuple[str, str]]:
_PATH_BASES = _path_bases()
def _path_redaction_enabled() -> bool:
"""Path-prefix redaction is on unless ``config.redact_paths`` is explicitly False."""
try:
from unshackle.core.config import config # lazy: config doesn't import redact, so no cycle
return bool(getattr(config, "redact_paths", True))
except (ImportError, AttributeError):
return True
def redact_path(text: Optional[str]) -> Optional[str]:
"""Replace local base-directory prefixes (install root, venv, home) in ``text`` with tokens.
Idempotent and cheap; only touches strings that actually contain a known base dir, so URLs
and relative paths pass through unchanged.
and relative paths pass through unchanged. Disabled by ``config.redact_paths: false``.
"""
if not isinstance(text, str) or not text:
if not isinstance(text, str) or not text or not _path_redaction_enabled():
return text
for base, token in _PATH_BASES:
if base in text: