irc configuration for onion only systems

This commit is contained in:
Bob Mottram 2016-11-01 21:53:25 +00:00
parent 9ec2bf6cbd
commit 6aa70353bf
2 changed files with 80 additions and 72 deletions

View File

@ -97,11 +97,12 @@ function create_irssi_config {
echo ' },' >> /home/${new_username}/.irssi/config
echo ' {' >> /home/${new_username}/.irssi/config
echo " address = \"127.0.0.1\";" >> /home/${new_username}/.irssi/config
echo ' use_ssl = "yes";' >> /home/${new_username}/.irssi/config
echo ' ssl_verify = "no";' >> /home/${new_username}/.irssi/config
if [[ ${ONION_ONLY} == 'no' ]]; then
echo ' use_ssl = "yes";' >> /home/${new_username}/.irssi/config
echo " port = \"${IRC_BOUNCER_PORT}\";" >> /home/${new_username}/.irssi/config
else
echo ' use_ssl = "no";' >> /home/${new_username}/.irssi/config
IRC_ONION_HOSTNAME=$(cat ${COMPLETION_FILE} | grep "irc onion domain" | head -n 1 | awk -F ':' '{print $2}')
echo " port = \"${IRC_ONION_PORT}\";" >> /home/${new_username}/.irssi/config
fi
@ -517,6 +518,8 @@ function install_irc_server {
sed -i "s/irc.example.net/$DEFAULTDOMAIN/g" /etc/ngircd/ngircd.conf
sed -i "s|Yet another IRC Server running on Debian GNU/Linux|IRC Server of $DEFAULTDOMAIN|g" /etc/ngircd/ngircd.conf
sed -i 's/;Password = wealllikedebian/Password =/g' /etc/ngircd/ngircd.conf
sed -i "s/;Ports =.*/Ports = ${IRC_PORT}/1" /etc/ngircd/ngircd.conf
if [[ $ONION_ONLY == 'no' ]]; then
if [ -f /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem ]; then
sed -i "s|;CertFile = /etc/ssl/certs/server.crt|CertFile = /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem|g" /etc/ngircd/ngircd.conf
else
@ -524,8 +527,8 @@ function install_irc_server {
fi
sed -i "s|;DHFile = /etc/ngircd/dhparams.pem|DHFile = /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.dhparam|g" /etc/ngircd/ngircd.conf
sed -i "s|;KeyFile = /etc/ssl/private/server.key|KeyFile = /etc/ssl/private/${DEFAULT_DOMAIN_NAME}.key|g" /etc/ngircd/ngircd.conf
sed -i "s/;Ports =.*/Ports = ${IRC_PORT}/1" /etc/ngircd/ngircd.conf
sed -i "s/;Ports =.*/Ports = ${IRC_PORT}/2" /etc/ngircd/ngircd.conf
fi
sed -i "s/;Name = #ngircd/Name = #${PROJECT_NAME}/g" /etc/ngircd/ngircd.conf
sed -i "s/;Topic = Our ngircd testing channel/Topic = ${PROJECT_NAME} chat channel/g" /etc/ngircd/ngircd.conf
sed -i 's/;MaxUsers = 23/MaxUsers = 23/g' /etc/ngircd/ngircd.conf
@ -607,7 +610,11 @@ function install_irc_bouncer {
echo ' IPv4 = true' >> /home/znc/.znc/configs/znc.conf
echo ' IPv6 = true' >> /home/znc/.znc/configs/znc.conf
echo ' Port = 6697' >> /home/znc/.znc/configs/znc.conf
if [[ ${ONION_ONLY} == 'no' ]]; then
echo ' SSL = true' >> /home/znc/.znc/configs/znc.conf
else
echo ' SSL = false' >> /home/znc/.znc/configs/znc.conf
fi
echo ' URIPrefix = /' >> /home/znc/.znc/configs/znc.conf
echo '</Listener>' >> /home/znc/.znc/configs/znc.conf
echo '' >> /home/znc/.znc/configs/znc.conf

View File

@ -652,7 +652,7 @@ function configure_firewall_for_web_access {
function update_default_domain {
echo $'Updating default domain'
if [[ $ONION_ONLY == 'no' ]]; then
if [ -d /etc/prosody ]; then
if [ ! -d /etc/prosody/certs ]; then
mkdir /etc/prosody/certs
@ -726,6 +726,7 @@ function update_default_domain {
systemctl restart dovecot
fi
fi
fi
}
# NOTE: deliberately no exit 0