feat: template pki/vars
All checks were successful
the build was successful

instead of copying the default vars file, that is wrong for nearly everyone,
this commit adds a jinja2 template that takes data from the environment

fixes #3
This commit is contained in:
Jan Christian Grünhage 2018-06-22 22:03:00 +02:00
parent feb99f2e78
commit 9eb963b4e2
3 changed files with 11 additions and 2 deletions

View file

@ -10,7 +10,9 @@ RUN apk add --no-cache \
su-exec \
bash \
taskd \
taskd-pki
taskd-pki \
py2-pip \
&& pip2 install j2cli
COPY docker/root /

View file

@ -12,7 +12,7 @@ if [ ! -f ${TASKDDATA}/config ]; then
# Copy tools for certificates generation and generate it
cp /usr/share/taskd/pki/generate* ${TASKDDATA}/pki
cp /usr/share/taskd/pki/vars ${TASKDDATA}/pki
j2 /usr/share/taskd/vars.j2 > ${TASKDDATA}/pki/vars
cd ${TASKDDATA}/pki
./generate
cd /

View file

@ -0,0 +1,7 @@
BITS={{ BITS | default(4096) }}
EXPIRATION_DAYS={{ EXPIRATION_DAYS | default(3650) }}
ORGANIZATION={{ ORGANIZATION | default("") }}
CN={{ CN | default("localhost") }}
COUNTRY={{ COUNTRY | default("") }}
STATE={{ STATE | default("") }}
LOCALITY={{ LOCALITY | default("") }}