mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Remove messy openssl output during package install
This commit is contained in:
parent
cc62c226d7
commit
2009385bd6
1 changed files with 13 additions and 3 deletions
|
@ -10,6 +10,14 @@ do_init_regen() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
LOGFILE="/tmp/yunohost-ssl-init"
|
||||||
|
|
||||||
|
echo "Initializing a local SSL certification authority ..."
|
||||||
|
echo "(logs available in $LOGFILE)"
|
||||||
|
|
||||||
|
rm -f $LOGFILE
|
||||||
|
touch $LOGFILE
|
||||||
|
|
||||||
# create certs and SSL directories
|
# create certs and SSL directories
|
||||||
mkdir -p "/etc/yunohost/certs/yunohost.org"
|
mkdir -p "/etc/yunohost/certs/yunohost.org"
|
||||||
mkdir -p "${ssl_dir}/"{ca,certs,crl,newcerts}
|
mkdir -p "${ssl_dir}/"{ca,certs,crl,newcerts}
|
||||||
|
@ -24,9 +32,10 @@ do_init_regen() {
|
||||||
|
|
||||||
# create default certificates
|
# create default certificates
|
||||||
if [[ ! -f /etc/yunohost/certs/yunohost.org/ca.pem ]]; then
|
if [[ ! -f /etc/yunohost/certs/yunohost.org/ca.pem ]]; then
|
||||||
|
echo -e "\n# Creating the CA key (?)\n" >>$LOGFILE
|
||||||
openssl req -x509 -new -config "$openssl_conf" \
|
openssl req -x509 -new -config "$openssl_conf" \
|
||||||
-days 3650 -out "${ssl_dir}/ca/cacert.pem" \
|
-days 3650 -out "${ssl_dir}/ca/cacert.pem" \
|
||||||
-keyout "${ssl_dir}/ca/cakey.pem" -nodes -batch 2>&1
|
-keyout "${ssl_dir}/ca/cakey.pem" -nodes -batch >>$LOGFILE 2>&1
|
||||||
cp "${ssl_dir}/ca/cacert.pem" \
|
cp "${ssl_dir}/ca/cacert.pem" \
|
||||||
/etc/yunohost/certs/yunohost.org/ca.pem
|
/etc/yunohost/certs/yunohost.org/ca.pem
|
||||||
ln -sf /etc/yunohost/certs/yunohost.org/ca.pem \
|
ln -sf /etc/yunohost/certs/yunohost.org/ca.pem \
|
||||||
|
@ -35,12 +44,13 @@ do_init_regen() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f /etc/yunohost/certs/yunohost.org/crt.pem ]]; then
|
if [[ ! -f /etc/yunohost/certs/yunohost.org/crt.pem ]]; then
|
||||||
|
echo -e "\n# Creating initial key and certificate (?)\n" >>$LOGFILE
|
||||||
openssl req -new -config "$openssl_conf" \
|
openssl req -new -config "$openssl_conf" \
|
||||||
-days 730 -out "${ssl_dir}/certs/yunohost_csr.pem" \
|
-days 730 -out "${ssl_dir}/certs/yunohost_csr.pem" \
|
||||||
-keyout "${ssl_dir}/certs/yunohost_key.pem" -nodes -batch 2>&1
|
-keyout "${ssl_dir}/certs/yunohost_key.pem" -nodes -batch >>$LOGFILE 2>&1
|
||||||
openssl ca -config "$openssl_conf" \
|
openssl ca -config "$openssl_conf" \
|
||||||
-days 730 -in "${ssl_dir}/certs/yunohost_csr.pem" \
|
-days 730 -in "${ssl_dir}/certs/yunohost_csr.pem" \
|
||||||
-out "${ssl_dir}/certs/yunohost_crt.pem" -batch 2>&1
|
-out "${ssl_dir}/certs/yunohost_crt.pem" -batch >>$LOGFILE 2>&1
|
||||||
|
|
||||||
last_cert=$(ls $ssl_dir/newcerts/*.pem | sort -V | tail -n 1)
|
last_cert=$(ls $ssl_dir/newcerts/*.pem | sort -V | tail -n 1)
|
||||||
chmod 640 "${ssl_dir}/certs/yunohost_key.pem"
|
chmod 640 "${ssl_dir}/certs/yunohost_key.pem"
|
||||||
|
|
Loading…
Add table
Reference in a new issue