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': "syncthing generate --no-default-folder",
'unless': "test -d /var/lib/syncthing/.local/state/syncthing",
},
"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"},
'unless': "grep -q '0.0.0.0:8384' /var/lib/syncthing/.local/state/syncthing/config.xml",
},
}