From 2f1de2b4f486a07fad8fc0ff28513056608b4883 Mon Sep 17 00:00:00 2001 From: prplV Date: Tue, 27 May 2025 05:12:20 -0400 Subject: [PATCH] env vars added --- .env.example | 5 ++++- crates/api-grub/src/jitter.rs | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 26da514..d0cc4fe 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,9 @@ DB_DBNAME = "db_name"1 EXPORTER_URL = "http(s)://ip.ip.ip.ip:port" # VINTEO Jitter puller (needed to init Jitter native grab) +VINTEO_URL_BASE = "http(s)://ip.ip.ip.ip:port" +VINTEO_ENDPOINT_CONFERENCES = "/api/v1/to/something" +VINTEO_ENDPOINT_PARTICIPANTS = "/api/v1/to/something" VINTEO_API_KEY = "6fe8b0db-62b4-4065-9c1e-441ec4228341.9acec20bd17d7178f332896f8c006452877a22b8627d089105ed39c5baef9711" # Status Model API support @@ -20,7 +23,7 @@ STATUS_SYSTEM_URL = "http://192.168.2.39:9999/api/input" ENODE_MONITORING_IP = "ip.ip.ip.ip" ENODE_MONITORING_LOGIN = "admin_user_enode_monitoring" # admin user is required ENODE_MONITORING_PASSWORD = "admin_password_enode_monitoring" # # admin password is required -ENODE_TARGET_DEVICES = "device$18,device$19" +ENODE_TARGET_DEVICES = "18, 19" # IM configuration for max level of logging info # for example DEBUG, INFO, WARN, ERROR, TRACE diff --git a/crates/api-grub/src/jitter.rs b/crates/api-grub/src/jitter.rs index a06c3d8..ac76d92 100644 --- a/crates/api-grub/src/jitter.rs +++ b/crates/api-grub/src/jitter.rs @@ -11,8 +11,9 @@ use async_stream::stream; use futures::{future, pin_mut, stream::Stream, StreamExt}; lazy_static! { - static ref CONFERENCES_ENDPOINT: String = String::from("/api/v1/conferences"); - static ref USERS_ENDPOINT: String = String::from("/api/v1/participants/"); + static ref VINTEO_BASE: String = std::env::var("VINTEO_URL_BASE").unwrap_or_else(|_| String::from("https://demo.vcs.vinteo.dev")); + static ref CONFERENCES_ENDPOINT: String = std::env::var("VINTEO_ENDPOINT_CONFERENCES").unwrap_or_else(|_| String::from("/api/v1/conferences")); + static ref USERS_ENDPOINT: String = std::env::var("VINTEO_ENDPOINT_PARTICIPANTS").unwrap_or_else(|_| String::from("/api/v1/participants/")); } // conferences ids @@ -49,8 +50,8 @@ struct Requester { impl Requester { pub fn new() -> anyhow::Result { Ok(Self { - base: String::from("https://demo.vcs.vinteo.dev"), - api_key: std::env::var("VINTEO_API_KEY").unwrap(), + base: VINTEO_BASE.clone().to_owned(), + api_key: std::env::var("VINTEO_API_KEY")?, client: Client::builder().user_agent("api-grub").build()?, }) } -- 2.40.1