diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-04-28 18:56:40 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-04-28 20:26:27 +0200 |
commit | 963cac60bea36c658aa5f5a267aaed551690a64d (patch) | |
tree | a8e61eee13b337c4b5ec2a0c07ad0e0e78b4c093 /src | |
parent | 1794b48b7ce2b0effec30774b623c033b20300d6 (diff) |
Add device publish config setting and devices
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/configuration.rs | 26 | ||||
-rw-r--r-- | src/profile.rs | 6 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/configuration.rs b/src/configuration.rs index 009baec..0c06157 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -54,6 +54,29 @@ pub struct Configuration { // #[get_val] // /// Timeout before merge should be attempted // merge_timeout: Duration, + // + + /// Name under which to provide the local device. E.G. + /// Some("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY") + /// + /// If none, one will be generated and set + #[serde(rename = "device_name")] + #[get_val] + device_name: Option<String>, + + /// Key to sign stuff that comes from this device. + /// + /// Create by using `ipfs key gen <name>` + #[serde(rename = "devicekey")] + #[get_val] + device_key: String, + + /// Devices for the profile + /// E.G: + /// ["/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY"] + #[serde(rename = "profiles")] + #[get_val] + devices: Vec<String>, } impl Default for Configuration { @@ -69,6 +92,9 @@ impl Default for Configuration { autoserve_blacklist : Vec::new(), autoserve_whitelist : Vec::new(), // merge_timeout : Duration::minutes(15), + device_name : None, + device_key : None, + devices : Vec::new(), } } } diff --git a/src/profile.rs b/src/profile.rs new file mode 100644 index 0000000..870db08 --- /dev/null +++ b/src/profile.rs @@ -0,0 +1,6 @@ + +#[derive(Serialize, Deserialize, Debug)] +struct Profile { + device_name: String, + other_devices: Vec<String>, +} |