mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-19 00:08:43 +00:00
Add .env to dockerfile and fix SEARXNG URL var
This commit is contained in:
@ -16,6 +16,8 @@ services:
|
|||||||
dockerfile: app.dockerfile
|
dockerfile: app.dockerfile
|
||||||
environment:
|
environment:
|
||||||
- SEARXNG_API_URL=http://searxng:8080
|
- SEARXNG_API_URL=http://searxng:8080
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
|
@ -40,10 +40,13 @@ type RecursivePartial<T> = {
|
|||||||
[P in keyof T]?: RecursivePartial<T[P]>;
|
[P in keyof T]?: RecursivePartial<T[P]>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadConfig = () =>
|
const loadConfig = () => {
|
||||||
toml.parse(
|
const configPath = path.join(process.cwd(), configFileName);
|
||||||
fs.readFileSync(path.join(process.cwd(), `${configFileName}`), 'utf-8'),
|
if (!fs.existsSync(configPath) || fs.lstatSync(configPath).isDirectory()) {
|
||||||
) as any as Config;
|
return {} as Config;
|
||||||
|
}
|
||||||
|
return toml.parse(fs.readFileSync(configPath, 'utf-8')) as any as Config;
|
||||||
|
};
|
||||||
|
|
||||||
const getEnvVar = (key: string): string | undefined => {
|
const getEnvVar = (key: string): string | undefined => {
|
||||||
return process.env[key];
|
return process.env[key];
|
||||||
@ -88,7 +91,7 @@ export const getGeminiApiKey = () =>
|
|||||||
getConfigValue(['MODELS', 'GEMINI', 'API_KEY'], '');
|
getConfigValue(['MODELS', 'GEMINI', 'API_KEY'], '');
|
||||||
|
|
||||||
export const getSearxngApiEndpoint = () =>
|
export const getSearxngApiEndpoint = () =>
|
||||||
getConfigValue(['API_ENDPOINTS', 'SEARXNG'], '');
|
process.env.SEARXNG_API_URL || getConfigValue(['API_ENDPOINTS', 'SEARXNG'], '');
|
||||||
|
|
||||||
export const getOllamaApiEndpoint = () =>
|
export const getOllamaApiEndpoint = () =>
|
||||||
getConfigValue(['MODELS', 'OLLAMA', 'API_URL'], 'http://localhost:11434');
|
getConfigValue(['MODELS', 'OLLAMA', 'API_URL'], 'http://localhost:11434');
|
||||||
|
Reference in New Issue
Block a user