We need to disable PAM support at compile time to get this working,
because with PAM compiled in global password are broken until
485d0ae
(Use server password when PAM is compiled in but disabled, 2014-02-27,
[1]).
485d0ae landed after ngIRCd v21, so it will probably be in the
next release after that. Once that lands in Gentoo's Portage tree, we
can re-enable PAM.
[1]: http://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git;a=commit;h=
485d0aec813db9966922f17aae044df2d82b0b67
MAINTAINER ${MAINTAINER}
#VOLUME ["${PORTAGE}:/usr/portage:ro", "${PORTAGE}/distfiles:/usr/portage/distfiles:rw"]
RUN echo 'net-irc/ngircd ~amd64' >> /etc/portage/package.accept_keywords
+RUN echo 'net-irc/ngircd -pam' >> /etc/portage/package.use
RUN emerge -v net-irc/ngircd
RUN eselect news read new
RUN rc-update add ngircd default
> …
> -p 6667:6667 -p 6697:6697 wking/ngircd
+You can optionally set a `GLOBAL_PASSWORD` environment variable to
+require a global password for all client connections.
+
[ngIRCd]: http://ngircd.barton.de/
[TLS]: http://en.wikipedia.org/wiki/Transport_Layer_Security
[volume-mount]: http://docs.docker.io/en/latest/use/working_with_volumes/
# EMAIL="admin@example.net" INFO="testing, testing" \
# setup-ngircd-config-from-environment
+ENVSUBST='
+ ${HOSTNAME}
+ ${DESCRIPTION}
+ ${LOCATION}
+ ${EMAIL}
+ ${INFO}
+ '
+
+if [ -n "${GLOBAL_PASSWORD}" ]
+then
+ ENVSUBST="${ENVSUBST} \${GLOBAL_PASSWORD}"
+ # In lines matching '# Global password' or the two succeeding lines,
+ # replace ';Password = .*' with 'Password = ${GLOBAL_PASSWORD}'
+ sed -i '/# Global password/,+2 s/;Password = .*/Password = ${GLOBAL_PASSWORD}/' /etc/ngircd/ngircd.conf
+fi
+
HOSTNAME=$(hostname -f) \
- envsubst '
- ${HOSTNAME}
- ${DESCRIPTION}
- ${LOCATION}
- ${EMAIL}
- ${INFO}
- ' \
- < /etc/ngircd/ngircd.conf > /tmp/ngircd.conf &&
+ envsubst "${ENVSUBST}" < /etc/ngircd/ngircd.conf > /tmp/ngircd.conf &&
mv /tmp/ngircd.conf /etc/ngircd/ngircd.conf
if [ "${SSL}" = 'yes' ]