MAXMIND를 역 IP 조회용으로 설정하기

What is MAXMIND and why would I want it?

Discourse uses MAXMIND to provide geographical information for reverse IP lookups.

Without Maxmind’s database you’ll see something like this:

Or perhaps you’ve noticed this message fly by when you rebuild your container:

MaxMind IP database download requires an account ID and a license key
Please set DISCOURSE_MAXMIND_ACCOUNT_ID and DISCOURSE_MAXMIND_LICENSE_KEY. See https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941 for more details.

Why would I care?

It’s often useful for moderators to see where someone is logging in from to determine if the person is who (and where) they say they are or to diagnose problems with your site. (“Oh, we frequently see problems with Special-ISP”.)

Also, as of 2.2.0.beta4, Discourse also uses this information to notify admins if a login is seen from a new location. Without the Maxmind database, Discourse cannot provide this notification.

What if I don’t setup a MaxMind account and generate a license key

You won’t be able to do reverse lookups. If the issues above do not concern you, then it is a good bet that nothing bad will happen if you just ignore this.

How do I setup a MaxMind account and obtain an Account ID and a license key?

See Maxmind’s Generate a license key page for up-to-date instructions, but you need to

  • Visit the GeoLite2 Sign Up page.
  • generate a license key on the Manage License Keys tab in the left navigation bar once you’ve logged in. Generate a new key, and copy the account ID and the license key. If you lose it, you’ll need to generate a new one.

You then add that key to the ENV section of your app.yml with a line like this:

  DISCOURSE_MAXMIND_ACCOUNT_ID: your-account-id-here
  DISCOURSE_MAXMIND_LICENSE_KEY: your-key-here

Or via discourse-setup when prompted.

Notes for IPv6 users

The Standard install doesn’t fully support IPv6 out of the box. If you have a server with IPv6 configured and need Maxmind information for IPv6 addresses, you’ll need to make sure that the user’s actual IP address is what is getting to Discourse, normally by using an external proxy that passes the remote IP address to Discourse. This requires more systems administration expertise than the standard install.

32개의 좋아요

@pfaffman , the URL to ‘My License Keys’ contains your account ID at MaxMind and therefore won’t work for anyone but you :wink:

3개의 좋아요

Works for me! :winking_face_with_tongue:

What’s funny, though is that no one else has complained in 3 years! It’s a wiki, so you can fix it. I’ll try to update when I get to a computer if I can manage to remember.

2개의 좋아요

Shows how many people actually read pages likes these :grin:

I’ve edited the page :nerd_face:

3개의 좋아요

Right!? And I spent a fair amount of time creating it. Not sure how I missed that the link worked just for me, but I guess having to log in was enough to distract me and maybe lots of other people.

2개의 좋아요

Just a curiosity question @evert, did you mean to leave the brackets there? If so, would it perhaps look better as a button?

Button example

Manage License Keys

<kbd>Manage License Keys</kbd>
3개의 좋아요

Sure, why not? :+1:t2:

2개의 좋아요

So far as I can tell I’m good to go

image

but all users show location “unknown”

Any help is appreciated.

You need to remove the # character in front and rebuild. The # character makes the entire line a comment in the YAML file.

5개의 좋아요

Thank you, just write out and exit or rebuild too?

You have to rebuild. Discourse won’t see app.yml changes otherwise.

4개의 좋아요

Thank you, done and working :hugs:

2개의 좋아요

It probably goes without saying for most here, but someone using a VPN may generate more alerts than others. It’s a nudge for the admins but doesn’t necessarily indicate a nefarious user.

2개의 좋아요

Perfect! thank for this tutorial.

1개의 좋아요

죄송합니다.
Discourse가 관리자 패널에서 IP 조회(역 IP 조회)를 수행할 때 오프라인 GeoIP 데이터베이스를 사용하는지, 아니면 매번 외부 API를 호출하는지 궁금합니다.

감사합니다!!

1개의 좋아요

참고로, 저는 외부 API를 호출하는 대신, Discourse를 로컬의 GeoLite2-City.mmdb 파일로 지정하여 IP 조회를 오프라인으로 처리하는 방식을 선호합니다.

그런데 IPv6을 지원하지 않나요? 이 트래픽을 v4로 리디렉션할 때가 된 것 같습니다 :slight_smile:

(여기서 질문을 삭제하고 Support 게시판에 게시합니다: MaxMind 401 오류 – 라이선스 키가 있지만 다운로드 불가)