Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
30178ef0
Commit
30178ef0
authored
Aug 01, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a --force flag to dns_update
parent
cd590259
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
daemon.py
management/daemon.py
+1
-1
dns_update.py
management/dns_update.py
+4
-4
dns_update
tools/dns_update
+5
-1
No files found.
management/daemon.py
View file @
30178ef0
...
...
@@ -65,7 +65,7 @@ def mail_domains():
def
dns_update
():
from
dns_update
import
do_dns_update
try
:
return
do_dns_update
(
env
)
return
do_dns_update
(
env
,
force
=
request
.
form
.
get
(
'force'
,
''
)
==
'1'
)
except
Exception
as
e
:
return
(
str
(
e
),
500
)
...
...
management/dns_update.py
View file @
30178ef0
...
...
@@ -54,7 +54,7 @@ def get_custom_dns_config(env):
except
:
return
{
}
def
do_dns_update
(
env
):
def
do_dns_update
(
env
,
force
=
False
):
# What domains (and their zone filenames) should we build?
domains
=
get_dns_domains
(
env
)
zonefiles
=
get_dns_zones
(
env
)
...
...
@@ -71,7 +71,7 @@ def do_dns_update(env):
# See if the zone has changed, and if so update the serial number
# and write the zone file.
if
not
write_nsd_zone
(
domain
,
"/etc/nsd/zones/"
+
zonefile
,
records
,
env
):
if
not
write_nsd_zone
(
domain
,
"/etc/nsd/zones/"
+
zonefile
,
records
,
env
,
force
):
# Zone was not updated. There were no changes.
continue
...
...
@@ -288,7 +288,7 @@ def build_tlsa_record(env):
########################################################################
def
write_nsd_zone
(
domain
,
zonefile
,
records
,
env
):
def
write_nsd_zone
(
domain
,
zonefile
,
records
,
env
,
force
):
# We set the administrative email address for every domain to domain_contact@[domain.com].
# You should probably create an alias to your email address.
...
...
@@ -363,7 +363,7 @@ $TTL 86400 ; default time to live
# If the existing zone is the same as the new zone (modulo the serial number),
# there is no need to update the file. Unless we're forcing a bump.
if
zone
==
existing_zone
and
not
force_bump
:
if
zone
==
existing_zone
and
not
force_bump
and
not
force
:
return
False
# If the existing serial is not less than a serial number
...
...
tools/dns_update
View file @
30178ef0
#!/bin/bash
curl
-s
-d
POSTDATA
--user
$(
</var/lib/mailinabox/api.key
)
: http://127.0.0.1:10222/dns/update
POSTDATA
=
dummy
if
[
"
$1
"
==
"--force"
]
;
then
POSTDATA
=
force
=
1
fi
curl
-s
-d
$POSTDATA
--user
$(
</var/lib/mailinabox/api.key
)
: http://127.0.0.1:10222/dns/update
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment