Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions server/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ pub struct Cli {

///maximum disk usage allowed
pub max_disk_usage: f64,

pub ms_clarity_tag: Option<String>,
}

impl Cli {
Expand Down Expand Up @@ -142,6 +144,7 @@ impl Cli {
pub const CORS: &'static str = "cors";
pub const HOT_TIER_PATH: &'static str = "hot-tier-path";
pub const MAX_DISK_USAGE: &'static str = "max-disk-usage";
pub const MS_CLARITY_TAG: &'static str = "ms-clarity-tag";

pub fn local_stream_data_path(&self, stream_name: &str) -> PathBuf {
self.local_staging_path.join(stream_name)
Expand Down Expand Up @@ -423,6 +426,14 @@ impl Cli {
.help("Maximum allowed disk usage in percentage e.g 90.0 for 90%")
.next_line_help(true),
)
.arg(
Arg::new(Self::MS_CLARITY_TAG)
.long(Self::MS_CLARITY_TAG)
.env("P_MS_CLARITY_TAG")
.value_name("STRING")
.required(false)
.help("Tag for MS Clarity"),
)
.group(
ArgGroup::new("oidc")
.args([Self::OPENID_CLIENT_ID, Self::OPENID_CLIENT_SECRET, Self::OPENID_ISSUER])
Expand Down Expand Up @@ -566,6 +577,8 @@ impl FromArgMatches for Cli {
.cloned()
.expect("default for max disk usage");

self.ms_clarity_tag = m.get_one::<String>(Self::MS_CLARITY_TAG).cloned();

Ok(())
}
}
7 changes: 5 additions & 2 deletions server/src/handlers/http/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub async fn about() -> Json<serde_json::Value> {
)
};

let send_analytics = CONFIG.parseable.send_analytics;
let ms_clarity_tag = &CONFIG.parseable.ms_clarity_tag;

Json(json!({
"version": current_version,
Expand All @@ -115,6 +115,9 @@ pub async fn about() -> Json<serde_json::Value> {
"type": CONFIG.get_storage_mode_string(),
"path": store_endpoint
},
"sendAnalytics": send_analytics
"analytics": {
"clarityTag": ms_clarity_tag
}

}))
}