Commit graph

99 commits

Author SHA1 Message Date
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](8616af08d9/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 a08b3a4d19.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
Jonas Heinrich
e1c0d281b2 nixos/nextcloud: Rename extraOptions to settings 2024-01-26 14:22:49 +01:00
Maximilian Bosch
d25fdec5b3
Merge pull request #212430 from onny/nextcloud-cleanup
nixos/nextcloud: Move options into now freeForm extraOptions
2023-12-29 23:44:24 +01:00
nikstur
1c22b64fc9 nixos/tests/nextcloud: replace activationScript
Replace with a seprate systemd service
2023-12-29 03:41:45 +01:00
Jonas Heinrich
dd8c96379f nixos/nextcloud: Move options into now freeForm extraOptions 2023-12-29 01:04:46 +01:00
Robert Schütz
f6ea3f91b5 nextcloud28: init at 28.0.0 2023-12-13 15:57:33 -08:00
Sandro Jäckel
79e3ab84dd
nixos/tests/nextcloud: fix with-declarative-redis-and-secrets test 2023-11-25 22:58:06 +01:00
K900
5323b93e9d nixos/tests: remove unnecessary stateVersion assignments 2023-10-27 12:56:13 +03:00
Maximilian Bosch
efc5c80e18
nextcloud25: remove
EOL of Nextcloud v25 is scheduled by the end of this month.
2023-10-07 16:16:42 +02:00
Jonas Heinrich
14f7b1161d nixos/tests/nextcloud: Fix deprecation warning 2023-08-09 16:57:57 +02:00
Jonas Heinrich
b0ba7d2406 nixos/tests/nextcloud: Fix broken webdav url
Starting with Rclone v1.63, which is used in the Nextcloud tests for
synchronization, the client relies on the correct WebDAV endpoint url,
see https://github.com/rclone/rclone/issues/7103
2023-08-01 09:11:27 +02:00
Maximilian Bosch
cac7282c17
nixos/tests/nextcloud: fix more issues related to redis tests
* Ensure that the redis cache is actually used in the "trivial" case
  (`with-postgresql-and-redis`)
* Test against all Nextcloud versions we've packaged
* Actually set a secret to make sure that the provided secret is
  properly read by Nextcloud.
* Add myself as maintainer to the secret-test to make sure that I don't
  miss any more changes like this that could break the functionality of
  that feature.
2023-06-17 14:04:44 +02:00
Maximilian Bosch
3df3a89892
nixos/nextcloud: fix declarative cache configuration
It's supposed to be `memcache.distributed`, not an associative PHP array
named `memcache` with a key `distributed`.

This was probably never caught because the initial `grep -q` check in
the test was invalid: `redis-cli` prints nothing if no keys can be found
when not writing to a tty apparently.
2023-06-16 14:11:38 +02:00
Maximilian Bosch
5a2769d981
nextcloud27: init
Fixes #237560
2023-06-16 14:11:38 +02:00
figsoda
202699c918 nixos/tests: fix typos 2023-05-19 22:31:04 -04:00
Gabriel Fontes
f9f76529cd
nixos/nextcloud: default createLocally to false 2023-05-14 12:09:50 -03:00
Gabriel Fontes
fddf531c6f
nixos/nextcloud: refactor database.createLocally
Fixes https://github.com/NixOS/nixpkgs/issues/228971
2023-05-01 12:20:40 -03:00
Maximilian Bosch
430f1dcdbd
nextcloud: remove nextcloud24, 25.0.5 -> 25.0.6, 26.0.0 -> 26.0.1 2023-04-20 11:34:54 +02:00