summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2011-02-13 11:41:55 (GMT)
committer tg(x) <*@tg-x.net>2013-06-05 15:58:40 (GMT)
commit568aef2c60e8b76545c8d5600f6a08fe25d88189 (patch)
tree4d41f8236e9a5877a9574a5a0a47ad8c59f76f25
parent3614b92c53ccb4955eaa665a9c264b50bb8ce1ae (diff)
improved zone configuration: allow multiple views
-rwxr-xr-xbin/gitzone3
-rw-r--r--etc/gitzone.conf20
2 files changed, 16 insertions, 7 deletions
diff --git a/bin/gitzone b/bin/gitzone
index c987248..a90dd68 100755
--- 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
index e8556d1..b80c1ec 100644
--- 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
# },
}