From 2b0b401c3a9ed451406b142e253123ccc7df3e04 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Tue, 30 Sep 2025 21:15:27 +0200 Subject: [PATCH 1/3] updated syncthing module --- states/_modules/syncthing.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/states/_modules/syncthing.py b/states/_modules/syncthing.py index 414a8c0..4d67f5b 100644 --- a/states/_modules/syncthing.py +++ b/states/_modules/syncthing.py @@ -27,9 +27,10 @@ def get_apikey(configfile="/root/.config/syncthing/config.xml"): return None -def get_config(url="http://localhost:8384", verify=False, apikey=""): + +def get_config(url="http://localhost:8384", verify=False, apikey=None): try: - apikey=get_apikey() + apikey = get_apikey() except: return None fullurl = f"{url}/rest/config" @@ -47,7 +48,10 @@ def get_config(url="http://localhost:8384", verify=False, apikey=""): return None -def set_config_options(url="http://localhost:8384", verify=False, apikey=get_apikey(), options={}): + +def set_config_options(url="http://localhost:8384", verify=False, apikey=None, options={}): + if not apikey: + apikey = get_apikey() fullurl = f"{url}/rest/config/options" req = Request(method="PUT", url=fullurl, @@ -68,7 +72,9 @@ def set_config_options(url="http://localhost:8384", verify=False, apikey=get_api return None -def set_config_gui(url="http://localhost:8384", verify=False, apikey=get_apikey(), gui={}): +def set_config_gui(url="http://localhost:8384", verify=False, apikey=None, gui={}): + if not apikey: + apikey = get_apikey() fullurl = f"{url}/rest/config/gui" req = Request(method="PUT", url=fullurl, @@ -92,7 +98,9 @@ def set_config_gui(url="http://localhost:8384", verify=False, apikey=get_apikey( return None ## deprecated -def _set_config(url="http://localhost:8384", verify=False, apikey=get_apikey(), config={}): +def _set_config(url="http://localhost:8384", verify=False, apikey=None, config={}): + if not apikey: + apikey = get_apikey() fullurl = f"{url}/rest/config" req = Request(method="POST", url=fullurl, @@ -113,7 +121,10 @@ def _set_config(url="http://localhost:8384", verify=False, apikey=get_apikey(), return None -def insync(url="http://localhost:8384", verify=False, apikey=get_apikey()): + +def insync(url="http://localhost:8384", verify=False, apikey=None): + if not apikey: + apikey = get_apikey() fullurl = f"{url}/rest/config/restart-required" req = Request(method="GET", url=fullurl) @@ -128,7 +139,10 @@ def insync(url="http://localhost:8384", verify=False, apikey=get_apikey()): return None -def restart(url="http://localhost:8384", verify=False, apikey=get_apikey()): + +def restart(url="http://localhost:8384", verify=False, apikey=None): + if not apikey: + apikey = get_apikey() fullurl = f"{url}/rest/system/restart" req = Request(method="POST", url=fullurl) From d595daae4d7bbebeb3794ba1dfd3afc7df14a428 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Tue, 30 Sep 2025 21:16:55 +0200 Subject: [PATCH 2/3] updated syncthing module --- states/_modules/syncthing.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/states/_modules/syncthing.py b/states/_modules/syncthing.py index 4d67f5b..373afee 100644 --- a/states/_modules/syncthing.py +++ b/states/_modules/syncthing.py @@ -48,7 +48,6 @@ def get_config(url="http://localhost:8384", verify=False, apikey=None): return None - def set_config_options(url="http://localhost:8384", verify=False, apikey=None, options={}): if not apikey: apikey = get_apikey() @@ -121,7 +120,6 @@ def _set_config(url="http://localhost:8384", verify=False, apikey=None, config={ return None - def insync(url="http://localhost:8384", verify=False, apikey=None): if not apikey: apikey = get_apikey() @@ -139,7 +137,6 @@ def insync(url="http://localhost:8384", verify=False, apikey=None): return None - def restart(url="http://localhost:8384", verify=False, apikey=None): if not apikey: apikey = get_apikey() From 55f37b699e0cb6ca22095e996611e16476129198 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 2 Oct 2025 13:26:36 +0200 Subject: [PATCH 3/3] updated vector state --- states/vector/config.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/states/vector/config.sls b/states/vector/config.sls index e704bd0..faa2ab0 100644 --- a/states/vector/config.sls +++ b/states/vector/config.sls @@ -23,7 +23,7 @@ vector-config-dir: - name: /etc/vector - user: {{ vector.user.name }} - group: {{ vector.group.name }} - - mode: 700 + - mode: 755 - watch_in: - service: vector-service