Fix ca cert creation on first run
This commit is contained in:
parent
0cf09d3098
commit
6b35b8fda5
3
run.sh
3
run.sh
|
@ -4,6 +4,7 @@ CERTS_DIR=/certs
|
||||||
CA_CERT_FILE="${CERTS_DIR}/ca/cert.pem"
|
CA_CERT_FILE="${CERTS_DIR}/ca/cert.pem"
|
||||||
CA_KEY_FILE="${CERTS_DIR}/ca/key.pem"
|
CA_KEY_FILE="${CERTS_DIR}/ca/key.pem"
|
||||||
|
|
||||||
|
mkdir -p "${CERTS_DIR}/ca"
|
||||||
[ -e "${CA_CERT_FILE}" -a -e "${CA_KEY_FILE}" ] || \
|
[ -e "${CA_CERT_FILE}" -a -e "${CA_KEY_FILE}" ] || \
|
||||||
openssl req -new -newkey rsa:2048 -sha256 -days 1500 -nodes -x509 \
|
openssl req -new -newkey rsa:2048 -sha256 -days 1500 -nodes -x509 \
|
||||||
-extensions v3_ca -subj "/C=/ST=/L=/O=/OU=/CN=proxy" \
|
-extensions v3_ca -subj "/C=/ST=/L=/O=/OU=/CN=proxy" \
|
||||||
|
@ -14,7 +15,7 @@ cp -f "${CA_CERT_FILE}" /static/ca.crt
|
||||||
|
|
||||||
[ -d "${CERTS_DIR}/ssl_db" ] || /usr/lib/squid/security_file_certgen -c \
|
[ -d "${CERTS_DIR}/ssl_db" ] || /usr/lib/squid/security_file_certgen -c \
|
||||||
-s "${CERTS_DIR}/ssl_db" -M 4MB
|
-s "${CERTS_DIR}/ssl_db" -M 4MB
|
||||||
chown -R squid:squid "${CERTS_DIR}/ssl_db"
|
chown -R squid:squid "${CERTS_DIR}"
|
||||||
|
|
||||||
[ -e /var/cache/squid/swap.state ] || squid -z
|
[ -e /var/cache/squid/swap.state ] || squid -z
|
||||||
while [ -e /var/run/squid.pid ] ; do
|
while [ -e /var/run/squid.pid ] ; do
|
||||||
|
|
Loading…
Reference in New Issue