src.nth.io/

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.rs14
-rw-r--r--src/controller/mod.rs4
-rw-r--r--src/main.rs4
3 files changed, 11 insertions, 11 deletions
diff --git a/src/config.rs b/src/config.rs
index 3e53975..8288d4e 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,5 +1,5 @@
//! Validated JSON configuration, file-compatible with the TypeScript
-//! implementation (`/etc/mattertimesync/config.json`, camelCase keys).
+//! implementation (`/etc/mattertimectl/config.json`, camelCase keys).
//!
//! Unknown fields are rejected loudly via serde's `deny_unknown_fields`;
//! device membership deliberately lives in controller storage, not here.
@@ -10,7 +10,7 @@ use std::path::PathBuf;
use jiff::tz::TimeZone;
use serde::Deserialize;
-pub const DEFAULT_CONFIG_PATH: &str = "/etc/mattertimesync/config.json";
+pub const DEFAULT_CONFIG_PATH: &str = "/etc/mattertimectl/config.json";
/// Matter FabricDescriptorStruct label limit.
const FABRIC_LABEL_MAX_LENGTH: usize = 32;
@@ -94,7 +94,7 @@ fn default_timezone() -> String {
}
fn default_fabric_label() -> String {
- "Matter Time Sync".into()
+ "Matter Time Controller".into()
}
impl Config {
@@ -168,18 +168,18 @@ impl Config {
mod tests {
use super::*;
- const MINIMAL: &str = r#"{ "storagePath": "/var/lib/mattertimesync" }"#;
+ const MINIMAL: &str = r#"{ "storagePath": "/var/lib/mattertimectl" }"#;
#[test]
fn minimal_config_applies_defaults() {
let config = Config::parse(MINIMAL).unwrap();
assert_eq!(
config.storage_path,
- PathBuf::from("/var/lib/mattertimesync")
+ PathBuf::from("/var/lib/mattertimectl")
);
assert_eq!(config.timezone, "America/Chicago");
assert_eq!(config.log_level, LogLevel::Info);
- assert_eq!(config.fabric_label, "Matter Time Sync");
+ assert_eq!(config.fabric_label, "Matter Time Controller");
}
#[test]
@@ -220,7 +220,7 @@ mod tests {
let config = Config::parse(r#"{ "storagePath": "/var/lib/$USER/mts" }"#).unwrap();
assert!(config.path_warnings()[0].contains("unexpanded shell variable"));
- let config = Config::parse(r#"{ "storagePath": "/var/lib/mattertimesync" }"#).unwrap();
+ let config = Config::parse(r#"{ "storagePath": "/var/lib/mattertimectl" }"#).unwrap();
assert!(config.path_warnings().is_empty());
}
diff --git a/src/controller/mod.rs b/src/controller/mod.rs
index 739615c..c712c68 100644
--- a/src/controller/mod.rs
+++ b/src/controller/mod.rs
@@ -558,7 +558,7 @@ fn lock_storage(storage: &Path) -> anyhow::Result<std::fs::File> {
let rc = unsafe { libc::flock(file.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) };
if rc != 0 {
bail!(
- "another mattertimesync instance is already running against {}",
+ "another mattertimectl instance is already running against {}",
storage.display()
);
}
@@ -590,7 +590,7 @@ fn prepare_storage_dir(path: &Path) -> anyhow::Result<()> {
.context("chmod storage directory")?;
} else {
log::warn!(
- "storagePath {} already exists and does not look like a mattertimesync storage \
+ "storagePath {} already exists and does not look like a mattertimectl storage \
directory; leaving its permissions unchanged (it should be mode 0700, owned by the \
service user)",
path.display()
diff --git a/src/main.rs b/src/main.rs
index f372f8e..d245578 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,4 @@
-//! mattertimesync: a one-shot CLI Matter controller that sets the clocks of
+//! mattertimectl: a one-shot CLI Matter controller that sets the clocks of
//! Matter devices via the standard Time Synchronization cluster.
//!
//! # CLI invariants
@@ -54,7 +54,7 @@ use crate::time::MatterMicros;
#[derive(Parser)]
#[command(
- name = "mattertimesync",
+ name = "mattertimectl",
version,
about,
disable_help_subcommand = true