Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update maxmind lib #840

Merged
merged 1 commit into from
Nov 21, 2024
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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,30 @@ Docker
Vichan comes with a Dockerfile and docker-compose configuration, the latter aimed primarily at development and testing.
See the `docker/doc.md` file for more information.

MaxMind support
------------
We use MaxMind to retrieve flags for posts. Previously, the country database was stored in `inc/lib/geoip`, but updating it in that location became unmanageable. Now, a MaxMind account is required to download the country database.

### How to Set It Up

1. Follow these instructions to create a free account for using GeoLite2:
[Create an Account on MaxMind](https://support.maxmind.com/hc/en-us/articles/4407099783707-Create-an-Account#h_01G4G4NV169TJWFCJ1KGFAM1CD)

2. Download the database using maxmind website

3. (Optional) Install `geoipupdate` to download the database using CLI:
[GeoIP Update Installation Guide](https://github.com/maxmind/geoipupdate)

1. Edit the `/etc/GeoIP.conf` file to add your API key.
2. Run `geoipupdate`

5. Update path in `$config['maxmind']['db_path']`

6. (Optional) Set up a cron job to automatically update the database:
```
0 0 * * 2,5 geoipupdate
```

vichan API
----------
vichan provides by default a 4chan-compatible JSON API. For documentation on this, see:
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"lifo/ip": "^1.0",
"gettext/gettext": "^5.5",
"mrclay/minify": "^2.1.6",
"geoip/geoip": "^1.17",
"dapphp/securimage": "^4.0",
"erusev/parsedown": "^1.7.4"
"erusev/parsedown": "^1.7.4",
"geoip2/geoip2": "^2.13"
},
"autoload": {
"classmap": ["inc/"],
Expand All @@ -39,6 +39,7 @@
"inc/functions/net.php",
"inc/functions/num.php",
"inc/functions/theme.php",
"inc/functions/ip.php",
"inc/context.php"
]
},
Expand Down
Loading