> -e INFO="testing, testing" \
> -p 6667:6667 wking/ngircd
-For [SSL / TLS][TLS], set the `SSL` environment variable to `yes` and
-[volume-mount][volume-mount] your keys under the container's
-`/etc/ngircd/ssl/`:
+For [SSL / TLS][TLS], set the `SSL` environment variable to `yes` or
+`optional` and [volume-mount][volume-mount] your keys under the
+container's `/etc/ngircd/ssl/`:
$ docker run -d --name ngircd-0 --hostname irc.example.net \
> …
`server-key.pem` in that directory. If you're using DH or DSA keys,
you'll also want `dhparams.pem` with [Diffie–Hellman][DH] parameters;
you can manage the file with OpenSSH's [dhparam][]). If you don't
-want to require SSL, you can expose both the [encrypted port][6697]
-and the [unencrypted port][6667]:
+want to require SSL, set `SSL` to `optional` and expose both the
+[encrypted port][6697] and the [unencrypted port][6667]:
$ docker run -d --name ngircd-0 --hostname irc.example.net \
> …
+ > -e SSL=optional \
+ > -v /etc/ssl/ngircd-0:/etc/ngircd/ssl \
> -p 6667:6667 -p 6697:6697 wking/ngircd
You can optionally set a `GLOBAL_PASSWORD` environment variable to
envsubst "${ENVSUBST}" < /etc/ngircd/ngircd.conf > /tmp/ngircd.conf &&
mv /tmp/ngircd.conf /etc/ngircd/ngircd.conf
-if [ "${SSL}" = 'yes' ]
+if [ "${SSL}" = 'yes' ] || [ "${SSL}" = 'optional' ]
then
+ if [ "${SSL}" = 'optional' ]
+ then
+ sed -i 's/;Ports = 6667.*/Ports = 6667/' /etc/ngircd/ngircd.conf
+ fi
sed -i \
-e 's/;\[SSL\]/[SSL]/' \
-e 's/;Ports = 6697, 9999/Ports = 6697/' \