Commit Graph

244 Commits

Author SHA1 Message Date
Nicola Squartini
a2eeaddea2
nixos/nextcloud: support SSE-C for S3 primary storage
Add configuration option to enable [server-side encryption with
customer-provided keys][1] (SSE-C) when using S3 as primary storage in
Nextcloud.

[1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html
2023-02-24 16:59:41 +01:00
Sandro
b2cf9511b3
Merge pull request #211547 from yater/patch-3 2023-02-14 22:32:47 +01:00
pennae
0a6e6cf7e6 nixos/manual: render module chapters with nixos-render-docs
this converts meta.doc into an md pointer, not an xml pointer. since we
no longer need xml for manual chapters we can also remove support for
manual chapters from md-to-db.sh

since pandoc converts smart quotes to docbook quote elements and our
nixos-render-docs does not we lose this distinction in the rendered
output. that's probably not that bad, our stylesheet didn't make use of
this anyway (and pre-23.05 versions of the chapters didn't use quote
elements either).

also updates the nixpkgs manual to clarify that option docs support all
extensions (although it doesn't support headings at all, so heading
anchors don't work by extension).
2023-01-27 20:07:34 +01:00
yater
3e1fdaf2e5 nixos/nextcloud: fix typo in option description
an option services.nextcloud.nginx.enableImagemagick does not exist.
2023-01-26 03:17:22 +01:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Maximilian Bosch
35b146ca31
nixos/nextcloud: fixup openssl compat change
Upon testing the change itself I realized that it doesn't build properly
because

* the `pname` of a php extension is `php-<name>`, not `<name>`.
* calling the extension `openssl-legacy` resulted in PHP trying to compile
  `ext/openssl-legacy` which broke since it doesn't exist:

      source root is php-8.1.12
      setting SOURCE_DATE_EPOCH to timestamp 1666719000 of file php-8.1.12/win32/wsyslog.c
      patching sources
      cdToExtensionRootPhase
      /nix/store/48mnkga4kh84xyiqwzx8v7iv090i7z66-stdenv-linux/setup: line 1399: cd: ext/openssl-legacy: No such file or directory

I didn't encounter that one before because I was mostly interested in
having a sane behavior for everyone not using this "feature" and the
documentation around this. My findings about the behavior with turning
openssl1.1 on/off are still valid because I tested this on `master` with
manually replacing `openssl` by `openssl_1_1` in `php-packages.nix`.

To work around the issue I had to slightly modify the extension
build-system for PHP:

* The attribute `extensionName` is now relevant to determine the output
  paths (e.g. `lib/openssl.so`). This is not a behavioral change for
  existing extensions because then `extensionName==name`.

  However when specifying `extName` in `php-packages.nix` this value is
  overridden and it is made sure that the extension called `extName` NOT
  `name` (i.e. `openssl` vs `openssl-legacy`) is built and installed.

  The `name` still has to be kept to keep the legacy openssl available
  as `php.extensions.openssl-legacy`.

Additionally I implemented a small VM test to check the behavior with
server-side encryption:

* For `stateVersion` below 22.11, OpenSSL 1.1 is used (in `basic.nix`
  it's checked that OpenSSL 3 is used). With that the "default"
  behavior of the module is checked.

* It is ensured that the PHP interpreter for Nextcloud's php-fpm
  actually loads the correct openssl extension.

* It is tested that (encrypted) files remain usable when (temporarily)
  installing OpenSSL3 (of course then they're not decryptable, but on a
  rollback that should still be possible).

Finally, a few more documentation changes:

* I also mentioned the issue in `nextcloud.xml` to make sure the issue
  is at least mentioned in the manual section about Nextcloud. Not too
  much detail here, but the relevant option `enableBrokenCiphersForSSE`
  is referenced.

* I fixed a few minor wording issues to also give the full context
  (we're talking about Nextcloud; we're talking about the PHP extension
  **only**; please check if you really need this even though it's
  enabled by default).

  This is because I felt that sometimes it might be hard to understand
  what's going on when e.g. an eval-warning appears without telling where
  exactly it comes from.
2022-11-11 14:45:46 +01:00
Maximilian Bosch
61128cba67
nixos/nextcloud: minor docs cleanup for openssl change
* s/NextCloud/Nextcloud/g
* `enableBrokenCiphersForSSE` should be enabled by default for any NixOS
  installation from before 22.11 to make sure existing installations
  don't run into the issue. Not the other way round.
* Update release notes to reflect on that.
* Improve wording of the warning a bit: explain which option to change
  to get rid of it.
* Ensure that basic tests w/o `enableBrokenCiphersForSSE` run with
  OpenSSL 3.
2022-11-10 12:17:43 +01:00
Raito Bezarius
394d4de877
nextcloud25: enable by default broken ciphers for NixOS ≤ 22.11 2022-11-10 12:17:43 +01:00
Raito Bezarius
7eefaeb5e3
nextcloud25: use openssl 1.1 as a PHP extension to fix RC4 encryption 2022-11-10 12:17:43 +01:00
Maximilian Bosch
176676c4cf
Merge pull request #192890 from Enzime/fix/nextcloud-space-passwords
nixos/nextcloud: handle passwords with spaces
2022-11-08 18:02:04 +01:00
Maximilian Bosch
ad21c759d4
nixos/nextcloud: fix upgrade warning 2022-11-03 14:32:21 +01:00
Sandro Jäckel
44cdc6104a
nixos/nextcloud: allow changing logType 2022-10-27 23:32:00 +02:00
Maximilian Bosch
40b7f52b8f
nextcloud25: init 2022-10-23 17:20:49 +02:00
Michael Hoang
823e4d2fdb nixos/nextcloud: handle passwords with spaces 2022-09-25 23:57:55 +10:00
pennae
722b99bc0e nixos/*: convert options with admonitions to MD
rendering changes only slightly, most changes are in spacing.
2022-08-31 16:36:16 +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
c915b915b5 nixos/*: md-convert options with unordered lists
mostly no rendering changes. some lists (like simplelist) don't have an
exact translation to markdown, so we use a comma-separated list of
literals instead.
2022-08-31 16:32:53 +02:00
pennae
51a11254a7 nixos/*: literalDocBook -> literalMD
no change to rendered output
2022-08-27 19:18:29 +02:00
Phillip Seeber
9704e9c856 nixos/nextcloud: add option to set fastcgi timeout 2022-08-21 18:14:47 +02:00
pennae
6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
pennae
d0ba463fcf nixos/*: replace <quote> with actual quotes 2022-08-19 22:40:58 +02:00
pennae
a4fdff515b nixos/*: turn inline code blocks into more appropriate things 2022-08-19 22:40:58 +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
16102dce2f nixos/*: replace <code> in option docs with <literal>
markdown can't represent the difference without another extension and
both the html manual and the manpage render them the same, so keeping the
distinction is not very useful on its own. with the distinction removed
we can automatically convert many options that use <code> tags to markdown.

the manpage remains unchanged, html manual does not render
differently (but class names on code tags do change from "code" to "literal").
2022-08-03 21:03:23 +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
stuebinm
3fbc2a433d services/nextcloud: impossible error message 2022-07-06 11:57:44 +02:00
stuebinm
5f4d5fcfa4 services/nextcloud: apply suggestions 2022-07-06 00:16:04 +02:00
stuebinm
dd9200c0a4 services/nextcloud: fix a bug 2022-07-06 00:05:31 +02:00
stuebinm
c3e03d1199
Merge branch 'master' into nextcloud-secrets 2022-06-30 22:24:44 +02:00
stuebinm
ef75aab612 services/nextcloud: more consistent code 2022-06-30 22:21:43 +02:00
Winter
d6f59779c6 nixos/nextcloud: remove extraneous nginx config directive 2022-06-26 14:30:59 -04:00
Winter
e54ddddd2a nixos/nextcloud: make all services run after nextcloud-setup 2022-06-26 14:29:59 -04:00
Winter
6be3ce36b6 nixos/nextcloud: use mkOption.default for datadir 2022-06-26 14:27:03 -04:00
Elis Hirwing
d0862b0ed9
nixos/nextcloud: Upgrade to PHP 8.0 2022-06-08 18:09:07 +02:00
Aleksandar Topuzović
fd86efb8c2 nixos/nextcloud: Fix broken config file 2022-05-28 19:14:12 +01:00
Maximilian Bosch
57a8966d03
Merge pull request #171227 from aidalgol/nextcloud-setup-script-fix
nixos/nextcloud: Fix broken error suppression in setup script
2022-05-27 13:23:10 +02:00
Antoine Martin
f3f0b60006 nixos/nextcloud: use PHP 8 avoiding broken 2FA app 2022-05-23 18:39:39 +02:00
Maximilian Bosch
33c44a1031
nextcloud22: drop
Version 22 will be EOLed in July 2022[1] and we shouldn't have
unsupported software in the soon-to-be-released NixOS 22.05, hence
dropping it already.

[1] https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule
2022-05-21 18:34:28 +02:00
Aidan Gauland
80367c8db8
nixos/nextcloud: Remove confusing comment
There is a comment above the invocation of 'nextcloud-occ app:enable', stating
that the script should not fail if any of the apps cannot be enabled, but there
is nothing in place to suppress errors.  The app:enable command already
continues installing the remaining apps when one fails to install, and we do not
want to suppress errors in the setup script, so this just removes the comment
about not failing.
2022-05-21 10:36:51 +12:00
Maximilian Bosch
f1f849afb8
Merge pull request #171736 from arnottcr/nextcloud
nextcloud24: init at 24.0.0
2022-05-18 12:14:01 +02:00
Maximilian Bosch
a0bcf1e9ea
nixos/nextcloud: styling 2022-05-18 11:50:53 +02:00
Maximilian Bosch
e46bff9569
nixos/nextcloud: upgrade instructions / info for v23 2022-05-18 11:47:50 +02:00
Maximilian Bosch
6f80d6836a
nixos/nextcloud: mariadb workaround is for versions >=24 not needed anymore 2022-05-18 11:22:31 +02:00
Maximilian Bosch
6e6ba864b3
Merge pull request #130434 from mrVanDalo/feature/fix_nextcloud_logging
nextcloud: fix logging parameter
2022-05-17 18:53:36 +02:00
Maximilian Bosch
ab8a7cae2c
nixos/nextcloud: remove unneeded log_level-param
Actually it's called `loglevel` on both v22 and v23.
2022-05-17 18:11:40 +02:00
Aidan Gauland
59244e07f0
nixos/nextcloud: Add option for max-age HSTS directive
* Add an option services.nextcloud.nginx.hstsMaxAge for setting the max-age
  directive of the Strict-Transport-Security HTTP header.

* Make the Strict-Transport-Security HTTP header in the Nginx virtualhost block
  dependant upon the option services.nextcloud.https instead of
  services.nextcloud.nginx.recommendedHttpHeaders, as this header makes no sense
  when not using HTTPS.  (Closes #169465)
2022-05-14 09:04:45 +12:00
Colin Arnott
ecd8d42397
nextcloud24: init at 24.0.0
Added Nextcloud 23 and set it as the default Nextcloud version for the
NixOS module. Added PHP 8.1 as an option for phpPackage and default for
Nextcloud ≥ 24.
2022-05-06 00:37:39 +00:00
stuebinm
92fe62e1de
Merge branch 'master' into nextcloud-secrets 2022-04-24 18:43:28 +02:00
stuebinm
095c27c9d5 services/nixos: decode secret file correctly 2022-04-24 18:03:58 +02:00
stuebinm
b5af071946 services/nextcloud: apply suggestions from PR 118093 2022-04-24 15:48:00 +02:00
Maximilian Bosch
9931c4a407
nixos/nextcloud: make profile.enabled configurable
I recently learned that Nextcloud 23's new profile feature — basically a
way for users to share personal contact details — has a problematic
default setting, profile data is shared with **everyone** by default.

This means that an unauthenticated user can access personal information
by accessing `nextcloud.tld/u/user.name`.

The announcement of v23 states[1]:

> We go a step further and introduce a profile page. Here you can put a
> description of yourself, show links to, for example, social media, what
> department you are in and information on how to contact you. All these
> are of course entirely optional and you can choose what is visible to who!
> The profile and user status are accessible also from our mobile and desktop clients.

It's not mentioned that by default you share personal information[3] with
everyone and personally I think that's somewhat problematic.

To work around that, I decided to add an option for the recently added[2]
and even set it to `false` by default to make an explicit opt-in for
that feature.

[1] https://nextcloud.com/blog/nextcloud-hub-2-brings-major-overhaul-introducing-nextcloud-office-p2p-backup-and-more/
[2] https://github.com/nextcloud/server/pull/31624/files
[3] By default, this affects the following properties:
    * About
    * Full name
    * Headline
    * Organisation
    * Profile picture
    * Role
    * Twitter
    * Website
    Phone, Address and Email are not affected and only shown to
    authenticated users by default.
2022-04-23 13:31:50 +02:00
Jonas Heinrich
047473aa32 nixos/nextcloud: Support create database locally 2022-04-19 14:35:59 -04:00
Maximilian Bosch
15876a546c
nextcloud21: remove
EOLed by upstream in 2022-02[1].

[1] https://docs.nextcloud.com/server/23/admin_manual/release_schedule.html#older-versions
2022-03-15 21:26:46 +01:00
Jörg Thalheim
956dab36a3 nextcloud: use tmpfiles to create group-readable home
users.users.*.createHome makes home only owner-readable.
This breaks nginx reading static assets from nextcloud's home,
after a nixos-rebuild that did not restart nextcloud-setup.

Closes #112639
2022-01-27 19:13:50 +01:00
Lara
7109660b9a nixos/nextcloud: Optionally disable setting HTTP response headers
This commit introduces a new option
`services.nextcloud.nginx.recommendedHttpHeaders` that can be used to
optionally disable serving recommended HTTP Response Headers in nginx.
This is especially useful if some headers are already configured
elsewhere to be served in nginx and thus result in duplicate headers.

Resolves #120223
2022-01-18 18:33:11 +00:00
Graham Christensen
06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
Malte
7c43256291 nixos/nextcloud: update warning for MariaDB >= 10.6 2021-12-13 13:25:21 +01:00
pennae
2d564521c0 treewide: add literalDocBook text to options with complex defaults
some options have default that are best described in prose, such as
defaults that depend on the system stateVersion, defaults that are
derivations specific to the surrounding context, or those where the
expression is much longer and harder to understand than a simple text
snippet.
2021-12-09 01:38:24 +01:00
Ilan Joselevich
c0f4b20db7 nextcloud23: init at 23.0.0 2021-12-02 20:53:21 +02:00
Malte Brandy
868157b9d6
nixos/nextcloud: Adapt cron frequency to changed upstream requirement
https://docs.nextcloud.com/server/22/admin_manual/configuration_server/background_jobs_configuration.html

Says that the job should be run every 5 minutes.
Nextcloud shows a warning in the settings screen whenever the last run
was more than 10 minutes ago.
2021-10-30 14:22:22 +02:00
Maximilian Bosch
04fdff2517
nixos/nextcloud: drop obsolete assertion 2021-10-27 12:54:04 +02:00
Maximilian Bosch
e1e15974f8
nextcloud20: drop
The version 20 of Nextcloud will be EOLed by the end of this month[1].

Since the recommended default (that didn't raise an eval-warning) on
21.05 was Nextcloud 21, this shouldn't affect too many people.

In order to ensure that nobody does a (not working) upgrade across
several major-versions of Nextcloud, I replaced the derivation of
`nextcloud20` with a `throw` that provides instructions how to proceed.

The only case that I consider "risky" is a setup upgraded from 21.05 (or
older) with a `system.stateVersion` <21.11 and with
`services.nextcloud.package` not explicitly declared in its config. To
avoid that, I also left the `else-if` for `stateVersion < 21.03` which
now sets `services.nextcloud.package` to `pkgs.nextcloud20` and thus
leads to an eval-error. This condition can be removed
as soon as 21.05 is EOL because then it's safe to assume that only
21.11. is used as stable release where no Nextcloud <=20 exists that can
lead to such an issue.

It can't be removed earlier because then every `system.stateVersion <
21.11` would lead to `nextcloud21` which is a problem if `nextcloud19`
is still used.

[1] https://docs.nextcloud.com/server/20/admin_manual/release_schedule.html
2021-10-25 01:34:47 +02:00
Maximilian Bosch
3498c5ff3c
nixos/nextcloud: build manual without warnings 2021-10-09 22:45:39 +02:00
Maximilian Bosch
1ee008fcb5
nixos/nextcloud: fixup #119638
A few minor changes to get #119638 - nextcloud: add option to set
datadir and extensions - ready:

* `cfg.datadir` now gets `cfg.home` as default to make the type
  non-nullable.
* Enhanced the `basic` test to check the behavior with a custom datadir
  that's not `/var/lib/nextcloud`.
* Fix hashes for apps in option example.
* Simplify if/else for `appstoreenable` in override config.
* Simplify a few `mapAttrsToList`-expressions in
  `nextcloud-setup.service`.
2021-10-09 22:45:31 +02:00
Robbert Gurdeep Singh
1852212872
nixos/nextcloud: fail systemd-service if apps don't activate 2021-10-09 20:33:17 +02:00
Robbert Gurdeep Singh
18b18929d7
nixos/nextcloud: add settings to manage nextcloud apps
Note the appstoreEnable which will prevent nextcloud form updating
nix-managed apps. This is needed because nextcloud will store an other
version of the app in /var/lib/nextcloud/store-apps and it will
no longer be manageable.
2021-10-09 20:33:16 +02:00
Robbert Gurdeep Singh
7ba02a7b1e
nixos/nextcloud: add services.nextcloud.datadir setting
This option can be used to set an alternative storage location for
files and app metadata.
2021-10-09 20:33:13 +02:00
Maximilian Bosch
f57bed8832
nixos/nextcloud: drop adminpass/dbpass options entirely 2021-10-08 18:30:57 +02:00
Maximilian Bosch
9f37d6aee0
nixos/nextcloud: put secrets into the environment of nextcloud-setup.service
The `$(</path/to/file)`-expansion appears verbatim in the cmdline of
`nextcloud-occ` which means that an unprivileged user could find
sensitive values (i.e. admin password & database password) by monitoring
`/proc/<pid>/cmdline`.

Now, these values don't appear in a command line anymore, but will be
passed as environment variables to `nextcloud-occ`.
2021-10-06 18:18:18 +02:00
Maximilian Bosch
fb40526961
nixos/nextcloud: minor manual improvements
* Linkify documentation about objectstore-feature rather than only
  mentioning it.
* Use `<literal>` where it makes sense.
* Remove unnecessary `Whether to load` from `enableImagemagick` because
  `mkEnableOption` already prepends `Whether to enable` to the given
  description.
2021-10-06 17:33:31 +02:00
Maximilian Bosch
f8feb1ad27
Merge pull request #139604 from mitchmindtree/nextcloud-objectstore
nixos/nextcloud: Add option for using object storage as primary storage
2021-10-05 20:52:24 +02:00
mitchmindtree
c5d08ebee1 nixos/nextcloud: Fix ambiguity in objectstoreConfig string
Previously this was a little tricky to read and had the potential to
cause some ambiguity in string parsing.
2021-10-05 17:07:44 +10:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
mitchmindtree
a539a82707 nixos/nextcloud: Account for nix_read_secret refactor in exception msg
Previously, the `nix_read_pwd` function was only used for reading the
`dbpassFile`, however it has since been refactored to handle reading
other secret files too. This fixes the message of the exception that is
thrown in the case that the file is not present so that it no longer
refers specifically to the `dbpass` file.
2021-10-03 17:29:13 +10:00
mitchmindtree
fbffaddefe nixos/nextcloud: Make objectstore.s3.useSsl explicitly true by default
This appears to match the nextcloud default behaviour observed here:

e2116e2fb2/lib/private/Files/ObjectStore/S3ConnectionTrait.php (L83)
2021-10-03 16:38:56 +10:00
mitchmindtree
b23d6a4113 nixos/nextcloud: Simplify objectstore.s3 options, remove submodule
Removes the submodule in favour of using an attrset.

Also:

- Makes better use of nix's laziness in config expansion.
- Makes use of `boolToString` where applicable.
2021-10-03 16:38:03 +10:00
mitchmindtree
03171ae31a nixos/nextcloud: Remove objectstore.s3.secret option
We should discourage users from adding secrets in a way that allows for
them to end up in the globally readable `/nix/store`. Users should use
the `objectstore.s3.secretFile` option instead.
2021-10-03 12:52:13 +10:00
mitchmindtree
1ed93ac4a1 nixos/nextcloud: Add option for using object storage as primary storage
This allows to declaratively configure an S3 class object storage as the
primary storage for the nextcloud service. Previously, this could only
be achieved by manually editing the `config.php`.

I've started testing this today with my own digitalocean nextcloud
instance, which now points to my digitalocean S3-compatible "Space" and
all appears to be working smoothly.

My motivation for this change is my recent discovery of how much cheaper
some S3-compatible object storage options are compared to digitalocean's
"Volume" options.

Implementation follows the "Simple Storage Service" instructions here:

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html

I have neglected to implement a submodule for the OpenStack Swift
object storage as I don't personally have a use case for it or a method
to test it, however the new `nextcloud.objectstore.s3` submodule should
act as a useful guide for anyone who does wish to implement it.
2021-10-03 12:52:06 +10:00
Maximilian Bosch
cdb48d75c0
Merge pull request #140159 from Ma27/nextcloud-misc
nextcloud: misc changes
2021-10-01 21:08:31 +02:00
Maximilian Bosch
66edc1e846
nixos/nextcloud: use php8 where possible 2021-10-01 17:03:09 +02:00
Maximilian Bosch
675e262f5a
nixos/nextcloud: temp fix for MariaDB >=10.6
The MariaDB version 10.6 doesn't seem supported with current Nextcloud
versions and the test fails with the following error[1]:

    nextcloud # [   14.950034] nextcloud-setup-start[1001]: Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.

According to a support-thread in upstream's Discourse[2] this is because
of a missing support so far.

Considering that we haven't received any bugreports so far - even though
the issue already exists on master - and the workaround[3] appears to
work fine, an evaluation warning for administrators should be
sufficient.

[1] https://hydra.nixos.org/build/155015223
[2] https://help.nextcloud.com/t/update-to-next-cloud-21-0-2-has-get-an-error/117028/15
[3] setting `innodb_read_only_compressed=0`
2021-10-01 15:25:31 +02:00
Maximilian Bosch
eaeb4fe04e
nixos/nextcloud: remove invalid --database-table-prefix option
This doesn't work anymore and thus breaks the installation leaving a
broken `/var/lib/nextcloud`.

It isn't a big deal since we set this value in the override config
before, so the correct table-prefix is still used. In order to confirm
that, I decided to add a custom prefix to the basic test.
2021-08-27 20:21:25 +02:00
stuebinm
a8ecb909c0
nixos/nextcloud: fixed secretFile example 2021-08-01 20:47:38 +02:00
stuebinm
164f8c9457
nixos/nextcloud: deduplicate file reading
This combines the two functions nix_read_pwd and nix_read_secrets into a
single function nix_read_file, which takes two arguments: the file to be
read, and an error message that should be printed if reading the file
failed.
2021-08-01 20:39:29 +02:00
Maximilian Bosch
ccd348f846
Merge pull request #129732 from nivadis/patch-2
nextcloud: remove expires header
2021-07-23 12:29:52 +02:00
Ingolf Wagner
18d5ed658b
nextcloud: fix logging parameter 2021-07-17 10:19:45 +02:00
Valentin Conrad
ceef268c4b
nextcloud: remove expires header
nextcloud default nginx config did not include the expires config
see: https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
2021-07-09 10:50:25 +02:00
Maximilian Bosch
e05f4101c1
nextcloud22: init at 22.0.0 2021-07-08 17:00:04 +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
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
stuebinm
83a669a0be
nixos/nextcloud: better json typechecking
this now uses the pkgs.formats.json instead of the builtin function to
serialise json, which comes with a type signature that we can pass to mkOptions
2021-03-31 14:56:14 +02:00
stuebinm
727bdd736c
nixos/nextcloud: use array_merge instead of array_push
This should correctly merge the various configs (via nix module options,
the secretFile option, and the extraOptions option).
2021-03-31 14:52:45 +02:00
stuebinm
4ca2f27a60
nixos/nextcloud: allow more declarative config
This adds two options to the nextcloud module, with the aim of allowing
the entirety of `config.php` to be set declaratively:
1. `services.nextcloud.extraOptions`, which takes free-form options
   given as an attribute set, and reads them in via json from the php
   side (which lets us prevent syntax errors in php, if not key errors –
   given the full length of nextcloud's potential options, I don't think
   specifying them all via Nix is a viable option)
2. `services.nextcloud.secretFile`, which takes a path to a json file
   specifying options which a user may want to keep secret and not add
   to their nix store; this file is read in the same way on startup by
   php, and may even overwrite options set in some other way.
2021-03-30 20:07:50 +02:00
Benjamin Koch
6e6f5f0923 nixos/nextcloud: Rename option to services.nextcloud.disableImagemagick
... as was suggested in the related issue
2021-03-09 00:38:39 +01:00
Benjamin Koch
e30311bc68 nixos/nextcloud: Conditionally enable ImageMagick PHP extension 2021-03-08 01:06:48 +01:00
Maximilian Bosch
690449f3ae
nixos/nextcloud: enable apc cache for cli if apcu is enabled
As described in the admin manual[1] of Nextcloud.

[1] https://docs.nextcloud.com/server/21/admin_manual/configuration_server/caching_configuration.html#id1
2021-03-04 21:13:51 +01:00
Maximilian Bosch
797721423c
nixos/nextcloud: update nginx config
Please note that I didn't use the current nginx config from the
administration manual as this would've broken ACME challenges[1].

Also added a fix for Microsoft clients.

[1] https://github.com/nextcloud/documentation/pull/5825#issuecomment-783977761
2021-02-24 23:01:14 +01:00
Maximilian Bosch
b1f65920c3
nixos/nextcloud: add defaultPhoneRegion option for v21 2021-02-24 22:27:39 +01:00