Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
48bad486
Commit
48bad486
authored
Dec 16, 2024
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/re6stnet: add promise to check the end date of CA certificate of registry
parent
46c50dae
Pipeline
#38628
failed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
software/re6stnet/buildout.hash.cfg
software/re6stnet/buildout.hash.cfg
+1
-1
software/re6stnet/instance-re6stnet.cfg.in
software/re6stnet/instance-re6stnet.cfg.in
+11
-1
software/re6stnet/test/test.py
software/re6stnet/test/test.py
+15
-1
No files found.
software/re6stnet/buildout.hash.cfg
View file @
48bad486
...
@@ -18,7 +18,7 @@ md5sum = 57ddaa585f4755f8e8d1613e5321eefc
...
@@ -18,7 +18,7 @@ md5sum = 57ddaa585f4755f8e8d1613e5321eefc
[template-re6stnet]
[template-re6stnet]
filename = instance-re6stnet.cfg.in
filename = instance-re6stnet.cfg.in
md5sum =
01da4462b5e20cab73b87e7415f7483d
md5sum =
afa3bc5d61b46b244cac6f5e5f8c9441
[template-apache-conf]
[template-apache-conf]
filename = apache.conf.in
filename = apache.conf.in
...
...
software/re6stnet/instance-re6stnet.cfg.in
View file @
48bad486
...
@@ -170,10 +170,19 @@ context =
...
@@ -170,10 +170,19 @@ context =
[re6st-registry-promise]
[re6st-registry-promise]
<= monitor-promise-base
<= monitor-promise-base
promise = check_socket_listening
promise = check_socket_listening
name = re6st-registry.py
name =
check-
re6st-registry.py
config-host = ${re6st-registry:ipv4}
config-host = ${re6st-registry:ipv4}
config-port = ${re6st-registry:port}
config-port = ${re6st-registry:port}
[re6st-certificate-promise]
<= monitor-promise-base
promise = check_certificate
name = check-re6st-certificate.py
config-certificate = ${re6st-registry-conf-dict:ca}
config-key = ${re6st-registry-conf-dict:key}
# RENEW_PERIOD is 30 days in re6st, so warn 15 days before all nodes will try to renew
config-certificate-expiration-days = 45
[apache-registry-promise]
[apache-registry-promise]
<= monitor-promise-base
<= monitor-promise-base
promise = check_socket_listening
promise = check_socket_listening
...
@@ -206,5 +215,6 @@ parts =
...
@@ -206,5 +215,6 @@ parts =
port-redirection
port-redirection
re6st-registry-promise
re6st-registry-promise
re6st-certificate-promise
apache-registry-promise
apache-registry-promise
monitor-base
monitor-base
software/re6stnet/test/test.py
View file @
48bad486
...
@@ -39,9 +39,23 @@ setUpModule, Re6stnetTestCase = makeModuleSetUpAndTestCaseClass(
...
@@ -39,9 +39,23 @@ setUpModule, Re6stnetTestCase = makeModuleSetUpAndTestCaseClass(
class
TestRe6stnetRegistry
(
Re6stnetTestCase
):
class
TestRe6stnetRegistry
(
Re6stnetTestCase
):
def
test_
listen
(
self
):
def
test_
default
(
self
):
connection_parameters
=
self
.
computer_partition
.
getConnectionParameterDict
()
connection_parameters
=
self
.
computer_partition
.
getConnectionParameterDict
()
registry_url
=
connection_parameters
[
're6stry-local-url'
]
registry_url
=
connection_parameters
[
're6stry-local-url'
]
promise
=
os
.
path
.
join
(
self
.
computer_partition_root_path
,
'etc'
,
'plugin'
,
'check-re6st-certificate.py'
)
self
.
assertTrue
(
os
.
path
.
exists
(
promise
))
with
open
(
promise
)
as
fh
:
promise_content
=
fh
.
read
()
self
.
assertIn
(
"""extra_config_dict = { 'certificate': '%(partition_root_dir)s/etc/re6stnet/ssl/re6stnet.crt',
'certificate-expiration-days': '45',
'key': '%(partition_root_dir)s/etc/re6stnet/ssl/re6stnet.key'}"""
%
{
'partition_root_dir'
:
self
.
computer_partition_root_path
},
promise_content
)
self
.
assertIn
(
"from slapos.promise.plugin.check_certificate import RunPromise"
,
promise_content
)
_
=
requests
.
get
(
registry_url
)
_
=
requests
.
get
(
registry_url
)
...
...
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