From 5c22586e464af6fdb5dcf5b0f23a8d816f0d9474 Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Tue, 3 Oct 2023 15:36:46 -0700 Subject: [PATCH 01/11] feat: [CP-548] Adding config files for EKS stage and dev --- config/development.js | 73 +++++++++++++++++++++++++++++++++++++++++++ config/staging.js | 69 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 config/development.js create mode 100644 config/staging.js diff --git a/config/development.js b/config/development.js new file mode 100644 index 0000000000..8e8702ace5 --- /dev/null +++ b/config/development.js @@ -0,0 +1,73 @@ +const { merge } = require('webpack-merge'); +var base = require('./index.js') + +const apolloBatching = process.env.APOLLO_BATCH !== 'false'; +const memcachedServers = process.env.MEMCACHE_HOST || 'ui-memcached:11211'; + +module.exports = merge(base, { + app: { + apolloBatching, + host: 'www.development.kiva.org', + publicPath: 'https://www.development.kiva.org/', + photoPath: 'https://www-dev-kiva-org.freetls.fastly.net/img/', + graphqlUri: 'https://gateway.development.kiva.org/graphql', + enablePerimeterx: true, + perimeterxAppId: 'PX5u4Lz98O', + enableAnalytics: true, + enableGTM: true, + googleTagmanagerId: 'GTM-PXFRMT', + enableGA: true, + gaId: 'UA-11686022-3', + grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', + enableHotjar: true, + hotjarId: '3071239', + enableSnowplow: true, + snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', + enableFB: true, + fbApplicationId: '364044572460', + fbOgNameSpace: 'dev-kiva', + enableSentry: true, + sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', + algoliaConfig: { + group: 'dev', + appId: 'testingZ9YK0WNQ85', + apiKey: '28aaa1d56e6a1688f13f6b41da0f27a5', + defaultIndex: 'dev_fundraising_popularity', + }, + btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', + auth0: { + loginRedirectUrls: { + cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5: 'https://admin.development.kiva.org/admin/login?force=1', + e6wSaTBDpKRkV5SV5cWw6zD6eJjd2DEk: 'https://partners.development.kiva.org/pa2/login/login?authLevel=recent', + xOXldYg02WsLnlnn0D5xoPWI2i3aNsFD: 'https://www.development.kiva.org/authenticate?authLevel=recent', + KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH: 'https://www.development.kiva.org/ui-login?force=true', + ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF: 'https://www.development.kiva.org/ui-login?force=true', + }, + enable: true, + checkFakeAuth: true, + apiAudience: 'https://api.dev.kivaws.org/graphql', + mfaAudience: 'https://kiva-dev.auth0.com/mfa/', + browserClientID: 'ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF', + serverClientID: 'KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH', + browserCallbackUri: 'https://www.development.kiva.org/process-browser-auth', + serverCallbackUri: 'https://www.development.kiva.org/process-ssr-auth', + domain: 'login.dev.kiva.org', + }, + paypal : { + url: 'www.sandbox.paypal.com', + environment: 'sandbox' + }, + oneTrust: { + enable: true, + key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', + domainSuffix: '-test', + }, + }, + server: { + graphqlUri: 'https://gateway.development.kiva.org/graphql', + sessionUri: 'https://www.development.kiva.org/start-ui-session', + memcachedEnabled: true, + memcachedServers, + disableCluster: true + } +}) diff --git a/config/staging.js b/config/staging.js new file mode 100644 index 0000000000..d14a054ae3 --- /dev/null +++ b/config/staging.js @@ -0,0 +1,69 @@ +const { merge } = require('webpack-merge'); +var base = require('./index.js') + +module.exports = merge(base, { + app: { + host: 'www.staging.kiva.org', + publicPath: 'https://www.development.kiva.org/', + photoPath: 'https://www-stage-kiva-org.freetls.fastly.net/img/', + graphqlUri: 'https://gateway.staging.kiva.org/graphql', + enablePerimeterx: false, + perimeterxAppId: '####', + enableAnalytics: true, + enableGTM: true, + googleTagmanagerId: 'GTM-K6HR28', + enableGA: true, + gaId: 'UA-11686022-5', + grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', + enableSnowplow: true, + snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', + enableHotjar: false, + hotjarId: '3112979', + enableOptimizely: false, + enableFB: true, + fbApplicationId: '2260431077572912', + fbOgNameSpace: 'stage-kiva', + enableSentry: true, + sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', + algoliaConfig: { + group: 'stage', + appId: 'testingZ9YK0WNQ85', + apiKey: '28aaa1d56e6a1688f13f6b41da0f27a5', + defaultIndex: 'stage_fundraising_popularity', + }, + btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', + auth0: { + loginRedirectUrls: { + iHNp5rV3XxaozU7B50oXpNye6RCAE5OD: 'https://admin.staging.kiva.org/admin/login?force=1', + fNYmJqpKX6mWiz1Evk8b1eqbM9KoeQ45: 'https://partners.staging.kiva.org/pa2/login/login?authLevel=recent', + '5NP78k662QLODpkk4VzMyKxP0QWTcVmB': 'https://www.staging.kiva.org/authenticate?authLevel=recent', + Ch7rwGop9lctGpm5KfEl6VTVMrqKoWZ4: 'https://www.staging.kiva.org/ui-login?force=true', + pK7XVUBouUjPEFm9bz5MN7sjU5HACqqe: 'https://www.staging.kiva.org/ui-login?force=true', + }, + enable: true, + checkFakeAuth: true, + apiAudience: 'https://api.stage.kivaws.org/graphql', + mfaAudience: 'https://kiva-stage.auth0.com/mfa/', + browserClientID: 'pK7XVUBouUjPEFm9bz5MN7sjU5HACqqe', + serverClientID: 'Ch7rwGop9lctGpm5KfEl6VTVMrqKoWZ4', + browserCallbackUri: 'https://www.staging.kiva.org/process-browser-auth', + serverCallbackUri: 'https://www.staging.kiva.org/process-ssr-auth', + domain: 'login.stage.kiva.org', + }, + paypal : { + url: 'www.sandbox.paypal.com', + environment: 'sandbox' + }, + oneTrust: { + enable: true, + key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', + domainSuffix: '-test', + }, + }, + server: { + graphqlUri: 'https://gateway.staging.kiva.org/graphql', + sessionUri: 'https://www.staging.kiva.org/start-ui-session', + memcachedEnabled: true, + memcachedServers: 'stage-memcached-01:11211', + } +}) From 4e43da33c75281eb836b6720284d8b1c1424c71c Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Tue, 3 Oct 2023 16:29:08 -0700 Subject: [PATCH 02/11] feat: [CP-548] Generic config that can be overriden --- config/development.js | 73 ------------------------------------- config/eks.js | 85 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 73 deletions(-) delete mode 100644 config/development.js create mode 100644 config/eks.js diff --git a/config/development.js b/config/development.js deleted file mode 100644 index 8e8702ace5..0000000000 --- a/config/development.js +++ /dev/null @@ -1,73 +0,0 @@ -const { merge } = require('webpack-merge'); -var base = require('./index.js') - -const apolloBatching = process.env.APOLLO_BATCH !== 'false'; -const memcachedServers = process.env.MEMCACHE_HOST || 'ui-memcached:11211'; - -module.exports = merge(base, { - app: { - apolloBatching, - host: 'www.development.kiva.org', - publicPath: 'https://www.development.kiva.org/', - photoPath: 'https://www-dev-kiva-org.freetls.fastly.net/img/', - graphqlUri: 'https://gateway.development.kiva.org/graphql', - enablePerimeterx: true, - perimeterxAppId: 'PX5u4Lz98O', - enableAnalytics: true, - enableGTM: true, - googleTagmanagerId: 'GTM-PXFRMT', - enableGA: true, - gaId: 'UA-11686022-3', - grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', - enableHotjar: true, - hotjarId: '3071239', - enableSnowplow: true, - snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', - enableFB: true, - fbApplicationId: '364044572460', - fbOgNameSpace: 'dev-kiva', - enableSentry: true, - sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', - algoliaConfig: { - group: 'dev', - appId: 'testingZ9YK0WNQ85', - apiKey: '28aaa1d56e6a1688f13f6b41da0f27a5', - defaultIndex: 'dev_fundraising_popularity', - }, - btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', - auth0: { - loginRedirectUrls: { - cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5: 'https://admin.development.kiva.org/admin/login?force=1', - e6wSaTBDpKRkV5SV5cWw6zD6eJjd2DEk: 'https://partners.development.kiva.org/pa2/login/login?authLevel=recent', - xOXldYg02WsLnlnn0D5xoPWI2i3aNsFD: 'https://www.development.kiva.org/authenticate?authLevel=recent', - KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH: 'https://www.development.kiva.org/ui-login?force=true', - ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF: 'https://www.development.kiva.org/ui-login?force=true', - }, - enable: true, - checkFakeAuth: true, - apiAudience: 'https://api.dev.kivaws.org/graphql', - mfaAudience: 'https://kiva-dev.auth0.com/mfa/', - browserClientID: 'ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF', - serverClientID: 'KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH', - browserCallbackUri: 'https://www.development.kiva.org/process-browser-auth', - serverCallbackUri: 'https://www.development.kiva.org/process-ssr-auth', - domain: 'login.dev.kiva.org', - }, - paypal : { - url: 'www.sandbox.paypal.com', - environment: 'sandbox' - }, - oneTrust: { - enable: true, - key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', - domainSuffix: '-test', - }, - }, - server: { - graphqlUri: 'https://gateway.development.kiva.org/graphql', - sessionUri: 'https://www.development.kiva.org/start-ui-session', - memcachedEnabled: true, - memcachedServers, - disableCluster: true - } -}) diff --git a/config/eks.js b/config/eks.js new file mode 100644 index 0000000000..3d19f1d3c6 --- /dev/null +++ b/config/eks.js @@ -0,0 +1,85 @@ +const { merge } = require('webpack-merge'); +var base = require('./index.js') + +const apolloBatching = process.env.APOLLO_BATCH !== 'false'; +const memcachedServers = process.env.MEMCACHE_HOST || 'ui-memcached:11211'; +const baseUrl = process.env.BASE_URL || 'development.kiva.org'; +const env = process.env.SHORT_ENV || 'dev'; +let enableOptimizely = true; +if (process.env.ENABLE_OPTIMIZELY !== undefined) { + enableOptimizely = process.env.ENABLE_OPTIMIZELY === "true" || process.env.ENABLE_OPTIMIZELY === true; +} +let enablePerimeterx = true; +if (process.env.ENABLE_PERIMETERX !== undefined) { + enableOptimizely = process.env.ENABLE_PERIMETERX === "true" || process.env.ENABLE_PERIMETERX === true; +} + + +module.exports = merge(base, { + app: { + apolloBatching, + host: `www.${baseUrl}`, + publicPath: `https://www.${baseUrl}/`, + photoPath: process.env.PHOTO_PATH || 'https://www-dev-kiva-org.freetls.fastly.net/img/', + graphqlUri: `https://gateway.${baseUrl}/graphql`, + enablePerimeterx, + perimeterxAppId: process.env.PERIMETERX_APP_ID || 'PX5u4Lz98O', + enableAnalytics: true, + enableGTM: true, + googleTagmanagerId: process.env.GOOGLE_TAG_MANAGER_ID || 'GTM-PXFRMT', + enableGA: true, + gaId: process.env.GOOGLE_ANALYTICS_ID || 'UA-11686022-3', + grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', + enableHotjar: true, + hotjarId: process.env.HOTJAR_ID || '3071239', + enableSnowplow: true, + snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', + enableFB: true, + enableOptimizely, + fbApplicationId: process.env.FACEBOOK_APP_ID || '364044572460', + fbOgNameSpace: `${env}-kiva`, + enableSentry: true, + sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', + algoliaConfig: { + group: `${env}`, + appId: 'testingZ9YK0WNQ85', + apiKey: '28aaa1d56e6a1688f13f6b41da0f27a5', + defaultIndex: `${env}_fundraising_popularity`, + }, + btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', + auth0: { + loginRedirectUrls: { + cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5: `https://admin.${baseUrl}/admin/login?force=1`, + e6wSaTBDpKRkV5SV5cWw6zD6eJjd2DEk: `https://partners.${baseUrl}/pa2/login/login?authLevel=recent`, + xOXldYg02WsLnlnn0D5xoPWI2i3aNsFD: `https://www.${baseUrl}/authenticate?authLevel=recent`, + KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH: `https://www.$baseUrl}/ui-login?force=true`, + ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF: `https://www.${baseUrl}/ui-login?force=true`, + }, + enable: true, + checkFakeAuth: true, + apiAudience: `https://api.${env}.kivaws.org/graphql`, + mfaAudience: `https://kiva-${env}.auth0.com/mfa/`, + browserClientID: process.env.BROWSER_CLIENT_ID || 'ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF', + serverClientID: process.env.SERVER_CLIENT_ID || 'KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH', + browserCallbackUri: `https://www.${baseUrl}/process-browser-auth`, + serverCallbackUri: `https://www.${baseUrl}/process-ssr-auth`, + domain: `login.${env}.kiva.org`, + }, + paypal : { + url: 'www.sandbox.paypal.com', + environment: 'sandbox' + }, + oneTrust: { + enable: true, + key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', + domainSuffix: '-test', + }, + }, + server: { + graphqlUri: `https://gateway.${baseUrl}/graphql`, + sessionUri: `https://www.${baseUrl}/start-ui-session`, + memcachedEnabled: true, + memcachedServers, + disableCluster: true + } +}) From 3319d5da80e3846def18ad813ba3e4cdabc10c4c Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Tue, 3 Oct 2023 16:31:52 -0700 Subject: [PATCH 03/11] feat: [CP-548] Simplify boolean vars --- config/eks.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/config/eks.js b/config/eks.js index 3d19f1d3c6..4591abf28f 100644 --- a/config/eks.js +++ b/config/eks.js @@ -5,15 +5,8 @@ const apolloBatching = process.env.APOLLO_BATCH !== 'false'; const memcachedServers = process.env.MEMCACHE_HOST || 'ui-memcached:11211'; const baseUrl = process.env.BASE_URL || 'development.kiva.org'; const env = process.env.SHORT_ENV || 'dev'; -let enableOptimizely = true; -if (process.env.ENABLE_OPTIMIZELY !== undefined) { - enableOptimizely = process.env.ENABLE_OPTIMIZELY === "true" || process.env.ENABLE_OPTIMIZELY === true; -} -let enablePerimeterx = true; -if (process.env.ENABLE_PERIMETERX !== undefined) { - enableOptimizely = process.env.ENABLE_PERIMETERX === "true" || process.env.ENABLE_PERIMETERX === true; -} - +const enableOptimizely = process.env.ENABLE_OPTIMIZELY !== 'false'; +const enablePerimeterx = process.env.ENABLE_PERIMETERX !== 'false'; module.exports = merge(base, { app: { From f9a6f025048818de6de99ad4ed904aecf751e2c1 Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 07:34:15 -0700 Subject: [PATCH 04/11] feat: [CP-548] Missing bracket --- config/eks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/eks.js b/config/eks.js index 4591abf28f..0f4c2e1960 100644 --- a/config/eks.js +++ b/config/eks.js @@ -45,7 +45,7 @@ module.exports = merge(base, { cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5: `https://admin.${baseUrl}/admin/login?force=1`, e6wSaTBDpKRkV5SV5cWw6zD6eJjd2DEk: `https://partners.${baseUrl}/pa2/login/login?authLevel=recent`, xOXldYg02WsLnlnn0D5xoPWI2i3aNsFD: `https://www.${baseUrl}/authenticate?authLevel=recent`, - KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH: `https://www.$baseUrl}/ui-login?force=true`, + KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH: `https://www.${baseUrl}/ui-login?force=true`, ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF: `https://www.${baseUrl}/ui-login?force=true`, }, enable: true, From 7a961f579a3a50df600806db2acc8fe719201452 Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 08:15:21 -0700 Subject: [PATCH 05/11] feat: [CP-548 ] Removing unnecessary staging file --- config/staging.js | 69 ----------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 config/staging.js diff --git a/config/staging.js b/config/staging.js deleted file mode 100644 index d14a054ae3..0000000000 --- a/config/staging.js +++ /dev/null @@ -1,69 +0,0 @@ -const { merge } = require('webpack-merge'); -var base = require('./index.js') - -module.exports = merge(base, { - app: { - host: 'www.staging.kiva.org', - publicPath: 'https://www.development.kiva.org/', - photoPath: 'https://www-stage-kiva-org.freetls.fastly.net/img/', - graphqlUri: 'https://gateway.staging.kiva.org/graphql', - enablePerimeterx: false, - perimeterxAppId: '####', - enableAnalytics: true, - enableGTM: true, - googleTagmanagerId: 'GTM-K6HR28', - enableGA: true, - gaId: 'UA-11686022-5', - grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', - enableSnowplow: true, - snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', - enableHotjar: false, - hotjarId: '3112979', - enableOptimizely: false, - enableFB: true, - fbApplicationId: '2260431077572912', - fbOgNameSpace: 'stage-kiva', - enableSentry: true, - sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', - algoliaConfig: { - group: 'stage', - appId: 'testingZ9YK0WNQ85', - apiKey: '28aaa1d56e6a1688f13f6b41da0f27a5', - defaultIndex: 'stage_fundraising_popularity', - }, - btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', - auth0: { - loginRedirectUrls: { - iHNp5rV3XxaozU7B50oXpNye6RCAE5OD: 'https://admin.staging.kiva.org/admin/login?force=1', - fNYmJqpKX6mWiz1Evk8b1eqbM9KoeQ45: 'https://partners.staging.kiva.org/pa2/login/login?authLevel=recent', - '5NP78k662QLODpkk4VzMyKxP0QWTcVmB': 'https://www.staging.kiva.org/authenticate?authLevel=recent', - Ch7rwGop9lctGpm5KfEl6VTVMrqKoWZ4: 'https://www.staging.kiva.org/ui-login?force=true', - pK7XVUBouUjPEFm9bz5MN7sjU5HACqqe: 'https://www.staging.kiva.org/ui-login?force=true', - }, - enable: true, - checkFakeAuth: true, - apiAudience: 'https://api.stage.kivaws.org/graphql', - mfaAudience: 'https://kiva-stage.auth0.com/mfa/', - browserClientID: 'pK7XVUBouUjPEFm9bz5MN7sjU5HACqqe', - serverClientID: 'Ch7rwGop9lctGpm5KfEl6VTVMrqKoWZ4', - browserCallbackUri: 'https://www.staging.kiva.org/process-browser-auth', - serverCallbackUri: 'https://www.staging.kiva.org/process-ssr-auth', - domain: 'login.stage.kiva.org', - }, - paypal : { - url: 'www.sandbox.paypal.com', - environment: 'sandbox' - }, - oneTrust: { - enable: true, - key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', - domainSuffix: '-test', - }, - }, - server: { - graphqlUri: 'https://gateway.staging.kiva.org/graphql', - sessionUri: 'https://www.staging.kiva.org/start-ui-session', - memcachedEnabled: true, - memcachedServers: 'stage-memcached-01:11211', - } -}) From b42beceaa54a4ed6e533d67c936d6050eae4e81b Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 09:23:24 -0700 Subject: [PATCH 06/11] feat: [CP-548] Rename new config file --- config/{eks.js => dynamic.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/{eks.js => dynamic.js} (100%) diff --git a/config/eks.js b/config/dynamic.js similarity index 100% rename from config/eks.js rename to config/dynamic.js From a19ca4007de5d827e9d126e11268b4886595fe93 Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 09:59:03 -0700 Subject: [PATCH 07/11] feat: [CP-548] Make auth0 app IDs configurable --- config/dynamic.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/config/dynamic.js b/config/dynamic.js index 0f4c2e1960..f039f4df21 100644 --- a/config/dynamic.js +++ b/config/dynamic.js @@ -8,6 +8,13 @@ const env = process.env.SHORT_ENV || 'dev'; const enableOptimizely = process.env.ENABLE_OPTIMIZELY !== 'false'; const enablePerimeterx = process.env.ENABLE_PERIMETERX !== 'false'; +// Auth0 app IDs +const adminAuthId = process.env.ADMIN_AUTH_ID || 'cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5'; +const partnerAuthId = process.env.PARTNER_AUTH_ID || 'e6wSaTBDpKRkV5SV5cWw6zD6eJjd2DEk'; +const wwwAuthId = process.env.WWW_AUTH_ID || 'xOXldYg02WsLnlnn0D5xoPWI2i3aNsFD'; +const browserClientID = process.env.BROWSER_CLIENT_ID || 'ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF'; +const serverClientID = process.env.SERVER_CLIENT_ID || 'KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH'; + module.exports = merge(base, { app: { apolloBatching, @@ -42,18 +49,18 @@ module.exports = merge(base, { btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', auth0: { loginRedirectUrls: { - cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5: `https://admin.${baseUrl}/admin/login?force=1`, - e6wSaTBDpKRkV5SV5cWw6zD6eJjd2DEk: `https://partners.${baseUrl}/pa2/login/login?authLevel=recent`, - xOXldYg02WsLnlnn0D5xoPWI2i3aNsFD: `https://www.${baseUrl}/authenticate?authLevel=recent`, - KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH: `https://www.${baseUrl}/ui-login?force=true`, - ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF: `https://www.${baseUrl}/ui-login?force=true`, + [adminAuthId]: `https://admin.${baseUrl}/admin/login?force=1`, + [partnerAuthId]: `https://partners.${baseUrl}/pa2/login/login?authLevel=recent`, + [wwwAuthId]: `https://www.${baseUrl}/authenticate?authLevel=recent`, + [serverClientID]: `https://www.${baseUrl}/ui-login?force=true`, + [browserClientID]: `https://www.${baseUrl}/ui-login?force=true`, }, enable: true, checkFakeAuth: true, apiAudience: `https://api.${env}.kivaws.org/graphql`, mfaAudience: `https://kiva-${env}.auth0.com/mfa/`, - browserClientID: process.env.BROWSER_CLIENT_ID || 'ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF', - serverClientID: process.env.SERVER_CLIENT_ID || 'KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH', + browserClientID, + serverClientID, browserCallbackUri: `https://www.${baseUrl}/process-browser-auth`, serverCallbackUri: `https://www.${baseUrl}/process-ssr-auth`, domain: `login.${env}.kiva.org`, From d22726d31a77bb6d4c22511239e7e0eab5ada724 Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 10:03:37 -0700 Subject: [PATCH 08/11] feat: [CP-548] Make config support configuration for prod --- config/dynamic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/dynamic.js b/config/dynamic.js index f039f4df21..f64761d1b7 100644 --- a/config/dynamic.js +++ b/config/dynamic.js @@ -72,7 +72,7 @@ module.exports = merge(base, { oneTrust: { enable: true, key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', - domainSuffix: '-test', + domainSuffix: process.env.ONE_TRUST_DOMAIN_SUFFIX || '-test', }, }, server: { From 04f642946237ad6478738e64185bdf098d4e7d1a Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 10:40:32 -0700 Subject: [PATCH 09/11] feat: [CP_548] Alphabetize --- config/dynamic.js | 60 +++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/config/dynamic.js b/config/dynamic.js index f64761d1b7..8b4526770a 100644 --- a/config/dynamic.js +++ b/config/dynamic.js @@ -17,36 +17,13 @@ const serverClientID = process.env.SERVER_CLIENT_ID || 'KIzjUBQjKZwMRgYSn6NvMxsU module.exports = merge(base, { app: { - apolloBatching, - host: `www.${baseUrl}`, - publicPath: `https://www.${baseUrl}/`, - photoPath: process.env.PHOTO_PATH || 'https://www-dev-kiva-org.freetls.fastly.net/img/', - graphqlUri: `https://gateway.${baseUrl}/graphql`, - enablePerimeterx, - perimeterxAppId: process.env.PERIMETERX_APP_ID || 'PX5u4Lz98O', - enableAnalytics: true, - enableGTM: true, - googleTagmanagerId: process.env.GOOGLE_TAG_MANAGER_ID || 'GTM-PXFRMT', - enableGA: true, - gaId: process.env.GOOGLE_ANALYTICS_ID || 'UA-11686022-3', - grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', - enableHotjar: true, - hotjarId: process.env.HOTJAR_ID || '3071239', - enableSnowplow: true, - snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', - enableFB: true, - enableOptimizely, - fbApplicationId: process.env.FACEBOOK_APP_ID || '364044572460', - fbOgNameSpace: `${env}-kiva`, - enableSentry: true, - sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', algoliaConfig: { group: `${env}`, appId: 'testingZ9YK0WNQ85', apiKey: '28aaa1d56e6a1688f13f6b41da0f27a5', defaultIndex: `${env}_fundraising_popularity`, }, - btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', + apolloBatching, auth0: { loginRedirectUrls: { [adminAuthId]: `https://admin.${baseUrl}/admin/login?force=1`, @@ -65,21 +42,44 @@ module.exports = merge(base, { serverCallbackUri: `https://www.${baseUrl}/process-ssr-auth`, domain: `login.${env}.kiva.org`, }, - paypal : { - url: 'www.sandbox.paypal.com', - environment: 'sandbox' - }, + btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', + enableAnalytics: true, + enableFB: true, + enableGA: true, + enableGTM: true, + enableHotjar: true, + enableOptimizely, + enablePerimeterx, + enableSentry: true, + enableSnowplow: true, + fbApplicationId: process.env.FACEBOOK_APP_ID || '364044572460', + fbOgNameSpace: `${env}-kiva`, + gaId: process.env.GOOGLE_ANALYTICS_ID || 'UA-11686022-3', + googleTagmanagerId: process.env.GOOGLE_TAG_MANAGER_ID || 'GTM-PXFRMT', + graphqlUri: `https://gateway.${baseUrl}/graphql`, + grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', + host: `www.${baseUrl}`, + hotjarId: process.env.HOTJAR_ID || '3071239', oneTrust: { enable: true, key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', domainSuffix: process.env.ONE_TRUST_DOMAIN_SUFFIX || '-test', }, + paypal : { + url: 'www.sandbox.paypal.com', + environment: 'sandbox' + }, + perimeterxAppId: process.env.PERIMETERX_APP_ID || 'PX5u4Lz98O', + photoPath: process.env.PHOTO_PATH || 'https://www-dev-kiva-org.freetls.fastly.net/img/', + publicPath: `https://www.${baseUrl}/`, + sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', + snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', }, server: { + disableCluster: true, graphqlUri: `https://gateway.${baseUrl}/graphql`, - sessionUri: `https://www.${baseUrl}/start-ui-session`, memcachedEnabled: true, memcachedServers, - disableCluster: true + sessionUri: `https://www.${baseUrl}/start-ui-session`, } }) From 342c9142cabf8bd0633a246405c5d2084e4fb051 Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 10:58:16 -0700 Subject: [PATCH 10/11] feat: [CP-548] Set up dynamic config to work for prod --- config/dynamic.js | 55 +++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/config/dynamic.js b/config/dynamic.js index 8b4526770a..54a3bdd895 100644 --- a/config/dynamic.js +++ b/config/dynamic.js @@ -1,12 +1,13 @@ -const { merge } = require('webpack-merge'); -var base = require('./index.js') +const path = require("path"); const apolloBatching = process.env.APOLLO_BATCH !== 'false'; const memcachedServers = process.env.MEMCACHE_HOST || 'ui-memcached:11211'; const baseUrl = process.env.BASE_URL || 'development.kiva.org'; const env = process.env.SHORT_ENV || 'dev'; +const formattedUrlEnv = env === 'prod' ? '' : `${env}.`; const enableOptimizely = process.env.ENABLE_OPTIMIZELY !== 'false'; const enablePerimeterx = process.env.ENABLE_PERIMETERX !== 'false'; +const disableCluster = process.env.SERVER_DISABLE_CLUSTER === 'true'; // Auth0 app IDs const adminAuthId = process.env.ADMIN_AUTH_ID || 'cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5'; @@ -15,12 +16,14 @@ const wwwAuthId = process.env.WWW_AUTH_ID || 'xOXldYg02WsLnlnn0D5xoPWI2i3aNsFD'; const browserClientID = process.env.BROWSER_CLIENT_ID || 'ouGKxT4mE4wQEKqpfsHSE96c9rHXQqZF'; const serverClientID = process.env.SERVER_CLIENT_ID || 'KIzjUBQjKZwMRgYSn6NvMxsUwNppwnLH'; -module.exports = merge(base, { +const checkFakeAuth = process.env.CHECK_FAKE_AUTH === 'true'; + +module.exports = { app: { algoliaConfig: { group: `${env}`, - appId: 'testingZ9YK0WNQ85', - apiKey: '28aaa1d56e6a1688f13f6b41da0f27a5', + appId: process.env.ALGOLIA_APP_ID || 'testingZ9YK0WNQ85', + apiKey: process.env.ALGOLIA_API_KEY || '28aaa1d56e6a1688f13f6b41da0f27a5', defaultIndex: `${env}_fundraising_popularity`, }, apolloBatching, @@ -33,16 +36,17 @@ module.exports = merge(base, { [browserClientID]: `https://www.${baseUrl}/ui-login?force=true`, }, enable: true, - checkFakeAuth: true, - apiAudience: `https://api.${env}.kivaws.org/graphql`, + checkFakeAuth, + apiAudience: `https://api.${formattedUrlEnv}kivaws.org/graphql`, mfaAudience: `https://kiva-${env}.auth0.com/mfa/`, browserClientID, serverClientID, browserCallbackUri: `https://www.${baseUrl}/process-browser-auth`, serverCallbackUri: `https://www.${baseUrl}/process-ssr-auth`, - domain: `login.${env}.kiva.org`, + domain: `login.${formattedUrlEnv}kiva.org`, + scope: 'openid mfa', }, - btTokenKey: 'sandbox_q7kbtvzy_vynd473f79sfskz3', + btTokenKey: process.env.BT_TOKEN_KEY || 'sandbox_q7kbtvzy_vynd473f79sfskz3', enableAnalytics: true, enableFB: true, enableGA: true, @@ -53,33 +57,48 @@ module.exports = merge(base, { enableSentry: true, enableSnowplow: true, fbApplicationId: process.env.FACEBOOK_APP_ID || '364044572460', - fbOgNameSpace: `${env}-kiva`, + fbOgNameSpace: process.env.FB_OG_NAMESPACE || `${env}-kiva`, gaId: process.env.GOOGLE_ANALYTICS_ID || 'UA-11686022-3', + googlePay: { + merchantId: '10620948091453922228' + }, googleTagmanagerId: process.env.GOOGLE_TAG_MANAGER_ID || 'GTM-PXFRMT', graphqlUri: `https://gateway.${baseUrl}/graphql`, - grecaptchaSitekey: '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', + grecaptchaSitekey: process.env.G_RECAPTCHA_SITE_KEY || '6LcXENcmAAAAAEC4ygspn1WTm4zP4gLexXDnWuXE', host: `www.${baseUrl}`, hotjarId: process.env.HOTJAR_ID || '3071239', + locale: { + default: 'en', + supported: ['en', 'es', 'fr'], + }, oneTrust: { enable: true, key: 'db9dcf94-1c32-40fb-9a57-cefafea1088d', domainSuffix: process.env.ONE_TRUST_DOMAIN_SUFFIX || '-test', }, + optimizelyProjectId: '21625780072', paypal : { - url: 'www.sandbox.paypal.com', - environment: 'sandbox' + url: process.env.PAYPAL_URL || 'www.sandbox.paypal.com', + environment: process.env.PAYPAL_ENVIRONMENT || 'sandbox' }, perimeterxAppId: process.env.PERIMETERX_APP_ID || 'PX5u4Lz98O', photoPath: process.env.PHOTO_PATH || 'https://www-dev-kiva-org.freetls.fastly.net/img/', - publicPath: `https://www.${baseUrl}/`, - sentryURI: 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', - snowplowUri: 'events.fivetran.com/snowplow/v5qt54ocr2nm', + publicPath: process.env.PUBLIC_PATH || `https://www.${baseUrl}/`, + sentryURI: process.env.SENTRY_URI || 'https://7ce141b23c4a4e6091c206d08442f0e9@o7540.ingest.sentry.io/1201287', + snowplowUri: process.env.SNOWPLOW_URI || 'events.fivetran.com/snowplow/v5qt54ocr2nm', + transport: 'https', + }, + build: { + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', }, server: { - disableCluster: true, + disableCluster, graphqlUri: `https://gateway.${baseUrl}/graphql`, + gzipEnabled: false, memcachedEnabled: true, memcachedServers, + port: 8888, sessionUri: `https://www.${baseUrl}/start-ui-session`, } -}) +} From de2789e124c82142909afa02aeb26b0df360458b Mon Sep 17 00:00:00 2001 From: kathrynlovett Date: Wed, 4 Oct 2023 11:45:36 -0700 Subject: [PATCH 11/11] feat: [CP-548] Set disableCluster to true --- config/dynamic.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/dynamic.js b/config/dynamic.js index 54a3bdd895..289208a35f 100644 --- a/config/dynamic.js +++ b/config/dynamic.js @@ -7,7 +7,6 @@ const env = process.env.SHORT_ENV || 'dev'; const formattedUrlEnv = env === 'prod' ? '' : `${env}.`; const enableOptimizely = process.env.ENABLE_OPTIMIZELY !== 'false'; const enablePerimeterx = process.env.ENABLE_PERIMETERX !== 'false'; -const disableCluster = process.env.SERVER_DISABLE_CLUSTER === 'true'; // Auth0 app IDs const adminAuthId = process.env.ADMIN_AUTH_ID || 'cNTV7eN5sBKgv9nQOxDpAz1pPfJGlBI5'; @@ -93,7 +92,7 @@ module.exports = { assetsSubDirectory: 'static', }, server: { - disableCluster, + disableCluster: true, graphqlUri: `https://gateway.${baseUrl}/graphql`, gzipEnabled: false, memcachedEnabled: true,