commit 568aef2c60e8b76545c8d5600f6a08fe25d88189
parent 3614b92c53ccb4955eaa665a9c264b50bb8ce1ae
Author: tg(x) <*@tg-x.net>
Date: Sun, 13 Feb 2011 12:41:55 +0100
improved zone configuration: allow multiple views
Diffstat:
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/bin/gitzone b/bin/gitzone
@@ -196,7 +196,8 @@ sub install_zones {
my $zone = basename $f;
my $view = $zones->{$user}->{$f};
$view = $default_view if $view eq 1;
- `$rndc reload '$zone' $class $view`;
+ $view = [$view] if ref $view ne 'ARRAY';
+ `$rndc reload '$zone' $class $_` for @$view;
}
unlink $list_file;
diff --git a/etc/gitzone.conf b/etc/gitzone.conf
@@ -28,20 +28,28 @@ $class = 'IN';
# default view of the zones (optional)
$default_view = '';
-# Defines which files in a user's repo can be loaded as zone files,
-# this is merged with $zones_conf above, values specified here overwrite
-# you can also define which view a zone belongs to (1 means $default_view).
+# $zones defines which files in a user's repo can be loaded as zone files.
+#
+# You can define which view a zone belongs to, this can be
+# - a string
+# - an array with multiple views is allowed
+# - or 1 to use the $default_view
+#
# The basename of the files listed must be identical to the zone name.
# If a file name starts with a / it's treated as a BIND config file
# and every zone listed there is allowed for the user.
+#
# The -default key is tried first for every user, then it's merged with the user-specific config.
+
$zones = {
# -default => {
-# "/etc/bind/users/$user.conf" => 1, # allow every zone from this file, use the default view
+# "/etc/bind/users/$user.conf" => 1, # allow every zone from this file, use the default view
# },
# user1 => {
# '/etc/bind/users/user1-local.conf' => 'local', # allow every zone from this file, use the local view
-# 'example.com' => 1, # allow example.com, use the default view
-# 'local/example.net' => 'local', # allow example.net, use the local view
+# 'example.com' => 1, # allow example.com, use the default view
+# 'local/example.net' => 'local', # allow example.net, use the local view
+# 'extern/example.net' => 'extern', # allow example.net, use the extern view
+# 'common/example.net' => [qw(extern local)], # allow example.net, use both the local & extern view
# },
}