Monorepo for Tangled tangled.org

nix/modules/knot: make ssh ports configurable #716

closed opened by boltless.me targeting master from push-qrzyzsxkvpwt
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3m3uxsrdnqk22
+9 -2
Diff #0
+9 -2
nix/modules/knot.nix
··· 32 32 description = "User that hosts git repos and performs git operations"; 33 33 }; 34 34 35 + sshPorts = mkOption { 36 + type = types.listOf types.port; 37 + default = [22]; 38 + description = "Specifies ports used for ssh"; 39 + }; 40 + 35 41 openFirewall = mkOption { 36 42 type = types.bool; 37 43 default = true; 38 - description = "Open port 22 in the firewall for ssh"; 44 + description = "Open ssh port in the firewall"; 39 45 }; 40 46 41 47 stateDir = mkOption { ··· 138 144 139 145 services.openssh = { 140 146 enable = true; 147 + ports = cfg.sshPorts; 141 148 extraConfig = '' 142 149 Match User ${cfg.gitUser} 143 150 AuthorizedKeysCommand /etc/ssh/keyfetch_wrapper ··· 206 213 }; 207 214 }; 208 215 209 - networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [22]; 216 + networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall cfg.sshPorts; 210 217 }; 211 218 }

History

3 rounds 4 comments
sign up or login to add to the discussion
1 commit
expand
nix/modules/knot: remove firewall settings
3/3 success
expand
expand 4 comments

if openFirewall is not set to true, this is already configurable is it not?

Well.. it is, but as ssh ports are also configurable and the firewall should follow the correct configured ssh ports, I think removing the firewall settings will make things simpler. Users can configure there networks by their own.

ok I'm closing this. the description explicitly states it opens hard-coded port 22, so I think it's fine to leave it not following config.services.openssh.posts.

closed without merging
1 commit
expand
nix/modules/knot: remove firewall settings
3/3 success
expand
expand 0 comments
boltless.me submitted #0
1 commit
expand
nix/modules/knot: make ssh ports configurable
2/2 success
expand
expand 0 comments