Connect to IRC bouncer instead of directly

Changes botka on libera to connect to a bouncer, which also uses SASL,
in order to fix the connection issues and keep a stable connection with
minimal maintenance.
This commit is contained in:
2022-01-06 08:12:42 -06:00
parent 62ff4e51b7
commit f6fe3bab0f
2 changed files with 54 additions and 25 deletions

View File

@@ -17,7 +17,7 @@ include_recipe "kosmos-nodejs"
include_recipe "kosmos-redis"
application app_path do
data_bag = Chef::EncryptedDataBagItem.load('credentials', app_name)
credentials = Chef::EncryptedDataBagItem.load('credentials', app_name)
owner app_user
group app_group
@@ -63,11 +63,12 @@ application app_path do
environment: {
"HUBOT_LOG_LEVEL" => node.chef_environment == "development" ? "debug" : "info",
"HUBOT_IRC_USESSL" => "true",
"HUBOT_IRC_SERVER" => "irc.libera.chat",
"HUBOT_IRC_PORT" => "6697",
"HUBOT_IRC_SERVER" => credentials["znc_host"],
"HUBOT_IRC_PORT" => credentials["znc_port"],
"HUBOT_IRC_NICK" => "botka",
"HUBOT_IRC_NICKSERV_USERNAME" => "botka",
"HUBOT_IRC_NICKSERV_PASSWORD" => data_bag['nickserv_password'],
"HUBOT_IRC_USERNAME" => credentials['znc_user'],
"HUBOT_IRC_PASSWORD" => credentials['znc_password'],
"HUBOT_IRC_REALNAME" => "botka (kosmos)",
"HUBOT_IRC_ROOMS" => "#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub,#mastodon",
"HUBOT_IRC_UNFLOOD" => "100",
"HUBOT_RSS_PRINTSUMMARY" => "false",
@@ -78,13 +79,13 @@ application app_path do
"HUBOT_AUTH_ADMIN" => "bkero,raucao",
"HUBOT_HELP_REPLY_IN_PRIVATE" => "true",
"RS_LOGGER_USER" => "kosmos@5apps.com",
"RS_LOGGER_TOKEN" => data_bag['rs_logger_token'],
"RS_LOGGER_SERVER_NAME" => "freenode",
"RS_LOGGER_TOKEN" => credentials['rs_logger_token'],
"RS_LOGGER_SERVER_NAME" => "irc.libera.chat",
"RS_LOGGER_PUBLIC" => "true",
"GCM_API_KEY" => data_bag['gcm_api_key'],
"GCM_API_KEY" => credentials['gcm_api_key'],
"VAPID_SUBJECT" => "https://kosmos.org",
"VAPID_PUBLIC_KEY" => data_bag['vapid_public_key'],
"VAPID_PRIVATE_KEY" => data_bag['vapid_private_key']
"VAPID_PUBLIC_KEY" => credentials['vapid_public_key'],
"VAPID_PRIVATE_KEY" => credentials['vapid_private_key']
}
)
notifies :run, "execute[systemctl daemon-reload]", :delayed