From d7fb1e2077e98e2493f502a3c92e56b2ac3f4d23 Mon Sep 17 00:00:00 2001 From: Kalista Payne Date: Wed, 8 Jan 2025 17:05:54 -0600 Subject: [PATCH] WIP(privacy): remove Loggly echo of Amplitude data --- config.json.example | 49 ++++++++++++------------- website/server/libs/analyticsService.js | 14 +------ website/server/libs/cron.js | 13 ------- 3 files changed, 25 insertions(+), 51 deletions(-) diff --git a/config.json.example b/config.json.example index 9a50e86a222..1053f05bacb 100644 --- a/config.json.example +++ b/config.json.example @@ -8,18 +8,26 @@ "AMAZON_PAYMENTS_SELLER_ID": "SELLER_ID", "AMPLITUDE_KEY": "AMPLITUDE_KEY", "AMPLITUDE_SECRET": "AMPLITUDE_SECRET", + "APPLE_AUTH_CLIENT_ID": "", + "APPLE_AUTH_KEY_ID": "", + "APPLE_AUTH_PRIVATE_KEY": "", + "APPLE_TEAM_ID": "", "BASE_URL": "http://localhost:3000", + "BLOCKED_IPS": "", + "CONTENT_SWITCHOVER_TIME_OFFSET": 8, "CRON_SAFE_MODE": "false", "CRON_SEMI_SAFE_MODE": "false", + "DEBUG_ENABLED": "false", "DISABLE_REQUEST_LOGGING": "true", - "EMAILS_COMMUNITY_MANAGER_EMAIL": "admin@habitica.com", - "EMAILS_PRESS_ENQUIRY_EMAIL": "admin@habitica.com", - "EMAILS_TECH_ASSISTANCE_EMAIL": "admin@habitica.com", "EMAIL_SERVER_AUTH_PASSWORD": "password", "EMAIL_SERVER_AUTH_USER": "user", "EMAIL_SERVER_URL": "http://example.com", + "EMAILS_COMMUNITY_MANAGER_EMAIL": "admin@habitica.com", + "EMAILS_PRESS_ENQUIRY_EMAIL": "admin@habitica.com", + "EMAILS_TECH_ASSISTANCE_EMAIL": "admin@habitica.com", "ENABLE_CONSOLE_LOGS_IN_PROD": "false", "ENABLE_CONSOLE_LOGS_IN_TEST": "false", + "ENABLE_STACKDRIVER_TRACING": "false", "FACEBOOK_KEY": "123456789012345", "FACEBOOK_SECRET": "aaaabbbbccccddddeeeeffff00001111", "FLAG_REPORT_EMAIL": "email@example.com, email2@example.com", @@ -29,15 +37,15 @@ "IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/", "IGNORE_REDIRECT": "true", "ITUNES_SHARED_SECRET": "aaaabbbbccccddddeeeeffff00001111", + "LIVELINESS_PROBE_KEY": "", + "LOG_REQUESTS_EXCESSIVE_MODE": "false", "LOGGLY_CLIENT_TOKEN": "token", "LOGGLY_SUBDOMAIN": "example-subdomain", "LOGGLY_TOKEN": "example-token", - "LOG_REQUESTS_EXCESSIVE_MODE": "false", "MAINTENANCE_MODE": "false", - "NODE_DB_URI": "mongodb://localhost:27017/habitica-dev?replicaSet=rs", - "TEST_DB_URI": "mongodb://localhost:27017/habitica-test?replicaSet=rs", "MONGODB_POOL_SIZE": "10", "MONGODB_SOCKET_TIMEOUT": "20000", + "NODE_DB_URI": "mongodb://localhost:27017/habitica-dev?replicaSet=rs", "NODE_ENV": "development", "PATH": "bin:node_modules/.bin:/usr/local/bin:/usr/bin:/bin", "PAYPAL_BILLING_PLANS_basic_12mo": "basic_12mo", @@ -55,19 +63,24 @@ "PLAY_API_REFRESH_TOKEN": "aaaabbbbccccddddeeeeffff00001111", "PORT": 3000, "PUSH_CONFIGS_APN_ENABLED": "false", - "PUSH_CONFIGS_APN_KEY": "xxxxxxxxxx", "PUSH_CONFIGS_APN_KEY_ID": "xxxxxxxxxx", + "PUSH_CONFIGS_APN_KEY": "xxxxxxxxxx", "PUSH_CONFIGS_APN_TEAM_ID": "aaabbbcccd", "PUSH_CONFIGS_FCM_SERVER_API_KEY": "aaabbbcccd", + "RATE_LIMITER_ENABLED": "false", + "REDIS_HOST": "aaabbbcccdddeeefff", + "REDIS_PASSWORD": "12345678", + "REDIS_PORT": "1234", "S3_ACCESS_KEY_ID": "accessKeyId", "S3_BUCKET": "bucket", "S3_SECRET_ACCESS_KEY": "secretAccessKey", - "SESSION_SECRET": "YOUR SECRET HERE", "SESSION_SECRET_IV": "12345678912345678912345678912345", "SESSION_SECRET_KEY": "1234567891234567891234567891234567891234567891234567891234567891", + "SESSION_SECRET": "YOUR SECRET HERE", "SITE_HTTP_AUTH_ENABLED": "false", "SITE_HTTP_AUTH_PASSWORDS": "password,wordpass,passkey", "SITE_HTTP_AUTH_USERNAMES": "admin,tester,contributor", + "SKIP_SSL_CHECK_KEY": "key", "SLACK_FLAGGING_FOOTER_LINK": "https://habitrpg.github.io/flag-o-rama/", "SLACK_FLAGGING_URL": "https://hooks.slack.com/services/id/id/id", "SLACK_SUBSCRIPTIONS_URL": "https://hooks.slack.com/services/id/id/id", @@ -75,23 +88,9 @@ "STRIPE_API_KEY": "aaaabbbbccccddddeeeeffff00001111", "STRIPE_PUB_KEY": "22223333444455556666777788889999", "STRIPE_WEBHOOKS_ENDPOINT_SECRET": "111111", + "TEST_DB_URI": "mongodb://localhost:27017/habitica-test?replicaSet=rs", + "TIME_TRAVEL_ENABLED": "false", "TRANSIFEX_SLACK_CHANNEL": "transifex", - "WEB_CONCURRENCY": 1, - "SKIP_SSL_CHECK_KEY": "key", - "ENABLE_STACKDRIVER_TRACING": "false", - "APPLE_AUTH_PRIVATE_KEY": "", - "APPLE_TEAM_ID": "", - "APPLE_AUTH_CLIENT_ID": "", - "APPLE_AUTH_KEY_ID": "", - "BLOCKED_IPS": "", - "LOG_AMPLITUDE_EVENTS": "false", - "RATE_LIMITER_ENABLED": "false", - "LIVELINESS_PROBE_KEY": "", - "REDIS_HOST": "aaabbbcccdddeeefff", - "REDIS_PORT": "1234", - "REDIS_PASSWORD": "12345678", "TRUSTED_DOMAINS": "localhost,https://habitica.com", - "TIME_TRAVEL_ENABLED": "false", - "DEBUG_ENABLED": "false", - "CONTENT_SWITCHOVER_TIME_OFFSET": 8 + "WEB_CONCURRENCY": 1 } diff --git a/website/server/libs/analyticsService.js b/website/server/libs/analyticsService.js index b78e4dd2596..a71500ae03c 100644 --- a/website/server/libs/analyticsService.js +++ b/website/server/libs/analyticsService.js @@ -14,8 +14,6 @@ import logger from './logger'; const AMPLITUDE_TOKEN = nconf.get('AMPLITUDE_KEY'); const GA_TOKEN = nconf.get('GA_ID'); -const LOG_AMPLITUDE_EVENTS = nconf.get('LOG_AMPLITUDE_EVENTS') === 'true'; - const GA_POSSIBLE_LABELS = ['gaLabel', 'itemKey']; const GA_POSSIBLE_VALUES = ['gaValue', 'gemCost', 'goldCost']; const AMPLITUDE_PROPERTIES_TO_SCRUB = [ @@ -176,17 +174,11 @@ function _formatDataForAmplitude (data) { return ampData; } -function _sendDataToAmplitude (eventType, data, loggerOnly) { +function _sendDataToAmplitude (eventType, data) { const amplitudeData = _formatDataForAmplitude(data); amplitudeData.event_type = eventType; - if (LOG_AMPLITUDE_EVENTS) { - logger.info('Amplitude Event', amplitudeData); - } - - if (loggerOnly) return Promise.resolve(null); - return amplitude .track(amplitudeData) .catch(err => logger.error(err, 'Error while sending data to Amplitude.')); @@ -262,10 +254,6 @@ function _sendPurchaseDataToAmplitude (data) { amplitudeData.revenue = data.purchaseValue; amplitudeData.productId = data.itemPurchased; - if (LOG_AMPLITUDE_EVENTS) { - logger.info('Amplitude Purchase Event', amplitudeData); - } - return amplitude .track(amplitudeData) .catch(err => logger.error(err, 'Error while sending data to Amplitude.')); diff --git a/website/server/libs/cron.js b/website/server/libs/cron.js index 1af449af4b8..f2fda2f7e28 100644 --- a/website/server/libs/cron.js +++ b/website/server/libs/cron.js @@ -143,19 +143,6 @@ function trackCronAnalytics (analytics, user, _progress, options) { headers: options.headers, loginIncentives: user.loginIncentives, }); - - if ( - user.party && user.party.quest && !user.party.quest.RSVPNeeded - && !user.party.quest.completed && user.party.quest.key && !user.preferences.sleep - ) { - analytics.track('quest participation', { - category: 'behavior', - uuid: user._id, - user, - questName: user.party.quest.key, - headers: options.headers, - }, true); - } } function awardLoginIncentives (user) {