WIP 4
This commit is contained in:
parent
f62c9f064d
commit
b8c6e893ff
43 changed files with 4721 additions and 1807 deletions
|
|
@ -29,32 +29,16 @@ const checkRewrites = async (request: NextRequestWithAuth) => {
|
|||
const labelStudioURL = process.env.LABEL_STUDIO_URL ?? "http://label-studio:8080";
|
||||
const { token } = request.nextauth;
|
||||
const headers = { 'X-Forwarded-User': token?.email?.toLowerCase() };
|
||||
console.log ({ pathname: request.nextUrl.pathname});
|
||||
console.log({ pathname: request.nextUrl.pathname });
|
||||
|
||||
if (request.nextUrl.pathname.startsWith('/api/v1/configuration/account') ||
|
||||
request.nextUrl.pathname.startsWith('/api/v1/restapiinfo') ||
|
||||
request.nextUrl.pathname.startsWith('/api/v1/auth') ||
|
||||
request.nextUrl.pathname.startsWith('/api/core') ||
|
||||
request.nextUrl.pathname.startsWith('/api/dataconnections') ||
|
||||
request.nextUrl.pathname.startsWith('/api/v1/multitenancy') ||
|
||||
request.nextUrl.pathname.startsWith('/api/ism') ||
|
||||
request.nextUrl.pathname.startsWith('/node_modules') ||
|
||||
request.nextUrl.pathname.startsWith('/translations') || request.nextUrl.pathname.startsWith('/6867') || request.nextUrl.pathname.startsWith('/ui') || request.nextUrl.pathname.startsWith('/bootstrap')) {
|
||||
const headers = {
|
||||
'x-proxy-user': "admin",
|
||||
'x-proxy-roles': "all_access",
|
||||
// 'X-Forwarded-For': "link"
|
||||
};
|
||||
return rewriteURL(request, `${linkBaseURL}`, opensearchURL, headers);
|
||||
}
|
||||
else if (request.nextUrl.pathname.startsWith('/opensearch')) {
|
||||
if (request.nextUrl.pathname.startsWith('/opensearch')) {
|
||||
const headers = {
|
||||
'x-proxy-user': "admin",
|
||||
'x-proxy-roles': "all_access",
|
||||
// 'X-Forwarded-For': "link"
|
||||
};
|
||||
return rewriteURL(request, `${linkBaseURL}/opensearch`, opensearchURL, headers);
|
||||
}else if (request.nextUrl.pathname.startsWith('/metamigo')) {
|
||||
} else if (request.nextUrl.pathname.startsWith('/metamigo')) {
|
||||
return rewriteURL(request, `${linkBaseURL}/metamigo`, metamigoURL);
|
||||
} else if (request.nextUrl.pathname.startsWith('/label-studio')) {
|
||||
return rewriteURL(request, `${linkBaseURL}/label-studio`, labelStudioURL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue