Commit Graph
100 Commits
Author SHA1 Message Date
Kim Lindberger 5fd730e210 Merge pull request #128823 from NixOS/backport-127931-to-release-21.05
[Backport release-21.05] discourse: Fix plugin support
2021-07-15 14:50:11 +02:00
talyz 71474d1e41 discourse: Add a proper plugin builder + a few initial packages
Some discourse plugins have Ruby dependencies and require a
specialized builder. This introduces a generic builder that can be
used whether the plugin has Ruby dependencies or not. It also adds a
set of pre-packaged plugins available through `discourse.plugins` and
provides an easy way to add more.

(cherry picked from commit 7671b90919af8271bdf7e07bb86d63216a2145d6)
2021-06-30 22:07:26 +00:00
talyz 0a64a8b87c discourse: Patch sources instead of using replace-literal
(cherry picked from commit f0ae7fdf7e9518ab1fef4603daa860d5402f5b3b)
2021-06-30 22:07:25 +00:00
talyz 3b84448e67 discourse: Fix plugin support
For plugins to work properly, their assets need to be precompiled
along with the rest of Discourse's assets. This means we need to build
new packages when the list of plugins change.

(cherry picked from commit 9af3672f4faaafba0ce0129a87fc7925c14eeb61)
2021-06-30 22:07:25 +00:00
Kim Lindberger 3c6f3f84af Merge pull request #127679 from NixOS/revert-125407-patch-2
[21.05] Revert "php/generic: Allow to extend PHP_INI_SCAN_DIR"
2021-06-21 18:07:45 +02:00
Kim Lindberger b04df2100f Merge pull request #127652 from NixOS/backport-127454-to-release-21.05
[Backport release-21.05] keycloak: 13.0.1 -> 14.0.0
2021-06-21 16:32:55 +02:00
Kim Lindberger 65a1707f25 Revert "[21.05] php/generic: Allow to extend PHP_INI_SCAN_DIR" 2021-06-21 16:08:31 +02:00
Kim Lindberger 8201fae0e3 Merge pull request #127575 from NixOS/backport-127063-to-release-21.05
[Backport release-21.05] nixos/fail2ban: Remove `reloadIfChanged = true`
2021-06-20 20:08:37 +02:00
talyz d726b9c204 nixos/fail2ban: Remove reloadIfChanged = true
This makes the service fail when upgrading the package, so let's
properly restart it instead.

(cherry picked from commit b4c069b1476a92a540e906ef95cd7fb380d29c63)
2021-06-20 16:01:18 +00:00
Kim Lindberger b6cef599a4 Merge pull request #125407 from dxops/patch-2
[21.05] php/generic: Allow to extend PHP_INI_SCAN_DIR
2021-06-16 10:48:42 +02:00
Kim Lindberger dfbaf6023d Merge pull request #127014 from NixOS/backport-126969-to-release-21.05
[Backport release-21.05] discourse: 2.7.0 -> 2.7.4
2021-06-16 09:26:57 +02:00
talyz 4eec52ae4e discourse: 2.7.0 -> 2.7.4
(cherry picked from commit f7fb0d20a624c4d7fa12ba8a6e6d551655106a29)
2021-06-15 23:21:04 +00:00
Kim Lindberger ddc012dbea Merge pull request #126959 from NixOS/backport-126380-to-release-21.05
[Backport release-21.05] gitlab: Make sure the FOSS version isn't identified as EE
2021-06-15 18:00:01 +02:00
talyz d3d1674b3f gitlab: Make sure the FOSS version isn't identified as EE
(cherry picked from commit 8f16b1629155ad0022bb7830739081532d1bae50)
2021-06-15 15:16:10 +00:00
Kim Lindberger 34b9ccb9c8 Merge pull request #126956 from NixOS/backport-126892-to-release-21.05
[Backport release-21.05] gitlab: 13.12.3 -> 13.12.4
2021-06-15 17:10:34 +02:00
Kim Lindberger 32d2d13094 Merge pull request #126824 from NixOS/backport-126812-to-release-21.05
[Backport release-21.05] gitlab: 13.12.2 -> 13.12.3
2021-06-14 15:55:34 +02:00
Kim Lindberger 541e7d51c5 Merge pull request #126194 from NixOS/backport-126163-to-release-21.05
[Backport release-21.05] phpPackages.composer: 2.1.1 -> 2.1.2
2021-06-08 13:52:27 +02:00
Kim Lindberger 64393daa54 Merge pull request #125821 from NixOS/backport-125699-to-release-21.05
[Backport release-21.05] treewide: Fix mysql alias deprecation breakage
2021-06-06 08:53:44 +02:00
talyz a60818cacd 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`.

(cherry picked from commit 59e0120aa5c1241d48048afa615e25c65d7e366d)
2021-06-05 17:11:40 +00:00
Kim Lindberger 4c4a45e284 Merge pull request #124945 from NixOS/backport-124472-to-release-21.05
[Backport release-21.05] keycloak: 13.0.0 -> 13.0.1
2021-05-30 10:47:01 +02:00
talyz b423efaeeb 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.

(cherry picked from commit 544adbfcab2e92c2fe5774cae67f2edf165eb97e)
2021-05-28 22:16:10 -07:00
talyz ce5587e7bb discourse: 2.6.5 -> 2.7.0
(cherry picked from commit 42b8e7685d5fe5280f8f6101a6d19016b92f3a5c)
2021-05-28 22:16:10 -07:00
Kim Lindberger df25a8867f Merge pull request #124138 from talyz/21.05-php-iconv-errno
[21.05] php74.extensions.iconv: fix error signalling
2021-05-23 17:48:31 +02:00
Kim Lindberger 1693374dbd synergy: 1.11.1 -> 1.13.1.41 (#123359) 2021-05-23 01:55:42 +02:00
talyz 2d8a870813 keycloak.tests: Test HTTPS support 2021-05-21 13:09:43 +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
Kim Lindberger f131787bb6 Merge pull request #121708 from talyz/replace-secret
treewide: Replace uses of `replace-literal` with `replace-secret` to avoid leaking secrets
2021-05-19 09:34:51 +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 88b76d5ef9 nixos/mpd: 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.
2021-05-19 09:32:22 +02:00
talyz 3a29b7bf5b nixos/mpdscribble: 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:17 +02:00
talyz 7842e89bfc nixos/gitlab: 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:12 +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
talyz 27f8f6956a replace-secret: Init
Add a small utility script which securely replaces secrets in
files. Doing this with `sed`, `replace-literal` or similar utilities
leaks the secrets through the spawned process' `/proc/<pid>/cmdline` file.
2021-05-19 09:32:00 +02:00
talyz 5926b95fbe webkitgtk: Fix bubblewrap opengl-driver path
If `/run/opengl-driver/lib` is in `LD_LIBRARY_PATH`, bwrap will try to
mount it into the already bind mounted `/run/opengl-driver`. To
prevent this, we instead specify the subpaths of `/run/opengl-driver`
we're interested in.

Also, use the correct path for i686 builds.
2021-05-10 13:05:48 +02:00
Kim Lindberger eeece47a52 Merge pull request #121985 from r-ryantm/auto-update/keycloak
keycloak: 12.0.4 -> 13.0.0
2021-05-07 13:11:44 +02:00
talyz 360abc8e2a v8: Fix darwin build 2021-05-07 11:57:58 +02:00
talyz 8f83860a0a keycloak.tests: Make sure databaseUsername is either ignored...
...or used correctly.
2021-05-04 19:27:08 +02: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
Kim Lindberger fdd6ca8fce Merge pull request #118898 from talyz/gitlab-memory-bloat
nixos/gitlab: Add options to tame GitLab's memory usage somewhat
2021-04-30 16:58:30 +02:00
Kim Lindberger abecdfea73 Merge pull request #120833 from talyz/pipewire-0.3.26
pipewire: 0.3.25 -> 0.3.26
2021-04-29 18:46:35 +02:00
Kim Lindberger 3bed46e4b9 Merge pull request #114175 from eyJhb/php-phpdbg-disable
php: fixed not being able to disable phpdbgSupport
2021-04-28 10:46:47 +02:00
Kim Lindberger e50164a7ce Merge pull request #113201 from talyz/gitlab-db-key-base-patch
gitlab: Add patch for db_key_base length bug, fix descriptions
2021-04-27 19:25:43 +02:00
talyz 1215bd4ea9 Revert "nixos/tests/gitlab: add 32 byte secrets"
This reverts commit d6e0d38b84.

We need shorter secrets to continue working, since the earlier
recommendation was too short and there's no way to rotate the them.
2021-04-27 18:08:59 +02:00
talyz 7a67a2d1a8 gitlab: Add patch for db_key_base length bug, fix descriptions
The upstream recommended minimum length for db_key_base is 30 bytes,
which our option descriptions repeated. Recently, however, upstream
has, in many places, moved to using aes-256-gcm, which requires a key
of exactly 32 bytes. To allow for shorter keys, the upstream code pads
the key in some places. However, in many others, it just truncates the
key if it's too long, leaving it too short if it was to begin
with. This adds a patch that fixes this and updates the descriptions
to recommend a key of at least 32 characters.

See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53602
2021-04-27 17:49:43 +02:00
talyz fb86d324d1 pipewire: Add update script 2021-04-27 16:50:22 +02:00
talyz 6edd102013 pipewire: Fix tests 2021-04-27 12:41:35 +02:00
talyz 24320ba1dd pipewire: 0.3.25 -> 0.3.26 2021-04-27 12:41:30 +02:00
Kim Lindberger 37f49597e3 Merge pull request #118861 from talyz/gitlab-shell-fix
gitlab-shell: 13.15.1 -> 13.17.0
2021-04-16 16:17:58 +02:00
Kim Lindberger 7124e24a47 Merge pull request #119596 from talyz/discourse-2.6.5
discourse: 2.6.3 -> 2.6.5, module fixes
2021-04-16 16:06:47 +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
talyz 2db1ae068d discourse: 2.6.3 -> 2.6.5 2021-04-16 14:20:56 +02:00
Kim Lindberger 59917dc3a9 Merge pull request #119427 from talyz/tengine-modules
tengine: Add modules to passthru
2021-04-14 17:42:01 +02:00
talyz 4aab79918e tengine: Add passthru.tests 2021-04-14 16:56:54 +02:00
talyz 1ef95a8c5f nginx: Add all the nginx tests to passthru.tests 2021-04-14 16:39:35 +02:00
talyz 06dee38345 Revert "nixos/nginx: fix eval for tengine"
This reverts commit 2d3200e010.
2021-04-14 16:34:10 +02:00
talyz fd10431871 tengine: Add modules to passthru
Follow the interface of the `nginx` package and expose the enabled
modules. This is used in the `nginx` module to enable the
`additionalModules` option.
2021-04-14 16:14:28 +02:00
Kim Lindberger 2111e0cde8 Merge pull request #119114 from bkchr/bkchr-lorri-1.4.0
lorri: 1.3.1 -> 1.4.0
2021-04-12 09:39:41 +02:00
talyz 6389170b39 nixos/gitlab: Set MALLOC_ARENA_MAX to "2"
This should reduce memory fragmentation drastically and is recommended
by both the Puma and the Sidekiq author. It's also the default value
for Ruby deployments on Heroku.
2021-04-10 10:49:31 +02:00
talyz 306fc0648b nixos/gitlab: Add Sidekiq MemoryKiller support
Restart sidekiq automatically when it consumes too much memory. See
https://docs.gitlab.com/ee/administration/operations/sidekiq_memory_killer.html
for details.
2021-04-10 10:49:24 +02:00
talyz 6230936be2 nixos/gitlab: Add options to control puma worker and threads numbers 2021-04-10 10:49:18 +02:00
talyz 7377a1dfa6 gitlab-shell: 13.15.1 -> 13.17.0
Only the version had been updated previously, not the hashes and
patches.
2021-04-09 00:36:32 +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 9b30cda2f6 gitlab: 13.9.4 -> 13.10.2 2021-04-07 23:23:24 +02:00
Kim Lindberger bb91e5307b Merge pull request #118715 from petabyteboy/feature/gitlab-invalid-backup
nixos/gitlab: do not set backup.upload by default
2021-04-07 09:30:53 +02:00
talyz bc26a46943 rl-2105: Add Discourse module note 2021-04-05 13:56:02 +02:00
talyz 642854055c nixos/discourse: Add NixOS manual entry 2021-04-05 13:55:57 +02:00
talyz 5138941ad3 discourse: Add updater script 2021-04-05 13:55:52 +02:00
talyz 3c7df2a3cb nixos/discourse: Add test 2021-04-05 13:55:44 +02:00
talyz 8dddb70bb9 nixos/discourse: Init 2021-04-05 13:54:25 +02:00
talyz 1d3715d375 discourse-mail-receiver: Init at 4.0.7 2021-04-05 13:54:14 +02:00
talyz 4d8c8f4722 discourse: init at 2.6.3 2021-04-05 13:54:06 +02:00
talyz 46d935a4ce nixos/nginx: Add an option to specify additional third-party modules 2021-04-04 13:44:36 +02:00
Kim Lindberger 11ac9ab827 Merge pull request #118154 from talyz/pipewire-media-session-fixes
nixos/pipewire: Use formats.json, stricter typing and break up extremely long lines
2021-04-01 23:00:20 +02:00
talyz 2a3c276b53 nixos/pipewire: Use formats.json, stricter typing, line breaks
The upstream pipewire config is written in an almost, but not quite
JSON format. The parser accepts standard JSON, though, so we don't
need to write our file in the same nonstandard version.

The typing for all config options is changed from `types.attrs`, which
behaves poorly when the option is set from multiple locations, to the
formats.json-type.

Also, rewrite some very long one-liners for improved readability.
2021-04-01 12:08:29 +02:00
talyz 7b2d97cc2d pipewire: Add JSON parser patch 2021-04-01 12:08:24 +02:00
Kim Lindberger bd3ecdc3cd Merge pull request #114362 from talyz/gitlab-backups
nixos/gitlab: Introduce automatic backups
2021-03-30 20:16:20 +02:00
talyz abba76a3b9 nixos/gitlab: Document automatic backups 2021-03-30 19:15:33 +02:00
talyz 7b5cbde81f nixos/gitlab: Gitlab -> GitLab 2021-03-30 19:13:43 +02:00
talyz 35582c5af7 gitlab.tests: Test backup and restore
Test the automatic backup and restore functionality by backing up the
instance after running the initial tests, stopping GitLab and removing
all state, running the restore rake task, then running the tests
again, but without pushing data.
2021-03-30 19:13:37 +02:00
talyz 3fb04ca505 nixos/gitlab: Introduce automatic backup support
Add support for automatically backing up GitLab state, both locally
and to remote locations.
2021-03-30 19:13:31 +02:00
talyz 30cae53dbb v8: 7.4.255 -> 8.4.255 2021-03-29 15:25:17 +02:00
Kim Lindberger 06e36f5275 Merge pull request #114924 from r-ryantm/auto-update/keycloak
keycloak: 12.0.3 -> 12.0.4
2021-03-03 10:44:33 +01:00
Kim Lindberger 8eea5d0fbd Merge pull request #114592 from etu/php-minor-fixes
php: various fixes
2021-03-02 09:41:15 +01:00
Kim Lindberger e72375464b Merge pull request #113635 from talyz/gitlab-improvements
nixos/gitlab: Clean config dir, switch to puma, split PreStart script and more
2021-03-01 13:37:53 +01:00
talyz ca725e7fcd nixos/gitlab: Add gitlab.target
To make it easier to start and stop all GitLab services, introduce
`gitlab.target` which wants all services (meaning they will start with
it) and which all services are part of (meaning they will stop with
it).
2021-02-26 19:54:23 +01:00
talyz f38c601b54 nixosTests.gitlab: Test pages and mailroom service start
Make sure that the `gitlab-pages` and `gitlab-mailroom` services at
least start.
2021-02-26 19:54:11 +01:00
talyz 9d4e76dd46 nixos/gitlab: Make gitlab.service's PreStart into two new services
Make the config initialization script run in gitlab.service's PreStart
section into two new services, `gitlab-config.service` and
`gitlab-db-config.service`. Other services can then depend on the
config scripts they need instead of unnecessarily depending on
`gitlab.service`. This makes the reason for the configured service
dependencies much clearer and should also reduce the restart time of
the `gitlab` service quite a lot, when triggered manually.

Also, set up stricter service dependencies, using `bindsTo`, to ensure
that if a service fails or is stopped, its dependants are also
stopped. For example, if we're using the `postgresql` service and it's
stopped, `gitlab.service` and `gitlab-sidekiq.service`, which depend on
it to function, should also be stopped.
2021-02-26 19:54:05 +01:00
talyz 53d9ec83ff nixos/gitlab: postgresql: Make PSQL a function, run as superUser
A function is more appropriate for this use. See
http://mywiki.wooledge.org/BashFAQ/050 for reference.

Also, we don't need to run the service as root: since we essentially
run all commands as `services.postgresql.superUser` anyway, the whole
service can just run as that user instead.
2021-02-24 18:32:31 +01:00
talyz 2b3800b9c7 nixos/gitlab: Change default SMTP port, enable postfix only if used
Change the default SMTP port to `25`, to better match the default
address `localhost`. This gets rid of some error outputs in the test,
where it fails to connect to localhost:465.

Also, don't enable postfix by default unless it's actually useful to
us.
2021-02-24 18:32:24 +01:00
talyz f8ab43ef7b nixos/gitlab: Switch from unicorn to puma
Puma is the new upstream default server since GitLab 13.
2021-02-24 18:31:30 +01:00
talyz 2ec397ff9f nixos/gitlab: Clean up the config dir more thoroughly
This removes all the subdirectories in `config` on start.

From one version of GitLab to the next, the files in the `config`
directory changes. Since we're only overwriting the existing files
with ones from the repo, cruft sometimes gets left behind,
occationally causing issues.

Ideally, all configuration put in the `config` directory is declared
by NixOS options and we could just remove the whole directory on
start, but I'm not sure if that's the case. It would also require a
little bit of additional rework and testing. The subdirectories,
however, should seldom contain user configuration and the ones that
frequently does, `initializers`, is already removed on start.
2021-02-24 18:31:24 +01:00