Add encrypted configuration backup and planned restore

This commit is contained in:
Mikei386
2026-09-30 14:20:21 +02:00
parent 18adaf4a52
commit e7a1deaab0
22 changed files with 844 additions and 28 deletions
+4 -4
View File
@@ -7,12 +7,12 @@ MANAGED_LABEL='io.athena-deck.managed=true'
ROLE_LABEL='io.athena-deck.role=application'
class DockerSupport:
def call(self,action,service=None):
def call(self,action,service=None,values=None):
path=os.environ.get('DECK_DOCKER_HELPER_SOCKET','/run/athena-deck-docker/control.sock')
with socket.socket(socket.AF_UNIX) as sock:
sock.settimeout(65);sock.connect(path);sock.sendall(json.dumps({'action':action,**({'service':service} if service is not None else {})}).encode()+b'\n')
with sock.makefile('rb') as stream:raw=stream.readline(1048577)
if len(raw)>1048576:raise ValueError('Docker-Helferantwort zu groß.')
sock.settimeout(1900);sock.connect(path);sock.sendall(json.dumps({'action':action,**({'service':service} if service is not None else {}),**(values or {})}).encode()+b'\n')
with sock.makefile('rb') as stream:raw=stream.readline(67108865)
if len(raw)>67108864:raise ValueError('Docker-Helferantwort zu groß.')
value=json.loads(raw)
if 'error' in value:raise ValueError(value['error'])
return value