Init repo

This commit is contained in:
2025-01-22 21:07:21 +01:00
commit 3185ecbc3a
7 changed files with 57 additions and 0 deletions

24
libs/uberspace.py Normal file
View File

@@ -0,0 +1,24 @@
class Uberspaceify:
def __init__(self, node=None):
self.node = node
def nodes(self, nodes):
for node_name in nodes.keys():
if not node_name.endswith(".uber.space"):
continue
uberspace_name = node_name.removesuffix(".uber.space")
nodes[node_name]["hostname"] = node_name
nodes[node_name]["username"] = uberspace_name
nodes[node_name]["cmd_wrapper_outer"] = "sh -c {}"
nodes[node_name]["lock_dir"] = f"/home/{uberspace_name}/.local/state/bundlewrap"
return nodes
def files(self, files):
for file_name in files.keys():
files[file_name]["owner"] = self.node.username
files[file_name]["group"] = self.node.username
return files