1#![forbid(unsafe_code)]
2
3#[cfg(not(unix))]
4compile_error!("guth-sync currently supports Unix systems with OpenSSH and rsync");
5
6pub mod profile;
7pub mod transfer;
8
9use guth_cli::{PluginManifest, MANIFEST_SCHEMA};
10use std::io;
11use std::path::PathBuf;
12use uuid::Uuid;
13
14pub const PLUGIN_ID: Uuid = Uuid::from_u128(0x019f613e14ad7205a36d73f8ac49c24e);
15
16pub fn plugin_manifest(executable: PathBuf) -> io::Result<PluginManifest> {
17 let manifest = PluginManifest {
18 schema: MANIFEST_SCHEMA,
19 id: PLUGIN_ID,
20 name: "Guth Sync".to_string(),
21 version: env!("CARGO_PKG_VERSION").to_string(),
22 executable,
23 description: "SSH-encrypted rsync transfers between matching Guth profiles.".to_string(),
24 capabilities: vec!["sync".to_string()],
25 };
26 manifest.validate()?;
27 Ok(manifest)
28}
29
30#[cfg(test)]
31mod tests {
32 use super::*;
33 use uuid::Version;
34
35 #[test]
36 fn plugin_identity_is_uuid_v7() {
37 assert_eq!(PLUGIN_ID.get_version(), Some(Version::SortRand));
38 }
39}