Commit 887c6bcb authored by Stefane Fermigier's avatar Stefane Fermigier

feat: ssl certificates for Mynij

parent 62e149d9
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
# not need these here). # not need these here).
[instance-profile] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = c847ebf823ab0352a5fd4e1826c68eb4 md5sum = fe8c54b2149fe400aaaa68d1e0ed825f
...@@ -37,7 +37,7 @@ service = ${:etc}/service ...@@ -37,7 +37,7 @@ service = ${:etc}/service
# Path of the log directory used by our service (see [helloweb]) # Path of the log directory used by our service (see [helloweb])
log = ${:var}/log log = ${:var}/log
plugins = ${:etc}/plugins plugins = ${:etc}/plugins
ssl = ${:etc}/ssl
[mynij-proxy-service] [mynij-proxy-service]
# Actual script that starts the service: # Actual script that starts the service:
...@@ -45,7 +45,10 @@ plugins = ${:etc}/plugins ...@@ -45,7 +45,10 @@ plugins = ${:etc}/plugins
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
host = ${slap-configuration:ipv6-random} host = ${slap-configuration:ipv6-random}
port = ${slap-configuration:configuration.port} port = ${slap-configuration:configuration.port}
command-line = {{ gunicorn_bin }} --bind [${:host}]:${:port} --pid server.pid -k uvicorn.workers.UvicornWorker -w 4 mynij_proxy:app command-line = {{ gunicorn_bin }} --bind [${:host}]:${:port} \
--pid server.pid -k uvicorn.workers.UvicornWorker -w 4 \
--keyfile "${certificates:ssl_key}" --certfile "${certificates:ssl_crt}" \
mynij_proxy:app
wrapper-path = ${directory:service}/mynij-proxy wrapper-path = ${directory:service}/mynij-proxy
...@@ -65,3 +68,11 @@ config-port = ${mynij-proxy-service:port} ...@@ -65,3 +68,11 @@ config-port = ${mynij-proxy-service:port}
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
<= monitor-publish <= monitor-publish
url = http://[${mynij-proxy-service:host}]:${mynij-proxy-service:port} url = http://[${mynij-proxy-service:host}]:${mynij-proxy-service:port}
[certificates]
recipe = plone.recipe.command
command = "{{ parameter_dict['openssl'] }}" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:ssl_key}" -out "${:ssl_crt}"
stop-on-error = true
ssl_crt = ${directory:ssl}/httpd.crt
ssl_key = ${directory:ssl}/httpd.key
...@@ -25,14 +25,17 @@ parts = ...@@ -25,14 +25,17 @@ parts =
mynij-proxy-eggs mynij-proxy-eggs
instance-profile instance-profile
[python] [python]
part = python3 part = python3
[jinja-template] [jinja-template]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename} template = ${:_profile_base_location_}/${:filename}
mode = 0644 mode = 0644
[mynij-proxy-eggs] [mynij-proxy-eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
...@@ -46,6 +49,7 @@ eggs = ...@@ -46,6 +49,7 @@ eggs =
scripts = scripts =
gunicorn gunicorn
[mynij-proxy-repository] [mynij-proxy-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://github.com/abilian/mynij-proxy.git repository = https://github.com/abilian/mynij-proxy.git
...@@ -53,6 +57,7 @@ branch = main ...@@ -53,6 +57,7 @@ branch = main
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
# revision = 0b5ff71a2ede76499e81659aed392057ae910917 # revision = 0b5ff71a2ede76499e81659aed392057ae910917
[mynij-proxy-develop] [mynij-proxy-develop]
recipe = zc.recipe.egg:develop recipe = zc.recipe.egg:develop
setup = ${mynij-proxy-repository:location} setup = ${mynij-proxy-repository:location}
...@@ -73,6 +78,7 @@ context = ...@@ -73,6 +78,7 @@ context =
raw gunicorn_bin ${buildout:bin-directory}/gunicorn raw gunicorn_bin ${buildout:bin-directory}/gunicorn
raw template_monitor ${monitor2-template:rendered} raw template_monitor ${monitor2-template:rendered}
[versions] [versions]
click = 7.1.2 click = 7.1.2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment