Skip to content

Commit

Permalink
simplify keys setup (#988)
Browse files Browse the repository at this point in the history
## Done

- simplify keys setup, use ecc key which speeds up key generation, so we
don't need to cache the key and can remove dhparams generation
  • Loading branch information
edlerd authored Nov 19, 2024
2 parents a087e17 + 5b996df commit df407b2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 39 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ jobs:
run: |
sudo pip3 install dotrun
- name: Restore cached keys
uses: actions/cache/restore@v3
with:
path: keys
key: keys-folder

- name: Install LXD-UI dependencies
run: |
set -x
Expand All @@ -43,18 +37,6 @@ jobs:
dotrun &
curl --head --fail --retry-delay 2 --retry 100 --retry-connrefused --insecure https://localhost:8407
- name: Set keys permissions
run: |
set -x
sudo chmod -R 0666 keys
sudo chmod 0777 keys
- name: Save keys
uses: actions/cache/save@v3
with:
path: keys
key: keys-folder

- name: Install LXD
uses: canonical/[email protected]
with:
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ jobs:
run: |
sudo pip3 install dotrun
- name: Restore cached keys
uses: actions/cache/restore@v3
with:
path: keys
key: keys-folder

- name: Install LXD-UI dependencies
run: |
set -x
Expand All @@ -100,18 +94,6 @@ jobs:
dotrun &
curl --head --fail --retry-delay 2 --retry 100 --retry-connrefused --insecure https://localhost:8407
- name: Set keys permissions
run: |
set -x
sudo chmod -R 0666 keys
sudo chmod 0777 keys
- name: Save keys
uses: actions/cache/save@v3
with:
path: keys
key: keys-folder

- name: Install LXD
uses: canonical/[email protected]
with:
Expand Down
3 changes: 1 addition & 2 deletions entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ else
# generate certificates for dev environment
if [ ! -d "keys" ]; then
mkdir -p keys
openssl req -nodes -x509 -newkey rsa:2048 -keyout keys/lxd-ui.key -out keys/lxd-ui.crt -subj "/C=GB/ST=London/L=London/O=LXD UI/OU=dev/CN=localhost" -days 3000
openssl dhparam -out keys/dhparams.pem 2048
openssl req -nodes -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 -sha384 -keyout keys/lxd-ui.key -out keys/lxd-ui.crt -subj "/C=GB/ST=London/L=London/O=LXD UI/OU=dev/CN=localhost" -days 3000
cat keys/lxd-ui.key keys/lxd-ui.crt > keys/lxd-ui.pem
cp keys/lxd-ui.key keys/lxd-ui.crt.key
echo 'finished generating certificates'
Expand Down
1 change: 0 additions & 1 deletion haproxy-dev.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
global
daemon
ssl-dh-param-file keys/dhparams.pem

defaults
mode http
Expand Down

0 comments on commit df407b2

Please sign in to comment.