Richard Hansen
09a2f40633
tests: Turn helper function into docker_compose_file
fixture
...
This makes it easier for tests to override the filename.
2023-02-17 02:34:08 -05:00
Richard Hansen
01745a836f
tests: Fix path to ca-root.crt
...
`os.getcwd()` is not guaranteed to always return the `test/`
directory.
2023-02-17 02:34:08 -05:00
Richard Hansen
2115974e93
feat: Add ability to completely override location blocks
...
Co-authored-by: Trent Harvey <trent@harvdog.net>
2023-01-31 04:53:12 -05:00
Nicolas Duchon
8ac8b021b8
Merge pull request #2155 from rhansen/docker-pull
...
chore: Pass `--pull` to `docker build` to get fresh images
2023-01-30 07:57:44 +01:00
Richard Hansen
912a065406
chore: Pass --pull
to docker build
to get fresh images
...
This is a no-op if the images are already up to date, and it prevents
puzzling problems when the images are old.
2023-01-28 18:17:40 -05:00
Richard Hansen
6162427c45
fix: Generate at most one server
directive per container
2023-01-28 18:01:19 -05:00
Vincent Herlemont
07cc80ac6b
feat: Support LOG_FORMAT env variable ( #2151 )
2023-01-27 12:28:40 -05:00
Richard Hansen
8346b68a28
fix: Ignore VIRTUAL_HOST
set to the empty string
...
Fixes #2144
2023-01-23 20:48:16 -05:00
Richard Hansen
f8ae0a4b00
feat: DEFAULT_ROOT=none
disables the default location /
block
2023-01-23 20:47:00 -05:00
Richard Hansen
8fbc8514ef
feat: Unconditionally produce debug comments
...
Rationale for eliminating the check to see if the `DEBUG` environment
variable holds a true value:
* The `DEBUG` environment variable might be set on a container (for
purposes specific to that container, not `nginx-proxy`) to a value
that cannot be parsed as a bool, which would break `nginx-proxy`.
* It simplifies the template.
* It eliminates a cold code path.
* It avoids heisenbugs.
* It makes debugging easier for users.
Also delete the debug info tests, as they are fragile and they provide
limited value.
Alternatively, we could avoid collision with the container's use of
the `DEBUG` environment variable by using a container label [1] such
as `com.google.nginx-proxy.nginx-proxy.debug`. I think doing so has
dubious value, especially if we want to attempt backwards
compatibility with the `DEBUG` environment variable.
Fixes #2139
[1] https://docs.docker.com/engine/reference/commandline/run/#-set-metadata-on-container--l---label---label-file
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2023-01-18 17:27:04 -05:00
Richard Hansen
92e1a6567e
tests: Remove extraction of nginx.tmpl
(now unnecessary)
2023-01-17 18:02:30 -05:00
Richard Hansen
486addd144
tests: Bind-mount the entire nginx-proxy directory in the container
2023-01-17 18:02:30 -05:00
Richard Hansen
569953521a
tests: Exit non-zero if creation of nginx-proxy-tester image fails
2023-01-17 18:02:30 -05:00
Richard Hansen
55cfae9636
tests: Avoid unnecessary bashisms
2023-01-17 18:02:30 -05:00
Richard Hansen
d56b5b370d
tests: Whitespace fixes
2023-01-17 18:02:30 -05:00
Richard Hansen
26b0b05f73
tests: Fix test_debug/*
tests when IPv6 is enabled
2023-01-17 18:02:29 -05:00
dependabot[bot]
9c9545bf7f
chore(deps): bump pytest from 7.2.0 to 7.2.1 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.2.0 to 7.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.2.0...7.2.1 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 04:12:49 +00:00
dependabot[bot]
831615fdd4
chore(deps): bump requests from 2.28.1 to 2.28.2 in /test/requirements
...
Bumps [requests](https://github.com/psf/requests ) from 2.28.1 to 2.28.2.
- [Release notes](https://github.com/psf/requests/releases )
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md )
- [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.28.2 )
---
updated-dependencies:
- dependency-name: requests
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-01-13 04:04:20 +00:00
浊酒
af877cf784
feat: Add proxy header X-Forwarded-Host
...
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2022-12-26 17:59:50 -05:00
Nicolas Duchon
6f4f9ec20c
Merge pull request #1927 from rhansen/untrusted-headers
...
feat: Option to not trust `X-Forwarded-*` headers from clients
2022-12-26 20:47:05 +01:00
Nicolas Duchon
7c0d38cd2e
Merge pull request #1985 from hiqdev/networks-order
...
Make sure networks order is the same
2022-12-26 16:59:41 +01:00
Richard Hansen
8aa00fcea2
feat: Option to not trust X-Forwarded-*
headers from clients
...
If header values from a malicious client are passed to the backend
server unchecked and unchanged, the client may be able to subvert
security checks done by the backend server.
2022-12-19 02:48:01 -05:00
dependabot[bot]
e5b340cb6f
chore(deps): bump docker from 5.0.3 to 6.0.1 in /test/requirements
...
Bumps [docker](https://github.com/docker/docker-py ) from 5.0.3 to 6.0.1.
- [Release notes](https://github.com/docker/docker-py/releases )
- [Commits](https://github.com/docker/docker-py/compare/5.0.3...6.0.1 )
---
updated-dependencies:
- dependency-name: docker
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 14:30:16 +00:00
dependabot[bot]
b53e09373a
chore(deps): bump backoff from 1.11.1 to 2.2.1 in /test/requirements
...
Bumps [backoff](https://github.com/litl/backoff ) from 1.11.1 to 2.2.1.
- [Release notes](https://github.com/litl/backoff/releases )
- [Changelog](https://github.com/litl/backoff/blob/master/CHANGELOG.md )
- [Commits](https://github.com/litl/backoff/compare/v1.11.1...v2.2.1 )
---
updated-dependencies:
- dependency-name: backoff
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 13:02:13 +00:00
dependabot[bot]
302ecfff51
chore(deps): bump requests from 2.27.1 to 2.28.1 in /test/requirements
...
Bumps [requests](https://github.com/psf/requests ) from 2.27.1 to 2.28.1.
- [Release notes](https://github.com/psf/requests/releases )
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md )
- [Commits](https://github.com/psf/requests/compare/v2.27.1...v2.28.1 )
---
updated-dependencies:
- dependency-name: requests
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 12:00:48 +00:00
dependabot[bot]
d23a746833
chore(deps): bump pytest from 7.1.2 to 7.2.0 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.1.2 to 7.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.2...7.2.0 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 04:21:21 +00:00
SilverFire - Dmitry Naumenko
510d376f00
Make sure networks order is the same
2022-05-11 12:56:18 +00:00
dependabot[bot]
20e76ac7a6
chore(deps): bump pytest from 7.1.1 to 7.1.2 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.1...7.1.2 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 04:22:00 +00:00
dependabot[bot]
1cc3bbf5ce
chore(deps): bump pytest from 7.0.1 to 7.1.1 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.0.1 to 7.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.0.1...7.1.1 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 04:16:58 +00:00
Gilles Filippini
5aba125fb7
chore: do not copy useless files into the image
...
Move required files but 'nginx.tmpl' into a local 'app' folder and copy the
folder content into the image.
'nginx.tmpl' should be moved as well, but this is a breaking change for
configuration with a separate 'docker-gen' container.
2022-03-07 16:01:15 +01:00
Nicolas Duchon
0185a2971c
tests: fix virtual path tests for new dhparam
2022-02-24 15:21:14 +01:00
Alexander Lieret
7ede0fa4b9
test: fix: Rename new test files
2022-02-24 15:08:18 +01:00
Alexander Lieret
2509fc1076
test: Add test cases for NETWORK_ACCESS=internal
2022-02-24 15:08:18 +01:00
Alexander Lieret
6a580ad664
test: Add test case for location config priority
2022-02-24 15:08:18 +01:00
Alexander Lieret
4099fcd618
test: Add test case for default app redirect
...
Co-authored-by: Jonathan Underwood <junderwood@bitcoinbank.co.jp>
2022-02-24 15:08:18 +01:00
Alexander Lieret
e08b3487c9
test: Add test to cover SSL of path-based routing
2022-02-24 15:08:18 +01:00
Alexander Lieret
33eab70d32
feat: Add custom location block to virtual paths
...
This features allows the custom location blocks to be added to the
virtual path based routing. The custom config can be specified for each
container individually.
2022-02-24 15:08:17 +01:00
Alexander Lieret
4b85e95824
feat: Replace path stripping with variable
...
This commit removes the automatic path stripping and replaces it with a
user configurable environment variable. This can be set individually for
each container.
2022-02-24 15:08:17 +01:00
Alexander Lieret
9df330e51e
feat: Add user customizable default root response
2022-02-24 15:08:15 +01:00
Alexander Lieret
fc4c4e17ca
ci: Add tests for the virtual-path routing
...
@gregsymons test cases were too outdated to be ported easily. The new
tests should include the coverage of the old ones.
2022-02-24 15:07:02 +01:00
Robin Windey
18027fa71b
Add container logs in case testcontainer exited unexpectedly
2022-02-20 15:10:05 +01:00
dependabot[bot]
42535c01d9
chore(deps): bump pytest from 7.0.0 to 7.0.1 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.0.0...7.0.1 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 04:20:00 +00:00
dependabot[bot]
dc8094daf5
chore(deps): bump pytest from 6.2.5 to 7.0.0 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 6.2.5 to 7.0.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.5...7.0.0 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 04:23:26 +00:00
Nicolas Duchon
e22ae4a6fd
tests: display container version
2022-01-12 10:17:49 +01:00
Nicolas Duchon
fde0e809e4
chore: jwilder/docker-gen > nginx-proxy/docker-gen
2022-01-11 19:55:29 +01:00
Nicolas Duchon
ed7b17d9d7
Merge pull request #1856 from polarathene/tests/fix-container-networking
...
tests: Fix pytest container networking issues
2022-01-06 10:32:40 +01:00
dependabot[bot]
b9ac4b936e
chore(deps): bump requests from 2.26.0 to 2.27.1 in /test/requirements
...
Bumps [requests](https://github.com/psf/requests ) from 2.26.0 to 2.27.1.
- [Release notes](https://github.com/psf/requests/releases )
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md )
- [Commits](https://github.com/psf/requests/compare/v2.26.0...v2.27.1 )
---
updated-dependencies:
- dependency-name: requests
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-06 04:21:32 +00:00
polarathene
6b3ee66783
chore: white-space housekeeping
...
Noticed some trailing white-space. Removed for consistency with the rest of the file.
2022-01-01 01:39:51 +13:00
polarathene
115461744b
fix: Skip IPv6 when forced but not available + avoid none
network
...
A test on raw IP addresses doesn't reach the existing IPv6 skip logic, added that to avoid a test failing when only IPv4 is available (eg: standard docker container networks).
Additionally some other tests set the `none` network and connecting to this fails as it's not allowed? Preventing that from happening resolves the final failing tests within containerized pytest.
2022-01-01 01:38:13 +13:00
polarathene
04b0181980
fix: Ensure networks are actually connected to pytest container
...
The `network` object would never be in a list of network names (strings), and without `greedy=True` arg as the `docker-py` API docs note, the containers will not be part of the results, thus always returning an empty list which was not intended..
Now the network will properly match the current networks for pytest container, avoiding duplicate connect attempts, and the network list result will actually have containers to count when filtering by length.
2021-12-31 22:30:49 +13:00