Commit Graph

985 Commits

Author SHA1 Message Date
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
Naïm Favier
94197f9339
Merge pull request #207725 from SuperSandro2000/nixos-nginx 2023-01-14 10:45:32 +01:00
github-actions[bot]
49722fd14a
Merge master into staging-next 2023-01-13 18:01:34 +00:00
pennae
53fc887582 nixos/manual: move "edit the MD file" comments to generated XML 2023-01-10 12:34:37 +01:00
pennae
bf92eaebe4 nixos/manual: generate module chapters with md-to-db.sh 2023-01-10 10:32:00 +01:00
pennae
23ea73b416 nixos/manual: enable smart quotes for all MD chapters 2023-01-10 10:31:59 +01:00
pennae
8a86d1f759 nixos/garage: convert manual chapter to MD 2023-01-10 10:31:59 +01:00
pennae
22144ba269 nixos/manual: normalize <package> -> <literal>
markdown can only do <literal>, so normalize to that. without
auto-linking to a package index the distinction is not very useful anyway.
2023-01-10 10:31:52 +01:00
pennae
0715ecf936 nixos/manual: normalize <programlisting>
makes sure that program listing tags are separated from their contents
by exactly a newline character. this makes the markdown translation
easier to verify (since no new newlines need to be inserted), and
there's no rendering difference anyway.
2023-01-10 10:31:52 +01:00
Sandro Jäckel
b973513d04
nixos/nginx: cleanup, remove old todo 2023-01-09 22:04:06 +01:00
github-actions[bot]
e859576396
Merge staging-next into staging 2023-01-04 00:03:20 +00:00
Kevin Cox
c930fd9517
Merge pull request #207874 from kevincox/nginx-unique
nixos/nginx: Deduplicate modules.
2023-01-03 13:07:43 -05:00
Jan Tojnar
5810109b42 Merge branch 'staging-next' into staging
- readline6 attribute removed from all-packages.nix in d879125d61
- readline attribute was bumped to readline82 in 50adabdd60
2023-01-02 03:04:32 +01:00
Raito Bezarius
1db2175e7a nixos/garage: provide multiple versions to provide an upgrade path when using NixOS service
- Add mention to release notes 23.05
- Introduce Garage v0.8
- Protect against unexpected upgrade with stateVersion
- Test matrix over 0.7 × 0.8
2022-12-30 15:12:44 +01:00
Izorkin
4a7d0140a0
nixos/nginx: add recommended brotli settings 2022-12-29 18:14:35 +03:00
Kevin Cox
487b51e77c
nixos/nginx: Deduplicate modules.
In most places in NixOS defining an option multiple places just merges the result together. This is particularly useful if you have two modules that both need an option, you don't want to have problems when they both set it. This makes the nginx `additionalModules` option follow this pattern.
2022-12-26 15:47:51 -05:00
Jan Tojnar
72c37eddec Merge branch 'staging-next' into staging 2022-12-25 01:30:47 +01:00
Jörg Thalheim
7ef58bce9d nixos/nginx: disable configuration validation for now
There still seem a lot of breakages not addressed yet:

https://github.com/NixOS/nixpkgs/pull/205561
2022-12-24 09:25:43 +01:00
Guillaume Girol
92dbac3199
Merge pull request #205561 from symphorien/nginx-conf-validate
nixos/nginx: validate config at build time
2022-12-19 19:52:33 +00:00
github-actions[bot]
dc7ebb0163
Merge staging-next into staging 2022-12-18 18:01:41 +00:00
Valentin Gagarin
f782da699e
Merge pull request #206646 from figsoda/typos 2022-12-18 18:27:57 +01:00
Vincent Bernat
fc39b5ecc8 nginx: make global redirect vhost option accept exceptions
By moving the return into a location directive, one can provide
exceptions by adding locations. This is similar to what the forceSSL
option does.
2022-12-18 12:21:27 +01:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Guillaume Girol
a768871934 nixos/nginx: validate syntax of config file at build time
Shamelessly stolen from nixcloud-webservices:
https://github.com/nixcloud/nixcloud-webservices/blob/master/modules/web/webserver/lib/nginx_check_config.nix

The nixos test testing the behavior of nginx in case of faulty config
would not build with this change (on purpose), so I modified it so that
the failure is not syntactic.
2022-12-10 23:04:57 +01:00
Robert Hensing
16f5747575
Merge pull request #175649 from Artturin/opt-in-structured-attrs
stdenv: support opt-in __structuredAttrs
2022-12-10 21:12:43 +01:00
Artturin
c01f509e44 treewide: source .attrs in builders
if theres a source $stdenv then this is needed

for structuredAttrs
2022-12-08 21:09:02 +02:00
Naïm Favier
0ff3b35356 nixos/doc: fix some options 2022-12-08 17:52:52 +01:00
Daniel Nagy
ad866e565d
treewide: switch to port type for nixos modules 2022-12-08 00:00:00 +01:00
Alexander Bantyev
df85dda331
Merge pull request #198314 from Izorkin/update-nginx-cache
nixos/nginx: add proxyCache options
2022-11-27 18:51:09 +04:00
Pierre Bourdon
4ac2dbfec5
Merge pull request #201329 from jqqqqqqqqqq/master
nixos/nginx: fix default listen port options
2022-11-15 17:57:51 +01:00
Curtis Jiang
f7bed8cd44 nixos/nginx: fix default listen port options 2022-11-15 15:11:52 +00:00
Franz Pletz
f0609d6c05
Merge pull request #198529 from jqqqqqqqqqq/master 2022-11-15 04:58:47 +01:00
Curtis Jiang
81cd6b06f9 nixos/nginx: add default listen port options 2022-11-15 02:00:03 +00:00
Bryan Richter
e3fc19b301
nixos/nginx: docs: Update formatting
* Capitalize ACME
* Use bold instead of ALL CAPS
* Tweak sentence structure
2022-11-14 12:24:17 +02:00
Bryan Richter
fd9eed5bf3
nixos/nginx: Extend acmeFallbackHost documentation
This extra example would have saved me a lot of uncertainty and doubt.
2022-11-14 11:54:33 +02:00
Pol Dellaiera
364a7d2920
php: switch to nts by default 2022-11-13 11:47:27 +01:00
Izorkin
c09fd120cc
nixos/nginx: add proxyCache options 2022-11-01 10:07:38 +03:00
Francesco Gazzetta
b43605fb03 nixos/merecat: init 2022-10-31 09:24:28 +01:00
Sandro
8f0c7e38cb
Merge pull request #190181 from RaitoBezarius/garage-module
services/garage: init
2022-10-27 02:14:01 +02:00
Raito Bezarius
9b7dc6cb1c services/garage: init 2022-10-23 18:54:18 +02:00
happysalada
fdfdc5df21 caddy: module: rmem_max default 2022-10-22 07:55:53 -04:00
Sandro
67e4972c5d
Merge pull request #195745 from virusdave/patch-1 2022-10-22 00:00:52 +02:00
Jonas Heinrich
c54a28030f nixos/httpd: Make option adminAddr optional 2022-10-21 09:12:25 -04:00
Dave Nicponski
1a73877305 Tweak nginx config for Let's Encrypt ACME challenges
Currently, this is using a "URI prefix match", but per nginx docs,

```
[...] the location with the longest matching prefix is selected and remembered. Then regular expressions are checked, in the order of their appearance in the configuration file. The search of regular expressions terminates on the first match, and the corresponding configuration is used. If no match with a regular expression is found then the configuration of the prefix location remembered earlier is used.
```
which means a config like this (from wordpress service) will override that
```
locations = {
          "~ /\\." = {
            priority = 800;
            extraConfig = "deny all;";
          };
};
```
😱
Luckily, from nginx docs:
```
If the longest matching prefix location has the “^~” modifier then regular expressions are not checked.
```

Whew!
2022-10-20 10:59:28 -04:00
David Warde-Farley
a81954b818 Fix docs. 2022-09-28 10:48:10 -04:00
David Warde-Farley
c3e75d4931 Use null instead of empty string.
Per @aanderse in 7556fd7.
2022-09-28 10:48:10 -04:00
David Warde-Farley
0d5a365f61 caddy: Omit --adapter from invocations if empty string supplied
This allows specifying configuration in the natively processed Caddy JSON format.

Fixes #153142.
2022-09-28 10:48:10 -04:00
pennae
1d41cff3dc nixos/*: convert straggler options to MD 2022-08-31 17:27:38 +02:00
pennae
f2ea09ecbe nixos/*: convert options with listings
minor rendering changes.
2022-08-31 17:27:36 +02:00
pennae
722b99bc0e nixos/*: convert options with admonitions to MD
rendering changes only slightly, most changes are in spacing.
2022-08-31 16:36:16 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
c915b915b5 nixos/*: md-convert options with unordered lists
mostly no rendering changes. some lists (like simplelist) don't have an
exact translation to markdown, so we use a comma-separated list of
literals instead.
2022-08-31 16:32:53 +02:00
pennae
51a11254a7 nixos/*: literalDocBook -> literalMD
no change to rendered output
2022-08-27 19:18:29 +02:00
Bernardo Meurer
d05ae63d23
Merge pull request #179155 from linj-fork/caddy-improve-security
nixos/caddy: improve security about acme certs
2022-08-25 10:36:10 -03:00
pennae
6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
pennae
7e7d68a250 nixos/*: mark pre-existing markdown descriptions as mdDoc 2022-08-19 22:40:58 +02:00
pennae
b51f8036c2 nixos/*: use properly indented strings for option docs
using regular strings works well for docbook because docbook is not as
whitespace-sensitive as markdown. markdown would render all of these as
code blocks when given the chance.
2022-08-19 22:40:58 +02:00
pennae
72b507d5a2 nixos/*: convert some markdown in docbook to tags
a lot of markdown syntax has already snuck into option docs, many of it
predating the intent to migrate to markdown. we don't convert all of it
here, just that which is accompanied by docbook tags as well. the rest
can be converted by simply adding the mdDoc marker.
2022-08-19 22:40:58 +02:00
Pascal Bach
b6ab2508f5
Merge pull request #187299 from superherointj/nixos-modules-minio-fix-network-issue
nixos/minio: fix startup issue
2022-08-18 21:46:43 +02:00
superherointj
89f527384b nixos/minio: fix startup issue 2022-08-18 11:52:29 -03:00
ckie
30ad2e1c12
Merge pull request #162484 from jappeace/keter-module
nixos/keter: init at 2.0.1
2022-08-18 15:44:05 +03:00
Jappie Klooster
a4d72ad628
nixos/keter: init
Enable keter module

Keter is an apploader which:
1. has the old app running on a port.
2. loads a new one, and wait for that to complete
3. switches the old with the new one once the new one finished loading.

It supports more functionality but this use case
is the primary one being used by supercede.

Adds keter as a module to nixos.
Currently keter is unusable with nix,
because it relies on bundeling of a tar and uploading that to a specific folder.
These expressions automate these devops tasks,
with especially nixops in mind.
This will work with versions above 1.8

The test seems to work.
This uses a new version of keter which has good
support for status code on error pages.
We're using this config at production at supercede
so it should be fine.

Squash log:
==========

mention keter in changelog

Update generated release notes

Always restart keter on failure

This is a little bit of extra stability in case keter crashes.
Which can happen under extreme conditions (DoS attacks).

Update nixos/doc/manual/release-notes/rl-2205.section.md

Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com>

Update nixos/modules/module-list.nix

Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com>

Remove sanitization

don't put domain in as a string

Update nixos/tests/keter.nix

Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com>

add jappie as module maintainer

Use type path instead of two seperate options

Fix generated docs

added test machinery to figure out why it's failing

Fix the test, use console output

run nixpkgs-fmt on all modules

Inline config file.

This get's rid of a lot of inderection as well.

Run nix format

remove comment

simplify executable for test

delete config file

add config for keter root

Remove after redis clause

set keter root by default to /var/lib/keter

Update nixos/modules/services/web-servers/keter/default.nix

Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com>

Update nixos/modules/services/web-servers/keter/default.nix

Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com>

Update nixos/modules/services/web-servers/keter/default.nix

Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com>

fix nit

add newlines

add default text and move description in a long description

Delete rather obvious comment

fix release db thing

remove longDescription and put it in a comment instead

change description of mkEnalbeOption

explain what keter does by using the hackage synopsis

set domain to keterDomain and same for executable

move comment to where it's happening

fix type error

add formatting better comment

try add seperate user for keter

Revert "try add seperate user for keter"

This reverts commit d3522d36c96117335bfa072e6f453406c244e940.

Doing this breaks the setup

set default to avoid needing cap_net_bind_service

remove weird comment

use example fields

eleborated on process leakage

Update nixos/modules/services/web-servers/keter/default.nix

Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com>

run nixpkgs-fmt

update docs

Fix formatting, set keter package by default

format our little nixexpr

replace '' -> " where possible

drop indent for multiline string

make description much shorter

regen docs database
2022-08-18 15:29:47 +03:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
pennae
423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae
3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +02:00
pennae
9c8531c8a5 nixos/*: replace <replaceable>s with «thing»
we can't embed syntactic annotations of this kind in markdown code
blocks without yet another extension. replaceable is rare enough to make
this not much worth it, so we'll go with «thing» instead. the module
system already uses this format for its placeholder names in attrsOf
paths.
2022-08-03 21:08:58 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Winter
c4665307de
Merge pull request #180148 from Luflosi/nginx-fix-listenAddresses-example
nixos/nginx: fix broken listenAddresses example
2022-07-25 17:47:00 -04:00
Luflosi
320e4dbcc3
nixos/nginx: fix broken listenAddresses example
When using the example without the square brackets, nginx fails to start:
```
nginx-pre-start: nginx: [emerg] invalid port in "::1:80" of the "listen" directive in /nix/store/xyz-nginx.conf:29
nginx-pre-start: nginx: configuration file /nix/store/xyz-nginx.conf test failed
```
2022-07-04 19:46:18 +02:00
Lin Jian
d1b90cf540
nixos/caddy: force caddy to reload config in ExecReload
This patch follows an upstream commit[1].

Before this patch, if acme module is used, caddy will still use an old
cert even a new one is available. The cause is that without --force
flag, caddy will not reload an unchanged config.

Refer to that commit[1] message for more information.

[1]: 979e498d6d
2022-06-29 10:36:24 +08:00
Lin Jian
f7baa65db7
nixos/caddy: improve security about acme certs
Before this patch, the caddy process has acme in its supplementary
group because of the SupplementaryGroups in its service config, which
may give it more permission than needed, is inconsistent with the
documentation of services.caddy.virtualHosts.<name>.useACMEHost and is
redundant since we have mkCertOwnershipAssertion in assertions.

This patch fixes these problems by defaulting the group of needed
certs to caddy, which is what other web servers like nginx do and
deleting SupplementaryGroups config.
2022-06-29 05:41:13 +08:00
Winter
6c53004840 nixos/nginx: allow recommended proxy settings to be enabled per location 2022-06-12 19:52:35 -04:00
ajs124
30186896ee nixos/nginx: fix SystemCallFilter for openresty 2022-05-30 11:58:28 +02:00
Madoura
b18031c413
treewide/meta: Remove chiiruno and replace with Madouura (#169096)
* maintainers: remove chiiruno

* nixos/zeronet.nix: replace chiiruno with Madouura

* nixos/hydron: replace chiiruno with Madouura

* nixos/tests/bcachefs: replace chiiruno with Madouura

* lutris: replace chiiruno with Madouura

* qtchan: replace chiiruno with Madouura

* tinygo: replace chiiruno with Madouura

* vlang: replace chiiruno with Madouura

* merkletools: replace chiiruno with Madouura

* easyjson: replace chiiruno with Madouura

* quicktemplate: replace chiiruno with Madouura

* statik: replace chiiruno with Madouura

* dumb: replace chiiruno with Madouura

* sndio: replace chiiruno with Madouura

* hydron: replace chiiruno with Madouura

* edid-decode-unstable: replace chiiruno with Madouura

* tewisay: replace chiiruno with Madouura

* svt-av1: replace chiiruno with Madouura
2022-04-18 02:13:36 +03:00
Izorkin
e87240e216 nixos/nginx: add extraParameters to http3 protocol 2022-04-11 22:33:12 +02:00
Izorkin
c508da303b nixos/nginx: add reuseport option 2022-04-11 22:33:12 +02:00
Izorkin
660a36f173 nixos/nginx: fix http3 configuration 2022-04-11 22:33:12 +02:00
Dominique Martinet
b0a04e4105 nginx/logrotate: run logrotate as nginx user 2022-04-01 07:09:27 +09:00
Dominique Martinet
e92c05349c nixos/logrotate: convert to freeform
using freeform is the new standard way of using modules and should replace
extraConfig.
In particular, this will allow us to place a condition on mails
2022-04-01 07:09:26 +09:00
Sander van der Burg
43543a6bbc
Merge pull request #163716 from svanderburg/fixtomcat
nixos/tomcat: configure default group and fix broken default package …
2022-03-13 21:43:45 +01:00
Sander van der Burg
d12186a601 nixos/tomcat: configure default group and fix broken default package reference
Without this fix, evaluating a NixOS configuration with Tomcat enabled and the
default settings results in the following evaluation error:

Failed assertions:
- users.users.tomcat.group is unset. This used to default to
nogroup, but this is unsafe. For example you can create a group
for this user with:
users.users.tomcat.group = "tomcat";
users.groups.tomcat = {};
2022-03-13 14:00:09 +01:00
Luke Granger-Brown
3004e58f6a nixos/pomerium: avoid blocking when renewing ACME certificates 2022-03-11 14:09:19 +00:00
Izorkin
b672e4dd2c
nginxModules: add option disableIPC
The disableIPC option is required to checking enabled nginxModules
and disable the SystemCallFilter IPC filter.
2022-03-08 14:37:11 +03:00
Janne Heß
e5823f77b3
Merge pull request #159187 from martinetd/logrotate
logrotate service enhancements
2022-02-23 11:24:17 +01:00
Sandro
5a57844cf6
Merge pull request #158592 from SuperSandro2000/nginx-nixos 2022-02-20 16:32:09 +01:00
Sandro
a6d259faf3
Merge pull request #141650 from 06kellyjac/agate 2022-02-16 00:56:27 +01:00
Dominique Martinet
c7618fbd9b nginx: add logrotate rule for nginx logs 2022-02-11 21:07:37 +09:00
ajs124
3ecddf791d nixos/shellinabox: drop 2022-02-08 18:59:47 -05:00
Sandro Jäckel
ae66e2d5ec
treewide: use configured nginx package 2022-02-08 12:13:30 +01:00
06kellyjac
0a6d22c6c3 nixos/agate: init 2022-02-07 16:03:44 +00:00
Jörg Thalheim
fd382c011a
Merge branch 'master' into nginx 2022-01-31 05:44:42 +01:00
Jörg Thalheim
26ea046ed7
Update nixos/modules/services/web-servers/nginx/default.nix 2022-01-31 05:43:53 +01:00
Daniel Olsen
ab7e6995ac nixos/nginx: Add defaultListenAddresses option
Lets you specify the default listen address if none are listed in the vhost configuration.

Useful for hosts with more than one ip
2022-01-24 02:20:30 +01:00
Martin Weinelt
f0f67400bc
Merge pull request #153942 from winterqt/acme-web-server-ownership-assertions 2022-01-11 15:03:43 +01:00
Nikolay Amiantov
e8daaa85d4
Merge pull request #153589 from abbradar/uwsgi-fixes
uWSGI configuration generation fixes
2022-01-09 09:49:05 +03:00
Winter
b52607f43b nixos/acme: ensure web servers using certs can access them 2022-01-08 15:05:34 -05:00
Aaron Andersen
45477f7ce5 nixos/caddy: add globalConfig option 2022-01-06 09:25:58 -05:00
Nikolay Amiantov
2be5e93ecc uwsgi service: deduplicate plugins list
Duplicates can lead to unnecessary `uwsgi` rebuilds and conflicts.
2022-01-05 14:18:59 +03:00
Nikolay Amiantov
4be78f0dd3 uwsgi service: redefine PATH envvar
Previously if user had `PATH` variable set we would define several
`PATH` variables and trigger a conflict.
2022-01-05 14:18:59 +03:00
Naïm Favier
ec150abd1a
Revert "nixos/nginx: disable rejectSSL activation when https is disabled"
This reverts commit 2f66ac01e9.
2022-01-02 21:01:29 +01:00
Lucas Savva
377c6bcefc
nixos/acme: Add defaults and inheritDefaults option
Allows configuring many default settings for certificates,
all of which can still be overridden on a per-cert basis.
Some options have been moved into .defaults from security.acme,
namely email, server, validMinDays and renewInterval. These
changes will not break existing configurations thanks to
mkChangedOptionModule.

With this, it is also now possible to configure DNS-01 with
web servers whose virtualHosts utilise enableACME. The only
requirement is you set `acmeRoot = null` for each vhost.

The test suite has been revamped to cover these additions
and also to generally make it easier to maintain. Test config
for apache and nginx has been fully standardised, and it
is now much easier to add a new web server if it follows
the same configuration patterns as those two. I have also
optimised the use of switch-to-configuration which should
speed up testing.
2021-12-26 16:44:10 +00:00
Aaron Andersen
baa0e61569
Merge pull request #147973 from aanderse/nixos/caddy
nixos/caddy: introduce several new options
2021-12-25 17:01:54 -05:00
7c6f434c
b0f154fd44
Merge pull request #147027 from Izorkin/update-nginx-ktls
nginxMainline: enable ktls support
2021-12-24 10:23:17 +00:00
Aaron Andersen
81a67a3353 nixos/caddy: introduce several new options 2021-12-20 20:00:42 -05:00
Graham Christensen
06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
pennae
2d564521c0 treewide: add literalDocBook text to options with complex defaults
some options have default that are best described in prose, such as
defaults that depend on the system stateVersion, defaults that are
derivations specific to the surrounding context, or those where the
expression is much longer and harder to understand than a simple text
snippet.
2021-12-09 01:38:24 +01:00
Sandro
e1f9dbf673
Merge pull request #139815 from ncfavier/fastcgiParams-path 2021-12-07 20:38:55 +01:00