Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
acme-dns-tiny
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adrien Dorsaz
acme-dns-tiny
Commits
230998d8
Commit
230998d8
authored
Mar 19, 2018
by
Adrien Dorsaz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2: finish to remove the CheckChallengeDelay and set to correct type default values
parent
3fc26f61
Pipeline
#191
failed with stage
in 3 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
acme_dns_tiny.py
acme_dns_tiny.py
+4
-5
tests/config_factory.py
tests/config_factory.py
+2
-2
No files found.
acme_dns_tiny.py
View file @
230998d8
...
...
@@ -284,16 +284,15 @@ See example.ini file to configure correctly this script."""
args
=
parser
.
parse_args
(
argv
)
config
=
ConfigParser
()
config
.
read_dict
({
"acmednstiny"
:
{
"ACMEDirectory"
:
"https://acme-staging-v02.api.letsencrypt.org/directory"
,
"CheckChallengeDelay"
:
3
},
"DNS"
:
{
"Port"
:
"53"
,
"TTL"
:
"10"
}})
config
.
read_dict
({
"acmednstiny"
:
{
"ACMEDirectory"
:
"https://acme-staging-v02.api.letsencrypt.org/directory"
},
"DNS"
:
{
"Port"
:
53
,
"TTL"
:
10
}})
config
.
read
(
args
.
configfile
)
if
args
.
csr
:
config
.
set
(
"acmednstiny"
,
"csrfile"
,
args
.
csr
)
if
(
set
([
"accountkeyfile"
,
"csrfile"
,
"acmedirectory"
,
"checkchallengedelay"
])
-
set
(
config
.
options
(
"acmednstiny"
))
if
(
set
([
"accountkeyfile"
,
"csrfile"
,
"acmedirectory"
])
-
set
(
config
.
options
(
"acmednstiny"
))
or
set
([
"keyname"
,
"keyvalue"
,
"algorithm"
])
-
set
(
config
.
options
(
"TSIGKeyring"
))
or
set
([
"zone"
,
"host"
,
"port"
,
"ttl"
])
-
set
(
config
.
options
(
"DNS"
))):
raise
ValueError
(
"Some required settings are missing."
)
...
...
tests/config_factory.py
View file @
230998d8
...
...
@@ -5,11 +5,11 @@ from subprocess import Popen
# domain with server.py running on it for testing
DOMAIN
=
os
.
getenv
(
"GITLABCI_DOMAIN"
)
ACMEDIRECTORY
=
os
.
getenv
(
"GITLABCI_ACMEDIRECTORY_V2"
,
"https://acme-staging-v02.api.letsencrypt.org/directory"
)
CHALLENGEDELAY
=
os
.
getenv
(
"GITLABCI_CHALLENGEDELAY"
,
"3"
)
DNSHOST
=
os
.
getenv
(
"GITLABCI_DNSHOST"
)
DNSHOSTIP
=
os
.
getenv
(
"GITLABCI_DNSHOSTIP"
)
DNSZONE
=
os
.
getenv
(
"GITLABCI_DNSZONE"
)
DNSPORT
=
os
.
getenv
(
"GITLABCI_DNSPORT"
,
"53"
)
DNSTTL
=
os
.
getenv
(
"GITLABCI_DNSTTL"
,
"10"
)
TSIGKEYNAME
=
os
.
getenv
(
"GITLABCI_TSIGKEYNAME"
)
TSIGKEYVALUE
=
os
.
getenv
(
"GITLABCI_TSIGKEYVALUE"
)
TSIGALGORITHM
=
os
.
getenv
(
"GITLABCI_TSIGALGORITHM"
)
...
...
@@ -32,7 +32,6 @@ def generate_config():
parser
[
"acmednstiny"
][
"AccountKeyFile"
]
=
account_key
.
name
parser
[
"acmednstiny"
][
"CSRFile"
]
=
domain_csr
.
name
parser
[
"acmednstiny"
][
"ACMEDirectory"
]
=
ACMEDIRECTORY
parser
[
"acmednstiny"
][
"CheckChallengeDelay"
]
=
CHALLENGEDELAY
parser
[
"acmednstiny"
][
"Contacts"
]
=
"mailto:mail@example.com"
parser
[
"TSIGKeyring"
][
"KeyName"
]
=
TSIGKEYNAME
parser
[
"TSIGKeyring"
][
"KeyValue"
]
=
TSIGKEYVALUE
...
...
@@ -40,6 +39,7 @@ def generate_config():
parser
[
"DNS"
][
"Host"
]
=
DNSHOST
parser
[
"DNS"
][
"Port"
]
=
DNSPORT
parser
[
"DNS"
][
"Zone"
]
=
DNSZONE
parser
[
"DNS"
][
"TTL"
]
=
DNSTTL
config
=
NamedTemporaryFile
(
delete
=
False
)
with
open
(
config
.
name
,
'w'
)
as
configfile
:
...
...
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