Skip to content

Commit

Permalink
Add focus obfuscation support
Browse files Browse the repository at this point in the history
  • Loading branch information
Threated committed Nov 13, 2023
1 parent 0d0d078 commit 400971d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/beam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ pub fn create_beam_task(
let proxy_id = CONFIG.beam_app_id.proxy_id();
let broker_id = proxy_id.as_ref().split_once('.').expect("Invalid beam id in config").1;
let to = target_sites.into_iter().map(|site| AppId::new_unchecked(format!("focus.{site}.{broker_id}"))).collect();
let metadata = if let Some(project) = &CONFIG.project {
serde_json::json!({
"project": project
})
} else {
serde_json::Value::Null
};
TaskRequest {
id,
from: CONFIG.beam_app_id.clone(),
to,
metadata: serde_json::Value::Null,
metadata,
body: query.into(),
failure_strategy: beam_lib::FailureStrategy::Retry {
backoff_millisecs: 1000,
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ struct Config {
#[clap(long, env)]
beam_secret: String,

/// Optional project name used by focus
#[clap(long, env)]
project: Option<String>,

/// The socket address this server will bind to
#[clap(long, env, default_value = "0.0.0.0:8080")]
bind_addr: SocketAddr,
Expand Down

0 comments on commit 400971d

Please sign in to comment.