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

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 { bindirCmds = mkOption {
type = types.lines; type = types.lines;
internal = true; internal = true;
@ -403,19 +413,19 @@ in
<Location /> <Location />
Order allow,deny Order allow,deny
Allow localhost ${cfg.allowFrom}
</Location> </Location>
<Location /admin> <Location /admin>
Order allow,deny Order allow,deny
Allow localhost ${cfg.allowFrom}
</Location> </Location>
<Location /admin/conf> <Location /admin/conf>
AuthType Basic AuthType Basic
Require user @SYSTEM Require user @SYSTEM
Order allow,deny Order allow,deny
Allow localhost ${cfg.allowFrom}
</Location> </Location>
<Policy default> <Policy default>