Commit Graph

35 Commits

Author SHA1 Message Date
Arnout Engelen
336f17028a nixos/onlyoffice: add allowLocalConnections option (#347209) 2026-04-22 11:56:05 +00:00
Bob Bobber
cd8540da55 nixos/onlyoffice: add allowLocalConnections option
Allow the document server to download files from private and
link-local IP addresses by setting `allowPrivateIPAddress` and
`allowMetaIPAddress` to true in the request-filtering-agent
configuration.

Resolves https://github.com/NixOS/nixpkgs/issues/317225
2026-03-30 17:39:46 -04:00
Arnout Engelen
6dd27a616e x2t: move under onlyoffice-documentserver
No longer makes sense to have this as its own entry
2026-03-19 16:20:07 +01:00
Arnout Engelen
f9576bd74d nixos/onlyoffice: declaratively manage fonts
This refactor has several additional advantages:

* simplify by moving logic from service startup to build time, also
  making the service more stateless because they can now be loaded
  from the nix store instead of keeping this state in /var/lib/onlyoffice
* improve disk usage by reducing the need for copying over symlinking

This also unlocks further simplifications: it removes the need to have
`pkgs/by-name/x2/x2t` as a separate package and brings us closer to
not needing the fhs wrapper for the converter and docservice. Those
are for the future, though.
2026-01-19 13:55:40 +01:00
Arnout Engelen
75cf04564d onlyoffice-documentserver: build from source
instead of relying on upstream deb
2026-01-08 15:40:29 +01:00
Arnout Engelen
dc155f27ff nixos/onlyoffice: add wopi setting (#417590) 2025-12-19 17:01:55 +00:00
Artturin
0f9e4925bd nixos/onlyoffice: Add NOTE to securityNonceFile
`JK6^MWnHuS04rgR0Gle*oCb6lEL2S!Nd0i6!aMNC27dxhu&ADq$vlwjNQY9VwNQr` gave

```
nginx: [emerg] unknown "vlwjnqy9vwnqr" variable
nginx: configuration file /etc/nginx/nginx.conf test failed
```

I updated the system at the same time so it took a while to find
the issue.
2025-12-16 16:25:05 +02:00
Eli Ribble
9319694d25 nixos/onlyoffice: add wopi setting
Expose setting for enabling WOPI support flag in onlyoffice. It's useful
and previously was hard-coded to disabled.

See https://api.onlyoffice.com/docs/docs-api/more-information/faq/using-wopi/
2025-12-10 15:32:07 +00:00
Arnout Engelen
d199ea28a5 nixos/onlyoffice: document securityNonceFile permissions
Easy to make a mistake with when using a secrets management system such
as agenix
2025-11-28 10:28:14 +01:00
Marcel
8a1a9cd932 nixos/onlyoffice: wait for rabbitmq 2025-11-16 14:51:30 +01:00
Marcel
5c2683eb21 nixos/onlyoffice: require a user supplied nonce
Co-authored-by: Martin Weinelt <hexa@darmstadt.ccc.de>
2025-11-16 02:30:52 +01:00
Arnout Engelen
50f126198c nixos/onlyoffice: allow specifying a nonce (#461561) 2025-11-14 16:22:41 +00:00
Arnout Engelen
6efa083e17 nixos/onlyoffice: update maintainership
Sandro expressed desire to transfer maintainership of this package.
While I don't expect to be a super active maintainer, I do use this
package and am relatively familiar with its internals, so I can take
this on.
2025-11-14 16:55:26 +01:00
Arnout Engelen
acad2ac1d3 nixos/onlyoffice: allow specifying a nonce
Co-Authored-By: Marcel <me@m4rc3l.de>
2025-11-13 15:01:47 +01:00
Arnout Engelen
14a3cc02bd onlyoffice: fix syntax error
The `more_set_headers` syntax was wrong.

Syntax docs: https://github.com/openresty/headers-more-nginx-module?tab=readme-ov-file#more_set_headers

This led to:

```
{\"Exception\":\"InvalidArgumentException\",\"Message\":\"\\\"attachment;\\\" is not valid header name.\",\"Code\":0,\"Trace\":[
{\"file\":\"/nix/store/4y4c191pd9pa5nd78i8flvkf50gd4lvp-nextcloud-31.0.8/3rdparty/guzzlehttp/psr7/src/MessageTrait.php\",\"line\":153,\"function\":\"assertHeader\",\"class\":\"GuzzleHttp\\\\Psr7\\\\Response\",\"type\":\"->\"},
```

Introduced in https://github.com/NixOS/nixpkgs/pull/419765
2025-09-18 16:17:03 +02:00
w
95452e8797 nixos/onlyoffice: fix gixy error (#419765) 2025-08-14 13:58:47 +02: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
Sandro Jäckel
ed26b7b0c3 nixos/onlyoffice: misc cleanup 2025-04-04 11:37:33 +02:00
Arnout Engelen
ea0b776f71 x2t: init at 8.3.2 2025-04-03 20:08:48 +02:00
piegames
603733851b treewide: Fix incorrect string escapes 2025-01-07 19:49:28 +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
Benedikt Ritter
57ea5be929 onlyoffice: Remove top-level with lib;
Prepend affected components with `lib.` instead.
2024-07-10 10:42:29 +02:00
Benedikt Ritter
d61489db1a onlyoffice: Fix typos 2024-07-10 09:14:21 +02:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
h7x4
0a37316d6c treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Maximilian Bosch
48459567ae nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgresql15
Closes #216989

First of all, a bit of context: in PostgreSQL, newly created users don't
have the CREATE privilege on the public schema of a database even with
`ALL PRIVILEGES` granted via `ensurePermissions` which is how most of
the DB users are currently set up "declaratively"[1]. This means e.g. a
freshly deployed Nextcloud service will break early because Nextcloud
itself cannot CREATE any tables in the public schema anymore.

The other issue here is that `ensurePermissions` is a mere hack. It's
effectively a mixture of SQL code (e.g. `DATABASE foo` is relying on how
a value is substituted in a query. You'd have to parse a subset of SQL
to actually know which object are permissions granted to for a user).

After analyzing the existing modules I realized that in every case with
a single exception[2] the UNIX system user is equal to the db user is
equal to the db name and I don't see a compelling reason why people
would change that in 99% of the cases. In fact, some modules would even
break if you'd change that because the declarations of the system user &
the db user are mixed up[3].

So I decided to go with something new which restricts the ways to use
`ensure*` options rather than expanding those[4]. Effectively this means
that

* The DB user _must_ be equal to the DB name.
* Permissions are granted via `ensureDBOwnerhip` for an attribute-set in
  `ensureUsers`. That way, the user is actually the owner and can
  perform `CREATE`.
* For such a postgres user, a database must be declared in
  `ensureDatabases`.

For anything else, a custom state management should be implemented. This
can either be `initialScript`, doing it manual, outside of the module or
by implementing proper state management for postgresql[5], but the
current state of `ensure*` isn't even declarative, but a convergent tool
which is what Nix actually claims to _not_ do.

Regarding existing setups: there are effectively two options:

* Leave everything as-is (assuming that system user == db user == db
  name): then the DB user will automatically become the DB owner and
  everything else stays the same.

* Drop the `createDatabase = true;` declarations: nothing will change
  because a removal of `ensure*` statements is ignored, so it doesn't
  matter at all whether this option is kept after the first deploy (and
  later on you'd usually restore from backups anyways).

  The DB user isn't the owner of the DB then, but for an existing setup
  this is irrelevant because CREATE on the public schema isn't revoked
  from existing users (only not granted for new users).

[1] not really declarative though because removals of these statements
    are simply ignored for instance: https://github.com/NixOS/nixpkgs/issues/206467
[2] `services.invidious`: I removed the `ensure*` part temporarily
    because it IMHO falls into the category "manage the state on your
    own" (see the commit message). See also
    https://github.com/NixOS/nixpkgs/pull/265857
[3] e.g. roundcube had `"DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";`
[4] As opposed to other changes that are considered a potential fix, but
    also add more things like collation for DBs or passwords that are
    _never_ touched again when changing those.
[5] As suggested in e.g. https://github.com/NixOS/nixpkgs/issues/206467
2023-11-13 17:16:25 +01:00
Sandro
4fba4ceab7 Merge pull request #215407 from aopom/onlyoffice-mergeable-execstartpre
nixos/onlyoffice: allow ExecStartPre additions
2023-02-17 13:37:39 +01:00
Tom Hubrecht
405984ac13 nixos/onlyoffice: Fix initial permissions for the documentserver data 2023-02-10 19:16:19 +01:00
ppom
5a1ba62841 onlyoffice: allow ExecStartPre additions 2023-02-09 00:56:08 +01:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Naïm Favier
0ff3b35356 nixos/doc: fix some options 2022-12-08 17:52:52 +01:00
Sandro Jäckel
0a564318e8 nixos/onlyoffice: fix database upgrades 2022-09-25 01:35:01 +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
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
Sandro Jäckel
5e297d07aa nixos/onlyoffice: init 2022-07-16 23:32:07 +02:00