Home
last modified time | relevance | path

Searched hist:38 (Results 1 – 25 of 56) sorted by path

123

/unit/
H A DREADME.mddiff 2298:38a2e5c452b2 Thu Jan 12 16:47:00 UTC 2023 Artem Konev <artem.konev@nginx.com> Fixed the Slack workspace link.
/unit/auto/
H A Dmakediff 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 Doptionsdiff 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/auto/modules/
H A Dnodejsdiff 2651:fa2780144e8f Tue Nov 07 19:38:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Node.js: Build/install fix

A user on GitHub reported an issue when trying to build/install the
nodejs language module.

Doing a

$ ./configure nodejs --node=/usr/bin/node --npm=/usr/bin/npm --node-gyp=/usr/bin/node-gyp
$ make install

was throwing the following error

mv build/src//usr/bin/node/unit-http-g/unit-http-1.31.1.tgz build//usr/bin/node-unit-http-g.tar.gz
mv: cannot move 'build/src//usr/bin/node/unit-http-g/unit-http-1.31.1.tgz' to 'build//usr/bin/node-unit-http-g.tar.gz': No such file or directory
make: *** [build/Makefile:2061: build//usr/bin/node-unit-http-g.tar.gz] Error 1

The fact that we're using the path given by --node= to then use as
directory locations seems erroneous.

But rather than risk breaking existing expectations the simple fix is to
just use build/src in the destination path above to match that of the
source.

These paths were added in some previous commits, and the missing 'src/'
component looks like an oversight.

After this commit both the following work

$ ./configure nodejs --node-gyp=/usr/lib/node_modules/bin/node-gyp-bin/node-gyp --local=/opt/unit/node
$ ./configure nodejs --node=/usr/bin/node --node-gyp=/usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp --local=/opt/unit/node

Reported-by: ruspaul013 <https://github.com/ruspaul013>
Tested-by: ruspaul013 <https://github.com/ruspaul013>
Fixes: 0ee8de554 ("Fixed Makefile target for NodeJS.")
Fixes: c84948386 ("Node.js: fixing module global installation.")
Reviewed-by: Timo Stark <t.stark@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 806:6b647daed063 Thu Oct 18 10:38:00 UTC 2018 Alexander Borisov <alexander.borisov@nginx.com> Fixed Makefile target for NodeJS.
H A Dphpdiff 1376:2ecb15904ba5 Tue Mar 03 14:38:00 UTC 2020 Tiago Natel de Moura <t.nateldemoura@f5.com> PHP: optimization to avoid surplus chdir(2) calls.

For each request, the worker calls the php_execute_script function
from libphp that changes to the script directory before doing its
work and then restores the process directory before returning. The
chdir(2) calls it performs are unnecessary in Unit design. In simple
benchmarks, profiling shows that the chdir syscall code path (syscall,
FS walk, etc.) is where the CPU spends most of its time.

PHP SAPI semantics requires the script to be run from the script
directory. In Unit's PHP implementation, we have two use cases:

- script
- arbitrary path

The "script" configuration doesn't have much need for a working
directory change: it can be changed once at module initialization.
The module needs to chdir again only if the user's PHP script also
calls chdir to switch to another directory during execution.

If "script" is not used in Unit configuration, we must ensure the
script is run from its directory (thus calling chdir before exec),
but there's no need to restore the working directory later.

Our implementation disables mandatory chdir calls with the SAPI
option SAPI_OPTION_NO_CHDIR, instead calling chdir only when needed.

To detect the user's calls to chdir, a simple "unit" extension is
added that hooks the built-in chdir() PHP call.
/unit/docs/
H A Dchanges.xmldiff 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/pkg/deb/
H A DMakefilediff 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.
H A DMakefile.python36441:2206b023fae3 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: added support for Ubuntu 17.10.
H A DMakefile.wasmdiff 2702:ae8b55fd206b Thu Feb 22 22:12:00 UTC 2024 Konstantin Pavlov <thresh@nginx.com> Packages: Pass CFLAGS to compile wasm modules on all packaging targets

This extends the approach used for debian-based packages in 3f805bc64e28
to rpm as well. Notable change for both deb and rpm packaging is to use
CFLAGS as defined in the build/Makefile, and not pass them from the
environment which might not be there (as is the case for rpm).

While at it, stop passing CFLAGS in the install phase, as it should no
longer invoke builds (see d54af163c46b).

The rpm part was overlooked in 7a6405566c0, since testing was not done
on the platforms where problem manifested itself, notably Amazon Linux
2023 and Fedora 38+.
/unit/pkg/deb/debian.module/
H A Drules-noarch.indiff 442:3f841e1db4a7 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for deb.
H A Drules.indiff 442:3f841e1db4a7 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for deb.
H A Dunit.example-python3.6-config441:2206b023fae3 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: added support for Ubuntu 17.10.
/unit/pkg/deb/debian/
H A Drules.indiff 442:3f841e1db4a7 Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for deb.
/unit/pkg/docker/
H A DMakefilediff 534:51e5b0a89e82 Thu Feb 08 16:38:00 UTC 2018 Andrei Belov <defan@nginx.com> Docker: typo fixed.
/unit/pkg/rpm/
H A DMakefile.wasmdiff 2702:ae8b55fd206b Thu Feb 22 22:12:00 UTC 2024 Konstantin Pavlov <thresh@nginx.com> Packages: Pass CFLAGS to compile wasm modules on all packaging targets

This extends the approach used for debian-based packages in 3f805bc64e28
to rpm as well. Notable change for both deb and rpm packaging is to use
CFLAGS as defined in the build/Makefile, and not pass them from the
environment which might not be there (as is the case for rpm).

While at it, stop passing CFLAGS in the install phase, as it should no
longer invoke builds (see d54af163c46b).

The rpm part was overlooked in 7a6405566c0, since testing was not done
on the platforms where problem manifested itself, notably Amazon Linux
2023 and Fedora 38+.
H A Dunit.module.spec.indiff 443:2b933f0bc77d Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for rpm.
H A Dunit.spec.indiff 443:2b933f0bc77d Thu Dec 28 17:38:00 UTC 2017 Andrei Belov <defan@nginx.com> Packages: hardening flags for rpm.
/unit/src/
H A Dnxt_application.hdiff 615:38d50cba8f00 Thu Apr 05 14:19:00 UTC 2018 Max Romanov <max.romanov@nginx.com> Stopping timed out application process.
H A Dnxt_cert.cdiff 1821:e1b1c9b16820 Wed Mar 24 13:38:00 UTC 2021 Valentin Bartenev <vbart@nginx.com> Certificates: moved SAN processing to a separate function.

No functional changes.
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.
H A Dnxt_controller.cdiff 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.
H A Dnxt_errno.hdiff 1003:a7122e3c6e06 Tue Mar 05 12:38:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Handling ENOBUFS error same was as EAGAIN.

Unlike EAGAIN, ENOBUFS returned on OSX when trying to send many relatively
small (64 bytes) fragments.

Found during investigation of #167 issue on GitHub.
H A Dnxt_h1proto.cdiff 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.
H A Dnxt_http_parse.cdiff 38:c47bca12f947 Tue Apr 25 13:57:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> HTTP parser: fixed minimum length optimization in headers hash.
diff 19:385969e9f503 Tue Mar 07 21:38:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> More optimizations of HTTP parser.

SSE 4.2 code removed, since loop unrolling gives better results.
H A Dnxt_http_variables.cdiff 2591:c31330e61c3f Wed Nov 08 17:38:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Var: simplified length calculation for $status variable.
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 Dnxt_js.cdiff 2657:3dcd52317325 Wed Jan 31 06:38:00 UTC 2024 Zhidao HONG <z.hong@f5.com> NJS: Simplified nxt_js_call()

123