config-filed the url, fixed command error
This commit is contained in:
parent
a50efdeea0
commit
8494664829
2 changed files with 7 additions and 6 deletions
|
@ -97,7 +97,7 @@ rust-project TODO: write shell script for automatically updating `cargoHash`
|
|||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = ''
|
||||
${cfg.package}/bin/status_cloud --config_file ${builtins.toString cfg.config_path}
|
||||
${cfg.package}/bin/status_cloud --config-file ${builtins.toString cfg.config_path}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -55,14 +55,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
|
||||
let update = Client::new()
|
||||
.put(format!("https://files.nickiel.net/index.php/apps/notes/api/v1/notes/{}", cfg.note_id.clone()))
|
||||
Client::new()
|
||||
.put(format!("https://{}/index.php/apps/notes/api/v1/notes/{}", cfg.server_url.clone(), cfg.note_id.clone()))
|
||||
.header("Accept", "application/json")
|
||||
.header("Content-Type", "application/json")
|
||||
.basic_auth(cfg.user.clone(), Some(cfg.pswd.clone()))
|
||||
.body(serde_json::to_string(&NoteUpdate {content: body_content}).unwrap());
|
||||
|
||||
//println!("{:#?}", update.send()?.json::<Note>()?);
|
||||
.body(serde_json::to_string(&NoteUpdate {content: body_content}).unwrap())
|
||||
.send()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -90,6 +89,7 @@ struct Config {
|
|||
user: String,
|
||||
pswd: String,
|
||||
note_id: String,
|
||||
server_url: String
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
|
@ -98,6 +98,7 @@ impl Default for Config {
|
|||
user: "".to_string(),
|
||||
pswd: "".to_string(),
|
||||
note_id: "".to_string(),
|
||||
server_url: "".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue