Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cert): reuse bootstrap certs for web #344

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,18 @@ services:
- opi
command: --script=dns-service-discovery -p 5353 avahi

# TODO: remove this and use sztp keys and certificates
setup-cert:
image: ghcr.io/opiproject/opi-sztp-server:main
build:
context: sztp-server
volumes:
- certs:/certs
user: "0"
entrypoint: /bin/bash
command: >
-c '
set -e
openssl req -x509 -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 365 \
-subj "/C=GB/ST=London/L=London/O=Alros/OU=IT Department/CN=localhost"
cp key.pem cert.pem /certs/
echo "Certificates created succcessfully."
cp sztpd1/sbi/end-entity/private_key.pem sztpd1/sbi/end-entity/my_cert.pem /tmp/ta_cert_chain.pem /certs/
'

web:
Expand All @@ -115,8 +113,8 @@ services:
-e "s/^#\(LoadModule .*mod_ssl.so\)/\1/" \
-e "s/^#\(LoadModule .*mod_socache_shmcb.so\)/\1/" \
conf/httpd.conf
cp /certs/cert.pem conf/server.crt
cp /certs/key.pem conf/server.key
cp /certs/my_cert.pem conf/server.crt
cp /certs/private_key.pem conf/server.key
httpd-foreground
'

Expand Down
Loading