Commit 0dbd29d2 authored by hadret's avatar hadret

feat: sync bionic against master.

parent db05f1e9
nginx (1.14.2-2bionic0) bionic; urgency=medium
nginx (1.14.2-3bionic0) bionic; urgency=medium
* Non-maintainer upload.
* Introduce stream server traffic status dynamic modules.
* Upgrade 3rd party modules:
* http-lua to 0.10.14
* nchan module to 1.2.5;
* http-dav-ext to 3.0.0
* http-fancyindex to 0.4.3
* http-cache-purge to 2.5
* Fix and provide where missing watch files for the modules.
-- Filip Chabik <hadret@gmail.com> Mon, 15 Apr 2019 10:34:37 +0000
nginx (1.14.2-2bionic0) bionic; urgency=medium
* Replace built-in geoip with third-party geoip2.
-- Filip Chabik <hadret@gmail.com> Fri, 08 Feb 2019 10:13:59 +0000
......
......@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Debian Nginx Maintainers <pkg-nginx-maintainers@lists.alioth.debian.org>
Uploaders: Christos Trochalakis <ctrochalakis@debian.org>
Build-Depends: debhelper (>= 9),
Build-Depends: debhelper (>= 10),
dh-systemd,
po-debconf,
dpkg-dev (>= 1.15.5),
......@@ -110,6 +110,7 @@ Depends: libnginx-mod-http-auth-ldap (= ${binary:Version}),
libnginx-mod-http-echo (= ${binary:Version}),
libnginx-mod-http-geoip2 (= ${binary:Version}),
libnginx-mod-http-image-filter (= ${binary:Version}),
libnginx-mod-http-stream-server-traffic-status (= ${binary:Version}),
libnginx-mod-http-subs-filter (= ${binary:Version}),
libnginx-mod-http-upstream-fair (= ${binary:Version}),
libnginx-mod-http-upsync (= ${binary:Version}),
......@@ -117,6 +118,7 @@ Depends: libnginx-mod-http-auth-ldap (= ${binary:Version}),
libnginx-mod-http-vhost-traffic-status (= ${binary:Version}),
libnginx-mod-mail (= ${binary:Version}),
libnginx-mod-stream (= ${binary:Version}),
libnginx-mod-stream-server-traffic-status (= ${binary:Version}),
nginx-common (= ${source:Version}),
${misc:Depends},
${shlibs:Depends}
......@@ -187,6 +189,7 @@ Depends: libnginx-mod-http-auth-ldap (= ${binary:Version}),
libnginx-mod-http-image-filter (= ${binary:Version}),
libnginx-mod-http-lua (= ${binary:Version}),
libnginx-mod-http-perl (= ${binary:Version}),
libnginx-mod-http-stream-server-traffic-status (= ${binary:Version}),
libnginx-mod-http-subs-filter (= ${binary:Version}),
libnginx-mod-http-uploadprogress (= ${binary:Version}),
libnginx-mod-http-upstream-fair (= ${binary:Version}),
......@@ -196,6 +199,7 @@ Depends: libnginx-mod-http-auth-ldap (= ${binary:Version}),
libnginx-mod-mail (= ${binary:Version}),
libnginx-mod-nchan (= ${binary:Version}),
libnginx-mod-stream (= ${binary:Version}),
libnginx-mod-stream-server-traffic-status (= ${binary:Version}),
nginx-common (= ${source:Version}),
${misc:Depends},
${shlibs:Depends}
......@@ -461,3 +465,25 @@ Depends: ${misc:Depends}, ${shlibs:Depends}
Description: dynamic upstreams via consul or etcd for Nginx
Sync upstreams from consul or etcd, dynamically modify backend servers
attributes like weight, max_fails etc. without the need to reload nginx.
Package: libnginx-mod-http-stream-server-traffic-status
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends},
libnginx-mod-stream-server-traffic-status (= ${binary:Version}),
Description: stream server traffic status core module for Nginx
STS module provides access to stream server traffic status information.
It provides support for implementing stream server stats, filters,
limits and embedded variables.
.
This package provides core module necessary to run STS.
Package: libnginx-mod-stream-server-traffic-status
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends},
libnginx-mod-http-stream-server-traffic-status (= ${binary:Version}),
Description: stream server traffic status module for Nginx
STS module provides access to stream server traffic status information.
It provides support for implementing display and control of stream
server stats and
.
This package provides second module necessary to run STS.
#!/usr/bin/perl -w
use File::Basename;
# Guess module name
$module = basename($0, '.nginx');
$module =~ s/^libnginx-mod-//;
$modulepath = $module;
$modulepath =~ s/-/_/g;
print "mod debian/build-extras/objs/ngx_${modulepath}_module.so\n";
print "mod debian/libnginx-mod.conf/mod-${module}.conf\n";
#!/usr/bin/perl -w
use File::Basename;
# Guess module name
$module = basename($0, '.nginx');
$module =~ s/^libnginx-mod-//;
$modulepath = $module;
$modulepath =~ s/-/_/g;
print "mod debian/build-extras/objs/ngx_${modulepath}_module.so\n";
print "mod debian/libnginx-mod.conf/mod-${module}.conf\n";
load_module modules/ngx_stream_server_traffic_status.so;
load_module modules/ngx_http_stream_server_traffic_status.so;
......@@ -18,9 +18,8 @@ Files-Excluded: .gitignore .gitattributes .travis.yml
Module: http-lua
Homepage: https://github.com/openresty/lua-nginx-module
Version: 0.10.11
Version: 0.10.14
Patch:
openssl-1.1.0.patch
discover-luajit-2.1.patch
Files-Excluded: .gitignore .gitattributes .travis.yml .github
......@@ -34,8 +33,8 @@ Patch:
Module: nchan
Homepage: https://github.com/slact/nchan
Version: 1.0.8
Files-Excluded: dev nchan_logo.png NchanSubscriber.js src/hiredis
Version: 1.2.5
Files-Excluded: dev nchan_logo.png NchanSubscriber.js
Module: http-uploadprogress
Homepage: https://github.com/masterzen/nginx-upload-progress-module
......@@ -44,15 +43,15 @@ Version: 0.9.2
Module: http-cache-purge
Homepage: https://github.com/nginx-modules/ngx_cache_purge
Version: 2.4.2
Version: 2.5
Module: http-dav-ext
Homepage: https://github.com/arut/nginx-dav-ext-module
Version: 0.1.0
Version: 3.0.0
Module: http-fancyindex
Homepage: https://github.com/aperezdc/ngx-fancyindex
Version: 0.4.2
Version: 0.4.3
Files-Excluded: .gitignore .travis.yml
Module: http-subs-filter
......@@ -84,3 +83,12 @@ Version: 219131a
Module: http-geoip2
Homepage: https://github.com/leev/ngx_http_geoip2_module
Version: 3.2
Module: stream-server-traffic-status
Homepage: https://github.com/vozlt/nginx-module-stream-sts
Version: v0.1.1
Module: http-stream-server-traffic-status
Homepage: https://github.com/vozlt/nginx-module-sts
Version: v0.1.1
......@@ -12,39 +12,38 @@ cache:
env:
global:
- JOBS=4
- NGINX_VERSION=1.12.0
- NGINX_PREFIX=/opt/nginx
- OPENSSL_PREFIX=/opt/ssl
- OPENSSL_LIB=$OPENSSL_PREFIX/lib
- OPENSSL_INC=$OPENSSL_PREFIX/include
- OPENSSL_VER=1.0.2k
matrix:
- NGINX_VERSION=1.14.0
- NGINX_VERSION=1.15.2
before_install:
- sudo apt-get install -qq -y cpanminus
- mkdir --parents download-cache
- sudo apt-get update -qq
- sudo apt-get install -qq zlib1g-dev libpcre3-dev cpanminus
# Get OpenSSL 1.0.2 from Ubuntu Xenial
# https://packages.ubuntu.com/xenial-updates/libssl1.0.0
- test -f download-cache/libssl1.0.0_1.0.2g-1ubuntu4.13_amd64.deb || wget -O download-cache/libssl1.0.0_1.0.2g-1ubuntu4.13_amd64.deb "http://de.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.13_amd64.deb"
# https://packages.ubuntu.com/xenial/libssl-dev
- test -f download-cache/libssl-dev_1.0.2g-1ubuntu4.13_amd64.deb || wget -O download-cache/libssl-dev_1.0.2g-1ubuntu4.13_amd64.deb "http://de.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.0.2g-1ubuntu4.13_amd64.deb"
- sudo dpkg -i download-cache/libssl*_amd64.deb
# Test::Nginx
- git clone https://github.com/openresty/test-nginx.git test-nginx
- cd test-nginx/ && sudo cpanm . && cd ..
# NGINX source
- test -f download-cache/nginx-$NGINX_VERSION.tar.gz || wget -O download-cache/nginx-$NGINX_VERSION.tar.gz http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
install:
- if [ ! -d /opt ]; then mkdir /opt; fi
- if [ ! -d download-cache ]; then mkdir download-cache; fi
- if [ ! -f download-cache/nginx-$NGINX_VERSION.tar.gz ]; then wget -O download-cache/nginx-$NGINX_VERSION.tar.gz http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz; fi
- if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -O download-cache/openssl-$OPENSSL_VER.tar.gz https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz; fi
- git clone https://github.com/openresty/test-nginx.git
- tar -xzf download-cache/nginx-${NGINX_VERSION}.tar.gz
- cd nginx-${NGINX_VERSION}/
- ./configure --prefix=${NGINX_PREFIX} --with-debug --with-http_ssl_module --add-module=${PWD}/..
- make -j${JOBS}
- sudo make install
- cd ..
- export PATH="${NGINX_PREFIX}/sbin:$PATH"
# - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
script:
- cd test-nginx/ && sudo cpanm . && cd ..
- tar zxf download-cache/openssl-$OPENSSL_VER.tar.gz
- cd openssl-$OPENSSL_VER/
- ./config shared --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1)
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
- sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- tar zxf download-cache/nginx-$NGINX_VERSION.tar.gz
- cd nginx-$NGINX_VERSION/
- ./configure --prefix=$NGINX_PREFIX --with-debug --add-module=$PWD/.. > build.log 2>&1 || (cat build.log && exit 1)
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- export PATH=$NGINX_PREFIX/sbin:$PATH
# - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
- nginx -V
- ldd `which nginx`
- ldd $(which nginx)
- prove t
2017-09-28 VERSION 2.4.2
* Fix segfault in call to ngx_read_file of partial key purge
* Fix segfault in cplcf->conf->purge_all with separate location syntax
2018-08-04 VERSION 2.5
* feat/docs: cache_purge_response_type directive, selecting response type (html|json|xml|text)
* break: changed status of HTTP code 404 (Not Found) to 412 (Precondition Failed)
* fix: remove path information of response body (#4, 3a8c08a, #11)
2017-02-21 VERSION 2.4.1
* Fix compatibility with nginx-1.11.6+, Sułowicz Paweł
......
......@@ -90,6 +90,17 @@ uwsgi_cache_purge
Sets area and key used for purging selected pages from `uWSGI`'s cache.
Configuration directives (Optional)
===================================================
cache_purge_response_type
-----------------
* **syntax**: `cache_purge_response_type html|json|xml|text`
* **default**: `html`
* **context**: `http`, `server`, `location`
Sets a response type of purging result.
Partial Keys
......@@ -155,6 +166,61 @@ Sample configuration (separate location syntax)
}
}
Sample configuration (Optional)
===============================================
http {
proxy_cache_path /tmp/cache keys_zone=tmpcache:10m;
cache_purge_response_type text;
server {
cache_purge_response_type json;
location / { #json
proxy_pass http://127.0.0.1:8000;
proxy_cache tmpcache;
proxy_cache_key $uri$is_args$args;
}
location ~ /purge(/.*) { #xml
allow 127.0.0.1;
deny all;
proxy_cache_purge tmpcache $1$is_args$args;
cache_purge_response_type xml;
}
location ~ /purge2(/.*) { # json
allow 127.0.0.1;
deny all;
proxy_cache_purge tmpcache $1$is_args$args;
}
}
server {
location / { #text
proxy_pass http://127.0.0.1:8000;
proxy_cache tmpcache;
proxy_cache_key $uri$is_args$args;
}
location ~ /purge(/.*) { #text
allow 127.0.0.1;
deny all;
proxy_cache_purge tmpcache $1$is_args$args;
}
location ~ /purge2(/.*) { #html
allow 127.0.0.1;
deny all;
proxy_cache_purge tmpcache $1$is_args$args;
cache_purge_response_type html;
}
}
}
Testing
=======
......
......@@ -92,10 +92,10 @@ qr/\[(warn|error|crit|alert|emerg)\]/
--- config eval: $::config
--- request
PURGE /purge/proxy/passwd
--- error_code: 404
--- error_code: 412
--- response_headers
Content-Type: text/html
--- response_body_like: 404 Not Found
--- response_body_like: 412 Precondition Failed
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
......
......@@ -94,10 +94,10 @@ qr/\[(warn|error|crit|alert|emerg)\]/
--- config eval: $::config
--- request
PURGE /purge/proxy/passwd
--- error_code: 404
--- error_code: 412
--- response_headers
Content-Type: text/html
--- response_body_like: 404 Not Found
--- response_body_like: 412 Precondition Failed
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
......
......@@ -124,10 +124,10 @@ qr/\[(warn|error|crit|alert|emerg)\]/
--- config eval: $::config
--- request
PURGE /proxy/passwd
--- error_code: 404
--- error_code: 412
--- response_headers
Content-Type: text/html
--- response_body_like: 404 Not Found
--- response_body_like: 412 Precondition Failed
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
......@@ -190,10 +190,10 @@ qr/\[(warn|error|crit|alert|emerg)\]/
--- config eval: $::config_allowed
--- request
PURGE /proxy/passwd
--- error_code: 404
--- error_code: 412
--- response_headers
Content-Type: text/html
--- response_body_like: 404 Not Found
--- response_body_like: 412 Precondition Failed
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
......
......@@ -127,10 +127,10 @@ qr/\[(warn|error|crit|alert|emerg)\]/
--- config eval: $::config
--- request
PURGE /proxy/passwd
--- error_code: 404
--- error_code: 412
--- response_headers
Content-Type: text/html
--- response_body_like: 404 Not Found
--- response_body_like: 412 Precondition Failed
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
......@@ -193,10 +193,10 @@ qr/\[(warn|error|crit|alert|emerg)\]/
--- config eval: $::config_allowed
--- request
PURGE /proxy/passwd
--- error_code: 404
--- error_code: 412
--- response_headers
Content-Type: text/html
--- response_body_like: 404 Not Found
--- response_body_like: 412 Precondition Failed
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
......
......@@ -25,7 +25,7 @@ our $config = <<'_EOC_';
location = /etc/passwd {
root /var/www/html;
root /;
}
_EOC_
......
......@@ -25,7 +25,7 @@ our $config = <<'_EOC_';
location = /etc/passwd {
root /var/www/html;
root /;
}
_EOC_
......
# vi:filetype=perl
use lib 'lib';
use Test::Nginx::Socket;
repeat_each(1);
plan tests => repeat_each() * (blocks() * 4 + 3 * 1);
our $http_config = <<'_EOC_';
proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m;
proxy_temp_path /tmp/ngx_cache_purge_temp 1 2;
_EOC_
our $config = <<'_EOC_';
cache_purge_response_type json;
location /proxy {
proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd;
proxy_cache test_cache;
proxy_cache_key $uri$is_args$args;
proxy_cache_valid 3m;
add_header X-Cache-Status $upstream_cache_status;
}
location ~ /purge(/.*) {
proxy_cache_purge test_cache $1$is_args$args;
cache_purge_response_type html;
}
location ~ /purge_json(/.*) {
proxy_cache_purge test_cache $1$is_args$args;
}
location ~ /purge_xml(/.*) {
proxy_cache_purge test_cache $1$is_args$args;
cache_purge_response_type xml;
}
location ~ /purge_text(/.*) {
proxy_cache_purge test_cache $1$is_args$args;
cache_purge_response_type text;
}
location = /etc/passwd {
root /;
}
_EOC_
worker_connections(128);
no_shuffle();
run_tests();
no_diff();
__DATA__
=== TEST 1: prepare
--- http_config eval: $::http_config
--- config eval: $::config
--- request
GET /proxy/passwd
--- error_code: 200
--- response_headers
Content-Type: text/plain
--- response_body_like: root
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
=== TEST 2: get from cache
--- http_config eval: $::http_config
--- config eval: $::config
--- request
GET /proxy/passwd
--- error_code: 200
--- response_headers
Content-Type: text/plain
X-Cache-Status: HIT
--- response_body_like: root
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
=== TEST 3: purge from cache
--- http_config eval: $::http_config
--- config eval: $::config
--- request
PURGE /purge/proxy/passwd
--- error_code: 200
--- response_headers
Content-Type: text/html
--- response_body_like: Successful purge
--- timeout: 10
--- no_error_log eval
qr/\[(warn|error|crit|alert|emerg)\]/
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
=== TEST 4: purge from empty cache