Merge pull request 'Fix regression of peach-dyndns-server' (#14) from fix-regression into master
Reviewed-on: #14
This commit is contained in:
commit
216c29ef02
21
README.md
21
README.md
|
@ -44,7 +44,7 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test peach-bind9 is running,
|
# test peach-bind9 is running,
|
||||||
```
|
```
|
||||||
# this returns version of bind running
|
# this returns version of bind running
|
||||||
dig -t txt -c chaos VERSION.BIND @IP_ADDRESS_OF_SERVER
|
dig -t txt -c chaos VERSION.BIND @IP_ADDRESS_OF_SERVER
|
||||||
|
@ -56,4 +56,23 @@ nslookup blue.dyn.peachcloud.org YOUR_SERVER_IP_ADDRESS
|
||||||
nslookup blue.dyn.peachcloud.org ns.peachcloud.org
|
nslookup blue.dyn.peachcloud.org ns.peachcloud.org
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# test nsupdate is working
|
||||||
|
|
||||||
|
```
|
||||||
|
/usr/bin/nsupdate -k /var/lib/peachcloud/peach-dyndns/tsig.key -v <<EOF
|
||||||
|
server ns.peachcloud.org
|
||||||
|
zone bluemirage889.dyn.peachcloud.org
|
||||||
|
update delete bluemirage889.dyn.peachcloud.org
|
||||||
|
update add bluemirage889.dyn.peachcloud.org 30 A 174.76.52.101
|
||||||
|
send
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
```
|
||||||
|
cat <<EOF | /usr/bin/nsupdate -k /var/lib/peachcloud/peach-dyndns/tsig.key -v
|
||||||
|
server ns.peachcloud.org
|
||||||
|
zone bluemirage889.dyn.peachcloud.org
|
||||||
|
update delete bluemirage889.dyn.peachcloud.org
|
||||||
|
update add bluemirage889.dyn.peachcloud.org 30 A 174.76.52.101
|
||||||
|
send
|
||||||
|
EOF
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
cargo build --release --target=x86_64-unknown-linux-musl
|
cargo build --release --target=x86_64-unknown-linux-musl
|
||||||
|
cp target/x86_64-unknown-linux-musl/release/peach-dyndns-server devops/files/peach-dyndns-server
|
||||||
|
|
Binary file not shown.
|
@ -1,12 +1,4 @@
|
||||||
#
|
#
|
||||||
# Allow peach-dyndns to reload bind as sudo
|
# Allow peach-dyndns to reload bind as sudo
|
||||||
#
|
#
|
||||||
|
peach-dyndns ALL=(ALL) NOPASSWD: /usr/bin/reloadbind
|
||||||
# User alias for bind-ctl which can reload bind
|
|
||||||
User_Alias BIND_CTRL = peach-dyndns
|
|
||||||
|
|
||||||
# Command alias for reboot and shutdown
|
|
||||||
Cmnd_Alias RELOADBIND = /usr/bin/reloadbind
|
|
||||||
|
|
||||||
# Allow BIND_CTRL users to execute RELOADBIND command without password
|
|
||||||
BIND_CTRL ALL=(ALL) NOPASSWD: RELOADBIND
|
|
|
@ -7,5 +7,6 @@
|
||||||
// If you are just adding zones, please do that in /etc/bind/named.conf.local
|
// If you are just adding zones, please do that in /etc/bind/named.conf.local
|
||||||
|
|
||||||
include "/etc/bind/named.conf.options";
|
include "/etc/bind/named.conf.options";
|
||||||
|
include "/etc/bind/dyn.peachcloud.org.keys";
|
||||||
include "/etc/bind/named.conf.local";
|
include "/etc/bind/named.conf.local";
|
||||||
include "/etc/bind/named.conf.default-zones";
|
include "/etc/bind/named.conf.default-zones";
|
|
@ -100,14 +100,26 @@ pub fn generate_zone(full_domain: &str) -> Result<String, PeachDynDnsError> {
|
||||||
.append(true)
|
.append(true)
|
||||||
.open(bind_conf_path)
|
.open(bind_conf_path)
|
||||||
.unwrap_or_else(|_| panic!("failed to open {}", bind_conf_path));
|
.unwrap_or_else(|_| panic!("failed to open {}", bind_conf_path));
|
||||||
|
// this commented out section, with update-policy stopped working
|
||||||
|
// so we are now using allow-update
|
||||||
|
// let zone_section_text = format!(
|
||||||
|
// "\
|
||||||
|
// zone \"{full_domain}\" {{
|
||||||
|
// type master;
|
||||||
|
// file \"/var/lib/bind/{full_domain}\";
|
||||||
|
// update-policy {{
|
||||||
|
// grant {full_domain} self {full_domain};
|
||||||
|
// }};
|
||||||
|
// }};
|
||||||
|
// ",
|
||||||
|
// full_domain = full_domain
|
||||||
|
// );
|
||||||
let zone_section_text = format!(
|
let zone_section_text = format!(
|
||||||
"\
|
"\
|
||||||
zone \"{full_domain}\" {{
|
zone \"{full_domain}\" {{
|
||||||
type master;
|
type master;
|
||||||
file \"/var/lib/bind/{full_domain}\";
|
file \"/var/lib/bind/{full_domain}\";
|
||||||
update-policy {{
|
allow-update {{key \"{full_domain}\";}};
|
||||||
grant {full_domain} self {full_domain};
|
|
||||||
}};
|
|
||||||
}};
|
}};
|
||||||
",
|
",
|
||||||
full_domain = full_domain
|
full_domain = full_domain
|
||||||
|
|
Loading…
Reference in New Issue