src.nth.io/

summaryrefslogtreecommitdiff
path: root/mattertimectl/controller/templates
diff options
context:
space:
mode:
Diffstat (limited to 'mattertimectl/controller/templates')
-rw-r--r--mattertimectl/controller/templates/config.json.j26
-rw-r--r--mattertimectl/controller/templates/mattertimectl.service.j215
-rw-r--r--mattertimectl/controller/templates/mattertimectl.timer.j210
3 files changed, 31 insertions, 0 deletions
diff --git a/mattertimectl/controller/templates/config.json.j2 b/mattertimectl/controller/templates/config.json.j2
new file mode 100644
index 0000000..34f319c
--- /dev/null
+++ b/mattertimectl/controller/templates/config.json.j2
@@ -0,0 +1,6 @@
+{
+ "storagePath": "{{mattertimectl_storage_path}}",
+ "timezone": "{{mattertimectl_timezone}}",
+ "logLevel": "{{mattertimectl_log_level}}",
+ "fabricLabel": "{{mattertimectl_fabric_label}}"
+}
diff --git a/mattertimectl/controller/templates/mattertimectl.service.j2 b/mattertimectl/controller/templates/mattertimectl.service.j2
new file mode 100644
index 0000000..96cbeee
--- /dev/null
+++ b/mattertimectl/controller/templates/mattertimectl.service.j2
@@ -0,0 +1,15 @@
+[Unit]
+Description=Matter device clock synchronization
+Wants=network-online.target
+After=network-online.target time-sync.target
+
+[Service]
+Type=oneshot
+User={{mattertimectl_user}}
+Group={{mattertimectl_user}}
+ExecStart={{mattertimectl_install_dir}}/mattertimectl --config {{mattertimectl_config_dir}}/config.json sync
+NoNewPrivileges=true
+PrivateTmp=true
+ProtectSystem=strict
+ProtectHome=true
+ReadWritePaths={{mattertimectl_storage_path}}
diff --git a/mattertimectl/controller/templates/mattertimectl.timer.j2 b/mattertimectl/controller/templates/mattertimectl.timer.j2
new file mode 100644
index 0000000..a4242de
--- /dev/null
+++ b/mattertimectl/controller/templates/mattertimectl.timer.j2
@@ -0,0 +1,10 @@
+[Unit]
+Description=Periodic Matter device clock synchronization
+
+[Timer]
+OnBootSec={{mattertimectl_on_boot_sec}}
+OnUnitActiveSec={{mattertimectl_on_active_sec}}
+RandomizedDelaySec={{mattertimectl_randomized_delay_sec}}
+
+[Install]
+WantedBy=timers.target