Delegation: some final steps.
This commit is contained in:
parent
f817927c4d
commit
adf223fe38
1 changed files with 10 additions and 8 deletions
|
@ -392,13 +392,13 @@ class DNSManager::Storage
|
||||||
|
|
||||||
# Removes a delegation file, then update the token file.
|
# Removes a delegation file, then update the token file.
|
||||||
def remove_delegation_file(domain : String) : Nil
|
def remove_delegation_file(domain : String) : Nil
|
||||||
Baguette::Log.info "Removing a delegation file."
|
Baguette::Log.info "(domain #{domain}) removing a delegation file."
|
||||||
File.delete "#{@delegationdir}/#{domain}"
|
File.delete "#{@delegationdir}/#{domain}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Removes a Bind9 zonefile.
|
# Removes a Bind9 zonefile.
|
||||||
def remove_bind9_zonefile(domain : String) : Nil
|
def remove_bind9_zonefile(domain : String) : Nil
|
||||||
Baguette::Log.info "Removing a Bind9 zone file."
|
Baguette::Log.info "(domain #{domain}) removing a Bind9 zone file."
|
||||||
File.delete "#{@zonefiledir}/#{domain}"
|
File.delete "#{@zonefiledir}/#{domain}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -478,17 +478,16 @@ class DNSManager::Storage
|
||||||
|
|
||||||
# Remove the user's domain when he is the only owner.
|
# Remove the user's domain when he is the only owner.
|
||||||
if domain_cloned.owners.empty?
|
if domain_cloned.owners.empty?
|
||||||
# The domain may not have tokens.
|
wipe_domain user_id, domain.name
|
||||||
@tokens_by_domain.delete? domain_cloned.name
|
wipe_zone user_id, domain.name
|
||||||
@zones_by_domain.delete domain_cloned.name
|
|
||||||
@domains_by_name.delete domain_cloned.name
|
|
||||||
remove_bind9_zonefile domain_cloned.name
|
|
||||||
else
|
else
|
||||||
@domains_by_name.update domain_cloned
|
@domains_by_name.update domain_cloned
|
||||||
end
|
end
|
||||||
|
rescue e
|
||||||
|
Baguette::Log.error "while removing the domain #{domain.name}: #{e}"
|
||||||
end
|
end
|
||||||
rescue e
|
rescue e
|
||||||
Baguette::Log.error "while removing a domain: #{e}"
|
Baguette::Log.error "while removing all user data (uid: #{user_id}): #{e}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Removes user data.
|
# Removes user data.
|
||||||
|
@ -563,6 +562,9 @@ class DNSManager::Storage
|
||||||
# Remove the delegation file and regenerate the delegation files.
|
# Remove the delegation file and regenerate the delegation files.
|
||||||
if delegation = zone.delegation
|
if delegation = zone.delegation
|
||||||
remove_delegation_file domain_name
|
remove_delegation_file domain_name
|
||||||
|
# Once the new delegation file has been removed, the script generating the (root) zone file must
|
||||||
|
# be informed by touching a file (named "delegation token file" in the source code).
|
||||||
|
update_delegation_token_file
|
||||||
end
|
end
|
||||||
|
|
||||||
# There is no need to keep a generated zone file.
|
# There is no need to keep a generated zone file.
|
||||||
|
|
Loading…
Add table
Reference in a new issue