diff --git a/Dockerfile b/Dockerfile index 95c9bc0..1421581 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ echo " ## Installing packages ## " && \ apk add --no-cache --virtual=build-dependencies \ python3 \ py3-pip \ + logrotate \ libmaxminddb && \ echo " ## Installing python modules ## " && \ pip3 install --no-cache-dir -r requirements.txt -COPY root/ / \ No newline at end of file +COPY root/ / diff --git a/README.md b/README.md index 100c36b..95b839a 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ Add the ones that differ on your system. | LOG_MEASUREMENT | nginx_access_logs | InfluxDB measurement name for nginx logs. Optional, defaults to the example. | | SEND_NGINX_LOGS | true | Set to `false` to disable nginx logs. Optional, defaults to `true`. | | GEOIP2INFLUX_LOG_LEVEL | info | Sets the log level in geoip2influx.log. Use `debug` for verbose logging Optional, defaults to info. | -| INFLUX_RETENTION | 30d | Sets the retention for the database. Optional, defaults to example.| -| INFLUX_SHARD | 2d | Set the shard for the database. Optional, defaults to example. | +| INFLUX_RETENTION | 7d | Sets the retention for the database. Optional, defaults to example.| +| INFLUX_SHARD | 1d | Set the shard for the database. Optional, defaults to example. | | MAXMINDDB_LICENSE_KEY | xxxxxxx | Add your Maxmind licence key | diff --git a/geoip2influx.py b/geoip2influx.py index 2b178a0..acb9fd8 100644 --- a/geoip2influx.py +++ b/geoip2influx.py @@ -40,8 +40,8 @@ influxdb_port = env.get('INFLUX_HOST_PORT', '8086') influxdb_database = env.get('INFLUX_DATABASE', 'geoip2influx') influxdb_user = env.get('INFLUX_USER', 'root') influxdb_user_pass = env.get('INFLUX_PASS', 'root') -influxdb_retention = env.get('INFLUX_RETENTION','30d') -influxdb_shard = env.get('INFLUX_SHARD', '2d') +influxdb_retention = env.get('INFLUX_RETENTION','7d') +influxdb_shard = env.get('INFLUX_SHARD', '1d') geo_measurement = env.get('GEO_MEASUREMENT', 'geoip2influx') log_measurement = env.get('LOG_MEASUREMENT', 'nginx_access_logs') send_nginx_logs = env.get('SEND_NGINX_LOGS','true') @@ -311,4 +311,4 @@ if __name__ == '__main__': try: main() except KeyboardInterrupt: - exit(0) \ No newline at end of file + exit(0) diff --git a/requirements.txt b/requirements.txt index 5abbd2e..82b023b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -geoip2 -geohash2 -influxdb -IPy \ No newline at end of file +geoip2==3.0.0 +geohash2==1.1 +influxdb==5.3.0 +IPy==1.0