fix: Use correct Zitadel port 8300 and get URL from Vault

- Fixed hardcoded port 9000 to 8300 (Zitadel default)
- Added base_url default with fallback to Vault URL
- Allows external Zitadel server configuration via Vault
- facade.rs: Updated help message with correct port
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-20 02:43:29 +00:00
parent 002e6c9b79
commit b2c5e912b3
2 changed files with 9 additions and 4 deletions

View file

@ -773,11 +773,11 @@ Store credentials in Vault:
"directory" => {
format!(
r"Zitadel Identity Provider:
URL: http://{}:9000
Console: http://{}:9000/ui/console
URL: http://{}:8300
Console: http://{}:8300/ui/console
Store credentials in Vault:
botserver vault put gbo/directory url=http://{}:9000 client_id=<client-id> client_secret=<client-secret>",
botserver vault put gbo/directory url=http://{}:8300 client_id=<client-id> client_secret=<client-secret>",
ip, ip, ip
)
}

View file

@ -76,13 +76,18 @@ pub async fn setup_directory() -> anyhow::Result<crate::core::package_manager::s
let stack_path = get_stack_path();
let base_url = "".to_string();
let config_path = PathBuf::from(&stack_path).join("conf/system/directory_config.json");
// Default base_url for local Zitadel instance
let base_url = "http://localhost:8300".to_string();
// Check if config already exists in Vault first
if let Ok(secrets_manager) = crate::core::secrets::SecretsManager::get() {
if secrets_manager.is_enabled() {
if let Ok(secrets) = secrets_manager.get_secret(crate::core::secrets::SecretPaths::DIRECTORY).await {
// Use URL from Vault if available
let base_url = secrets.get("url").cloned().unwrap_or_else(|| base_url.clone());
if let (Some(client_id), Some(client_secret)) = (secrets.get("client_id"), secrets.get("client_secret")) {
// Validate that credentials are real, not placeholders
let is_valid = !client_id.is_empty()