From 38be6c13f76e893cf47636257071b440dec0c5b2 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sun, 7 Sep 2025 17:32:13 +0200 Subject: initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- bundles/syncthing/items.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 bundles/syncthing/items.py (limited to 'bundles/syncthing/items.py') diff --git a/bundles/syncthing/items.py b/bundles/syncthing/items.py new file mode 100644 index 0000000..75b713c --- /dev/null +++ b/bundles/syncthing/items.py @@ -0,0 +1,44 @@ +if node.os != "alpine": + raise BundleError(f"{node.name}: OS {node.os} is not supported.") + +svc_openrc = { + "syncthing": { + "enabled": True, + "running": True, + "needs": [ + "pkg_apk:syncthing-openrc", + ], + }, +} + +files = { + "/etc/traefik/syncthing-gui.yaml": { + "content_type": "mako", + "source": "traefik.yaml", + "needs": {"bundle:traefik"}, + }, +} + +actions = { + "syncthing_generate_config": { + "command": "test -d /var/lib/syncthing/.local/state/syncthing || syncthing generate --no-default-folder", + }, + "syncthing_patch_config": { + "command": "patch -sfN -d /var/lib/syncthing -p1", + "data_stdin": """ +--- a/.local/state/syncthing/config.xml ++++ b/.local/state/syncthing/config.xml +@@ -52,7 +52,7 @@ + 0 + + +-
127.0.0.1:8384
++
0.0.0.0:8384
+ bdNpzhDXbZEdcTSAcNtczLGgdV7RpsfF + default +
+""", + "needs": {"action:syncthing_generate_config"}, + "triggers": {"svc_openrc:syncthing:restart"}, + }, +} -- cgit 1.4.1