mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-28 10:42:10 +01:00
* Web & API server versioning system. Displayed on UI. * Remove some debugging code. * Integrated backend version into GitHub Action & Docker build workflow using env variables. * Fixed web container environment variable name. * Revise Dockerfiles for GitHub Actions workflow. * Added system information page to admin panel with version info. Updated github workflows to include tagged version, and corresponding changes in the dockerfiles and codebases for web&backend to use env variables if present. Changed to 'dev' naming scheme if no env var is present to indicate local setup. Removed version from admin panel header. * Added missing systeminfo dir to remote repo.
48 lines
1.6 KiB
JavaScript
48 lines
1.6 KiB
JavaScript
// Get Danswer Web Version
|
|
const { version: package_version } = require('./package.json'); // version from package.json
|
|
const env_version = process.env.DANSWER_VERSION; // version from env variable
|
|
// Use env version if set & valid, otherwise default to package version
|
|
const version = env_version || package_version;
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
output: "standalone",
|
|
rewrites: async () => {
|
|
// In production, something else (nginx in the one box setup) should take
|
|
// care of this rewrite. TODO (chris): better support setups where
|
|
// web_server and api_server are on different machines.
|
|
if (process.env.NODE_ENV === "production") return [];
|
|
|
|
return [
|
|
{
|
|
source: "/api/:path*",
|
|
destination: "http://127.0.0.1:8080/:path*", // Proxy to Backend
|
|
},
|
|
];
|
|
},
|
|
redirects: async () => {
|
|
// In production, something else (nginx in the one box setup) should take
|
|
// care of this redirect. TODO (chris): better support setups where
|
|
// web_server and api_server are on different machines.
|
|
if (process.env.NODE_ENV === "production") return [];
|
|
|
|
return [
|
|
{
|
|
source: "/api/stream-direct-qa:params*",
|
|
destination: "http://127.0.0.1:8080/stream-direct-qa:params*", // Proxy to Backend
|
|
permanent: true,
|
|
},
|
|
{
|
|
source: "/api/stream-query-validation:params*",
|
|
destination: "http://127.0.0.1:8080/stream-query-validation:params*", // Proxy to Backend
|
|
permanent: true,
|
|
},
|
|
];
|
|
},
|
|
publicRuntimeConfig: {
|
|
version,
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|