Add config params for keycloak

This commit is contained in:
Lars Erhardt
2025-02-28 14:56:33 +01:00
parent 99351fc2a6
commit aa91d3bc60
8 changed files with 488 additions and 120 deletions

View File

@ -11,6 +11,11 @@ interface Config {
KEEP_ALIVE: string;
SEARCH_ENGINE_BACKEND: string;
};
KEYCLOAK: {
URL: string;
REALM: string;
CLIENT_ID: string;
};
MODELS: {
OPENAI: {
API_KEY: string;
@ -74,7 +79,8 @@ export const getAnthropicApiKey = () => loadConfig().MODELS.ANTHROPIC.API_KEY;
export const getGeminiApiKey = () => loadConfig().MODELS.GEMINI.API_KEY;
export const getSearchEngineBackend = () => loadConfig().GENERAL.SEARCH_ENGINE_BACKEND;
export const getSearchEngineBackend = () =>
loadConfig().GENERAL.SEARCH_ENGINE_BACKEND;
export const getGoogleApiKey = () => loadConfig().SEARCH_ENGINES.GOOGLE.API_KEY;
@ -82,7 +88,8 @@ export const getGoogleCseId = () => loadConfig().SEARCH_ENGINES.GOOGLE.CSE_ID;
export const getBraveApiKey = () => loadConfig().SEARCH_ENGINES.BRAVE.API_KEY;
export const getBingSubscriptionKey = () => loadConfig().SEARCH_ENGINES.BING.SUBSCRIPTION_KEY;
export const getBingSubscriptionKey = () =>
loadConfig().SEARCH_ENGINES.BING.SUBSCRIPTION_KEY;
export const getSearxngApiEndpoint = () =>
process.env.SEARXNG_API_URL || loadConfig().SEARCH_ENGINES.SEARXNG.ENDPOINT;
@ -98,6 +105,12 @@ export const getCustomOpenaiApiUrl = () =>
export const getCustomOpenaiModelName = () =>
loadConfig().MODELS.CUSTOM_OPENAI.MODEL_NAME;
export const getKeyCloakUrl = () => loadConfig().KEYCLOAK.URL;
export const getKeyCloakRealm = () => loadConfig().KEYCLOAK.REALM;
export const getKeyCloakClientId = () => loadConfig().KEYCLOAK.CLIENT_ID;
const mergeConfigs = (current: any, update: any): any => {
if (update === null || update === undefined) {
return current;