To make it work with On Prem Data Ingest #8

Merged
dsutanto merged 5 commits from dsutanto/Deep-Package-Inspection:main into Proxy_Server_API_Netify 2026-07-20 12:24:20 +07:00
6 changed files with 10102 additions and 40 deletions

No files matched your search

+2 -2
View File
@@ -1,10 +1,10 @@
FROM node:18-alpine AS base FROM node:24-alpine AS base
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json* ./ COPY package.json package-lock.json* ./
RUN npm ci RUN npm ci --legacy-peer-deps
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM base AS builder FROM base AS builder
-31
View File
@@ -1,31 +0,0 @@
FROM oven/bun:1-alpine AS base
FROM base AS deps
WORKDIR /app
COPY package.json .
RUN bun install
FROM base AS builder
WORKDIR /app
ARG NEXT_PUBLIC_API_URL=http://127.0.0.1:3001
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN bun run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
CMD ["bun", "run", "server.js"]
+1 -1
View File
@@ -40,7 +40,7 @@ function getBaseFilter(req, timeFilter = null) {
if (isGlobalUser && requestedSiteUuid) { if (isGlobalUser && requestedSiteUuid) {
filter.site_uuid = requestedSiteUuid; filter.site_uuid = requestedSiteUuid;
} else if (req.user?.site_uuid) { } else if (!isGlobalUser && req.user?.site_uuid) {
filter.site_uuid = req.user.site_uuid; filter.site_uuid = req.user.site_uuid;
} }
+1 -1
View File
@@ -43,7 +43,7 @@ const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS
app.use(cors({ app.use(cors({
origin: (origin, callback) => { origin: (origin, callback) => {
if (!origin) return callback(null, true); if (!origin) return callback(null, true);
if (ALLOWED_ORIGINS.includes(origin)) { if (ALLOWED_ORIGINS.includes('*') || ALLOWED_ORIGINS.includes(origin)) {
callback(null, true); callback(null, true);
} else { } else {
callback(new Error('Blocked by CORS policy (Unauthorized Origin)')); callback(new Error('Blocked by CORS policy (Unauthorized Origin)'));
+10098
View File
File diff suppressed because it is too large. Load diff
@@ -62,8 +62,3 @@ export async function POST(req: NextRequest) {
); );
} }
} }
// Nonaktifkan body parser bawaan Next.js — biar formData diurus manual
export const config = {
api: { bodyParser: false },
};