116 Commits

Author SHA1 Message Date
Jonas Heinrich 052cec991b nextcloud34: init at 34.0.1
Co-authored-by: Jonas Heinrich <757752+onny@users.noreply.github.com>
Co-Authored-By: Joseph Price <joe@pricey.uk>
2026-07-10 16:49:27 +02:00
Jonas Heinrich c9d5472053 nextcloud33, nextcloud33Packages: init at 33.0.0; nextcloud31*: drop (#492137) 2026-02-22 16:54:34 +00:00
Jonas Heinrich e16a074779 nextcloud31, nextcloud31Packages: drop 2026-02-21 17:22:34 +01:00
Maximilian Bosch 17f68091c7 nixos/tests/nextcloud: switch objectstorage test to garage
Part of #490996
2026-02-21 15:41:37 +01:00
Jonas Heinrich 810b1f6e35 nixosTests.nextcloud: init nextcloud 33 2026-02-20 12:09:07 +01:00
Darren Rambaud 0e1e6cc841 nixos/nextcloud: update test import
* `stalwart` module refactored as part of https://github.com/NixOS/nixpkgs/pull/481815 resulted in rename of `../stalwart/stalwart-mail-config.nix` to `../stalwart/stalwart-config.nix`
2026-02-01 21:13:37 -06:00
Mynacol fb9b54f507 nixos/tests/nextcloud: follow variable rename
evaluation warning: The option
`services.nextcloud.config.objectstore.s3.autocreate' defined in
`<unknown-file>' has been renamed to
`services.nextcloud.config.objectstore.s3.verify_bucket_exists'.
2025-11-28 20:53:00 +00:00
provokateurin 2718336490 nixos/nextcloud: Add services.nextcloud.settings.mail_* options 2025-11-21 15:48:24 +01:00
kraftnix cfcd8678e5 nixos/nextcloud: add secrets option
Uses existing `nix_read_secret` and LoadCredential to read contents of a
file into an entry in `config.php`
2025-11-21 15:33:48 +01:00
Maximilian Bosch c3615b0f5d nixos/nextcloud: Allow disabling initial admin user creation on Nextcloud >= 32 (#418378) 2025-10-27 11:24:44 +00:00
Maximilian Bosch 255e1c3cb9 nixos/tests/nextcloud: fix eval 2025-10-24 17:10:15 +02:00
provokateurin e739c5d78d nixos/nextcloud: Allow disabling initial admin user creation on Nextcloud >= 32
With https://github.com/nextcloud/server/pull/53212 it is not longer necessary to specify a username and password for an initial admin account during installation.
2025-10-13 20:47:01 +02:00
provokateurin 34a7111f89 nextcloud32: init at 32.0.0 2025-10-07 09:45:28 +02:00
provokateurin 3afd6ec50d nextcloud30: drop 2025-09-29 16:03:32 +02:00
Sandro Jäckel 9e2d007b94 nixos/nextcloud: configure redis by default 2025-07-26 23:31:35 +02:00
Jeremy Fleischman 0a4c03ed81 nextcloud: add nextcloud.nginx.enableFastcgiRequestBuffering option
Enabling this option fixes (works around) Nextcloud's notorious "0 byte file"
issue. See these upstream issues:

- https://github.com/nextcloud/documentation/issues/9574
- https://github.com/nextcloud/server/issues/7995

This fixes https://github.com/NixOS/nixpkgs/issues/252980

Co-authored-by: Maximilian Bosch <6025220+Ma27@users.noreply.github.com>
2025-07-06 13:21:01 -07:00
Wolfgang Walther 41c5662cbe nixos/postgresql: move postStart into separate unit
This avoids restarting the postgresql server, when only ensureDatabases
or ensureUsers have been changed. It will also allow to properly wait
for recovery to finish later.

To wait for "postgresql is ready" in other services, we now provide a
postgresql.target.

Resolves #400018

Co-authored-by: Marcel <me@m4rc3l.de>
2025-06-24 15:26:47 +02:00
Martin Weinelt 3fdac78c28 nixosTests: migrate mc config host add to mc alias set
The former command was deprecated in 2020 and removed in one of the last
releases.
2025-06-05 05:36:17 +02:00
Maximilian Bosch 26126c75df Merge: Use cacert in Nextcloud (#406252) 2025-05-15 18:50:53 +02:00
Maximilian Bosch e9f70c9462 nixos/nextcloud: verify that Nextcloud is using the system-wide CA
Nextcloud manages the CA bundle on its own by default, but we patch this
out and replace it with the system-wide bundle.

Since this was originally designed for the objectstore feature, this
test ensures that an S3 behind a reverse proxy with TLS and its own CA
works fine.
2025-05-15 18:19:58 +02:00
networkException 23468ad19f nixos/nextcloud: use LoadCredential to read services.nextcloud.secretFile
This patch adds support for using systemd's LoadCredential
feature to read in a json file at a path defined in the
services.nextcloud.secretFile option.

This is a follow up to 2ce1e84103.
2025-05-10 20:36:01 +02:00
provokateurin 1efc79ccca nextcloud29: drop 2025-04-21 07:48:32 +02:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Maximilian Bosch f20b220e17 Merge: nixos/nextcloud: add maintainer team, update docs about maintainership of apps (#393069) 2025-04-01 11:25:28 +02:00
Maximilian Bosch ad175bca29 nixos/nextcloud: fix eval of tests
Currently failing with

    error: cannot coerce a set to a string: { __functionArgs = «thunk»; __functor = «thunk»; }

This comes from the `extraTests` option I added to the test modules to
compose certain tests a little nicer. It's of type

    either (functionTo ...) str

and it seems like the `functionTo` part now returns a functor (i.e. an
attr-set that can be invoked as function). This is caught by
`lib.isFunction`, but `builtins.isFunction` returns `false`.

Hence, switching to the former fixes this.
2025-03-26 16:49:54 +01:00
Maximilian Bosch d3110c9532 nextcloud: update maintainer information
* Create a dedicated team. Before, information was inconsistent between
  e.g. tests and package, module had none at all.
* Add maintainership from us to all trivially packaged apps. This is
  only to make sure that we take care of them building and installing
  and that's about it.
2025-03-25 12:41:18 +00:00
Maximilian Bosch 6c4f93e113 Merge: nixos/nextcloud: use LoadCredential to read secrets (#367433) 2025-03-07 10:58:29 +01:00
transcaffeine dfe1187fea nextcloud31: init at 31.0.0
Release notes: https://github.com/nextcloud/server/releases/tag/v31.0.0
Upgrade notes: https://docs.nextcloud.com/server/31/admin_manual/release_notes/upgrade_to_31.html
2025-02-26 08:29:34 +01:00
networkException 549d8a6d44 nixos/tests/nextcloud: fix redis cache non empty tests
This patch changes the implementation of the subtests to
check for redis' cache being non empty to only run redis-cli
and jq in a shell and assert the returned length in python.

This fixes jq "len" simply not compiling and makes sure
regressions get noticed.
2025-01-21 13:13:36 +01:00
networkException 18de1c264e nixos/tests/nextcloud: use lib instead of pkgs.lib wherever trivial 2025-01-21 13:13:35 +01:00
networkException 9ffa0a5945 nixos/tests/nextcloud: test for notify_push in with-declarative-redis-and-secrets
This patch adds a subtest and corresponding configuration to
with-declarative-redis-and-secrets to test for nextcloud notify_push
to be working, just as in with-postgresql-and-redis.

As notify_push needs to connect to the database, including it
in this test checks that it can read the dbpassFile properly.
2025-01-21 13:13:30 +01:00
Maximilian Bosch 7ef73d05cd nextcloud28: remove
This major release is dead now.
2025-01-19 00:08:35 +01:00
Maximilian Bosch b95a9171dd nixos/nextcloud: don't use pg14 for tests
This currently fails to build, so we just update it now to make sure all
tests are green with the current changes.
2024-12-31 00:05:52 +01:00
Maximilian Bosch c7ccfc5f9f nixos/nextcloud: drop default for dbtype setting
Closes #355606

To quote the system requirements[1]:

> Database: SQLite 3.16+ (only recommended for testing and minimal-instances)

As discussed[2], this would already fail at eval-time for everyone and
makes all sqlite users aware that this is probably not the best choice.
Doing that regardless, is now an explicit decision.

[1] https://docs.nextcloud.com/server/30/admin_manual/installation/system_requirements.html
[2] https://github.com/NixOS/nixpkgs/pull/369242#discussion_r1899706512
2024-12-31 00:01:02 +01:00
Sandro Jäckel f6b7e8f625 nixos/tests/nextcloud: fix notify_push test 2024-12-15 22:43:12 +01:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Maximilian Bosch 25fe330bc9 Merge: nextcloud30: init at 30.0.0; nextcloud30Packages: init (#342521) 2024-10-01 14:51:56 +02:00
Jonas Heinrich 1b121c1ea2 nextcloud30: init at 30.0.0 2024-10-01 12:48:45 +02:00
Maximilian Bosch 02be206846 nixos/nextcloud: add nc version to drv name of mysql & declarative redis test 2024-09-30 22:21:29 +02:00
Maximilian Bosch cd6157bea4 nixos/nextcloud: re-add declarative-redis-and-secrets to matrix
Just noticed that I apparently disabled this test while restructuring
the Nextcloud tests[1] effectively disabling the test.

This patch re-adds it and adjusts the code accordingly.

I also noticed that the old check whether the cache is actually used
(`test "[]" = "$(redis-cli --json KEYS "*")"`) was broken because the
`nextcloud.fail()` hid the fact that the `redis-cli` invocation was
failing due to a missing password. Fixed the subtest accordingly.

[1] 0b31ada92b
2024-09-30 22:15:03 +02:00
Maximilian Bosch 60657a4591 nextcloud27: remove
Version will be EOL by the end of 2024-06.
2024-06-25 14:08:15 +02:00
Maximilian Bosch 45d2b8b536 nixos/nextcloud: deprecated dbtableprefix
Closes #320381

Installation with a custom dbtableprefix is not allowed anymore for a
while[1] and we shouldn't advertise it as such.

The option is deprecated for now since I'm not sure if there are some
weird corner-cases where removing the option directly would break
existing installations from before <20 with a custom dbtableprefix. The
migration-path for such a case is as follows:

* Check if /var/lib/nextcloud/config/config.php has the correct
  dbtableprefix set and if not, take care of it.
* Remove `dbtableprefix` from the NixOS configuration. It's effectively
  state anyways.

After a bit of time to switch (perhaps after the next release
branchoff), the option can be removed.

[1] https://github.com/nextcloud/server/issues/24836
2024-06-19 11:43:33 +02:00
Maximilian Bosch 0b31ada92b nixos/nextcloud: refactor tests
The tests had very much duplication and some if it was even wrong! For
instance, `withRcloneEnv` in the MySQL test didn't have the `"$@"` at
the bottom to execute commands passed to it. Because of that, the MySQL
testcase never checked whether files can be uploaded.

Since tests are just another module-system I decided to abstract away
common things by using it:

* Define a base module with
  * an empty `client` node and a `nextcloud` node with defaults
    shared among all tests.
  * rclone scripts that are used by all tests.
  * a `testScript` checking upload/download. Additional checks can be
    added via `test-helpers.extraTests`.

* Make common information such as admin user & password shared via
  options.

Also, changed the following things:

* The `name` of the final derivation also includes the Nextcloud major
  it was tested against.

* Improved the objecstore test by making sure the file was actually
  uploaded into the bucket.
2024-06-12 10:55:26 +02:00
Maximilian Bosch 6ecafb1c38 nixos/nextcloud: fix objectstore/s3 test
* Make sure `withRcloneEnv` actually invokes the command it gets as
  `argv`. Until no, nothing was uploaded. This mistake was copied from
  the MySQL test that appears to have the same issue (will be addressed
  in the next commit).

* Test upload/download through with rclone once to see if Nextcloud
  interaction with S3 works fine.

* Make sure we actually have something in the bucket (until now with an
  `ls` and no real check, will do some larger cleanups and make this
  better in the next commit).

* Use actual AWS-style access keys.
2024-06-11 12:37:42 +02:00
Jonas Heinrich de1f4538e8 nixos/tests/nextcloud: Add test for object store 2024-06-10 13:52:55 +02:00
Maximilian Bosch 4e964de927 nextcloud26: remove 2024-05-01 10:22:25 +02:00
Raito Bezarius 4a76833a0d nixos/tests/nextcloud: test NextCloud 29 (Hub 8) too
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-04-25 15:27:30 +02:00
Maximilian Bosch 0fac694dba Merge pull request #290507 from dotlambda/nextcloud-notify_push-meta
nextcloud-notify_push.test_client: add meta
2024-02-22 17:28:11 +01:00
Robert Schütz 16e379fa03 nextcloud-notify_push.test_client: add meta 2024-02-21 15:12:58 -08:00
Maximilian Bosch 37d6961f33 nixos/nextcloud: add regression test for not delivering code anymore
PR #277382 didn't fix just an issue with .mjs files for the `forms` app,
but an underlying, more problematic issue: for `/nix-apps` &
`/store-apps`, the fcgi config for PHP and the block for assets were
never reached.

That meant that e.g. `/nix-apps/notes/lib/AppInfo/Application.php`
returned the PHP source code as text/plain. Considering that there was
never a fundamental change to how this config's structure, I'm pretty
sure that the issue was pretty much there since the module exists.

After consulting the NixOS security team we agreed that this is most
likely harmless because you'd have to use private apps with secrets in
the raw PHP code of said app. However, this is still problematic because
one important assumption - that PHP code is never sent to the browser -
is broken which is why we decided on not mentioning this impact in the
previous PR from December 2023.

To make sure that we don't regress our nginx config, I decided to add
the reproducer which fails on 8bbbb228b4
as testcase to our integration tests.
2024-02-10 17:52:19 +01:00