Commit Graph

182 Commits

Author SHA1 Message Date
Adrian Pistol
1916a0cb9e syslogng: clean up build 2023-10-18 17:51:04 +02:00
Philippe Hürlimann
7ae1eab886 ulogd: add support for multiple logging stacks
fixes #244469
2023-09-18 00:16:54 +02:00
ajs124
6de832b0e5 nixos/logrotate: add extraArgs option 2023-09-05 16:04:07 +02:00
Isa
bd50b5fcf5 graylog-5_1: init at 5.1.4 2023-08-07 19:49:48 +02:00
K900
d5c292af6b
Merge pull request #197524 from f2k1de/graylog4
graylog: init at 4.0.8, 4.3.9, 5.0.2
2023-05-15 19:42:04 +03:00
Isa
c7629a78b7 graylog: let the user decide which version of graylog to use 2023-05-12 20:43:03 +02:00
Kai Norman Clasen
8989ea2778 nixos/vector: add package Option 2023-05-11 19:44:50 +02:00
happysalada
2909d9b117 vector: 0.28.1 -> 0.29.1 2023-04-28 18:58:41 -04:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Bruno Bigras
022436c47b nixos/logrotate: fix typo 2023-03-23 16:09:47 -04:00
Philippe Hürlimann
bcbedfeefc nixos/ulogd: init
Heavily based on original work by xvuko

Co-authored-by: xvuko <nix@vuko.pl>
2022-12-28 00:17:28 +01:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Daniel Nagy
b4674b39c1
treewide: use mkEnableOption in nixos modules 2022-11-10 09:30:00 +01:00
Dominique Martinet
665d896244 logrotate: add services.logrotate.settings example 2022-11-05 10:34:04 +09:00
Dominique Martinet
01ff1dd23f logrotate service: cleanup deprecated options 2022-11-05 10:34:03 +09:00
Yorick van Pelt
af4a43e36a
treewide: convert fake octal ints to strings
These were being cast to strings later and then reinterpreted as
octal.
2022-10-28 17:23:44 +02:00
Sandro Jäckel
4770866f93
nixos/vector: remove no longer required workaround for cross compiling 2022-09-11 17:11:47 +02:00
Sandro Jäckel
08dd3b91ea nixos/vector: fix validation for cross compiling 2022-09-09 11:59:07 -04:00
pennae
f2ea09ecbe nixos/*: convert options with listings
minor rendering changes.
2022-08-31 17:27:36 +02:00
pennae
9547123258 nixos/*: convert internal option descriptions to MD
we'll have to do it eventually, may as well be now.
2022-08-31 16:32:54 +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
1013069f52 nixos/*: convert more partially-md option descriptions
this mostly means marking options that use markdown already
appropriately and making a few adjustments so they still render
correctly. notable for nftables we have to transform the md links
because the manpage would not render them correctly otherwise.
2022-08-31 16:32:14 +02:00
pennae
7d102d113a nixos/*: convert multiline inline code to listings
presumably it was not intended to have these blocks rendered inline, and
markdown conversion would be messy as well.
2022-08-31 16:27:25 +02:00
pennae
7e7d68a250 nixos/*: mark pre-existing markdown descriptions as mdDoc 2022-08-19 22:40:58 +02: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
61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +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
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
Joachim F
0640ef2ccc
Merge pull request #180231 from dfithian/heartbeat
heartbeat service: specify package
2022-07-18 20:56:08 +02:00
Dan Fithian
49a5377557 heartbeat service: specify package
Other elastic services can specify the package. Now we can also do it for heartbeat.
2022-07-18 14:39:22 -04:00
Dominique Martinet
fd701a9cd1 logrotate: fix config check without sandbox
make logrotate not try to write to /var/lib/logrotate.status by
using an alternate path.

Also avoid /tmp and use build CWD

Fixes #180734
2022-07-09 09:55:03 +09:00
Dominique Martinet
f878c8994f logrotate: do not add mail if 'mail = false' is specified
Reported-by: Ricardo M. Correia <rcorreia@wizy.org>
2022-06-13 08:57:49 +09:00
ajs124
5bb61d6a25 syslogng_incubator: remove after being marked broken for over 18 months
It was marked in commit 6d797c8462 by Jörg Thalheim on 2018-08-27 (commited on 2018-08-27)
2022-06-02 18:03:52 +02:00
Janne Heß
57cd07f3a9
treewide: pkgs.systemd -> config.systemd.package
This ensures there is only one systemd package when e.g. testing the
next systemd version.
2022-05-05 20:00:31 +02:00
Nick Cao
70d0e24568 nixos/logrotate: use packages from buildPackages in configuration checkPhase, fixing cross compilation 2022-04-16 10:22:39 +02:00
Alyssa Ross
c099ec6aff nixos/klogd: remove
This module only has an effect for ancient kernel versions we don't
support.
2022-04-08 09:56:09 +00:00
Dominique Martinet
829c611b48 logrotate: add logrotate-checkconf.service
the build-time check is not safe (e.g. doesn't protect from bad users or nomissingok
paths missing), so add a new unit for configuration switch time check
2022-04-01 07:09:27 +09:00
Dominique Martinet
45ef5c1741 logrotate: add configuration check at build time
Now the service no longer starts immediately,
check if the config we generated makes sense as soon as possible.

The check isn't perfect because logrotate --debug wants to check
users required, there are two problems:
 - /etc/passwd and /etc/group are sandboxed and we don't have
visibility of system users
 - the check phase runs as nixbld which cannot su to other users
and logrotate fails on this

Until these two problems can be addressed, users-related checks
are filtered out, it's still much better than no check.
The check can be disabled with services.logrotate.checkConfig
if required
(bird also has a preCheck param, to prepare the environment
before check, but we can add it if it becomes necessary)

Since this makes for very verbose builds, we only show errors:
There is no way to control log level, but logrotate hardcodes
'error:' at common log level, so we can use grep, taking care
to keep error codes

Some manual tests:
───────┬──────────────────────────────────────────
       │ File: valid-config.conf
───────┼──────────────────────────────────────────
   1   │ missingok
───────┴──────────────────────────────────────────
logrotate --debug ok
grep ok

───────┬──────────────────────────────────────────
       │ File: postrotate-no-end.conf
───────┼──────────────────────────────────────────
   1   │ missingok
   2   │ /file {
   3   │    postrotate
   4   │      test
   5   │ }
───────┴──────────────────────────────────────────
error: postrotate-no-end.conf:prerotate, postrotate or preremove without endscript

───────┬──────────────────────────────────────────
       │ File: missing-file.conf
───────┼──────────────────────────────────────────
   1   │ "test" { daily }
───────┴──────────────────────────────────────────
error: stat of test failed: No such file or directory

───────┬──────────────────────────────────────────
       │ File: unknown-option.conf
───────┼──────────────────────────────────────────
   1   │ some syntax error
───────┴──────────────────────────────────────────
logrotate --debug ok
error: unknown-option.conf:1 unknown option 'some' -- ignoring line

───────┬──────────────────────────────────────────
       │ File: unknown-user.conf
───────┼──────────────────────────────────────────
   1   │ su notauser notagroup
───────┴──────────────────────────────────────────
error: unknown-user.conf:1 unknown user 'notauser'

In particular note that logrotate would not error on unknown option
(it just ignores the line) but this change makes the check fail.
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
Dominique Martinet
3cc8ea28d1 logrotate: add services.logrotate.configFile escape hatch 2022-04-01 07:09:26 +09:00
Dominique Martinet
3a2fa0d049 logrotate: run through nixpkgs-fmt
Running once now will make further patches formatting easier
2022-04-01 07:09:26 +09:00
Dominique Martinet
b457d917dc logrotate: move mail dependency from package to service
having pkgs.logrotate depend on mailutils brings in quite a bit of dependencies
through mailutil itself and recursive dependency to guile when most people
do not need it.

Remove mailutils dependency from the package, and conditionally add it to the
service if the user specify the mail option either at top level or in a path

Fixes #162001
2022-04-01 07:09:24 +09:00
Pascal VITOUX
045b819959 nixos/graylog: fix group creation
As described in #163571, the graylog group was not created by the
module.
2022-03-14 10:13:15 +01:00
Dominique Martinet
4d12b79cd7 logrotate: do not enable logrotate.service itself
logrotate.timer is enough for rotating logs. Enabling logrotate.service would
make the service start on every configuration switch, leading to tests failure when
logrotate is enabled.

Also update test to make sure the timer is active and runs the service
on date change.
2022-02-26 19:13:12 +09:00
Dominique Martinet
c132bfaa19 logrotate: prepend extraConfig instead of postpending it
logrotate global options only affect rules following them - as such,
services.logrotate.extraConfig being added last makes the option only
useful for adding new paths but not for setting global options (e.g.
'dateext' so all logs are rotate with a date suffix).

Moving this first solves this problem, and we can then use this instead
of default paths config to append missingok/notifempty.
2022-02-11 21:07:37 +09:00
Dominique Martinet
61c70dbc97 logrotate: default to enable if any rule is active 2022-02-11 21:07:37 +09:00
Dominique Martinet
9917af7fe0 logrotate: move wtmp/btmp rules to systemd
wtmp and btmp are created by systemd, so the rules are more appropriate there.

They can be disabled explicitly with something like
  services.ogrotate.paths = {
    "/var/log/btmp".enable = false;
    "/var/log/wtmp".enable = false;
  };
if required.
2022-02-11 20:52:40 +09:00
Linus Heckemann
3e4ce97430 nixos/promtail: use promtail package 2022-01-23 14:01:29 +01:00
Julien Moutinho
f7ff512d6d nixos/logrotate: rotate login/logout logs by default 2021-12-29 02:07:02 +01:00