From 0e974182dee69449849c98ad26837ac8ae5181a6 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Mon, 7 May 2018 19:34:56 +0200 Subject: [PATCH] Configure botka for web push notifications --- data_bags/credentials/botka_freenode.json | 39 +++++++++++++++---- .../kosmos-hubot/recipes/default.rb | 39 +++++++++++-------- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/data_bags/credentials/botka_freenode.json b/data_bags/credentials/botka_freenode.json index a68b6b8..a72d4ae 100644 --- a/data_bags/credentials/botka_freenode.json +++ b/data_bags/credentials/botka_freenode.json @@ -1,15 +1,38 @@ { "id": "botka_freenode", "rs_logger_token": { - "encrypted_data": "iRv44+Er+WEGESgyUqboHt3GEnZhfiy4wX+fSKw3aQw7fvOsojADBwFCW6eu\nWoBB9MimJi6PnmMOJJ6A+FyTYw==\n", - "iv": "VVLgCPz33YYqwNdjrF9WyQ==\n", - "version": 1, - "cipher": "aes-256-cbc" + "encrypted_data": "X/7BinesOs5sciifP2myTHzRyYA7q7GxHR92wlHKF1EnVD38GrfMxWFIUVsH\nYUjXr+mm\n", + "iv": "XcqCyyfIsqNJiVfX\n", + "auth_tag": "vPjh3was2w7pbDRYerGQFw==\n", + "version": 3, + "cipher": "aes-256-gcm" }, "nickserv_password": { - "encrypted_data": "OIjbuQTfjL0ksRM/3JLHw7aY/l61Z1NuQZr3sbG7kfMNJrdwaTsvDHXqf4Ja\nUmD3\n", - "iv": "jV1/0L2mpONfNWFPmec+8w==\n", - "version": 1, - "cipher": "aes-256-cbc" + "encrypted_data": "bOr4bTbmGIL6YHAycVQCHX3fDsEgvJPtSKYPDyzbMIqn\n", + "iv": "hEmlqJ91R4Mxeab/\n", + "auth_tag": "o8qf0GBVR23IrPYOANywFw==\n", + "version": 3, + "cipher": "aes-256-gcm" + }, + "gcm_api_key": { + "encrypted_data": "flJe/qcddW54emG29ReJf5BqYyIEmpOK+dKabuZAx5t678Dt1CqLr/UmkeB+\nOcXwezOgr9qj3XHIVQ==\n", + "iv": "fD46RYO1hpk9zb9q\n", + "auth_tag": "ucPDMdVey1QeZmOmYEFiPw==\n", + "version": 3, + "cipher": "aes-256-gcm" + }, + "vapid_public_key": { + "encrypted_data": "RkyN3Sx4Hme2cBJKMSvXxt6b1rW7liqAG/fLSLMi4aeR9EAMMRf6gEdOLJms\n1WSVx4RU2z7oRTvkD0zwmKwOtNNeyRaJ6zUh/eYnPviBdKMrxvLOXPaQam7O\nCLF9QMHpngCumMPQuaWpHg==\n", + "iv": "WPqkc48gE/uJjLB9\n", + "auth_tag": "UxAnYr9jdCy2V/1gnDC/Og==\n", + "version": 3, + "cipher": "aes-256-gcm" + }, + "vapid_private_key": { + "encrypted_data": "2O+ESjSSsw3Z4RgTx4AIA3QGYc+zpRY2j0DyEqF1Rdak3prc7bMKmTHy7MwP\nJXGS08Mye5Pnt6sk45TfhoE=\n", + "iv": "8+PRuHXa73tLd3wf\n", + "auth_tag": "ofPSsKrP7Lgt1qiPcZ8isQ==\n", + "version": 3, + "cipher": "aes-256-gcm" } } \ No newline at end of file diff --git a/site-cookbooks/kosmos-hubot/recipes/default.rb b/site-cookbooks/kosmos-hubot/recipes/default.rb index 12cd463..da40a89 100644 --- a/site-cookbooks/kosmos-hubot/recipes/default.rb +++ b/site-cookbooks/kosmos-hubot/recipes/default.rb @@ -151,6 +151,7 @@ application botka_freenode_path do content [ "hubot-help", "hubot-remotestorage-logger", + "hubot-web-push-notifications", ].to_json end @@ -173,22 +174,28 @@ application botka_freenode_path do group: "hubot", app_dir: botka_freenode_path, entry: "#{botka_freenode_path}/bin/hubot -a irc", - environment: { "HUBOT_IRC_SERVER" => "irc.freenode.net", - "HUBOT_IRC_ROOMS" => "#5apps,#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub,#opensourcedesign,#openknot,#emberjs,#mastodon,#indieweb,#lnd", - "HUBOT_IRC_NICK" => "botka", - "HUBOT_IRC_NICKSERV_USERNAME" => "botka", - "HUBOT_IRC_NICKSERV_PASSWORD" => botka_freenode_data_bag_item['nickserv_password'], - "HUBOT_IRC_UNFLOOD" => "100", - "HUBOT_RSS_PRINTSUMMARY" => "false", - "HUBOT_RSS_PRINTERROR" => "false", - "HUBOT_RSS_IRCCOLORS" => "true", - # "HUBOT_LOG_LEVEL" => "error", - "EXPRESS_PORT" => "8082", - "HUBOT_AUTH_ADMIN" => "bkero,derbumi,galfert,gregkare,jaaan,slvrbckt,raucao", - "RS_LOGGER_USER" => "kosmos@5apps.com", - "RS_LOGGER_TOKEN" => botka_freenode_data_bag_item['rs_logger_token'], - "RS_LOGGER_SERVER_NAME" => "freenode", - "RS_LOGGER_PUBLIC" => "true" } + environment: { + "HUBOT_IRC_SERVER" => "irc.freenode.net", + "HUBOT_IRC_ROOMS" => "#5apps,#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub,#opensourcedesign,#openknot,#emberjs,#mastodon,#indieweb,#lnd", + "HUBOT_IRC_NICK" => "botka", + "HUBOT_IRC_NICKSERV_USERNAME" => "botka", + "HUBOT_IRC_NICKSERV_PASSWORD" => botka_freenode_data_bag_item['nickserv_password'], + "HUBOT_IRC_UNFLOOD" => "100", + "HUBOT_RSS_PRINTSUMMARY" => "false", + "HUBOT_RSS_PRINTERROR" => "false", + "HUBOT_RSS_IRCCOLORS" => "true", + # "HUBOT_LOG_LEVEL" => "error", + "EXPRESS_PORT" => "8082", + "HUBOT_AUTH_ADMIN" => "bkero,derbumi,galfert,gregkare,jaaan,slvrbckt,raucao", + "RS_LOGGER_USER" => "kosmos@5apps.com", + "RS_LOGGER_TOKEN" => botka_freenode_data_bag_item['rs_logger_token'], + "RS_LOGGER_SERVER_NAME" => "freenode", + "RS_LOGGER_PUBLIC" => "true", + "GCM_API_KEY" => botka_freenode_data_bag_item['gcm_api_key'], + "VAPID_SUBJECT" => "https://kosmos.org", + "VAPID_PUBLIC_KEY" => botka_freenode_data_bag_item['vapid_public_key'], + "VAPID_PRIVATE_KEY" => botka_freenode_data_bag_item['vapid_private_key'] + } ) notifies :run, "execute[systemctl daemon-reload]", :delayed notifies :restart, "service[botka_freenode_nodejs]", :delayed