/unit/test/ |
H A D | test_node_application.py | diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
|
H A D | conftest.py | diff 1769:b7cd1517081e Fri Jan 08 10:38:00 UTC 2021 Tiago Natel de Moura <t.nateldemoura@f5.com> Tests: fixed test_respawn.py to act upon test processes.
Running `test_respawn_` test cases on a machine with Unit daemon in background would fail tests because `ps ax` was used without filtering out other unit instances.
This patch also prevents from tests killing other Unit processes not related to tests.
|
H A D | test_tls.py | diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
|
H A D | test_ruby_isolation.py | diff 1737:9be01e5d6ce5 Tue Dec 08 16:38:00 UTC 2020 Tiago Natel de Moura <t.nateldemoura@f5.com> Tests: fixed ruby isolation.
While alternating between running priv and unpriv tests locally, it happens that unpriv tests can't bind mount or create sub directories inside directories created by root. This patch fixes this by pointing "rootfs" to temporary directory.
Now the priv and unpriv test uses the same test function.
|
H A D | test_settings.py | diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
|
H A D | test_ruby_application.py | diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
|
H A D | test_respawn.py | diff 1769:b7cd1517081e Fri Jan 08 10:38:00 UTC 2021 Tiago Natel de Moura <t.nateldemoura@f5.com> Tests: fixed test_respawn.py to act upon test processes.
Running `test_respawn_` test cases on a machine with Unit daemon in background would fail tests because `ps ax` was used without filtering out other unit instances.
This patch also prevents from tests killing other Unit processes not related to tests. 1471:38ede0766e1a Tue May 12 16:59:00 UTC 2020 Andrei Zeliankou <zelenkov@nginx.com> Tests: added respawn tests.
|
H A D | test_python_procman.py | diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
|
H A D | test_routing.py | diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
|
H A D | test_python_application.py | diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
|
/unit/docs/ |
H A D | changes.xml | diff 2251:6e5a9550ead3 Thu Nov 17 21:56:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> Python: Added support for Python 3.11.
Python 3.8 added a new Python initialisation configuration API[0].
Python 3.11 marked the old API as deprecated resulting in the following compiler warnings which we treat as errors, failing the build
src/python/nxt_python.c: In function ‘nxt_python_start’: src/python/nxt_python.c:130:13: error: ‘Py_SetProgramName’ is deprecated [-Werror=deprecated-declarations] 130 | Py_SetProgramName(nxt_py_home); | ^~~~~~~~~~~~~~~~~ In file included from /opt/python-3.11/include/python3.11/Python.h:94, from src/python/nxt_python.c:7: /opt/python-3.11/include/python3.11/pylifecycle.h:37:38: note: declared here 37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *); | ^~~~~~~~~~~~~~~~~ src/python/nxt_python.c:134:13: error: ‘Py_SetPythonHome’ is deprecated [-Werror=deprecated-declarations] 134 | Py_SetPythonHome(nxt_py_home); | ^~~~~~~~~~~~~~~~ /opt/python-3.11/include/python3.11/pylifecycle.h:40:38: note: declared here 40 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *); | ^~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
We actually have a few config scenarios: Python < 3, Python >= 3.0 < 3.8 and for Python 3 we have two configs where we select one based on virtual environment setup.
Factor out the Python 3 config initialisation into its own function. We actually create two functions, one for Python 3.8+ and one for older Python 3. We pick the right function to use at build time.
The new API also has error checking (where the old API doesn't) which we handle.
[0]: https://peps.python.org/pep-0587/
Closes: <https://github.com/nginx/unit/issues/710> [ Andrew: Expanded upon patch from @sandeep-gh ] Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 2251:6e5a9550ead3 Thu Nov 17 21:56:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> Python: Added support for Python 3.11.
Python 3.8 added a new Python initialisation configuration API[0].
Python 3.11 marked the old API as deprecated resulting in the following compiler warnings which we treat as errors, failing the build
src/python/nxt_python.c: In function ‘nxt_python_start’: src/python/nxt_python.c:130:13: error: ‘Py_SetProgramName’ is deprecated [-Werror=deprecated-declarations] 130 | Py_SetProgramName(nxt_py_home); | ^~~~~~~~~~~~~~~~~ In file included from /opt/python-3.11/include/python3.11/Python.h:94, from src/python/nxt_python.c:7: /opt/python-3.11/include/python3.11/pylifecycle.h:37:38: note: declared here 37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *); | ^~~~~~~~~~~~~~~~~ src/python/nxt_python.c:134:13: error: ‘Py_SetPythonHome’ is deprecated [-Werror=deprecated-declarations] 134 | Py_SetPythonHome(nxt_py_home); | ^~~~~~~~~~~~~~~~ /opt/python-3.11/include/python3.11/pylifecycle.h:40:38: note: declared here 40 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *); | ^~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
We actually have a few config scenarios: Python < 3, Python >= 3.0 < 3.8 and for Python 3 we have two configs where we select one based on virtual environment setup.
Factor out the Python 3 config initialisation into its own function. We actually create two functions, one for Python 3.8+ and one for older Python 3. We pick the right function to use at build time.
The new API also has error checking (where the old API doesn't) which we handle.
[0]: https://peps.python.org/pep-0587/
Closes: <https://github.com/nginx/unit/issues/710> [ Andrew: Expanded upon patch from @sandeep-gh ] Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 2230:83b2d20d8f5c Fri Sep 16 13:38:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> PHP: allowed to specify URLs without a trailing '/'.
Both @lucatacconi & @mwoodpatrick reported what appears to be the same issue on GitHub. Namely that when using the PHP language module and trying to access a URL that is a directory but without specifying the trailing '/', they were getting a '503 Service Unavailable' error.
Note: This is when _not_ using the 'script' option.
E.g with the following config
{ "listeners": { "[::1]:8080": { "pass": "applications/php" } },
"applications": { "php": { "type": "php", "root": "/var/tmp/unit-php" } } }
and with a directory path of /var/tmp/unit-php/foo containing an index.php, you would see the following
$ curl http://localhost/foo <title>Error 503</title> Error 503
However
$ curl http://localhost/foo/
would work and serve up the index.php
This commit fixes the above so you get the desired behaviour without specifying the trailing '/' by doing the following
1] If the URL doesn't end in .php and doesn't have a trailing '/' then check if the requested path is a directory.
2) If it is a directory then create a 301 re-direct pointing to it. This matches the behaviour of the likes of nginx, Apache and lighttpd.
This also matches the behaviour of the "share" action in Unit.
This doesn't effect the behaviour of the 'script' option which bypasses the nxt_php_dynamic_request() function.
This also adds a couple of tests to test/test_php_application.py to ensure this continues to work.
Closes: <https://github.com/nginx/unit/issues/717> Closes: <https://github.com/nginx/unit/issues/753> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 2223:1019031754fe Wed Jan 16 07:38:00 UTC 2019 Remi Collet <remi@remirepo.net> Preferring system crypto policy.
If we don't call SSL_CTX_set_cipher_list(), then it uses the system's default.
Link: <https://fedoraproject.org/wiki/Changes/CryptoPolicy> Link: <https://docs.fedoraproject.org/en-US/packaging-guidelines/CryptoPolicies/> Link: <https://www.redhat.com/en/blog/consistent-security-crypto-policies-red-hat-enterprise-linux-8> Signed-off-by: Remi Collet <remi@remirepo.net> Acked-by: Andrei Belov <defan@nginx.com> [ alx: add changelog and tweak commit message ] Signed-off-by: Alejandro Colomar <alx@nginx.com> diff 2110:048281cd3d73 Thu May 26 12:38:00 UTC 2022 Alejandro Colomar <alx.manpages@gmail.com> Var: Added $request_uri (as in NGINX).
This supports a new variable $request_uri that contains the path and the query (See RFC 3986, section 3). Its contents are percent encoded. This is useful for example to redirect HTTP to HTTPS:
{ "return": "301", "location": "https://$host$request_uri" }
When <http://example.com/foo%23bar?baz> is requested, the server redirects to <https://example.com/foo%23bar?baz>.
===
Testing:
//diff --git a/src/nxt_http_return.c b/src/nxt_http_return.c //index 82c9156..adeb3a1 100644 //--- a/src/nxt_http_return.c //+++ b/src/nxt_http_return.c //@@ -196,6 +196,7 @@ nxt_http_return_send_ready(nxt_task_t *task, void *obj, void *data) // field->value = ctx->encoded.start; // field->value_length = ctx->encoded.length; // } //+ fprintf(stderr, "ALX: target[%1$i]: <%2$.*1$s>\n", (int)r->target.length, r->target.start); // // r->state = &nxt_http_return_send_state; //
{ "listeners": { "*:81": { "pass": "routes/ru" } },
"routes": { "ru": [{ "action": { "return": 301, "location": "$request_uri" } }] } }
$ curl -i http://localhost:81/*foo%2Abar?baz#arg HTTP/1.1 301 Moved Permanently Location: /*foo%2Abar?baz Server: Unit/1.27.0 Date: Mon, 30 May 2022 16:04:30 GMT Content-Length: 0
$ sudo cat /usr/local/unit.log | grep ALX ALX: target[15]: </*foo%2Abar?baz> diff 1951:863363011a94 Tue Aug 24 11:38:00 UTC 2021 Valentin Bartenev <vbart@nginx.com> Version bump. diff 1820:e969cea13cc3 Wed Mar 24 13:38:00 UTC 2021 Valentin Bartenev <vbart@nginx.com> Certficates: fixed counting DNS SAN entries.
Previously, entries of any type were counted during object allocation but only DNS type entries were actually processed. As a result, if some certificate entries had another type, returning information about the certificate caused uninitialized memory access. diff 441:2206b023fae3 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: added support for Ubuntu 17.10.
|
/unit/ |
H A D | version | diff 1951:863363011a94 Tue Aug 24 11:38:00 UTC 2021 Valentin Bartenev <vbart@nginx.com> Version bump. diff 1230:7d73ecd65b70 Mon Oct 07 15:38:00 UTC 2019 Valentin Bartenev <vbart@nginx.com> Version bump.
|
H A D | README.md | diff 2298:38a2e5c452b2 Thu Jan 12 16:47:00 UTC 2023 Artem Konev <artem.konev@nginx.com> Fixed the Slack workspace link.
|
/unit/pkg/docker/ |
H A D | Makefile | diff 534:51e5b0a89e82 Thu Feb 08 16:38:00 UTC 2018 Andrei Belov <defan@nginx.com> Docker: typo fixed.
|
/unit/pkg/rpm/ |
H A D | unit.spec.in | diff 443:2b933f0bc77d Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for rpm.
|
H A D | unit.module.spec.in | diff 443:2b933f0bc77d Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for rpm.
|
/unit/pkg/deb/debian.module/ |
H A D | rules.in | diff 442:3f841e1db4a7 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for deb.
|
/unit/pkg/deb/debian/ |
H A D | rules.in | diff 442:3f841e1db4a7 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for deb.
|
/unit/pkg/deb/ |
H A D | Makefile | diff 441:2206b023fae3 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: added support for Ubuntu 17.10. diff 440:759444c75bce Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: added python 3.4 module on Debian 8.
|
/unit/auto/ |
H A D | make | diff 304:2bd8a353a59d Thu Sep 07 23:38:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Decalring clean and dist targets as .PHONY.
|
H A D | options | diff 225:6f59f917d940 Thu Aug 24 15:38:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Renamed configure option --no-unix-domain to --no-unix-sockets.
|
/unit/src/ |
H A D | nxt_router.c | diff 2230:83b2d20d8f5c Fri Sep 16 13:38:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> PHP: allowed to specify URLs without a trailing '/'.
Both @lucatacconi & @mwoodpatrick reported what appears to be the same issue on GitHub. Namely that when using the PHP language module and trying to access a URL that is a directory but without specifying the trailing '/', they were getting a '503 Service Unavailable' error.
Note: This is when _not_ using the 'script' option.
E.g with the following config
{ "listeners": { "[::1]:8080": { "pass": "applications/php" } },
"applications": { "php": { "type": "php", "root": "/var/tmp/unit-php" } } }
and with a directory path of /var/tmp/unit-php/foo containing an index.php, you would see the following
$ curl http://localhost/foo <title>Error 503</title> Error 503
However
$ curl http://localhost/foo/
would work and serve up the index.php
This commit fixes the above so you get the desired behaviour without specifying the trailing '/' by doing the following
1] If the URL doesn't end in .php and doesn't have a trailing '/' then check if the requested path is a directory.
2) If it is a directory then create a 301 re-direct pointing to it. This matches the behaviour of the likes of nginx, Apache and lighttpd.
This also matches the behaviour of the "share" action in Unit.
This doesn't effect the behaviour of the 'script' option which bypasses the nxt_php_dynamic_request() function.
This also adds a couple of tests to test/test_php_application.py to ensure this continues to work.
Closes: <https://github.com/nginx/unit/issues/717> Closes: <https://github.com/nginx/unit/issues/753> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 615:38d50cba8f00 Thu Apr 05 14:19:00 UTC 2018 Max Romanov <max.romanov@nginx.com> Stopping timed out application process. diff 424:38b478d79178 Wed Dec 27 14:46:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Changing worker selection precedence.
This patch increase precedence of non-started worker over busy worker.
1. idle worker; 2. start new worker; 3. busy worker, but can accept request in advance; diff 317:94010c8bd7bc Fri Sep 15 11:38:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> Fixed port handlers arrays. diff 119:22bc18e61479 Thu Jul 06 15:38:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Router: read configuration from port.
Controller: stub to send configuration from POST body "as is" to router. diff 58:506c889e2682 Fri Jun 09 18:38:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> Fixed building by GCC 7 (broken in 0b10a73d4993).
|
H A D | nxt_application.h | diff 615:38d50cba8f00 Thu Apr 05 14:19:00 UTC 2018 Max Romanov <max.romanov@nginx.com> Stopping timed out application process.
|
H A D | nxt_http_variables.c | diff 2110:048281cd3d73 Thu May 26 12:38:00 UTC 2022 Alejandro Colomar <alx.manpages@gmail.com> Var: Added $request_uri (as in NGINX).
This supports a new variable $request_uri that contains the path and the query (See RFC 3986, section 3). Its contents are percent encoded. This is useful for example to redirect HTTP to HTTPS:
{ "return": "301", "location": "https://$host$request_uri" }
When <http://example.com/foo%23bar?baz> is requested, the server redirects to <https://example.com/foo%23bar?baz>.
===
Testing:
//diff --git a/src/nxt_http_return.c b/src/nxt_http_return.c //index 82c9156..adeb3a1 100644 //--- a/src/nxt_http_return.c //+++ b/src/nxt_http_return.c //@@ -196,6 +196,7 @@ nxt_http_return_send_ready(nxt_task_t *task, void *obj, void *data) // field->value = ctx->encoded.start; // field->value_length = ctx->encoded.length; // } //+ fprintf(stderr, "ALX: target[%1$i]: <%2$.*1$s>\n", (int)r->target.length, r->target.start); // // r->state = &nxt_http_return_send_state; //
{ "listeners": { "*:81": { "pass": "routes/ru" } },
"routes": { "ru": [{ "action": { "return": 301, "location": "$request_uri" } }] } }
$ curl -i http://localhost:81/*foo%2Abar?baz#arg HTTP/1.1 301 Moved Permanently Location: /*foo%2Abar?baz Server: Unit/1.27.0 Date: Mon, 30 May 2022 16:04:30 GMT Content-Length: 0
$ sudo cat /usr/local/unit.log | grep ALX ALX: target[15]: </*foo%2Abar?baz>
|
H A D | nxt_h1proto.c | diff 626:210b94412f8d Tue Apr 10 16:38:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Added "408 Request Timeout" error response. diff 625:f6db55355ece Tue Apr 10 16:38:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Refactored HTTP header parsing.
|