Skip to content

Commit

Permalink
k
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Oct 26, 2024
1 parent aa0f307 commit c32d428
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine AS base
FROM --platform=linux/amd64 node:20-alpine AS base

LABEL com.danswer.maintainer="[email protected]"
LABEL com.danswer.description="This image is the web/frontend container of Danswer which \
Expand Down Expand Up @@ -66,7 +66,7 @@ ARG NEXT_PUBLIC_POSTHOG_HOST
ENV NEXT_PUBLIC_POSTHOG_KEY=${NEXT_PUBLIC_POSTHOG_KEY}
ENV NEXT_PUBLIC_POSTHOG_HOST=${NEXT_PUBLIC_POSTHOG_HOST}

RUN npx next build
RUN npx next build --no-lint

# Step 2. Production image, copy all the files and run next
FROM base AS runner
Expand Down
7 changes: 4 additions & 3 deletions web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ const nextConfig = {
// - With both configured: Only unhandled errors are captured (no performance/session tracking)

// Determine if Sentry should be enabled
const sentryEnabled = Boolean(
process.env.SENTRY_AUTH_TOKEN && process.env.NEXT_PUBLIC_SENTRY_DSN
);
const sentryEnabled = false;
// Boolean(
// process.env.SENTRY_AUTH_TOKEN && process.env.NEXT_PUBLIC_SENTRY_DSN
// );

// Sentry webpack plugin options
const sentryWebpackPluginOptions = {
Expand Down
4 changes: 2 additions & 2 deletions web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import { default as dynamicImport } from "next/dynamic";
const PostHogPageView = dynamicImport(() => import("./PostHogPageView"), {
ssr: false,
});

const inter = Inter({
subsets: ["latin"],
variable: "--font-inter",
display: "swap",
preload: false, // Add this to prevent build-time font loading issues
adjustFontFallback: true, // Add this to ensure smooth fallback
});

export async function generateMetadata(): Promise<Metadata> {
Expand Down
15 changes: 11 additions & 4 deletions web/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const eePaths = [
"/admin/whitelabeling/:path*",
"/admin/performance/custom-analytics/:path*",
"/admin/standard-answer/:path*",
...(process.env.NEXT_PUBLIC_CLOUD_ENABLED
? ["/admin/cloud-settings/:path*"]
: []),
"/admin/cloud-settings/:path*",
];

// removes the "/:path*" from the end
Expand Down Expand Up @@ -46,5 +44,14 @@ export async function middleware(request: NextRequest) {

// Specify the paths that the middleware should run for
export const config = {
matcher: eePaths,
matcher: [
"/admin/groups/:path*",
"/admin/api-key/:path*",
"/admin/performance/usage/:path*",
"/admin/performance/query-history/:path*",
"/admin/whitelabeling/:path*",
"/admin/performance/custom-analytics/:path*",
"/admin/standard-answer/:path*",
"/admin/cloud-settings/:path*",
],
};

0 comments on commit c32d428

Please sign in to comment.