diff --git a/bin/core/src/helpers/stack/mod.rs b/bin/core/src/helpers/stack/mod.rs index a9c7fad45..7a8c9bba9 100644 --- a/bin/core/src/helpers/stack/mod.rs +++ b/bin/core/src/helpers/stack/mod.rs @@ -91,7 +91,11 @@ pub async fn get_stack_and_server( Ok((stack, server)) } -pub fn compose_container_match_regex(container_name: &str) -> anyhow::Result { +pub fn compose_container_match_regex( + container_name: &str, +) -> anyhow::Result { let regex = format!("^{container_name}-?[0-9]*$"); - Regex::new(®ex).with_context(|| format!("failed to construct valid regex from {regex}")) -} \ No newline at end of file + Regex::new(®ex).with_context(|| { + format!("failed to construct valid regex from {regex}") + }) +} diff --git a/bin/core/src/helpers/stack/remote.rs b/bin/core/src/helpers/stack/remote.rs index 22791c62c..e3aed6b07 100644 --- a/bin/core/src/helpers/stack/remote.rs +++ b/bin/core/src/helpers/stack/remote.rs @@ -1,4 +1,7 @@ -use std::{fs, path::{Path, PathBuf}}; +use std::{ + fs, + path::{Path, PathBuf}, +}; use anyhow::{anyhow, Context}; use formatting::format_serror; diff --git a/bin/core/src/listener/github/build.rs b/bin/core/src/listener/github/build.rs index 1962dcae4..702a5e19e 100644 --- a/bin/core/src/listener/github/build.rs +++ b/bin/core/src/listener/github/build.rs @@ -44,7 +44,7 @@ pub async fn handle_build_webhook( if request_branch != build.config.branch { return Err(anyhow!("request branch does not match expected")); } - + let user = git_webhook_user().to_owned(); let req = ExecuteRequest::RunBuild(RunBuild { build: build_id }); let update = init_execution_update(&req, &user).await?; diff --git a/bin/core/src/monitor/alert/stack.rs b/bin/core/src/monitor/alert/stack.rs index 78086e288..aa60edc6f 100644 --- a/bin/core/src/monitor/alert/stack.rs +++ b/bin/core/src/monitor/alert/stack.rs @@ -36,11 +36,9 @@ pub async fn alert_stacks( if status.curr.state != prev { // send alert let Ok(stack) = - resource::get::(&status.curr.id) - .await - .inspect_err(|e| { - error!("failed to get stack from db | {e:#?}") - }) + resource::get::(&status.curr.id).await.inspect_err( + |e| error!("failed to get stack from db | {e:#?}"), + ) else { continue; }; diff --git a/bin/core/src/resource/mod.rs b/bin/core/src/resource/mod.rs index 8ed82c7a5..8c8d0a16d 100644 --- a/bin/core/src/resource/mod.rs +++ b/bin/core/src/resource/mod.rs @@ -788,9 +788,11 @@ where ResourceTarget::Stack(id) => ("recents.Stack", id), ResourceTarget::Builder(id) => ("recents.Builder", id), ResourceTarget::Alerter(id) => ("recents.Alerter", id), - ResourceTarget::ServerTemplate(id) => ("recents.ServerTemplate", id), + ResourceTarget::ServerTemplate(id) => { + ("recents.ServerTemplate", id) + } ResourceTarget::ResourceSync(id) => ("recents.ResourceSync", id), - ResourceTarget::System(_) => return + ResourceTarget::System(_) => return, }; if let Err(e) = db_client() .await diff --git a/client/core/rs/src/api/execute/server.rs b/client/core/rs/src/api/execute/server.rs index 131a3706f..62f7e4536 100644 --- a/client/core/rs/src/api/execute/server.rs +++ b/client/core/rs/src/api/execute/server.rs @@ -96,4 +96,4 @@ pub struct PruneImages { pub struct PruneContainers { /// Id or name pub server: String, -} \ No newline at end of file +} diff --git a/client/core/rs/src/api/write/provider.rs b/client/core/rs/src/api/write/provider.rs index 9e82b967e..56ead83d2 100644 --- a/client/core/rs/src/api/write/provider.rs +++ b/client/core/rs/src/api/write/provider.rs @@ -92,7 +92,7 @@ pub type CreateDockerRegistryAccountResponse = DockerRegistryAccount; pub struct UpdateDockerRegistryAccount { /// The id of the docker registry to update pub id: String, - /// The partial docker registry account. + /// The partial docker registry account. pub account: _PartialDockerRegistryAccount, } diff --git a/client/core/rs/src/api/write/stack.rs b/client/core/rs/src/api/write/stack.rs index fed83925c..01834ad6d 100644 --- a/client/core/rs/src/api/write/stack.rs +++ b/client/core/rs/src/api/write/stack.rs @@ -4,7 +4,9 @@ use serde::{Deserialize, Serialize}; use typeshare::typeshare; use crate::entities::{ - stack::{Stack, _PartialStackConfig}, update::Update, NoData + stack::{Stack, _PartialStackConfig}, + update::Update, + NoData, }; use super::MonitorWriteRequest; diff --git a/client/core/rs/src/entities/config/core.rs b/client/core/rs/src/entities/config/core.rs index 0b33512c8..39ce480ec 100644 --- a/client/core/rs/src/entities/config/core.rs +++ b/client/core/rs/src/entities/config/core.rs @@ -160,7 +160,6 @@ pub struct CoreConfig { // =========== // = General = // =========== - /// The title of this monitor deployment. Will be used in the browser page title. /// Default: 'Monitor' #[serde(default = "default_title")] @@ -188,7 +187,6 @@ pub struct CoreConfig { // ============ // = Database = // ============ - /// Configure core mongo connection. /// /// An easy deployment method is to use Mongo Atlas to provide @@ -198,7 +196,6 @@ pub struct CoreConfig { // ================ // = Auth / Login = // ================ - /// enable login with local auth #[serde(default)] pub local_auth: bool, @@ -226,7 +223,6 @@ pub struct CoreConfig { // ========= // = Oauth = // ========= - /// Configure google oauth #[serde(default)] pub google_oauth: OauthCredentials, @@ -238,7 +234,6 @@ pub struct CoreConfig { // ============ // = Webhooks = // ============ - /// Used to verify validity from webhooks. /// Should be some secure hash maybe 20-40 chars. /// It is given to git provider when configuring the webhook. @@ -261,7 +256,6 @@ pub struct CoreConfig { // =========== // = Logging = // =========== - /// Configure logging #[serde(default)] pub logging: LogConfig, @@ -269,7 +263,6 @@ pub struct CoreConfig { // =========== // = Pruning = // =========== - /// Number of days to keep stats, or 0 to disable pruning. /// Stats older than this number of days are deleted on a daily cycle /// Default: 14 @@ -285,7 +278,6 @@ pub struct CoreConfig { // ================== // = Poll Intervals = // ================== - /// Interval at which to poll stacks for any updates / automated actions. /// Options: `15-sec`, `1-min`, `5-min`, `15-min`, `1-hr` /// Default: `5-min`. @@ -318,7 +310,6 @@ pub struct CoreConfig { // =================== // = Cloud Providers = // =================== - /// Configure AWS credentials to use with AWS builds / server launches. #[serde(default)] pub aws: AwsCredentials, @@ -330,7 +321,6 @@ pub struct CoreConfig { // ================= // = Git Providers = // ================= - /// Configure git credentials used to clone private repos. /// Supports any git provider. #[serde(default, alias = "git_provider")] @@ -339,7 +329,6 @@ pub struct CoreConfig { // ====================== // = Registry Providers = // ====================== - /// Configure docker credentials used to push / pull images. /// Supports any docker image repository. #[serde(default, alias = "docker_registry")] @@ -352,7 +341,6 @@ pub struct CoreConfig { // =========== // = Secrets = // =========== - /// Configure core-based secrets. These will be preferentially interpolated into /// values if they contain a matching secret. Otherwise, the periphery will have to have the /// secret configured. @@ -362,7 +350,6 @@ pub struct CoreConfig { // ========= // = Other = // ========= - /// Specify the directory used to clone stack / repo / build repos, for latest hash / contents. /// The default is fine when using a container. /// This directory has no need for persistence, so no need to mount it. diff --git a/client/core/rs/src/entities/config/periphery.rs b/client/core/rs/src/entities/config/periphery.rs index db0c3a364..7039a2d47 100644 --- a/client/core/rs/src/entities/config/periphery.rs +++ b/client/core/rs/src/entities/config/periphery.rs @@ -288,18 +288,18 @@ fn default_stats_polling_rate() -> Timelength { impl Default for PeripheryConfig { fn default() -> Self { - Self { - port: default_periphery_port(), - repo_dir: default_repo_dir(), - stack_dir: default_stack_dir(), - stats_polling_rate: default_stats_polling_rate(), - legacy_compose_cli: Default::default(), - logging: Default::default(), - allowed_ips: Default::default(), - passkeys: Default::default(), - secrets: Default::default(), - git_providers: Default::default(), - docker_registries: Default::default(), + Self { + port: default_periphery_port(), + repo_dir: default_repo_dir(), + stack_dir: default_stack_dir(), + stats_polling_rate: default_stats_polling_rate(), + legacy_compose_cli: Default::default(), + logging: Default::default(), + allowed_ips: Default::default(), + passkeys: Default::default(), + secrets: Default::default(), + git_providers: Default::default(), + docker_registries: Default::default(), } } -} \ No newline at end of file +} diff --git a/client/core/rs/src/entities/procedure.rs b/client/core/rs/src/entities/procedure.rs index d270d7c6e..d07ec7e12 100644 --- a/client/core/rs/src/entities/procedure.rs +++ b/client/core/rs/src/entities/procedure.rs @@ -89,7 +89,7 @@ impl Default for ProcedureConfig { Self { stages: Default::default(), webhook_enabled: default_webhook_enabled(), - webhook_secret: Default::default() + webhook_secret: Default::default(), } } } diff --git a/client/core/rs/src/entities/provider.rs b/client/core/rs/src/entities/provider.rs index 39946df0d..82c435e11 100644 --- a/client/core/rs/src/entities/provider.rs +++ b/client/core/rs/src/entities/provider.rs @@ -10,9 +10,7 @@ pub type _PartialGitProviderAccount = PartialGitProviderAccount; /// Configuration to access private git repos from various git providers. /// Note. Cannot create two accounts with the same domain and username. #[typeshare] -#[derive( - Serialize, Deserialize, Debug, Clone, Default, Partial, -)] +#[derive(Serialize, Deserialize, Debug, Clone, Default, Partial)] #[partial_derive(Serialize, Deserialize, Debug, Clone, Default)] #[partial(skip_serializing_none, from, diff)] #[cfg_attr( @@ -66,9 +64,7 @@ pub type _PartialDockerRegistryAccount = PartialDockerRegistryAccount; /// Configuration to access private image repositories on various registries. #[typeshare] -#[derive( - Serialize, Deserialize, Debug, Clone, Default, Partial, -)] +#[derive(Serialize, Deserialize, Debug, Clone, Default, Partial)] #[partial_derive(Serialize, Deserialize, Debug, Clone, Default)] #[partial(skip_serializing_none, from, diff)] #[cfg_attr( @@ -108,4 +104,4 @@ pub struct DockerRegistryAccount { fn default_registry_domain() -> String { String::from("docker.io") -} \ No newline at end of file +} diff --git a/client/periphery/rs/src/api/compose.rs b/client/periphery/rs/src/api/compose.rs index 74b72d753..2831d8223 100644 --- a/client/periphery/rs/src/api/compose.rs +++ b/client/periphery/rs/src/api/compose.rs @@ -1,5 +1,7 @@ use monitor_client::entities::{ - stack::{ComposeContents, ComposeProject, Stack}, update::Log, SearchCombinator, + stack::{ComposeContents, ComposeProject, Stack}, + update::Log, + SearchCombinator, }; use resolver_api::derive::Request; use serde::{Deserialize, Serialize};