diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..1435d53 --- /dev/null +++ b/config.json.example @@ -0,0 +1,12 @@ +{ + "host": "gitlab host", + "token": "gitlab token", + "projects": [ + { + "name": "lovallat/lovallat", + "ref_": "master", + "abs_x": 0, + "abs_y": 0 + } + ] +} diff --git a/src/config_manager.rs b/src/config_manager.rs index a243c54..33466f2 100644 --- a/src/config_manager.rs +++ b/src/config_manager.rs @@ -8,7 +8,7 @@ const CONFIG_FILENAME: &str = "./config.json"; #[derive(Clone, Deserialize, Serialize)] pub struct Config { pub host: String, - pub key: String, + pub token: String, pub projects: Vec } diff --git a/src/gitlab_controller.rs b/src/gitlab_controller.rs index decadf3..2799e31 100644 --- a/src/gitlab_controller.rs +++ b/src/gitlab_controller.rs @@ -78,7 +78,7 @@ pub fn load_from_config(config: Config) -> Vec> { info!("Loading gitlab manager from configuration."); let mut threads = vec![]; for p in config.projects.iter() { - let client = Gitlab::new(config.host.as_str(), config.key.as_str()).unwrap(); + let client = Gitlab::new(config.host.as_str(), config.token.as_str()).unwrap(); let project = p.clone(); threads.push(thread::spawn(move|| refresh_on_timer(client, project))); } diff --git a/src/launchpad_controller.rs b/src/launchpad_controller.rs index 1533537..39080d6 100644 --- a/src/launchpad_controller.rs +++ b/src/launchpad_controller.rs @@ -33,7 +33,7 @@ fn running_thread(config: Config) { let project = project.unwrap(); if restart { restart = false; - retry_pipeline(config.host.as_str(), config.key.as_str(), project); + retry_pipeline(config.host.as_str(), config.token.as_str(), project); disengage_restart(&mut output); } else { open::that_in_background(format!("https://{}/{}", config.host, project.name)); diff --git a/src/main.rs b/src/main.rs index 6a18159..83debbb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ fn main() { if conf.is_none() { config_manager::save_config(&Config { host: "gitlab-host".to_string(), - key: "your-gitlab-key".to_string(), + token: "your-gitlab-key".to_string(), projects: vec![Project { name: "example".to_string(), ref_: "master".to_string(),