MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / apply_runtime_defaults

Function apply_runtime_defaults

crates/openshell-server/src/cli.rs:497–520  ·  view source on GitHub ↗
(args: &mut RunArgs)

Source from the content-addressed store, hash-verified

495}
496
497fn apply_runtime_defaults(args: &mut RunArgs) -> Result<Option<LocalTlsPaths>> {
498 let local_tls = if args.disable_tls {
499 None
500 } else {
501 defaults::complete_local_tls_paths()?
502 };
503
504 if args.db_url.is_none() {
505 args.db_url = Some(defaults::default_database_url()?);
506 }
507
508 if !args.disable_tls
509 && args.tls_cert.is_none()
510 && args.tls_key.is_none()
511 && args.tls_client_ca.is_none()
512 && let Some(paths) = &local_tls
513 {
514 args.tls_cert = Some(paths.server_cert.clone());
515 args.tls_key = Some(paths.server_key.clone());
516 args.tls_client_ca = Some(paths.ca.clone());
517 }
518
519 Ok(local_tls)
520}
521
522/// Returns `true` when an argument's value came from clap's built-in default
523/// (or was never supplied at all). When the predicate is `true`, the loader

Calls 2

complete_local_tls_pathsFunction · 0.85
default_database_urlFunction · 0.85