Skip to content
This repository was archived by the owner on Jul 31, 2019. It is now read-only.

Add config variable for the cert directory. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions hpkpinx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

NGINX_ROOT='/etc/nginx'
HPKPINX_ROOT='/opt/hpkpinx'
CERT_ROOT="${NGINX_ROOT}/certs"

. ${HPKPINX_ROOT}/config.sh

Expand Down Expand Up @@ -58,7 +59,7 @@ then
echo -n "add_header Public-Key-Pins-Report-Only '" > ${NGINX_ROOT}/hpkp.conf
fi
echo -n "pin-sha256=\"${STATIC_PIN}\"; " >> ${NGINX_ROOT}/hpkp.conf
generate_pin "${NGINX_ROOT}/certs/${2}/privkey.pem" >> ${NGINX_ROOT}/hpkp.conf
generate_pin "${NGINX_ROOT}/certs/${2}/privkey.roll.pem" >> ${NGINX_ROOT}/hpkp.conf
generate_pin "${CERT_ROOT}/${2}/privkey.pem" >> ${NGINX_ROOT}/hpkp.conf
generate_pin "${CERT_ROOT}/${2}/privkey.roll.pem" >> ${NGINX_ROOT}/hpkp.conf
echo "max-age=${HPKP_AGE}';" >> ${NGINX_ROOT}/hpkp.conf
fi
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ include hpkp.conf;

The config file is located at `/opt/hpkpinx/config.sh`. You have the following options:

### CERT_ROOT

The path to the folder where dehydrated is putting the Certs (eg. $CERTDIR from the dehydrated config).
This is Optional, defaults to certs in the nginx folder.

### HPKP_AGE

The time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys.
Expand Down