Add configurable Deck GUI host allowlist with backup and restore

This commit is contained in:
Mikei386 committed 2026-10-07 20:56:49 +02:00
1 parent b5f161531e
commit 0966abf1b5
14 files changed
+237 -17

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ def main():
if base.exists() and not (base/'managed-by-deck').exists():raise SystemExit('Installationsverzeichnis belegt.')
base.mkdir(mode=0o755,exist_ok=True);(base/'managed-by-deck').touch();(base/'network').mkdir(exist_ok=True)
source=Path(__file__).resolve().parent.parent/'network'
for name in ('__init__.py','native.py','config.py','policy.py'):shutil.copyfile(source/name,base/'network'/name)
for name in ('__init__.py','native.py','config.py','policy.py','hosts.py'):shutil.copyfile(source/name,base/'network'/name)
state.mkdir(mode=0o700,exist_ok=True);state.chmod(0o700)
policy=state/'policy.json';interfaces=json.loads(subprocess.check_output(['ip','-j','address','show'],text=True))
interface=next((r['ifname'] for r in interfaces if any(v.get('local')==str(address) for v in r.get('addr_info',[]))),None)