diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-04-28 02:56:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 02:56:16 +0200 |
commit | 1f6d33ef268b688442c1157967a31591798b206e (patch) | |
tree | 8fbb690405a433f1564ed9fee52bcbd78990aef3 /nixos/modules | |
parent | c6518b5aafc96aea316384f93861ae3c43c2def5 (diff) | |
parent | 4062592f3a17d814812ca696604ea22ad615ca12 (diff) | |
download | nixlib-1f6d33ef268b688442c1157967a31591798b206e.tar nixlib-1f6d33ef268b688442c1157967a31591798b206e.tar.gz nixlib-1f6d33ef268b688442c1157967a31591798b206e.tar.bz2 nixlib-1f6d33ef268b688442c1157967a31591798b206e.tar.lz nixlib-1f6d33ef268b688442c1157967a31591798b206e.tar.xz nixlib-1f6d33ef268b688442c1157967a31591798b206e.tar.zst nixlib-1f6d33ef268b688442c1157967a31591798b206e.zip |
Merge pull request #86013 from Ma27/cups-allow-from
nixos/printing: make access to web-interface configurable
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/printing/cupsd.nix | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index 59306d625e6b..e67badfcd29e 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -153,6 +153,16 @@ in ''; }; + allowFrom = mkOption { + type = types.listOf types.str; + default = [ "localhost" ]; + example = [ "all" ]; + apply = concatMapStringsSep "\n" (x: "Allow ${x}"); + description = '' + From which hosts to allow unconditional access. + ''; + }; + bindirCmds = mkOption { type = types.lines; internal = true; @@ -403,19 +413,19 @@ in <Location /> Order allow,deny - Allow localhost + ${cfg.allowFrom} </Location> <Location /admin> Order allow,deny - Allow localhost + ${cfg.allowFrom} </Location> <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny - Allow localhost + ${cfg.allowFrom} </Location> <Policy default> |