Commit Graph

891 Commits

Author SHA1 Message Date
Felix Buehler
f3719756b5 treewide: use optionalString instead of 'then ""' 2023-06-24 20:19:19 +02:00
IndeedNotJames
93b9fc8ac0
nixos/caddy: omit empty bind directive when listenAddresses is empty
context: https://caddy.community/t/random-502-errors-when-proxying-to-application-with-self-signed-certificate/19657/6
2023-06-10 13:59:15 +02:00
IndeedNotJames
3f93ec5814
nixos/caddy: change acmeCA default to null
The nixos/caddy module is somewhat old by now
and has undergone quite some refactors.
This specific module option (originally named
`ca`) used to make a bit more sense when
Caddy did not have multiple ACME CAs as
fallback (LE & ZeroSSL) by configured by
default yet (ZeroSSL came with v2.3.0).

I also rephrased the description slightly,
to mention Caddy's automatic issuer fallback
and a note which this option maps to in the
Caddyfile, to provide a bit more context and
a more up-to-date recommendation.

Specifically that "fine-grained configuration"
section comes from a time when this module did
some custom tls/issuer config json merging
with the templated Caddyfile using `jq`.

The "The URL to the ACME CA's directory"
section is a word-for-word copy from the
official Caddy docs, which also include a link
to LE's docs to the referenced staging
endpoint. So I added that as well.
2023-06-10 13:59:10 +02:00
Joe Edmonds
f87892b50b nixos/modules/web-servers/nginx/default.nix: fix minor typo 2023-06-06 21:55:15 -07:00
Sandro
793dd34507
Merge pull request #219602 from 999eagle/traefik-envsubst
nixos/traefik: add environmentFiles option
2023-06-05 00:36:43 +02:00
Linus Heckemann
c4f727c944 nixos/garage: allow unsafe replication modes, restart on config change 2023-06-02 18:11:44 +02:00
Raito Bezarius
69bb0f94de nixos/nginx: first-class PROXY protocol support
PROXY protocol is a convenient way to carry information about the
originating address/port of a TCP connection across multiple layers of
proxies/NAT, etc.

Currently, it is possible to make use of it in NGINX's NixOS module, but
is painful when we want to enable it "globally".
Technically, this is achieved by reworking the defaultListen options and
the objective is to have a coherent way to specify default listeners in
the current API design.
See `mkDefaultListenVhost` and `defaultListen` for the details.

It adds a safeguard against running a NGINX with no HTTP listeners (e.g.
only PROXY listeners) while asking for ACME certificates over HTTP-01.

An interesting usecase of PROXY protocol is to enable seamless IPv4 to
IPv6 proxy with origin IPv4 address for IPv6-only NGINX servers, it is
demonstrated how to achieve this in the tests, using sniproxy.

Finally, the tests covers:

- NGINX `defaultListen` mechanisms are not broken by these changes;
- NGINX PROXY protocol listeners are working in a final usecase
  (sniproxy);
- uses snakeoil TLS certs from ACME setup with wildcard certificates;

In the future, it is desirable to spoof-attack NGINX in this scenario to
ascertain that `set_real_ip_from` and all the layers are working as
intended and preventing any user from setting their origin IP address to
any arbitrary, opening up the NixOS module to bad™ vulnerabilities.

For now, it is quite hard to achieve while being minimalistic about the
tests dependencies.
2023-05-26 19:48:26 +02:00
figsoda
701bcdbead nixos: fix typos 2023-05-19 22:31:04 -04:00
Robert Hensing
25f227fc67
Merge pull request #231316 from hercules-ci/nixos-system.checks
NixOS: add `system.checks`
2023-05-15 23:16:29 +02:00
Izorkin
baa5550162
unit: 1.29.1 -> 1.30.0 2023-05-13 16:55:47 +03:00
Robert Hensing
2e2f0d28ea nixos: Use checks instead of extraDependencies
... as appropriate.

This drops a few unnecessary store paths from the system closure.
2023-05-11 21:18:38 +02:00
Izorkin
2809915f19
nixos/nginx: allow arbitrary parameters in upstream servers
Adds a `freeformType` to `services.nginx.upstreams.<name>.servers` to
allow setting arbitrary parameters.
2023-05-07 11:17:49 +02:00
gaykitty
3056e9c395 nixos/stargazer: remove with lib 2023-04-30 13:05:34 -03:00
gaykitty
d4f3dd4f71 nixos/stargazer: fix route ordering 2023-04-30 13:05:34 -03:00
sandydoo
2086b377cf
nixos/nginx: serve the status page on localhost servers
The status page is inaccessible by default, unless a virtual host is
added with a `server_name` that's not `localhost`.

This commit moves the status page configuration, so that
it's matched before the main server blocks.
2023-04-28 07:20:36 +00:00
Sophie Tauchert
d568766fc7
nixos/traefik: add environmentFiles option 2023-04-25 16:05:28 +02:00
gaykitty
c251c021fe nixos/stargazer: init 2023-04-24 21:52:19 -03:00
Jan Tojnar
e25dc4a95e nixos/nginx: Fix listen string generation
This regressed in 327b0cff7a breaking nixosTests.php, among other things.
2023-04-21 17:18:45 +02:00
Artturi
b83db86a9e
Merge pull request #222080 from Stunkymonkey/nixos-optionalString 2023-04-20 16:07:30 +03:00
K900
c29ccca1a3
Merge pull request #222923 from oddlama/fix-nginx-duplicate-mime
nixos/nginx: fix warning about duplicate mime entry
2023-04-09 14:58:39 +03:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Vladimir Serov
0ff543e311
nixos/garage: fix links to config reference 2023-04-06 13:40:38 +04:00
Franz Pletz
0e950a1ec7
Merge pull request #223085 from Izorkin/update-nginx-proxy-cache
nixos/nginx: enable multiple proxyCachePath support
2023-04-06 02:52:44 +02:00
Sandro
44bdb9ce9f
Merge pull request #223091 from Izorkin/update-nginx-compression 2023-04-02 00:32:47 +02:00
Izorkin
427ae14373
nixos/nginx: update description in compression modules 2023-04-01 13:56:26 +03:00
Izorkin
8a289bcc79
nixos/nginx: enable multiple proxyCachePath support 2023-04-01 13:55:56 +03:00
Izorkin
77d6fd36cf
nixos/nginx: update quic configuration 2023-04-01 13:09:49 +03:00
Ryan Lahfa
6fcf40805a
Merge pull request #223439 from mjlbach/fix/garage
garage: fix missing stateVersion and default pkg
2023-03-28 00:26:47 +02:00
Michael Lingelbach
e6854e7d3a garage: fix missing stateVersion and default pkg
* stateVersion was not in scope, added config.system.systemVersion
* garage_0_8_0 -> garage_0_8, the former does not exist
2023-03-27 13:18:33 -07:00
06kellyjac
9b60eef4bd authelia: move module under security and minor fixes
Fixed test access to lib
Added nixos test to passthru
2023-03-27 12:00:07 +01:00
06kellyjac
6373a3966b nixos/authelia: init module
Co-authored-by: Martin Weinelt <hexa@darmstadt.ccc.de>
2023-03-24 21:23:41 -03:00
oddlama
ba0a1611fc
nixos/nginx: fix warning about duplicate mime entry 2023-03-24 19:44:00 +01:00
Sandro
995f9d1c95
Merge pull request #213874 from SuperSandro2000/nginx-zstd
nixos/nginx: add recommendedZstdSettings
2023-03-23 14:11:35 +01:00
John Soo
740fea3edd
fixup! nixos/minio: activate/restart service on credentials path changes 2023-03-16 09:45:09 -07:00
John Soo
e30469a37b
nixos/minio: activate/restart service on credentials path changes
Otherwise the `minio.service` service will fail either:

* with a message that the EnvironmentFile does not exist
* or silently with potentially stale credentials
2023-03-13 17:43:19 -07:00
John Soo
7f85002ec0
nixos/minio: format with nixpkgs-fmt 2023-03-13 17:36:52 -07:00
Izorkin
5eb5d881a4
nixos/nginx: add defaultMimeTypes option 2023-03-07 19:37:18 +03:00
Sandro Jäckel
5e5a84b193
nixos/nginx: add recommendedZstdSettings 2023-02-22 13:59:53 +01:00
IndeedNotJames
f5a06f7150
nixos/caddy: fix caddy fmt for caddy v2.6.3
The nixos module uses `caddy fmt` to *format* the generated Caddyfile.
v2.6.3 slightly altered `caddy fmt`'s behavior.

Excerpt from https://github.com/caddyserver/caddy/releases/tag/v2.6.3
> cmd: caddy fmt return code is 1 if not formatted
> cmd: fmt exit successfully after overwriting config file

Which is why the internal `Caddyfile-formatted` now uses `cp` and `caddy fmt --overwrite` instead
2023-02-09 03:36:10 +01:00
Sandro
6cdec6d1b8
nixos/nginx: add comment about clearing Connection header (#214211) 2023-02-06 23:37:38 +01:00
Nick Cao
4840ca34f4
Merge pull request #213626 from jamesreprise/entries-typo
nginx: fix typo in commonHttpConfig
2023-02-02 09:12:32 +08:00
Sandro
600adcfdcc
Merge pull request #187994 from Izorkin/update-nginx-gzip 2023-01-31 20:41:59 +01:00
Izorkin
d178a1d7a1
nixos/nginx: update recommended brotli settings 2023-01-30 23:13:12 +03:00
Izorkin
ee7e096c48
nixos/nginx: update recommended gzip settings 2023-01-30 23:03:01 +03:00
Sandro Jäckel
2d3efd3301
nixos/nginx: clear clients Connection headers 2023-01-30 20:25:22 +01:00
James Williams
18ab2268cd
fix: typo (enries -> entries) 2023-01-30 19:08:30 +00:00
pennae
0a6e6cf7e6 nixos/manual: render module chapters with nixos-render-docs
this converts meta.doc into an md pointer, not an xml pointer. since we
no longer need xml for manual chapters we can also remove support for
manual chapters from md-to-db.sh

since pandoc converts smart quotes to docbook quote elements and our
nixos-render-docs does not we lose this distinction in the rendered
output. that's probably not that bad, our stylesheet didn't make use of
this anyway (and pre-23.05 versions of the chapters didn't use quote
elements either).

also updates the nixpkgs manual to clarify that option docs support all
extensions (although it doesn't support headings at all, so heading
anchors don't work by extension).
2023-01-27 20:07:34 +01:00
Guillaume Girol
cb73862665 Revert "nixos/nginx: validate syntax of config file at build time"
This reverts commit a768871934.

This is too fragile, it breaks at least on:
* ssl dh params
* hostnames in proxypass and upstreams are resolved in the sandbox
2023-01-20 20:10:19 +01:00
Guillaume Girol
ecb06398e7 Revert "nixos/nginx: disable configuration validation for now"
This reverts commit 7ef58bce9d.
2023-01-20 20:07:47 +01:00
github-actions[bot]
79cb2f7e61
Merge master into staging-next 2023-01-14 11:12:34 +00:00