mirror of
https://github.com/meienberger/runtipi.git
synced 2024-08-16 23:50:34 +03:00
chore: disable sentry for local development
This commit is contained in:
parent
8d10d0e96a
commit
0e4f0d1ca7
@ -7,12 +7,12 @@ FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS node_base
|
||||
FROM node_base AS builder_base
|
||||
|
||||
ARG SENTRY_AUTH_TOKEN
|
||||
ARG SENTRY_DISABLE_AUTO_UPLOAD
|
||||
ARG TIPI_VERSION
|
||||
ARG LOCAL
|
||||
|
||||
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
|
||||
ENV SENTRY_DISABLE_AUTO_UPLOAD=${SENTRY_DISABLE_AUTO_UPLOAD}
|
||||
ENV TIPI_VERSION=${TIPI_VERSION}
|
||||
ENV LOCAL=${LOCAL}
|
||||
|
||||
RUN npm install pnpm -g
|
||||
RUN apk add --no-cache curl python3 make g++ git
|
||||
|
@ -30,10 +30,12 @@ COPY ./pnpm-lock.yaml ./
|
||||
RUN pnpm fetch --ignore-scripts
|
||||
|
||||
COPY ./package*.json ./
|
||||
COPY ./packages ./packages
|
||||
COPY ./packages/worker/package.json ./packages/worker/package.json
|
||||
COPY ./packages/shared/package.json ./packages/shared/package.json
|
||||
|
||||
RUN pnpm install -r --prefer-offline
|
||||
|
||||
COPY ./packages ./packages
|
||||
COPY ./tsconfig.json ./tsconfig.json
|
||||
COPY ./next.config.mjs ./next.config.mjs
|
||||
COPY ./public ./public
|
||||
|
@ -95,6 +95,7 @@ services:
|
||||
WORKER_APP_DIR: /app/packages/worker
|
||||
DASHBOARD_APP_DIR: /app
|
||||
NEXT_PUBLIC_TIPI_VERSION: development
|
||||
LOCAL: true
|
||||
env_file:
|
||||
- .env
|
||||
labels:
|
||||
|
@ -63,8 +63,8 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
SENTRY_DISABLE_AUTO_UPLOAD: true
|
||||
TIPI_VERSION: development
|
||||
LOCAL: true
|
||||
container_name: runtipi
|
||||
healthcheck:
|
||||
test: ['CMD', 'curl', '-f', 'http://localhost:5000/worker-api/healthcheck']
|
||||
@ -97,6 +97,7 @@ services:
|
||||
NODE_ENV: production
|
||||
TIPI_VERSION: development
|
||||
NEXT_PUBLIC_TIPI_VERSION: development
|
||||
LOCAL: true
|
||||
networks:
|
||||
- tipi_main_network
|
||||
ports:
|
||||
|
@ -18,22 +18,23 @@ const nextConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
export default withSentryConfig(
|
||||
nextConfig,
|
||||
{
|
||||
// https://github.com/getsentry/sentry-webpack-plugin#options
|
||||
silent: false,
|
||||
org: 'runtipi',
|
||||
project: 'runtipi-dashboard',
|
||||
dryRun: process.env.SENTRY_DISABLE_AUTO_UPLOAD === 'true',
|
||||
release: process.env.TIPI_VERSION,
|
||||
},
|
||||
{
|
||||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
||||
widenClientFileUpload: true,
|
||||
transpileClientSDK: false,
|
||||
tunnelRoute: '/errors',
|
||||
hideSourceMaps: false,
|
||||
disableLogger: true,
|
||||
},
|
||||
);
|
||||
export default !process.env.LOCAL === 'true'
|
||||
? withSentryConfig(
|
||||
nextConfig,
|
||||
{
|
||||
// https://github.com/getsentry/sentry-webpack-plugin#options
|
||||
silent: false,
|
||||
org: 'runtipi',
|
||||
project: 'runtipi-dashboard',
|
||||
release: process.env.TIPI_VERSION,
|
||||
},
|
||||
{
|
||||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
||||
widenClientFileUpload: true,
|
||||
transpileClientSDK: false,
|
||||
tunnelRoute: '/errors',
|
||||
hideSourceMaps: false,
|
||||
disableLogger: true,
|
||||
},
|
||||
)
|
||||
: nextConfig;
|
||||
|
@ -11,7 +11,7 @@
|
||||
"test:client": "jest --colors --selectProjects client --",
|
||||
"test:server": "jest --colors --selectProjects server --",
|
||||
"test:vite": "dotenv -e .env.test -- vitest run --coverage",
|
||||
"dev": "next dev",
|
||||
"dev": "next dev --turbo",
|
||||
"db:migrate": "NODE_ENV=development dotenv -e .env.local -- tsx ./src/server/run-migrations-dev.ts",
|
||||
"lint": "next lint",
|
||||
"lint:fix": "next lint --fix",
|
||||
|
@ -1,6 +1,21 @@
|
||||
const { build } = require('esbuild');
|
||||
const { sentryEsbuildPlugin } = require('@sentry/esbuild-plugin');
|
||||
|
||||
const plugins = [];
|
||||
|
||||
if (process.env.LOCAL !== 'true') {
|
||||
plugins.push(
|
||||
sentryEsbuildPlugin({
|
||||
authToken: process.env.SENTRY_AUTH_TOKEN,
|
||||
release: {
|
||||
name: process.env.TIPI_VERSION,
|
||||
},
|
||||
org: 'runtipi',
|
||||
project: 'runtipi-worker',
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async function bundle() {
|
||||
const start = Date.now();
|
||||
const options = {
|
||||
@ -15,16 +30,7 @@ async function bundle() {
|
||||
'.node': 'copy',
|
||||
},
|
||||
minify: true,
|
||||
plugins: [
|
||||
sentryEsbuildPlugin({
|
||||
authToken: process.env.SENTRY_AUTH_TOKEN,
|
||||
release: {
|
||||
name: process.env.TIPI_VERSION,
|
||||
},
|
||||
org: 'runtipi',
|
||||
project: 'runtipi-worker',
|
||||
}),
|
||||
],
|
||||
plugins,
|
||||
};
|
||||
|
||||
await build({
|
||||
|
@ -49,7 +49,7 @@ const main = async () => {
|
||||
logger.info('Copying system files...');
|
||||
await copySystemFiles(envMap);
|
||||
|
||||
if (envMap.get('ALLOW_ERROR_MONITORING') === 'true' && process.env.NODE_ENV === 'production') {
|
||||
if (envMap.get('ALLOW_ERROR_MONITORING') === 'true' && process.env.NODE_ENV === 'production' && process.env.LOCAL !== 'true') {
|
||||
logger.info(`Anonymous error monitoring is enabled, to disable it add "allowErrorMonitoring": false to your settings.json file. Version: ${process.env.TIPI_VERSION}`);
|
||||
setupSentry(process.env.TIPI_VERSION);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ const getClientConfig = () => {
|
||||
|
||||
const { allowErrorMonitoring } = getClientConfig();
|
||||
|
||||
if (allowErrorMonitoring && process.env.NODE_ENV === 'production') {
|
||||
if (allowErrorMonitoring && process.env.NODE_ENV === 'production' && process.env.LOCAL !== 'true') {
|
||||
Sentry.init({
|
||||
release: process.env.NEXT_PUBLIC_TIPI_VERSION,
|
||||
environment: process.env.NODE_ENV,
|
||||
|
@ -10,7 +10,7 @@ import { extraErrorDataIntegration } from '@sentry/integrations';
|
||||
|
||||
const { version, allowErrorMonitoring, NODE_ENV } = TipiConfig.getConfig();
|
||||
|
||||
if (allowErrorMonitoring && NODE_ENV === 'production') {
|
||||
if (allowErrorMonitoring && NODE_ENV === 'production' && process.env.LOCAL !== 'true') {
|
||||
Sentry.init({
|
||||
release: version,
|
||||
environment: NODE_ENV,
|
||||
|
@ -9,7 +9,7 @@ import { extraErrorDataIntegration } from '@sentry/integrations';
|
||||
|
||||
const { version, allowErrorMonitoring, NODE_ENV } = TipiConfig.getConfig();
|
||||
|
||||
if (allowErrorMonitoring && NODE_ENV === 'production') {
|
||||
if (allowErrorMonitoring && NODE_ENV === 'production' && process.env.LOCAL !== 'true') {
|
||||
Sentry.init({
|
||||
release: version,
|
||||
environment: NODE_ENV,
|
||||
|
Loading…
Reference in New Issue
Block a user