-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Nextcloud: add openFirewall setting #50256
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,10 @@ in { | |
enable = mkEnableOption "nextcloud"; | ||
hostName = mkOption { | ||
type = types.str; | ||
description = "FQDN for the nextcloud instance."; | ||
description = '' | ||
FQDN for the nextcloud instance. Automatically added to | ||
<literal>extraTrustedDomains</literal> are accepted. | ||
''; | ||
}; | ||
home = mkOption { | ||
type = types.str; | ||
|
@@ -50,6 +53,13 @@ in { | |
default = false; | ||
description = "Enable if there is a TLS terminating proxy in front of nextcloud."; | ||
}; | ||
openFirewall = mkOption { | ||
type = types.bool; | ||
default = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure we don't want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh my bad I definitely wanted to set it to false but forgot. |
||
description = '' | ||
Whether to automatically open the specified ports in the firewall. | ||
''; | ||
}; | ||
|
||
maxUploadSize = mkOption { | ||
default = "512M"; | ||
|
@@ -209,8 +219,8 @@ in { | |
default = []; | ||
description = '' | ||
Trusted domains, from which the nextcloud installation will be | ||
acessible. You don't need to add | ||
<literal>services.nextcloud.hostname</literal> here. | ||
acessible. You don't need to add either localhost or | ||
<literal>services.nextcloud.hostName</literal> here. | ||
''; | ||
}; | ||
}; | ||
|
@@ -256,6 +266,10 @@ in { | |
]; | ||
} | ||
|
||
{ | ||
networking.firewall.allowedTCPPorts = if cfg.openFirewall then [ 80 443 ] else []; | ||
} | ||
|
||
{ systemd.timers."nextcloud-cron" = { | ||
wantedBy = [ "timers.target" ]; | ||
timerConfig.OnBootSec = "5m"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be better placed in
services.nginx
, as it would open the firewall for all ofnginx
, and not only foropensmtpd
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would make sense th have the setting for both modules (with nextcloud passing it to nginx if nginx is enabled). Now if that slows evaluation, that looks bad xD