diff --git a/.gitpod.yml b/.gitpod.yml index ca107ecb1f..31694827b1 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,7 +4,7 @@ image: # List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/config-ports/ ports: - port: 5000 - onOpen: open-browser + onOpen: ignore visibility: public - port: 3000 onOpen: ignore diff --git a/services/service-community/package.service.js b/services/service-community/package.service.js index 29d50725f7..7b12ad6b12 100644 --- a/services/service-community/package.service.js +++ b/services/service-community/package.service.js @@ -64,6 +64,9 @@ module.exports = { */ async started(ctx) { + // 故障报告服务 + this.broker.createService(require("@steedos/service-sentry")); + // 启动 元数据服务 this.broker.createService(require("@steedos/service-metadata-server")); @@ -87,9 +90,6 @@ module.exports = { // 启动 登录页面 this.broker.createService(require("@steedos/webapp-accounts")); - // 故障报告服务 - this.broker.createService(require("@steedos/service-sentry")); - // 产品分析 this.broker.createService(require("@steedos/service-analytics")); }, diff --git a/services/service-sentry/package.json b/services/service-sentry/package.json index 98f741d720..f75e281565 100644 --- a/services/service-sentry/package.json +++ b/services/service-sentry/package.json @@ -6,8 +6,7 @@ "dependencies": { "@sentry/node": "7.7.0", "@sentry/tracing": "7.7.0", - "@sentry/utils": "7.7.0", - "@steedos/objectql": "2.2.55-beta.13" + "@sentry/utils": "7.7.0" }, "private": false, "publishConfig": { diff --git a/services/service-sentry/package.service.js b/services/service-sentry/package.service.js index e324f89ec9..a9e0ebf608 100644 --- a/services/service-sentry/package.service.js +++ b/services/service-sentry/package.service.js @@ -6,6 +6,7 @@ 'use strict' + const _ = require('lodash'); const Sentry = require('@sentry/node') const SentryUtils = require('@sentry/utils') @@ -24,7 +25,6 @@ const DEFAULT_DSN = { module.exports = { name: serviceName, namespace: "steedos", - mixins: [packageLoader], /** * Dependencies @@ -218,7 +218,7 @@ module.exports = { }) } }, - + started() { let { enabled, dsn, options } = this.settings.sentry if (enabled) { diff --git a/services/service-steedos-server/index.js b/services/service-steedos-server/index.js index db7f7ad32a..461d48577d 100644 --- a/services/service-steedos-server/index.js +++ b/services/service-steedos-server/index.js @@ -8,7 +8,7 @@ const packageLoader = require('@steedos/service-meteor-package-loader'); const objectql = require('@steedos/objectql'); const standardObjectsPath = path.dirname(require.resolve("@steedos/standard-objects/package.json")); const _ = require('lodash'); -const Sentry = require('@sentry/node') + /** * @typedef {import('moleculer').Context} Context Moleculer's Context */ diff --git a/services/service-sentry/main/default/client/sentry.client.js b/steedos-packages/service-analytics/main/default/client/sentry.client.js similarity index 91% rename from services/service-sentry/main/default/client/sentry.client.js rename to steedos-packages/service-analytics/main/default/client/sentry.client.js index a9126aa22d..af4ee2ee9b 100644 --- a/services/service-sentry/main/default/client/sentry.client.js +++ b/steedos-packages/service-analytics/main/default/client/sentry.client.js @@ -1,5 +1,4 @@ -console.log(Meteor.settings.public.sentry.dsn) -if (Meteor.settings.public.sentry.dsn) { +if (Meteor.settings.public.sentry && Meteor.settings.public.sentry.dsn) { let sentryScript = document.createElement("script"); sentryScript.setAttribute("src", Steedos.absoluteUrl('/sentry/sentry.min.js')); diff --git a/services/service-sentry/public/sentry/sentry.min.js b/steedos-packages/service-analytics/public/sentry/sentry.min.js similarity index 100% rename from services/service-sentry/public/sentry/sentry.min.js rename to steedos-packages/service-analytics/public/sentry/sentry.min.js