docs+tooling: Gitea-Token-Quelle auf ~/.secrets/credentials.env (Fallback .env)
gitea-tp-sync.py suchte den Token nur in ~/.hermes/.env; dort liegt er seit der Secrets-Konsolidierung nicht mehr. Jetzt: ~/.secrets/credentials.env zuerst, .env als Fallback, beide Wege in der Meldung.
This commit is contained in:
@@ -18,7 +18,7 @@ DNS/DHCP-Ablösung, WLAN via **CAPsMAN auf dem Core** (TP28, 2026-08-17), Firewa
|
|||||||
**Prosa/Detail = Repo** (`docs/teilprojekte.md` aktiv + `teilprojekte-archiv.md`, `### TPnn`-Abschnitte) ·
|
**Prosa/Detail = Repo** (`docs/teilprojekte.md` aktiv + `teilprojekte-archiv.md`, `### TPnn`-Abschnitte) ·
|
||||||
**Live-Gerätedaten = Nautobot** (Compliance-Zahl, RouterOS-Version …). Ein Status ändert sich **in Gitea**,
|
**Live-Gerätedaten = Nautobot** (Compliance-Zahl, RouterOS-Version …). Ein Status ändert sich **in Gitea**,
|
||||||
nicht mehr in einer Repo-Datei. Archiv-Backfill-Werkzeug `bin/gitea-tp-sync.py` (Dry-Run default,
|
nicht mehr in einer Repo-Datei. Archiv-Backfill-Werkzeug `bin/gitea-tp-sync.py` (Dry-Run default,
|
||||||
Token aus `~/.hermes/.env`, **nie ausgeben**).
|
Token aus `~/.secrets/credentials.env` (Fallback `~/.hermes/.env`), **nie ausgeben**).
|
||||||
- 🔴 **Die TP-Header in beiden Dateien tragen KEINEN Status mehr** (seit 2026-10-03). Form:
|
- 🔴 **Die TP-Header in beiden Dateien tragen KEINEN Status mehr** (seit 2026-10-03). Form:
|
||||||
`### TP25 · Gitea #17 — <Titel> — <Caveat>`. Der `· Gitea #N`-Zeiger ist die Brücke zum Issue.
|
`### TP25 · Gitea #17 — <Titel> — <Caveat>`. Der `· Gitea #N`-Zeiger ist die Brücke zum Issue.
|
||||||
Wer einen Status sucht, liest das **Label im Board** — nicht den Datei-Kopf. Der alte `▸ ✅ FERTIG …`-Anspruch
|
Wer einen Status sucht, liest das **Label im Board** — nicht den Datei-Kopf. Der alte `▸ ✅ FERTIG …`-Anspruch
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ Abgrenzung:
|
|||||||
- Status/Thema/State bestehender Issues: aendert nur der Mensch im Board.
|
- Status/Thema/State bestehender Issues: aendert nur der Mensch im Board.
|
||||||
- Per-TP-Prosa: bleibt in docs/teilprojekte.md / teilprojekte-archiv.md.
|
- Per-TP-Prosa: bleibt in docs/teilprojekte.md / teilprojekte-archiv.md.
|
||||||
|
|
||||||
Token: ~/.hermes/.env (GITEA_ACCESS_TOKEN, GITEA_HOST) — wird NIE ausgegeben.
|
Token: ~/.secrets/credentials.env (Fallback ~/.hermes/.env) — GITEA_ACCESS_TOKEN/GITEA_HOST,
|
||||||
|
wird NIE ausgegeben.
|
||||||
|
|
||||||
Aufruf:
|
Aufruf:
|
||||||
python3 bin/gitea-tp-sync.py # Dry-Run (default) — zeigt, was fehlt
|
python3 bin/gitea-tp-sync.py # Dry-Run (default) — zeigt, was fehlt
|
||||||
@@ -36,6 +37,7 @@ REPO = Path(__file__).resolve().parent.parent
|
|||||||
ACTIVE = REPO / "docs" / "teilprojekte.md"
|
ACTIVE = REPO / "docs" / "teilprojekte.md"
|
||||||
ARCHIV = REPO / "docs" / "teilprojekte-archiv.md"
|
ARCHIV = REPO / "docs" / "teilprojekte-archiv.md"
|
||||||
HERMES = Path.home() / ".hermes" / ".env"
|
HERMES = Path.home() / ".hermes" / ".env"
|
||||||
|
SECRETS = Path.home() / ".secrets" / "credentials.env"
|
||||||
OWNER_REPO = "admin/bf-infra"
|
OWNER_REPO = "admin/bf-infra"
|
||||||
COMMIT = "--commit" in sys.argv
|
COMMIT = "--commit" in sys.argv
|
||||||
|
|
||||||
@@ -65,17 +67,26 @@ THEME = {
|
|||||||
|
|
||||||
|
|
||||||
def hermes_env():
|
def hermes_env():
|
||||||
|
"""Token/Host suchen: zuerst ~/.secrets/credentials.env, dann ~/.hermes/.env.
|
||||||
|
|
||||||
|
Seit 2026-10-28 liegt der Token im Secrets-Store; das alte .env ist Fallback.
|
||||||
|
"""
|
||||||
tok = host = None
|
tok = host = None
|
||||||
for line in HERMES.read_text().splitlines():
|
for path in (SECRETS, HERMES):
|
||||||
m = re.match(r"\s*(GITEA_ACCESS_TOKEN|GITEA_HOST)\s*=\s*(.+?)\s*$", line)
|
if not path.exists():
|
||||||
if not m:
|
|
||||||
continue
|
continue
|
||||||
if m.group(1) == "GITEA_ACCESS_TOKEN":
|
for line in path.read_text(errors="ignore").splitlines():
|
||||||
tok = m.group(2).strip().strip('"').strip("'")
|
m = re.match(r"\s*(?:export\s+)?(GITEA_ACCESS_TOKEN|GITEA_HOST)\s*=\s*(.+?)\s*$", line)
|
||||||
else:
|
if not m:
|
||||||
host = m.group(2).strip().strip('"').strip("'")
|
continue
|
||||||
|
if m.group(1) == "GITEA_ACCESS_TOKEN":
|
||||||
|
tok = m.group(2).strip().strip('"').strip("'")
|
||||||
|
else:
|
||||||
|
host = m.group(2).strip().strip('"').strip("'")
|
||||||
|
if tok:
|
||||||
|
break
|
||||||
if not tok:
|
if not tok:
|
||||||
sys.exit("GITEA_ACCESS_TOKEN nicht in %s gefunden." % HERMES)
|
sys.exit("GITEA_ACCESS_TOKEN weder in %s noch in %s gefunden." % (SECRETS, HERMES))
|
||||||
host = (host or "https://gitea.emsenhuber.net").rstrip("/")
|
host = (host or "https://gitea.emsenhuber.net").rstrip("/")
|
||||||
if not host.startswith("http"):
|
if not host.startswith("http"):
|
||||||
host = "https://" + host
|
host = "https://" + host
|
||||||
|
|||||||
Reference in New Issue
Block a user