Commit graph

489 commits

Author SHA1 Message Date
talyz 59e0120aa5
treewide: Fix mysql alias deprecation breakage
62733b37b4 broke evaluation in all
places `pkgs.mysql` was used. Fix this by changing all occurrences to
`pkgs.mariadb`.
2021-06-04 21:42:08 +02:00
Luke Granger-Brown 39e225b0f4 nixos/engelsystem: don't rely on mysql alias
Since 3edde6562e, we can no longer use
aliases inside the test framework. This has the implication that we can
no longer use aliases in any NixOS modules used by the test framework as
well (which is good), but does mean we need to clean up any instances
where this is the case.
2021-06-04 08:43:48 +00:00
Maximilian Bosch cc88797ce0 plausible: minor polishing 2021-06-02 19:21:31 +09:00
Maximilian Bosch 6bc72cdd4a plausiblew: cleanup build & update script 2021-06-02 19:21:31 +09:00
Maximilian Bosch 02b15d0f5b plausible: first review fix iteration
* Most significant is probably the patching necessary to run plausible
  with postgres without superuser privilege. This change includes:
  * updating ecto_sql to 3.6 where `CREATE DATABASE` is only executed if
    it doesn't exist[1].
  * patching a migration to only modify the `users.email` column (to use
    `citext` rather than creating the extension. `plausible-postgres`
    takes care of that).
* Correctly declare dependencies in systemd.
* A few minor fixes.

[1] 051baf669e
2021-06-02 19:21:31 +09:00
Maximilian Bosch b06ea1146c plausible: init at 1.3.0 2021-06-02 19:21:31 +09:00
Johannes Schleifenbaum 878103ce55
nixos/trilium: use boolToString for noBackup 2021-05-30 18:16:13 +02:00
Martin Weinelt ee8cf6a664
Merge pull request #124839 from mweinelt/wordpress/secret-key-regen
nixos/wordpress: regenerate secret keys if misspelled key name is found
2021-05-29 22:13:03 +02:00
Martin Weinelt 724ed08df0
nixos/wordpress: regenerate secret keys if misspelled key name is found
A secret key generated by the nixos module was misspelled, which could
possibly impact the security of session cookies.

To recover from this situation we will wipe all security keys that were
previously generated by the NixOS module, when the misspelled one is
found. This will result in all session cookies being invalidated. This
is confirmed by the wordpress documentation:

> You can change these at any point in time to invalidate all existing
> cookies. This does mean that all users will have to login again.

https://wordpress.org/support/article/editing-wp-config-php/#security-keys

Meanwhile this issue shouldn't be too grave, since the salting function
of wordpress will rely on the concatenation of both the user-provided
and automatically generated values, that are stored in the database.

> Secret keys are located in two places: in the database and in the
> wp-config.php file. The secret key in the database is randomly
> generated and will be appended to the secret keys in wp-config.php.

https://developer.wordpress.org/reference/functions/wp_salt/

Fixes: 2adb03fdae ("nixos/wordpress:
generate secrets locally")

Reported-by: Moritz Hedtke <Moritz.Hedtke@t-online.de>
2021-05-29 04:24:42 +02:00
talyz cb80b67993 nixos/discourse: Assert deployed PostgreSQL version
Assert that the PostgreSQL version being deployed is the one used
upstream. Allow the user to override this assertion, since it's not
always possible or preferable to use the recommended one.
2021-05-28 17:43:02 -07:00
talyz 1f6b48be74 discourse: 2.6.5 -> 2.7.0 2021-05-28 17:43:02 -07:00
FliegendeWurst b9e2b878c5 nixos/trilium-server: noBackup option 2021-05-24 09:55:49 +02:00
FliegendeWurst 7cb492fb13 nixos/trilium-server: add myself as maintainer 2021-05-24 09:55:49 +02:00
Elis Hirwing e9cca93bf9
Merge pull request #121778 from talyz/keycloak-security
nixos/keycloak: Security fixes + misc
2021-05-21 16:55:26 +02:00
Kerstin Humm 224df6940f nixos/mastodon: use rails command instead of rake
Co-Authored-By: Izorkin <izorkin@elven.pw>
2021-05-21 15:04:12 +02:00
talyz ba00b0946e
nixos/keycloak: Split certificatePrivateKeyBundle into two options
Instead of requiring the user to bundle the certificate and private
key into a single file, provide separate options for them. This is
more in line with most other modules.
2021-05-21 13:09:38 +02:00
talyz dbf91bc2f1
nixos/keycloak: keycloak.database* -> keycloak.database.*
Move all database options to their own group / attribute. This makes
the configuration clearer and brings it in line with most other modern
modules.
2021-05-21 13:09:32 +02:00
talyz 83e406e97a
nixos/keycloak: frontendUrl always needs to be suffixed with /
In some places, Keycloak expects the frontendUrl to end with `/`, so
let's make sure it always does.
2021-05-21 13:09:25 +02:00
talyz 58614f8416
nixos/keycloak: Add myself to maintainers 2021-05-21 13:09:19 +02:00
talyz d748c86389
nixos/keycloak: Improve readablility by putting executables in PATH 2021-05-21 13:09:14 +02:00
talyz 8309368e4c
nixos/keycloak: Set umask before copying sensitive files
`install` copies the files before setting their mode, so there could
be a breif window where the secrets are readable by other users
without a strict umask.
2021-05-21 13:09:09 +02:00
talyz c2bebf4ee2
nixos/keycloak: Improve bash error handling 2021-05-21 13:09:03 +02:00
talyz d6727d28e1
nixos/keycloak: Set the postgresql database password securely
Feeding `psql` the password on the command line leaks it through the
`psql` process' `/proc/<pid>/cmdline` file. Using `echo` to put the
command in a file and then feeding `psql` the file should work around
this, since `echo` is a bash builtin and thus shouldn't spawn a new
process.
2021-05-21 13:08:53 +02:00
talyz 380b52c737
nixos/keycloak: Use replace-secret to avoid leaking secrets
Using `replace-literal` to insert secrets leaks the secrets through
the `replace-literal` process' `/proc/<pid>/cmdline`
file. `replace-secret` solves this by reading the secret straight from
the file instead, which also simplifies the code a bit.
2021-05-19 09:32:28 +02:00
talyz 38398fade1
nixos/discourse: Use replace-secret to avoid leaking secrets
Using `replace-literal` to insert secrets leaks the secrets through
the `replace-literal` process' `/proc/<pid>/cmdline`
file. `replace-secret` solves this by reading the secret straight from
the file instead, which also simplifies the code a bit.
2021-05-19 09:32:06 +02:00
Izorkin feebe402f5
treewide: remove duplicates SystemCallFilters 2021-05-13 15:44:56 +03:00
talyz deb58f6486 nixos/keycloak: Document how to use a custom local database 2021-05-04 19:27:08 +02:00
talyz fdf6bb5b95 Revert "nixos/keycloak: use db username in db init scripts"
This reverts commit d9e18f4e7f.

This change is broken, since it doesn't configure the proper database
username in keycloak when provisioning a local database with a custom
username. Its intended behavior is also potentially confusing and
dangerous, so rather than fixing it, let's revert to the old one.
2021-05-04 19:27:08 +02:00
Aaron Andersen aebebb5752
Merge pull request #119325 from ymarkus/bookstack
bookstack: 0.31.7 -> 21.04.3 + nixos/bookstack: use umask before echoing & clear cache before starting
2021-05-03 20:19:39 -04:00
Yannick Markus 336f3607d4
nixos/bookstack: use umask before echoing & clear cache before starting 2021-05-03 16:27:38 +02:00
Lassulus addfd88117
Merge pull request #117072 from em0lar/keycloak-module-dbuser
nixos/keycloak: use db username in db init scripts
2021-04-29 20:15:19 +02:00
Leo Maroni d9e18f4e7f
nixos/keycloak: use db username in db init scripts 2021-04-29 19:36:29 +02:00
Izorkin 8723d226b4 nixos/mastodon: update SystemCallFilters 2021-04-28 00:44:25 +02:00
Izorkin 47d3e955fc nixos/mastodon/sandbox: add @privileged and @raw-io to SystemCallFilter 2021-04-24 19:12:10 +02:00
Benjamin Koch 8122221c9b nixos/nextcloud: Rename services.nextcloud.nginx.disableImagemagick to services.nextcloud.nginx.enableImagemagick
Enable options are preferred. Suggested here:
https://github.com/NixOS/nixpkgs/pull/115372#issuecomment-821900334
2021-04-22 02:17:12 +02:00
talyz 7310dd0da8
nixos/discourse: Fix plugin linking
When linking multiple plugins, the `ln` runs need to be separated by
newlines..

Fixes #119584.
2021-04-16 14:21:07 +02:00
talyz 515fb48312
nixos/discourse: Fail on file errors
Bash doesn't handle subshell errors properly if the result is used as
input to a command. To cause the services to fail when the files can't
be read, we need to assign the value to a variable, then export it
separately.
2021-04-16 14:21:01 +02:00
Symphorien Gibol 7a87973b4c nixos/users: require one of users.users.name.{isSystemUser,isNormalUser}
As the only consequence of isSystemUser is that if the uid is null then
it's allocated below 500, if a user has uid = something below 500 then
we don't require isSystemUser to be set.

Motivation: https://github.com/NixOS/nixpkgs/issues/112647
2021-04-14 20:40:00 +02:00
Kim Lindberger 5a1bd5ff66
Merge pull request #116074 from talyz/discourse
discourse: Add package and NixOS module
2021-04-08 14:19:49 +02:00
talyz 642854055c
nixos/discourse: Add NixOS manual entry 2021-04-05 13:55:57 +02:00
talyz 8dddb70bb9
nixos/discourse: Init 2021-04-05 13:54:25 +02:00
Rémi NICOLE 8442c216af
nixos/shiori: fix SystemCallFilter after libseccomp update (#108160)
fixes #108146
2021-04-03 06:44:24 -04:00
Guillaume Girol f19434ad4a
Merge pull request #113994 from pborzenkov/calibre-web
calibre-web: init at 0.6.11
2021-03-31 18:25:45 +00:00
Maximilian Bosch ae73ec2b68
Merge pull request #116738 from Ma27/wiki-js
wiki-js: init at 2.5.191
2021-03-27 22:03:35 +01:00
Pavel Borzenkov 58ce51ed06 nixos/calibre-web: init module 2021-03-27 14:43:33 +03:00
Justin Humm 347a9168ae nixos/hledger-web: set capabilites as boolean 2021-03-26 13:45:13 +01:00
Justin Humm 569940b9fd nixos/hledger-web: add stateDir, use own user, fix ExecStart
This allows for shared hledger installations, where the web interface is
available via network and multiple user share a SSH access to the
hledger user.

Also added `--serve` to the CLI options, as hledger-web tries to open a
webbrowser otherwise:

hledger-web: xdg-open: rawSystem: runInteractiveProcess: exec: does not
exist (No such file or directory)

Co-authored-by: Aaron Andersen <aaron@fosslib.net>
2021-03-26 13:45:13 +01:00
Izorkin f3a032dee5 nixos/mastodon: enable sandbox mode 2021-03-24 17:28:50 +01:00
Sandro c10752cc4f
Merge pull request #113722 from rgrunbla/galene-03
galene: 0.2 -> 0.3 and bugfix of the associated module
2021-03-21 05:31:30 +01:00
Maximilian Bosch de98a184f5
wiki-js: init at 2.5.191 2021-03-20 20:43:21 +01:00