Skip to content

Commit fd7095a

Browse files
committed
Remove sentry and error reporting
1 parent 6d6021c commit fd7095a

File tree

18 files changed

+26
-144
lines changed

18 files changed

+26
-144
lines changed

backend/cmd/ipranges/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ import (
1616

1717
var commit string
1818
var version string
19-
var sentryDSN string
2019

2120
var cloudfrontURL = "https://ip-ranges.amazonaws.com/ip-ranges.json"
2221
var cloudflare4URL = "https://www.cloudflare.com/ips-v4"
2322
var cloudflare6URL = "https://www.cloudflare.com/ips-v6"
2423

2524
func main() {
2625
config.InitArgs(&version, &commit)
27-
if err := config.InitIPRanges(&version, &commit, &sentryDSN); err != nil {
26+
if err := config.InitIPRanges(&version, &commit); err != nil {
2827
fmt.Printf("# Config ERROR: %v\n", err)
2928
os.Exit(1)
3029
}

backend/cmd/server/main.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"npm/internal/database"
1111
"npm/internal/entity/certificate"
1212
"npm/internal/entity/host"
13-
"npm/internal/entity/setting"
1413
"npm/internal/entity/user"
1514
"npm/internal/errors"
1615
"npm/internal/jobqueue"
@@ -20,19 +19,17 @@ import (
2019

2120
var commit string
2221
var version string
23-
var sentryDSN string
2422

2523
func main() {
2624
config.InitArgs(&version, &commit)
27-
config.Init(&version, &commit, &sentryDSN)
25+
config.Init(&version, &commit)
2826

2927
database.Migrate(func() {
3028
if err := jwt.LoadKeys(); err != nil {
3129
logger.Error("KeysError", err)
3230
os.Exit(1)
3331
}
3432

35-
setting.ApplySettings()
3633
checkSetup()
3734

3835
// Internal Job Queue
@@ -79,9 +76,6 @@ func checkSetup() {
7976
config.IsSetup = true
8077
logger.Info("Application is setup")
8178
}
82-
if config.ErrorReporting {
83-
logger.Warn("Error reporting is enabled - Application Errors WILL be sent to Sentry, you can disable this in the Settings interface")
84-
}
8579
} else {
8680
logger.Error("DatabaseError", errors.ErrDatabaseUnavailable)
8781
}

backend/embed/api_docs/components/HealthObject.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "object",
33
"description": "HealthObject",
44
"additionalProperties": false,
5-
"required": ["version", "commit", "healthy", "setup", "error_reporting"],
5+
"required": ["version", "commit", "healthy", "setup"],
66
"properties": {
77
"version": {
88
"type": "string",
@@ -22,10 +22,6 @@
2222
"type": "boolean",
2323
"description": "Is the application set up?"
2424
},
25-
"error_reporting": {
26-
"type": "boolean",
27-
"description": "Will the application send any error reporting?"
28-
},
2925
"acme.sh": {
3026
"type": "string",
3127
"description": "Acme.sh version",

backend/embed/api_docs/paths/get.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
"version": "3.0.0",
2323
"commit": "9f119b6",
2424
"healthy": true,
25-
"setup": true,
26-
"error_reporting": true
25+
"setup": true
2726
}
2827
}
2928
},
@@ -33,8 +32,7 @@
3332
"version": "3.0.0",
3433
"commit": "9f119b6",
3534
"healthy": false,
36-
"setup": true,
37-
"error_reporting": true
35+
"setup": true
3836
}
3937
}
4038
}

backend/embed/migrations/mysql/20201013035839_initial_data.sql

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ INSERT INTO `setting` (
3030
`description`,
3131
`value`
3232
) VALUES
33-
-- Default error reporting setting
34-
(
35-
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
36-
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
37-
"error-reporting",
38-
"If enabled, any application errors are reported to Sentry. Sensitive information is not sent.",
39-
"true" -- remember this is json
40-
),
4133
-- Default site
4234
(
4335
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),

backend/embed/migrations/postgres/20201013035839_initial_data.sql

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ INSERT INTO "setting" (
3030
"description",
3131
"value"
3232
) VALUES
33-
-- Default error reporting setting
34-
(
35-
EXTRACT(EPOCH FROM TIMESTAMP '2011-05-17 10:40:28.876944') * 1000,
36-
EXTRACT(EPOCH FROM TIMESTAMP '2011-05-17 10:40:28.876944') * 1000,
37-
'error-reporting',
38-
'If enabled, any application errors are reported to Sentry. Sensitive information is not sent.',
39-
'true' -- remember this is json
40-
),
4133
-- Default site
4234
(
4335
EXTRACT(EPOCH FROM TIMESTAMP '2011-05-17 10:40:28.876944') * 1000,

backend/embed/migrations/sqlite/20201013035839_initial_data.sql

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,6 @@ INSERT INTO `capability` (
2323
("streams.manage"),
2424
("users.manage");
2525

26-
-- Default error reporting setting
27-
INSERT INTO `setting` (
28-
created_at,
29-
updated_at,
30-
name,
31-
description,
32-
value
33-
) VALUES (
34-
unixepoch() * 1000,
35-
unixepoch() * 1000,
36-
"error-reporting",
37-
"If enabled, any application errors are reported to Sentry. Sensitive information is not sent.",
38-
"true" -- remember this is json
39-
);
40-
4126
-- Default site
4227
INSERT INTO `setting` (
4328
created_at,

backend/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ require (
99
github.com/dgrijalva/jwt-go v3.2.0+incompatible
1010
github.com/drexedam/gravatar v0.0.0-20210327211422-e94eea8c338e
1111
github.com/fatih/color v1.15.0
12-
github.com/getsentry/sentry-go v0.21.0
1312
github.com/glebarez/sqlite v1.8.0
1413
github.com/go-chi/chi/v5 v5.0.8
1514
github.com/go-chi/cors v1.2.1

backend/go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
2020
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
2121
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
2222
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
23-
github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4=
24-
github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
2523
github.com/glebarez/go-sqlite v1.21.1 h1:7MZyUPh2XTrHS7xNEHQbrhfMZuPSzhkm2A1qgg0y5NY=
2624
github.com/glebarez/go-sqlite v1.21.1/go.mod h1:ISs8MF6yk5cL4n/43rSOmVMGJJjHYr7L2MbZZ5Q4E2E=
2725
github.com/glebarez/sqlite v1.8.0 h1:02X12E2I/4C1n+v90yTqrjRa8yuo7c3KeHI3FRznCvc=
@@ -32,7 +30,6 @@ github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
3230
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
3331
github.com/go-chi/jwtauth/v5 v5.1.0 h1:wJyf2YZ/ohPvNJBwPOzZaQbyzwgMZZceE1m8FOzXLeA=
3432
github.com/go-chi/jwtauth/v5 v5.1.0/go.mod h1:MA93hc1au3tAQwCKry+fI4LqJ5MIVN4XSsglOo+lSc8=
35-
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
3633
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
3734
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
3835
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
@@ -108,7 +105,6 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P
108105
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
109106
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
110107
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
111-
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
112108
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
113109
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
114110
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

backend/internal/api/handler/health.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@ import (
88
)
99

1010
type healthCheckResponse struct {
11-
Version string `json:"version"`
12-
Commit string `json:"commit"`
13-
AcmeShVersion string `json:"acme.sh"`
14-
Healthy bool `json:"healthy"`
15-
IsSetup bool `json:"setup"`
16-
ErrorReporting bool `json:"error_reporting"`
11+
Version string `json:"version"`
12+
Commit string `json:"commit"`
13+
AcmeShVersion string `json:"acme.sh"`
14+
Healthy bool `json:"healthy"`
15+
IsSetup bool `json:"setup"`
1716
}
1817

1918
// Health returns the health of the api
2019
// Route: GET /health
2120
func Health() func(http.ResponseWriter, *http.Request) {
2221
return func(w http.ResponseWriter, r *http.Request) {
2322
health := healthCheckResponse{
24-
Version: config.Version,
25-
Commit: config.Commit,
26-
Healthy: true,
27-
IsSetup: config.IsSetup,
28-
AcmeShVersion: acme.GetAcmeShVersion(),
29-
ErrorReporting: config.ErrorReporting,
23+
Version: config.Version,
24+
Commit: config.Commit,
25+
Healthy: true,
26+
IsSetup: config.IsSetup,
27+
AcmeShVersion: acme.GetAcmeShVersion(),
3028
}
3129

3230
h.ResultResponseJSON(w, r, http.StatusOK, health)

0 commit comments

Comments
 (0)