Download GeoIP databases on startup

This commit is contained in:
Martin Polden 2019-12-24 17:31:27 +01:00
parent 4974f9387b
commit 66719b9932
3 changed files with 8 additions and 4 deletions

2
.gitignore vendored
View File

@ -2,4 +2,4 @@
/custom.html /custom.html
/vendor/ /vendor/
.vscode/ .vscode/
/bin/ /bin/

View File

@ -47,3 +47,9 @@ docker-test:
docker-push: docker-test docker-login docker-push: docker-test docker-login
docker push $(DOCKER_IMAGE) docker push $(DOCKER_IMAGE)
heroku-run: geoip-download
ifndef PORT
$(error PORT must be set)
endif
echoip -f data/country.mmdb -c data/city.mmdb -a data/asn.mmdb -p -r -H CF-Connecting-IP -H X-Forwarded-For -l :$(PORT)

View File

@ -1,7 +1,5 @@
build: build:
languages: languages:
- go - go
pre:
- make geoip-download
run: run:
web: echoip -f data/country.mmdb -c data/city.mmdb -a data/asn.mmdb -p -r -H CF-Connecting-IP -H X-Forwarded-For -l :$PORT web: make heroku-run