@openneuro/server 4.26.1 → 4.27.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/server",
3
- "version": "4.26.1",
3
+ "version": "4.27.0-alpha.0",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -21,16 +21,15 @@
21
21
  "@elastic/elasticsearch": "8.13.1",
22
22
  "@graphql-tools/schema": "^10.0.0",
23
23
  "@keyv/redis": "^2.7.0",
24
- "@openneuro/search": "^4.26.1",
25
- "@passport-next/passport-google-oauth2": "^1.0.0",
26
- "@sentry/node": "^4.5.3",
24
+ "@openneuro/search": "^4.27.0-alpha.0",
25
+ "@sentry/node": "^8.25.0",
26
+ "@sentry/profiling-node": "^8.25.0",
27
27
  "base64url": "^3.0.0",
28
28
  "cookie-parser": "^1.4.6",
29
29
  "cors": "^2.8.5",
30
30
  "date-fns": "^2.16.1",
31
31
  "draft-js": "^0.11.7",
32
32
  "draft-js-export-html": "^1.4.1",
33
- "elastic-apm-node": "4.5.4",
34
33
  "express": "4.19.2",
35
34
  "graphql": "16.8.1",
36
35
  "graphql-bigint": "^1.0.0",
@@ -48,10 +47,10 @@
48
47
  "morgan": "^1.6.1",
49
48
  "node-mailjet": "^3.3.5",
50
49
  "object-hash": "2.1.1",
51
- "passport": "^0.6.0",
52
- "passport-google-oauth20": "^1.0.0",
53
- "passport-jwt": "^4.0.0",
54
- "passport-oauth2-refresh": "^2.0.0",
50
+ "passport": "0.7.0",
51
+ "passport-google-oauth20": "2.0.0",
52
+ "passport-jwt": "4.0.1",
53
+ "passport-oauth2-refresh": "2.2.0",
55
54
  "passport-orcid": "0.0.4",
56
55
  "react": "^18.2.0",
57
56
  "react-dom": "^18.2.0",
@@ -86,5 +85,5 @@
86
85
  "publishConfig": {
87
86
  "access": "public"
88
87
  },
89
- "gitHead": "059df1d714c883d1f5966c0b3968b073bf0120e3"
88
+ "gitHead": "7577739ccee193d927d81806f0eeffc285a28800"
90
89
  }
@@ -12,10 +12,10 @@ const config = {
12
12
  ORCID_API_ENDPOINT: process.env.ORCID_API_ENDPOINT,
13
13
  GOOGLE_TRACKING_IDS: process.env.GOOGLE_TRACKING_IDS,
14
14
  ENVIRONMENT: process.env.ENVIRONMENT,
15
+ SENTRY_DSN: process.env.SENTRY_DSN,
15
16
  SUPPORT_URL: process.env.FRESH_DESK_URL,
16
17
  DATALAD_GITHUB_ORG: process.env.DATALAD_GITHUB_ORG,
17
18
  AWS_S3_PUBLIC_BUCKET: process.env.AWS_S3_PUBLIC_BUCKET,
18
- ELASTIC_APM_SERVER_URL: process.env.ELASTIC_APM_SERVER_URL,
19
19
  }
20
20
 
21
21
  // Provide some environment variables to the client
@@ -8,6 +8,8 @@ export const sitemapStaticUrls = () => [
8
8
  { url: "/public/datasets", priority: 1.0, changefreq: "daily" },
9
9
  { url: "/faq", priority: 0.6, changefreq: "monthly" },
10
10
  { url: "/pet", priority: 0.5, changefreq: "monthly" },
11
+ { url: "/terms", priority: 0.5, changefreq: "monthly" },
12
+ { url: "/cite", priority: 0.4, changefreq: "monthly" },
11
13
  { url: "/public/jobs", priority: 0.5, changefreq: "monthly" },
12
14
  { url: "/crn/graphql", priority: 0.3 },
13
15
  ]
@@ -161,7 +161,7 @@ export const setupPassportAuth = () => {
161
161
  config.auth.orcid.apiURI.includes("sandbox"),
162
162
  clientID: config.auth.orcid.clientID,
163
163
  clientSecret: config.auth.orcid.clientSecret,
164
- scope: "/read-limited",
164
+ scope: "/activities/update",
165
165
  callbackURL: `${config.url + config.apiPrefix}auth/orcid/callback`,
166
166
  },
167
167
  verifyORCIDUser,
package/src/sentry.ts ADDED
@@ -0,0 +1,17 @@
1
+ import * as Sentry from "@sentry/node"
2
+ import { nodeProfilingIntegration } from "@sentry/profiling-node"
3
+ import config from "./config"
4
+ import { version } from "./lerna.json"
5
+
6
+ Sentry.init({
7
+ dsn: config.sentry.DSN,
8
+ environment: config.sentry.ENVIRONMENT,
9
+ integrations: [
10
+ nodeProfilingIntegration(),
11
+ ],
12
+ // Performance Monitoring
13
+ tracesSampleRate: 1.0, // Capture 100% of the transactions
14
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
15
+ profilesSampleRate: 1.0,
16
+ release: `openneuro-server@${version}`,
17
+ })
package/src/server.ts CHANGED
@@ -1,14 +1,5 @@
1
- import apm from "elastic-apm-node"
1
+ import "./sentry"
2
2
  import config from "./config"
3
- /** Needs to run before the other imports in Node */
4
- if (config.elasticsearch.apmServerUrl) {
5
- apm.start({
6
- serverUrl: config.elasticsearch.apmServerUrl,
7
- apiKey: config.elasticsearch.apmApiKey,
8
- serviceName: "openneuro-server",
9
- cloudProvider: "none",
10
- })
11
- }
12
3
  import { createServer } from "http"
13
4
  import mongoose from "mongoose"
14
5
  import { connect as redisConnect } from "./libs/redis"