Skip to content

Commit

Permalink
feat: support initializing license key from env var
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Aug 2, 2024
1 parent 911578c commit ec4178f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/frontend/src/handler/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ async fn handle_show_system_params(handler_args: HandlerArgs) -> Result<RwPgResp
.meta_client()
.get_system_params()
.await?;
// TODO: for secret params (like `license_key`), redact the value in the response.
let rows = params
.get_all()
.into_iter()
Expand Down
6 changes: 6 additions & 0 deletions src/meta/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ pub struct MetaNodeOpts {
#[clap(long, hide = true, env = "RW_CONNECTOR_RPC_ENDPOINT")]
pub connector_rpc_endpoint: Option<String>,

/// The license key to activate enterprise features.
#[educe(Debug(ignore))]
#[clap(long, hide = true, env = "RW_LICENSE_KEY")]
#[override_opts(path = system.license_key)]
pub license_key: Option<String>,

/// 128-bit AES key for secret store in HEX format.
#[educe(Debug(ignore))]
#[clap(long, hide = true, env = "RW_SECRET_STORE_PRIVATE_KEY_HEX")]
Expand Down
1 change: 0 additions & 1 deletion src/meta/src/controller/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ impl SystemParamsController {
let params = SystemParameter::find().all(&db).await?;
let params = merge_params(system_params_from_db(params)?, init_params);

info!("system parameters: {:?}", params);
check_missing_params(&params).map_err(|e| anyhow!(e))?;

let ctl = Self {
Expand Down
1 change: 0 additions & 1 deletion src/meta/src/manager/system_param/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ impl SystemParamsManager {
return Err(require_sql_meta_store_err().into());
}

info!("system parameters: {:?}", params);
check_missing_params(&params).map_err(|e| anyhow!(e))?;

Ok(Self {
Expand Down

0 comments on commit ec4178f

Please sign in to comment.