Unverified Commit 336f1702 authored by Arnout Engelen's avatar Arnout Engelen Committed by GitHub
Browse files

nixos/onlyoffice: add allowLocalConnections option (#347209)

parents 51c5df99 cd8540da
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ in
      description = "Port the OnlyOffice document server should listen on.";
    };

    allowLocalConnections = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = "Whether to allow the document server to download files from private IP addresses.";
    };

    examplePort = lib.mkOption {
      type = lib.types.port;
      default = null;
@@ -308,6 +314,10 @@ in
            # https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/run-document-server.sh
            FS_SECRET_STRING=$(cut -d '"' -f 2 < ${cfg.securityNonceFile})
            jq '
            ${lib.optionalString cfg.allowLocalConnections ''
              .services.CoAuthoring."request-filtering-agent".allowPrivateIPAddress = true |
              .services.CoAuthoring."request-filtering-agent".allowMetaIPAddress = true |
            ''}
              .storage.fs.secretString = "'$FS_SECRET_STRING'" |
              .services.CoAuthoring.server.port = ${toString cfg.port} |
              .services.CoAuthoring.sql.dbHost = "${cfg.postgresHost}" |