Compare commits
1 commit
use-gosign
...
master
Author | SHA1 | Date | |
---|---|---|---|
e575eed7ff |
14 changed files with 38 additions and 88 deletions
|
@ -1,2 +1 @@
|
||||||
.env
|
.env
|
||||||
**/.idea/**
|
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,7 +1,6 @@
|
||||||
.env
|
|
||||||
.idea/
|
.idea/
|
||||||
cacert-cats/
|
cacert-cats/
|
||||||
cacert-gosigner/
|
|
||||||
cacert-mgr/
|
cacert-mgr/
|
||||||
cacert-software/
|
cacert-software/
|
||||||
|
.env
|
||||||
testca/
|
testca/
|
||||||
|
|
|
@ -6,6 +6,3 @@ checkout = git clone git+ssh://git.cacert.org/srv/git/cacert-mgr.git cacert-mgr
|
||||||
|
|
||||||
[cacert-software]
|
[cacert-software]
|
||||||
checkout = git clone git+ssh://git.cacert.org/srv/git/cacert-devel.git cacert-software
|
checkout = git clone git+ssh://git.cacert.org/srv/git/cacert-devel.git cacert-software
|
||||||
|
|
||||||
[cacert-gosigner]
|
|
||||||
checkout = git clone https://git.dittberner.info/jan/cacert-gosigner.git
|
|
||||||
|
|
14
README.md
14
README.md
|
@ -55,17 +55,17 @@ Variable | Usage
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
echo "CATCHALL_MAILBOX_PASSWORD=$(openssl rand -base64 18)
|
echo "CATCHALL_MAILBOX_PASSWORD='$(openssl rand -base64 18)'
|
||||||
CLIENT_CERT_EMAIL=user@example.org
|
CLIENT_CERT_EMAIL=user@example.org
|
||||||
CLIENT_CERT_PASSWORD=$(openssl rand -base64 18)
|
CLIENT_CERT_PASSWORD='$(openssl rand -base64 18)'
|
||||||
CLIENT_CERT_USERNAME="John Doe"
|
CLIENT_CERT_USERNAME='John Doe'
|
||||||
MYSQL_WEBDB_PASSWORD=$(openssl rand -base64 18)
|
MYSQL_WEBDB_PASSWORD='$(openssl rand -base64 18)'
|
||||||
MYSQL_WEBDB_USER=cacert_dev
|
MYSQL_WEBDB_USER=cacert_dev
|
||||||
MYSQL_CATS_PASSWORD=$(openssl rand -base64 18)
|
MYSQL_CATS_PASSWORD='$(openssl rand -base64 18)'
|
||||||
MYSQL_CATS_USER=cats
|
MYSQL_CATS_USER=cats
|
||||||
MYSQL_MGR_PASSWORD=$(openssl rand -base64 18)
|
MYSQL_MGR_PASSWORD='$(openssl rand -base64 18)'
|
||||||
MYSQL_MGR_USER=cacert_mgr
|
MYSQL_MGR_USER=cacert_mgr
|
||||||
MYSQL_ROOT_PASSWORD=$(openssl rand -base64 18)" > .env
|
MYSQL_ROOT_PASSWORD='$(openssl rand -base64 18)'" | sed 's@/@_@g' > .env
|
||||||
./setup_test_ca.sh
|
./setup_test_ca.sh
|
||||||
docker-compose up
|
docker-compose up
|
||||||
```
|
```
|
||||||
|
|
|
@ -108,7 +108,7 @@ services:
|
||||||
signer:
|
signer:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: gosigner.Dockerfile
|
dockerfile: signer.Dockerfile
|
||||||
environment:
|
environment:
|
||||||
SIGNER_WORKDIR: /srv/ca/work
|
SIGNER_WORKDIR: /srv/ca/work
|
||||||
SIGNER_CA_CONFIG: /srv/caconfig
|
SIGNER_CA_CONFIG: /srv/caconfig
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
export SERIAL_PORT=/dev/ttyUSB0
|
|
||||||
|
|
||||||
mkdir -p /srv/ca/CA/certs /srv/ca/CA/private /srv/ca/CA/newcerts
|
|
||||||
cp /srv/testca/root/ca.crt.pem /srv/ca/CA/ca.crt.pem
|
|
||||||
cp /srv/testca/root/private/ca.key.pem /srv/ca/CA/private/ca.key.pem
|
|
||||||
if [ ! -f /srv/ca/CA/index.txt ]; then cp /srv/testca/root/index.txt /srv/ca/CA/index.txt; fi
|
|
||||||
if [ ! -f /srv/ca/CA/index.txt.attr ]; then cp /srv/testca/root/index.txt.attr /srv/ca/CA/index.txt.attr; fi
|
|
||||||
if [ ! -f /srv/ca/CA/serial ]; then printf '00' >/srv/ca/CA/serial; fi
|
|
||||||
if [ ! -f /srv/ca/CA/crlnumber ]; then echo 1000 >/srv/ca/CA/crlnumber; fi
|
|
||||||
|
|
||||||
mkdir -p /srv/ca/class3/certs /srv/ca/class3/private /srv/ca/class3/newcerts /srv/ca/gpg/gpg_root_0
|
|
||||||
cp /srv/testca/class3/ca.crt.pem /srv/ca/class3/ca.crt.pem
|
|
||||||
cp /srv/testca/class3/private/ca.key.pem /srv/ca/class3/private/ca.key.pem
|
|
||||||
if [ ! -f /srv/ca/class3/index.txt ]; then cp /srv/testca/class3/index.txt /srv/ca/class3/index.txt; fi
|
|
||||||
if [ ! -f /srv/ca/class3/index.txt.attr ]; then cp /srv/testca/class3/index.txt.attr /srv/ca/class3/index.txt.attr; fi
|
|
||||||
if [ ! -f /srv/ca/class3/serial ]; then printf '00' >/srv/ca/class3/serial; fi
|
|
||||||
if [ ! -f /srv/ca/class3/crlnumber ]; then echo 1000 >/srv/ca/class3/crlnumber; fi
|
|
||||||
if [ ! -f /srv/ca/gpg/gpg_root_0/secring.gpg ]; then cp /srv/testca/gpg/gpg_root_0/secring.gpg /srv/ca/gpg/gpg_root_0/secring.gpg; fi
|
|
||||||
if [ ! -f /srv/ca/gpg/gpg_root_0/pubring.gpg ]; then cp /srv/testca/gpg/gpg_root_0/pubring.gpg /srv/ca/gpg/gpg_root_0/pubring.gpg; fi
|
|
||||||
|
|
||||||
rm -f /srv/sockets/signer
|
|
||||||
socat -d -d PTY,link=/dev/ttyUSB0 UNIX-LISTEN:/srv/sockets/signer 2>&1 &
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
cd /app/
|
|
||||||
|
|
||||||
exec ./signer
|
|
|
@ -29,10 +29,10 @@ commonName = optional
|
||||||
emailAddress = optional
|
emailAddress = optional
|
||||||
|
|
||||||
[ usr_cert ]
|
[ usr_cert ]
|
||||||
basicConstraints = critical,CA:FALSE
|
basicConstraints = critical, CA:FALSE
|
||||||
nsComment = "To get your own certificate for FREE head over to http://www.CAcert.org"
|
nsComment = "To get your own certificate for FREE head over to http://www.CAcert.org"
|
||||||
keyUsage = critical,digitalSignature,keyEncipherment,keyAgreement
|
keyUsage = critical, digitalSignature, keyEncipherment, keyAgreement
|
||||||
extendedKeyUsage = emailProtection,clientAuth,codeSigning,msCodeInd,msCodeCom,msEFS,msSGC,nsSGC
|
extendedKeyUsage = emailProtection, clientAuth, codeSigning, msCodeInd, msCodeCom, msEFS, msSGC, nsSGC
|
||||||
authorityInfoAccess = OCSP;URI:http://ocsp.cacert.org
|
authorityInfoAccess = OCSP;URI:http://ocsp.cacert.org
|
||||||
crlDistributionPoints = URI:http://crl.cacert.localhost/test-class3-revoke.crl
|
crlDistributionPoints = URI:http://crl.cacert.localhost/test-class3-revoke.crl
|
||||||
subjectAltName = email:copy
|
subjectAltName = email:copy
|
||||||
|
|
|
@ -29,10 +29,10 @@ commonName = optional
|
||||||
emailAddress = optional
|
emailAddress = optional
|
||||||
|
|
||||||
[ usr_cert ]
|
[ usr_cert ]
|
||||||
basicConstraints = critical,CA:FALSE
|
basicConstraints = critical, CA:FALSE
|
||||||
nsComment = "To get your own certificate for FREE head over to http://www.CAcert.org"
|
nsComment = "To get your own certificate for FREE head over to http://www.CAcert.org"
|
||||||
keyUsage = critical,digitalSignature,keyEncipherment,keyAgreement
|
keyUsage = critical, digitalSignature, keyEncipherment, keyAgreement
|
||||||
extendedKeyUsage = emailProtection,clientAuth,msEFS,msSGC,nsSGC
|
extendedKeyUsage = emailProtection, clientAuth, msEFS, msSGC, nsSGC
|
||||||
authorityInfoAccess = OCSP;URI:http://ocsp.cacert.org
|
authorityInfoAccess = OCSP;URI:http://ocsp.cacert.org
|
||||||
crlDistributionPoints = URI:http://crl.cacert.localhost/class3-revoke.crl
|
crlDistributionPoints = URI:http://crl.cacert.localhost/class3-revoke.crl
|
||||||
subjectAltName = email:copy
|
subjectAltName = email:copy
|
||||||
|
|
|
@ -30,10 +30,10 @@ commonName = optional
|
||||||
emailAddress = optional
|
emailAddress = optional
|
||||||
|
|
||||||
[ usr_cert ]
|
[ usr_cert ]
|
||||||
basicConstraints = critical,CA:FALSE
|
basicConstraints = critical, CA:FALSE
|
||||||
nsComment = "To get your own certificate for FREE head over to http://www.CAcert.org"
|
nsComment = "To get your own certificate for FREE head over to http://www.CAcert.org"
|
||||||
keyUsage = critical,digitalSignature,keyEncipherment,keyAgreement
|
keyUsage = critical, digitalSignature, keyEncipherment, keyAgreement
|
||||||
extendedKeyUsage = emailProtection,clientAuth,msEFS,msSGC,nsSGC
|
extendedKeyUsage = emailProtection, clientAuth, msEFS, msSGC, nsSGC
|
||||||
authorityInfoAccess = OCSP;URI:http://ocsp.cacert.org
|
authorityInfoAccess = OCSP;URI:http://ocsp.cacert.org
|
||||||
crlDistributionPoints = URI:http://crl.cacert.localhost/class3-revoke.crl
|
crlDistributionPoints = URI:http://crl.cacert.localhost/class3-revoke.crl
|
||||||
subjectAltName = email:copy
|
subjectAltName = email:copy
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
FROM golang:alpine AS builder
|
|
||||||
|
|
||||||
COPY cacert-gosigner /src/
|
|
||||||
|
|
||||||
RUN set -ex ; \
|
|
||||||
cd /src/cmd/signer ; \
|
|
||||||
CGO_ENABLED=0 go build .
|
|
||||||
|
|
||||||
# need to use Debian because we need xdelta 1.x to support signer protocol
|
|
||||||
# version 1
|
|
||||||
FROM debian:buster-slim
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
socat \
|
|
||||||
xdelta \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY --from=builder /src/cmd/signer/signer /app/
|
|
||||||
|
|
||||||
COPY docker/run-gosigner usr/local/bin/
|
|
||||||
COPY docker/signer-config/* /srv/caconfig/
|
|
||||||
COPY testca /srv/testca/
|
|
||||||
|
|
||||||
VOLUME /srv/ca
|
|
||||||
|
|
||||||
ENTRYPOINT []
|
|
||||||
CMD ["/usr/local/bin/run-gosigner"]
|
|
15
imap.Dockerfile
Normal file
15
imap.Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
FROM debian:buster
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dovecot-imapd \
|
||||||
|
psmisc \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
EXPOSE 25
|
||||||
|
|
||||||
|
COPY docker/start-postfix.sh /usr/local
|
|
@ -1,4 +1,4 @@
|
||||||
FROM debian:buster-slim
|
FROM debian:buster
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
|
|
|
@ -133,7 +133,8 @@ if [ ! -f root/ca.crt.pem ]; then
|
||||||
openssl req -new -x509 -config ca.cnf \
|
openssl req -new -x509 -config ca.cnf \
|
||||||
-keyout root/private/ca.key.pem \
|
-keyout root/private/ca.key.pem \
|
||||||
-nodes \
|
-nodes \
|
||||||
-subj "/C=${COUNTRY_CODE}/O=${ORGANIZATION}/CN=Test Root" \
|
-subj "/CN=Test Root/C=${COUNTRY_CODE}/O=${ORGANIZATION}" \
|
||||||
|
-days 3650 \
|
||||||
-extensions root_extensions \
|
-extensions root_extensions \
|
||||||
-out root/ca.crt.pem
|
-out root/ca.crt.pem
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM debian:buster-slim
|
FROM debian:buster
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
|
|
Loading…
Reference in a new issue