feat: initial commit for ipv64 DNS TUI client
- Implement modular Textual TUI (main, app, widgets, config, api_client) - Integrate IPv64.net REST API client using httpx - Support record listing, creation, in-place edit, and deletion - Add flexible token resolution (.env, env export, interactive prompt) - Add bilingual README (DE/EN) and project configuration
This commit is contained in:
1 parent
fc1f055b11
commit
d15c927f55
11 files changed
+603
-1
No files matched your search
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python3
|
||||
"""IPv64 DNS TUI Client
|
||||
Author: Pascal Bouquet <pascal@ptbos.de>
|
||||
License: GNU General Public License v3.0 (GPL-3.0)
|
||||
Year: 2026
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
ENV_KEY_NAME = "IPV64_API_KEY"
|
||||
|
||||
# Standard-Platzhalter, die als "nicht konfiguriert" gewertet werden
|
||||
PLACEHOLDERS = {
|
||||
"",
|
||||
"dein_api_token_hier",
|
||||
"dein_api_key",
|
||||
"dein_geheimer_api_schluessel",
|
||||
"your_api_key_here",
|
||||
}
|
||||
|
||||
|
||||
def get_api_key() -> str:
|
||||
token = os.getenv(ENV_KEY_NAME, "").strip()
|
||||
|
||||
# Falls der Token leer ist oder noch ein Platzhalter drinsteht
|
||||
if token.lower() in PLACEHOLDERS:
|
||||
print("Kein gültiger API-Token gefunden (Platzhalter oder leer).")
|
||||
try:
|
||||
token = input("Bitte IPv64 API-Token eingeben: ").strip()
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
print("\nAbgebrochen.")
|
||||
sys.exit(0)
|
||||
|
||||
if not token or token.lower() in PLACEHOLDERS:
|
||||
print("Fehler: Ein gültiger Token ist erforderlich, um fortzufahren.")
|
||||
sys.exit(1)
|
||||
|
||||
return token
|
||||
Reference in new issue
Block a user