Cleanup live changes
This commit is contained in:
parent
d0f9e8bb65
commit
6a85c644dc
3 changed files with 22 additions and 20 deletions
|
|
@ -11,15 +11,11 @@ import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
export const Layout: FC<PropsWithChildren> = ({ children }) => {
|
export const Layout: FC<PropsWithChildren> = ({ children }) => {
|
||||||
const [cookies, setCookie] = useCookies(["cookieConsent"]);
|
const [cookies, setCookie] = useCookies(["cookieConsent"]);
|
||||||
|
|
||||||
const consentGranted = cookies.cookieConsent === "true";
|
const consentGranted = cookies.cookieConsent === "true";
|
||||||
/*
|
|
||||||
const {
|
const {
|
||||||
publicRuntimeConfig: { embedded },
|
publicRuntimeConfig: { embedded },
|
||||||
} = getConfig();
|
} = getConfig();
|
||||||
*/
|
|
||||||
|
|
||||||
const embedded = true;
|
|
||||||
const {
|
const {
|
||||||
colors: {
|
colors: {
|
||||||
white,
|
white,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ COPY --from=builder ${APP_DIR}/out/package-lock.json ./package-lock.json
|
||||||
RUN npm ci --omit=dev
|
RUN npm ci --omit=dev
|
||||||
|
|
||||||
COPY --from=builder ${APP_DIR}/out/full/ .
|
COPY --from=builder ${APP_DIR}/out/full/ .
|
||||||
ARG LINK_URL=https://link-stack-dev.digiresilience.org
|
|
||||||
RUN npm i -g turbo
|
RUN npm i -g turbo
|
||||||
RUN turbo run build --filter=link
|
RUN turbo run build --filter=link
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@ import type { NextRequest } from 'next/server';
|
||||||
import { withAuth, NextRequestWithAuth } from "next-auth/middleware";
|
import { withAuth, NextRequestWithAuth } from "next-auth/middleware";
|
||||||
|
|
||||||
const rewriteURL = (request: NextRequest, originBaseURL: string, destinationBaseURL: string, headers: any = {}) => {
|
const rewriteURL = (request: NextRequest, originBaseURL: string, destinationBaseURL: string, headers: any = {}) => {
|
||||||
|
if (request.nextUrl.protocol.startsWith('ws')) {
|
||||||
|
return NextResponse.next();
|
||||||
|
}
|
||||||
|
|
||||||
if (request.nextUrl.pathname.includes('/_next/static/development/')) {
|
if (request.nextUrl.pathname.includes('/_next/static/development/')) {
|
||||||
return NextResponse.next();
|
return NextResponse.next();
|
||||||
}
|
}
|
||||||
|
|
@ -26,12 +30,15 @@ console.log({finalHeaders: requestHeaders});
|
||||||
const checkRewrites = async (request: NextRequestWithAuth) => {
|
const checkRewrites = async (request: NextRequestWithAuth) => {
|
||||||
console.log({ currentURL: request.nextUrl.href });
|
console.log({ currentURL: request.nextUrl.href });
|
||||||
|
|
||||||
const linkBaseURL = "http://localhost:3000";
|
const linkBaseURL = process.env.LINK_URL ?? "http://localhost:3000";
|
||||||
const zammadURL = "http://zammad-nginx:8080";
|
const zammadURL = process.env.ZAMMAD_URL ?? "http://zammad-nginx:8080";
|
||||||
|
const leafcutterURL = process.env.LEAFCUTTER_URL ?? "http://leafcutter:3000";
|
||||||
|
const metamigoURL = process.env.METAMIGO_URL ?? "http://metamigo:3000";
|
||||||
|
|
||||||
if (request.nextUrl.pathname.startsWith('/proxy/leafcutter')) {
|
if (request.nextUrl.pathname.startsWith('/proxy/leafcutter')) {
|
||||||
return rewriteURL(request, linkBaseURL, "http://leafcutter:3000");
|
return rewriteURL(request, linkBaseURL, leafcutterURL);
|
||||||
} else if (request.nextUrl.pathname.startsWith('/proxy/metamigo')) {
|
} else if (request.nextUrl.pathname.startsWith('/proxy/metamigo')) {
|
||||||
return rewriteURL(request, linkBaseURL, "http://metamigo:3000");
|
return rewriteURL(request, linkBaseURL, metamigoURL);
|
||||||
} else if (request.nextUrl.pathname.startsWith('/proxy/zammad')) {
|
} else if (request.nextUrl.pathname.startsWith('/proxy/zammad')) {
|
||||||
console.log('proxying to zammad');
|
console.log('proxying to zammad');
|
||||||
const { token } = request.nextauth;
|
const { token } = request.nextauth;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue