Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 100 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@citation-js/core": "^0.7.18",
"@citation-js/plugin-csl": "^0.7.18",
"@fortawesome/fontawesome-free": "^6.7.2",
"@newrelic/browser-agent": "^1.301.0",
"@ngx-translate/core": "^16.0.4",
"@ngx-translate/http-loader": "^16.0.1",
"@ngxs/devtools-plugin": "^19.0.0",
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/provider/application.initialization.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { OSFConfigService } from '@core/services/osf-config.service';

import { ENVIRONMENT } from './environment.provider';

import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent';
import * as Sentry from '@sentry/angular';
import { GoogleTagManagerConfiguration } from 'angular-google-tag-manager';

Expand All @@ -25,6 +26,7 @@ export function initializeApplication() {
await configService.load();

const googleTagManagerId = environment.googleTagManagerId;

if (googleTagManagerId) {
googleTagManagerConfiguration.set({ id: googleTagManagerId });
}
Expand All @@ -41,6 +43,10 @@ export function initializeApplication() {
integrations: [],
});
}

if (environment.newRelic?.enabled) {
new BrowserAgent(environment.newRelic);
}
};
}

Expand Down
26 changes: 25 additions & 1 deletion src/app/shared/models/environment.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface EnvironmentModel {
defaultProvider: string;
dataciteTrackerRepoId: string | null;
dataciteTrackerAddress: string;

newRelic: NewRelicConfig;
activityLogs?: {
pageSize?: number;
};
Expand Down Expand Up @@ -50,3 +50,27 @@ export interface EnvironmentModel {
*/
googleFilePickerAppId: number;
}

interface NewRelicConfig {
enabled: boolean;
init: {
distributed_tracing: { enabled: boolean };
performance: { capture_measures: boolean };
privacy: { cookies_enabled: boolean };
ajax: { deny_list: string[] };
};
info: {
beacon: string;
errorBeacon: string;
licenseKey: string;
applicationID: string;
sa: number;
};
loader_config: {
accountID: string;
trustKey: string;
agentID: string;
licenseKey: string;
applicationID: string;
};
}
30 changes: 28 additions & 2 deletions src/assets/config/template.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
{
"webUrl": "",
"apiDomainUrl": "",
"shareTroveUrl": "",
"addonsApiUrl": "",
"funderApiUrl": "",
"casUrl": "",
"recaptchaSiteKey": "",
"dataciteTrackerRepoId": "",
"dataciteTrackerRepoId": null,
"dataciteTrackerAddress": "",
"sentryDsn": "",
"googleTagManagerId": "",
"googleFilePickerApiKey": "",
"googleFilePickerAppId": 0
"googleFilePickerAppId": 0,
"newRelic": {
"enabled": false,
"init": {
"distributed_tracing": { "enabled": false },
"performance": { "capture_measures": false },
"privacy": { "cookies_enabled": true },
"ajax": { "deny_list": [""] }
},
"info": {
"beacon": "",
"errorBeacon": "",
"licenseKey": "",
"applicationID": "",
"sa": 1
},
"loader_config": {
"accountID": "",
"trustKey": "",
"agentID": "",
"licenseKey": "",
"applicationID": ""
}
}
}
8 changes: 4 additions & 4 deletions src/environments/environment.development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ export const environment = {
/**
* Base URL of the OSF web application.
*/
webUrl: 'https://staging4.osf.io',
webUrl: 'https://staging3.osf.io',
/**
* Domain URL used for JSON:API v2 services.
*/
apiDomainUrl: 'https://api.staging4.osf.io',
apiDomainUrl: 'https://api.staging3.osf.io',
/**
* Base URL for SHARE discovery search (Trove).
*/
shareTroveUrl: 'https://staging-share.osf.io/trove',
/**
* URL for the OSF Addons API (v1).
*/
addonsApiUrl: 'https://addons.staging4.osf.io/v1',
addonsApiUrl: 'https://addons.staging3.osf.io/v1',
/**
* API endpoint for funder metadata resolution via Crossref.
*/
funderApiUrl: 'https://api.crossref.org/',
/**
* URL for OSF Central Authentication Service (CAS).
*/
casUrl: 'https://accounts.staging4.osf.io',
casUrl: 'https://accounts.staging3.osf.io',
/**
* Site key used for reCAPTCHA v2 validation in staging.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="utf-8" />
<title>OSF</title>
<base href="/" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta name="theme-color" content="#1976d2" />
<script src="assets/ace-builds/ace.js"></script>
<script src="assets/ace-builds/ace.js" defer></script>
</head>
<body>
<osf-root></osf-root>
Expand Down
Loading