NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.63k stars 13.1k forks source link

unable to configure Onlyoffice documentserver default.json file #317225

Open hatch01 opened 1 month ago

hatch01 commented 1 month ago

Describe the bug

I am unable to edit the /run/onlyoffice/config/default.json file to configure onlyoffice documentserver through nix parameters. And if I edit it manually, it is overwritten on each reboot.

Steps To Reproduce

Steps to reproduce the behavior:

  1. enable onlyoffice document server services.onlyoffice = {enable = true; hostname = "localhost";};
  2. echo /run/onlyoffice/config/default.json
  3. reboot
  4. the modification in default.json disappear

Expected behavior

Being able to configure the default.json file directly in the service config. It is a json file, so maybe it is possible to just set any parameters from the nix config to the json file with a simple conversion from nix to json.

Additional context

In my case, I need to modify these values :

      "request-filtering-agent": {
        "allowPrivateIPAddress": true,
        "allowMetaIPAddress": false
      },

Notify maintainers

@SuperSandro2000

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32, NixOS, 24.05 (Uakari), 24.05.20240531.805a384`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `not found`

Add a :+1: reaction to issues you find important.

hatch01 commented 1 month ago

I tried to add this which according to this line

  environment.sessionVariables = {
    ALLOW_META_IP_ADDRESS = "true";
    ALLOW_PRIVATE_IP_ADDRESS = "true";
  };

But this does not seem to have any effect.

SuperSandro2000 commented 1 month ago

We are doing some hacky stuff at https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/web-apps/onlyoffice.nix#L220-L259

we probably need to add a new option, to generally patch that file.