Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onlyoffice - new boolean: allow LAN/localhost connections #347209

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions nixos/modules/services/web-apps/onlyoffice.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ in
description = "Port the OnlyOffice document server should listen on.";
};

allowLocalConnections = lib.mkOption {
type = lib.types.bool;
default = false;
description = "If true, allows clients with LAN-range IPs to access your instance.";
};

examplePort = lib.mkOption {
type = lib.types.port;
default = null;
Expand Down Expand Up @@ -222,6 +228,13 @@ in
cp -r ${cfg.package}/etc/onlyoffice/documentserver/* /run/onlyoffice/config/
chmod u+w /run/onlyoffice/config/default.json

#Allow LAN-range IPs if set true
${lib.optionalString (cfg.allowLocalConnections) ''
sed -i 's/"allowPrivateIPAddress": false/"allowPrivateIPAddress": true/' /run/onlyoffice/config/default.json
sed -i 's/"allowMetaIPAddress": false/"allowMetaIPAddress": true/' /run/onlyoffice/config/default.json
''}


# Allow members of the onlyoffice group to serve files under /var/lib/onlyoffice/documentserver/App_Data
chmod g+x /var/lib/onlyoffice/documentserver

Expand Down