Merge pull request #86013 from Ma27/cups-allow-from

nixos/printing: make access to web-interface configurable
This commit is contained in:
Maximilian Bosch 2020-04-28 02:56:16 +02:00 committed by GitHub
commit 1f6d33ef26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -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>