irc via onion
This commit is contained in:
parent
c1a46656e9
commit
e453a38433
|
@ -88,6 +88,7 @@ CONFIGURATION_FILE="${PROJECT_NAME}.cfg"
|
|||
SSH_PORT=2222
|
||||
SSH_ONION_PORT=8094
|
||||
IRC_PORT=6697
|
||||
IRC_ONION_PORT=8097
|
||||
|
||||
# An optional password to log into IRC. This applies to all users
|
||||
IRC_PASSWORD=
|
||||
|
@ -7147,7 +7148,7 @@ function install_irc_server {
|
|||
sed -i 's|;CertFile = /etc/ssl/certs/server.crt|CertFile = /etc/ssl/certs/ngircd.crt|g' /etc/ngircd/ngircd.conf
|
||||
sed -i 's|;DHFile = /etc/ngircd/dhparams.pem|DHFile = /etc/ssl/certs/ngircd.dhparam|g' /etc/ngircd/ngircd.conf
|
||||
sed -i 's|;KeyFile = /etc/ssl/private/server.key|KeyFile = /etc/ssl/private/ngircd.key|g' /etc/ngircd/ngircd.conf
|
||||
sed -i "s/;Ports =.*/Ports = $IRC_PORT, 9999/g" /etc/ngircd/ngircd.conf
|
||||
sed -i "s/;Ports =.*/Ports = $IRC_PORT, 9999, $IRC_ONION_PORT/g" /etc/ngircd/ngircd.conf
|
||||
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
|
||||
|
@ -7177,6 +7178,18 @@ function install_irc_server {
|
|||
mkdir /var/run/ngircd
|
||||
touch /var/run/ngircd/ngircd.pid
|
||||
chown -R irc:irc /var/run/ngircd
|
||||
|
||||
IRC_ONION_HOSTNAME=
|
||||
if [[ $ONION_ONLY != "no" ]]; then
|
||||
sed -i "s/;Ports =.*/Ports = $IRC_PORT, 9999/g" /etc/ngircd/ngircd.conf
|
||||
IRC_ONION_HOSTNAME=$(add_onion_service irc ${IRC_PORT} ${IRC_PORT})
|
||||
else
|
||||
IRC_ONION_HOSTNAME=$(add_onion_service irc ${IRC_PORT} ${IRC_ONION_PORT})
|
||||
fi
|
||||
if ! grep -q $"IRC onion domain" $COMPLETION_FILE; then
|
||||
echo "IRC onion domain:$IRC_ONION_HOSTNAME" >> $COMPLETION_FILE
|
||||
fi
|
||||
|
||||
systemctl restart ngircd
|
||||
|
||||
# keep the daemon running
|
||||
|
|
Loading…
Reference in New Issue