feat: add default sentry
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Setting" ADD COLUMN "sentryDSN" TEXT;
|
@@ -32,6 +32,7 @@ model Setting {
|
|||||||
applicationStoragePathMigrationFinished Boolean @default(false)
|
applicationStoragePathMigrationFinished Boolean @default(false)
|
||||||
proxyDefaultRedirect String?
|
proxyDefaultRedirect String?
|
||||||
doNotTrack Boolean @default(false)
|
doNotTrack Boolean @default(false)
|
||||||
|
sentryDSN String?
|
||||||
isAPIDebuggingEnabled Boolean @default(false)
|
isAPIDebuggingEnabled Boolean @default(false)
|
||||||
isRegistrationEnabled Boolean @default(false)
|
isRegistrationEnabled Boolean @default(false)
|
||||||
isAutoUpdateEnabled Boolean @default(false)
|
isAutoUpdateEnabled Boolean @default(false)
|
||||||
|
@@ -36,6 +36,8 @@ declare module 'fastify' {
|
|||||||
|
|
||||||
const port = isDev ? 3001 : 3000;
|
const port = isDev ? 3001 : 3000;
|
||||||
const host = '0.0.0.0';
|
const host = '0.0.0.0';
|
||||||
|
const sentryDSN = 'https://40285978081c4739b3aed4093f0abe7d@o1082494.ingest.sentry.io/6091062';
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const settings = await prisma.setting.findFirst()
|
const settings = await prisma.setting.findFirst()
|
||||||
const fastify = Fastify({
|
const fastify = Fastify({
|
||||||
@@ -177,7 +179,7 @@ const host = '0.0.0.0';
|
|||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
await migrateServicesToNewTemplate()
|
await migrateServicesToNewTemplate()
|
||||||
}, isDev ? 1000 : 60000)
|
}, isDev ? 10000 : 60000)
|
||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
await copySSLCertificates();
|
await copySSLCertificates();
|
||||||
@@ -238,8 +240,8 @@ async function getTagsTemplates() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function initServer() {
|
async function initServer() {
|
||||||
try {
|
|
||||||
const appId = process.env['COOLIFY_APP_ID'];
|
const appId = process.env['COOLIFY_APP_ID'];
|
||||||
|
try {
|
||||||
let doNotTrack = false
|
let doNotTrack = false
|
||||||
if (appId === '') {
|
if (appId === '') {
|
||||||
doNotTrack = true
|
doNotTrack = true
|
||||||
@@ -248,6 +250,21 @@ async function initServer() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
const settings = await prisma.setting.findUnique({ where: { id: '0' } })
|
||||||
|
if (!settings.sentryDSN) {
|
||||||
|
if (appId == '') {
|
||||||
|
console.log('Telemetry disabled')
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
await prisma.setting.update({ where: { id: '0' }, data: { sentryDSN } })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Initialize Sentry
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
console.log(`[001] Initializing server...`);
|
console.log(`[001] Initializing server...`);
|
||||||
await asyncExecShell(`docker network create --attachable coolify`);
|
await asyncExecShell(`docker network create --attachable coolify`);
|
||||||
|
Reference in New Issue
Block a user