mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2024-12-24 11:20:13 +01:00
Add dhparam generation function
This commit is contained in:
parent
858f17c03f
commit
5802c2c043
@ -6,4 +6,15 @@ LXC_RANDOMPWD=32
|
|||||||
random_password() {
|
random_password() {
|
||||||
set +o pipefail
|
set +o pipefail
|
||||||
LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c${LXC_RANDOMPWD}
|
LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c${LXC_RANDOMPWD}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generate_dhparam() {
|
||||||
|
openssl dhparam -out /etc/nginx/dhparam.pem 2048
|
||||||
|
cat << EOF > /etc/cron.weekly/generate-dhparams
|
||||||
|
#!/bin/bash
|
||||||
|
openssl dhparam -out /etc/nginx/dhparam.gen 4096 > /dev/null 2>&1
|
||||||
|
mv /etc/nginx/dhparam.gen /etc/nginx/dhparam.pem
|
||||||
|
systemctl restart nginx
|
||||||
|
EOF
|
||||||
|
chmod +x /etc/cron.weekly/generate-dhparams
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user