From c2fd090d7df471ea86b0dbc74f78607d165fdb87 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 24 Nov 2023 11:31:11 +1100 Subject: [PATCH] DEV: revert missing license for maxmind changes (#24538) Reverts - DEV: maxmind license checking failing tests #24534 - UX: Show if MaxMind key is missing on IP lookup #18993 These changes are leading to surprising results, our logs are now filling up with warnings on dev environments We need the change to be redone --- .../javascripts/admin/addon/components/ip-lookup.hbs | 10 +--------- config/locales/client.en.yml | 1 - lib/discourse_ip_info.rb | 2 -- spec/serializers/user_auth_token_serializer_spec.rb | 1 - 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/assets/javascripts/admin/addon/components/ip-lookup.hbs b/app/assets/javascripts/admin/addon/components/ip-lookup.hbs index 43c476e1049..1097e54a84a 100644 --- a/app/assets/javascripts/admin/addon/components/ip-lookup.hbs +++ b/app/assets/javascripts/admin/addon/components/ip-lookup.hbs @@ -31,15 +31,7 @@
{{i18n "ip_lookup.location"}}
- {{#if this.location.no_license}} - - {{i18n "ip_lookup.no_license"}} - - {{else if this.location.location}} + {{#if this.location.location}} MaxMindDB" copied: "copied" - no_license: "You must configure MaxMind to enable GeoIP information. This is configured using DISCOURSE_MAXMIND_LICENSE_KEY in your container config. If you are on a hosted Discourse service, contact your service provider." user_fields: none: "(select an option)" diff --git a/lib/discourse_ip_info.rb b/lib/discourse_ip_info.rb index 2fe0bfc7110..2949f5858cb 100644 --- a/lib/discourse_ip_info.rb +++ b/lib/discourse_ip_info.rb @@ -105,8 +105,6 @@ class DiscourseIpInfo message: "IP #{ip} could not be looked up in MaxMind GeoLite2-City database.", ) end - else - ret[:no_license] = true end if @asn_mmdb diff --git a/spec/serializers/user_auth_token_serializer_spec.rb b/spec/serializers/user_auth_token_serializer_spec.rb index b6ea5a887d9..f90bf21eb0b 100644 --- a/spec/serializers/user_auth_token_serializer_spec.rb +++ b/spec/serializers/user_auth_token_serializer_spec.rb @@ -3,7 +3,6 @@ RSpec.describe UserAuthTokenSerializer do fab!(:user) { Fabricate(:moderator) } let(:token) { UserAuthToken.generate!(user_id: user.id, client_ip: "2a02:ea00::", staff: true) } - # Assign a dummy MaxMind license key, which is now checked in open_db before(:each) { DiscourseIpInfo.open_db(File.join(Rails.root, "spec", "fixtures", "mmdb")) }