Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9ea253021 | |||
| 237bd46593 | |||
| 40ebdb31d9 |
@@ -51,7 +51,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
# Ensure the cache directory specifically is writeable (Mintel Standard #16)
|
||||
RUN mkdir -p .next/cache && chown -R nextjs:nodejs .next/cache
|
||||
# We copy a small directory or just create it via COPY to avoid RUN chown permission issues
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/cache ./.next/cache
|
||||
|
||||
USER nextjs
|
||||
|
||||
|
||||
@@ -66,7 +66,11 @@ export class UmamiAnalyticsService implements AnalyticsService {
|
||||
const payload = {
|
||||
website: this.websiteId,
|
||||
hostname:
|
||||
typeof window !== "undefined" ? window.location.hostname : "server",
|
||||
typeof window !== "undefined"
|
||||
? window.location.hostname
|
||||
: this.serverContext?.referrer
|
||||
? new URL(this.serverContext.referrer).hostname
|
||||
: "server",
|
||||
screen:
|
||||
typeof window !== "undefined"
|
||||
? `${window.screen.width}x${window.screen.height}`
|
||||
@@ -131,7 +135,9 @@ export class UmamiAnalyticsService implements AnalyticsService {
|
||||
url:
|
||||
typeof window !== "undefined"
|
||||
? window.location.pathname + window.location.search
|
||||
: undefined,
|
||||
: this.serverContext?.referrer
|
||||
? new URL(this.serverContext.referrer).pathname
|
||||
: "/",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -144,7 +150,9 @@ export class UmamiAnalyticsService implements AnalyticsService {
|
||||
url ||
|
||||
(typeof window !== "undefined"
|
||||
? window.location.pathname + window.location.search
|
||||
: undefined),
|
||||
: this.serverContext?.referrer
|
||||
? new URL(this.serverContext.referrer).pathname
|
||||
: "/"),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,33 +31,63 @@ export class PinoLoggerService implements LoggerService {
|
||||
}
|
||||
|
||||
trace(msg: string, ...args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.logger.trace(msg, ...(args as any));
|
||||
if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).trace(args[0] as object, msg, ...args.slice(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).trace(msg, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
debug(msg: string, ...args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.logger.debug(msg, ...(args as any));
|
||||
if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).debug(args[0] as object, msg, ...args.slice(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).debug(msg, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
info(msg: string, ...args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.logger.info(msg, ...(args as any));
|
||||
if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).info(args[0] as object, msg, ...args.slice(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).info(msg, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
warn(msg: string, ...args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.logger.warn(msg, ...(args as any));
|
||||
if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).warn(args[0] as object, msg, ...args.slice(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).warn(msg, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
error(msg: string, ...args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.logger.error(msg, ...(args as any));
|
||||
if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).error(args[0] as object, msg, ...args.slice(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).error(msg, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
fatal(msg: string, ...args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.logger.fatal(msg, ...(args as any));
|
||||
if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).fatal(args[0] as object, msg, ...args.slice(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.logger as any).fatal(msg, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
child(bindings: Record<string, unknown>): LoggerService {
|
||||
|
||||
13
sentry.client.config.ts
Normal file
13
sentry.client.config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import { config } from "./lib/config";
|
||||
|
||||
if (config.errors.glitchtip.enabled) {
|
||||
Sentry.init({
|
||||
dsn: config.errors.glitchtip.dsn,
|
||||
tracesSampleRate: 1.0,
|
||||
debug: config.isDevelopment,
|
||||
environment: config.target || "production",
|
||||
// Use the proxy path defined in config
|
||||
tunnel: config.errors.glitchtip.proxyPath,
|
||||
});
|
||||
}
|
||||
11
sentry.edge.config.ts
Normal file
11
sentry.edge.config.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import { config } from "./lib/config";
|
||||
|
||||
if (config.errors.glitchtip.enabled) {
|
||||
Sentry.init({
|
||||
dsn: config.errors.glitchtip.dsn,
|
||||
tracesSampleRate: 1.0,
|
||||
debug: config.isDevelopment,
|
||||
environment: config.target || "production",
|
||||
});
|
||||
}
|
||||
11
sentry.server.config.ts
Normal file
11
sentry.server.config.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import { config } from "./lib/config";
|
||||
|
||||
if (config.errors.glitchtip.enabled) {
|
||||
Sentry.init({
|
||||
dsn: config.errors.glitchtip.dsn,
|
||||
tracesSampleRate: 1.0,
|
||||
debug: config.isDevelopment,
|
||||
environment: config.target || "production",
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user