diff --git a/build.sh b/build.sh index 43d8f2b..c646203 100755 --- a/build.sh +++ b/build.sh @@ -4,15 +4,15 @@ set -eu set -o pipefail -GEOIP_CITY_URL='http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz' -GEOIP_COUNTRY_URL='http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz' +GEOIP_CITY_URL='https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=Zik4GPoOZhFzIC2G&suffix=tar.gz' +GEOIP_COUNTRY_URL='https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=Zik4GPoOZhFzIC2G&suffix=tar.gz' GEOIP_MOD_URL='https://github.com/leev/ngx_http_geoip2_module/archive/3.0.tar.gz' GEOIP_UPDATE_CLI='https://github.com/maxmind/geoipupdate/releases/download/v3.1.1/geoipupdate-3.1.1.tar.gz' GEOIP_URL='https://github.com/maxmind/libmaxminddb/releases/download/1.3.2/libmaxminddb-1.3.2.tar.gz' -LUAROCKS_URL='http://luarocks.org/releases/luarocks-2.4.2.tar.gz' +LUAROCKS_URL='http://luarocks.org/releases/luarocks-3.4.0.tar.gz' NAXSI_URL='https://github.com/nbs-system/naxsi/archive/0.56.tar.gz' -OPEN_RESTY_URL='http://openresty.org/download/openresty-1.11.2.4.tar.gz' -STATSD_URL='https://github.com/UKHomeOffice/nginx-statsd/archive/0.0.1.tar.gz' +OPEN_RESTY_URL='http://openresty.org/download/openresty-1.15.8.3.tar.gz' +#STATSD_URL='https://github.com/UKHomeOffice/nginx-statsd/archive/0.0.1.tar.gz' MAXMIND_PATH='/usr/share/GeoIP' @@ -39,7 +39,7 @@ mkdir -p openresty luarocks naxsi nginx-statsd geoip geoipupdate ngx_http_geoip2 wget -qO - "$OPEN_RESTY_URL" | tar xzv --strip-components 1 -C openresty/ wget -qO - "$LUAROCKS_URL" | tar xzv --strip-components 1 -C luarocks/ wget -qO - "$NAXSI_URL" | tar xzv --strip-components 1 -C naxsi/ -wget -qO - "$STATSD_URL" | tar xzv --strip-components 1 -C nginx-statsd/ +#wget -qO - "$STATSD_URL" | tar xzv --strip-components 1 -C nginx-statsd/ wget -qO - "$GEOIP_URL" | tar xzv --strip-components 1 -C geoip/ wget -qO - "$GEOIP_UPDATE_CLI" | tar xzv --strip-components 1 -C geoipupdate/ wget -qO - "$GEOIP_MOD_URL" | tar xzv --strip-components 1 -C ngx_http_geoip2_module/ @@ -50,8 +50,12 @@ mkdir -p ${MAXMIND_PATH} ./configure make check install echo "/usr/local/lib" >> /etc/ld.so.conf.d/libmaxminddb.conf -curl -fSL ${GEOIP_COUNTRY_URL} | gzip -d > ${MAXMIND_PATH}/GeoLite2-Country.mmdb -curl -fSL ${GEOIP_CITY_URL} | gzip -d > ${MAXMIND_PATH}/GeoLite2-City.mmdb +mkdir -p /tmp/geodb/ +curl -fSL ${GEOIP_COUNTRY_URL} -o GeoLite2-Country.tar.gz && tar -xzvf GeoLite2-Country.tar.gz -C /tmp/geodb/ +mv /tmp/geodb/GeoLite2-Country_*/GeoLite2-Country.mmdb ${MAXMIND_PATH}/GeoLite2-Country.mmdb +curl -fSL ${GEOIP_CITY_URL} -o GeoLite2-City.tar.gz && tar -xzvf GeoLite2-City.tar.gz -C /tmp/geodb/ +mv /tmp/geodb/GeoLite2-City_*/GeoLite2-City.mmdb ${MAXMIND_PATH}/GeoLite2-City.mmdb +rm -rf /tmp/geodb/ chown -R 1000:1000 ${MAXMIND_PATH} popd @@ -64,10 +68,10 @@ popd echo "Checking libmaxminddb module" ldconfig && ldconfig -p | grep libmaxminddb +#--add-module="../nginx-statsd" \ pushd openresty ./configure --add-dynamic-module="/root/ngx_http_geoip2_module" \ --add-module="../naxsi/naxsi_src" \ - --add-module="../nginx-statsd" \ --with-http_realip_module \ --with-http_stub_status_module make install diff --git a/go.sh b/go.sh index 4350621..5c6c1c2 100755 --- a/go.sh +++ b/go.sh @@ -146,7 +146,7 @@ case "${LOG_FORMAT_NAME}" in lua_need_request_body on; set \$response_body ""; body_filter_by_lua ' - local resp_body = string.sub(ngx.arg[1], 1, 1000) + local resp_body = string.sub(ngx.arg[1], 1, 10000) ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body if ngx.arg[2] then ngx.var.response_body = ngx.ctx.buffered