HomeITAdmin / nextcloud_geoblocker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Workaround for Docker installations

jbunner opened this issue · comments

First, app looks great - looking forward to increased features such as auto block and banning.

When running Nextcloud in a Docker environment, the images don't contain the geoiplookup Debian packages installed. A quick workaround is to use another container to download the .mmdb files into a shared folder, then map that folder/volume within the NC Docker instance.

If using Docker Compose to launch Nextcloud app, database, etc. you can add another container to act as a geoip update service. Alternately, one GeoIP updater service can share the same database across multiple NC Docker instances. The updater service runs once a week, and uses about 52K memory idle most of the time. Check out https://github.com/tkrs/maxmind-geoipupdate for details about configuration options.

You will need to create a shared directory on the Docker host, in the example "./geoip"
You will still need to manually copy the geoip2.phar into the "custom_apps/geoblocker/3rdparty/maxmind_geolite2/" directory as stated in instructions.
Use the test function in Geoblocker, check logs to see if the database is read.

Hope this can help others running NC on Docker having problems getting geoblocker to function.

--

version: '3.6'

#service to check for geoip database update
services:
  geoip:
    image: tkrs/maxmind-geoipupdate
    volumes:
      - ./geoip:/usr/share/GeoIP
    environment:
      - ACCOUNT_ID=000000
      - LICENSE_KEY=****
    restart: always

  app:
    image: nextcloud
#... add below to volumes so NC can find geoip database files
    volumes:
      - ./geoip:/usr/share/GeoIP:ro
     #geoip update container places file in ./geoip on Docker host, or set your own path
#...

Thanks. I think this is very helpful. I will close this issue, but I linked it in the Readme so that everybody can find if they are looking for help for installation.