Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Commit 69a8155

Browse files
authored
Generate SSL certs on dkg entrypoint (#62)
* Remove holesky appearances * Generate SSL cert
1 parent e9d82f0 commit 69a8155

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

dappnode_package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ssv.dnp.dappnode.eth",
33
"version": "0.1.1",
4-
"upstream":[
4+
"upstream": [
55
{
66
"repo": "ssvlabs/ssv",
77
"version": "v1.3.4",
@@ -35,10 +35,10 @@
3535
},
3636
"repository": {
3737
"type": "git",
38-
"url": "git+https://github.com/dappnode/DAppNodePackage-holesky-SSV.git"
38+
"url": "git+https://github.com/dappnode/DAppNodePackage-SSV.git"
3939
},
4040
"bugs": {
41-
"url": "https://github.com/dappnode/DAppNodePackage-holesky-SSV/issues"
41+
"url": "https://github.com/dappnode/DAppNodePackage-SSV/issues"
4242
},
4343
"requirements": {
4444
"minimumDappnodeVersion": "0.2.58"

dkg/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ OPERATOR_ID_FILE=${OPERATOR_CONFIG_DIR}/operator_id.txt
1111
DKG_CONFIG_FILE=${DKG_CONFIG_DIR}/dkg-config.yml
1212
DKG_LOG_FILE=${DKG_LOGS_DIR}/dkg.log
1313

14+
CERT_DIR=/ssl
15+
CERT_FILE="$CERT_DIR/tls.crt"
16+
KEY_FILE="$CERT_DIR/tls.key"
17+
1418
create_directories() {
1519
mkdir -p ${DKG_CONFIG_DIR} ${DKG_LOGS_DIR} ${DKG_OUTPUT_DIR}
1620
}
@@ -73,6 +77,22 @@ fetch_operator_id_from_api() {
7377
fi
7478
}
7579

80+
generate_tls_cert() {
81+
echo "[INFO] Generating TLS certificates..."
82+
83+
mkdir -p "$CERT_DIR"
84+
85+
# Generate a self-signed SSL certificate only if it doesn't exist
86+
if [ ! -f "$CERT_FILE" ] || [ ! -f "$KEY_FILE" ]; then
87+
echo "[INFO] Certificate or key file not found. Generating new SSL certificate and key."
88+
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
89+
-keyout "$KEY_FILE" -out "$CERT_FILE" \
90+
-subj "/C=IL/ST=Tel Aviv/L=Tel Aviv/O=Coin-Dash Ltd/CN=*.ssvlabs.io"
91+
else
92+
echo "[INFO] Existing SSL certificate and key found. Using them."
93+
fi
94+
}
95+
7696
start_dkg() {
7797
exec /bin/ssv-dkg start-operator \
7898
--operatorID ${OPERATOR_ID} \
@@ -89,6 +109,7 @@ main() {
89109
create_directories
90110
wait_for_private_key
91111
get_operator_id
112+
generate_tls_cert
92113
start_dkg
93114
}
94115

getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# **SSV Holesky**
1+
# **SSV**
22

33
SSV is a network of validators that use a decentralized network of operators to run their validators. This package allows you to run an SSV Operator Node on Ethereum mainnet.
44

0 commit comments

Comments
 (0)