From 534f23eebce37d5d37bc2290948a685e1974ec12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Fri, 4 Nov 2022 14:38:16 +0100 Subject: [PATCH] Remove obsolete recipes --- .../kosmos-hubot/recipes/botka_freenode.rb | 120 ------------------ .../kosmos-hubot/recipes/default.rb | 12 -- .../kosmos-hubot/recipes/hal8000.rb | 103 --------------- 3 files changed, 235 deletions(-) delete mode 100644 site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb delete mode 100644 site-cookbooks/kosmos-hubot/recipes/default.rb delete mode 100644 site-cookbooks/kosmos-hubot/recipes/hal8000.rb diff --git a/site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb b/site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb deleted file mode 100644 index 16cd272..0000000 --- a/site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb +++ /dev/null @@ -1,120 +0,0 @@ -# -# Cookbook Name:: kosmos-hubot -# Recipe:: botka_freenode -# - -app_name = "botka_freenode" -app_path = "/opt/#{app_name}" -app_user = "hubot" -app_group = "hubot" - -build_essential app_name do - compile_time true -end - -include_recipe 'redisio::default' -include_recipe 'redisio::enable' -include_recipe "kosmos-nodejs" - -application app_path do - data_bag = Chef::EncryptedDataBagItem.load('credentials', app_name) - - owner app_user - group app_group - - git do - user app_user - group app_group - repository "https://gitea.kosmos.org/kosmos/botka.git" - revision "master" - end - - file "#{app_path}/external-scripts.json" do - mode "0640" - owner app_user - group app_group - content [ - "hubot-help", - "hubot-redis-brain", - "hubot-remotestorage-logger", - "hubot-web-push-notifications", - ].to_json - end - - npm_install do - user app_user - end - - execute "systemctl daemon-reload" do - command "systemctl daemon-reload" - action :nothing - end - - template "/lib/systemd/system/#{app_name}.service" do - source 'nodejs.systemd.service.erb' - owner 'root' - group 'root' - mode '0644' - variables( - user: app_user, - group: app_group, - app_dir: app_path, - entry: "#{app_path}/bin/hubot -a irc", - environment: { - "HUBOT_LOG_LEVEL" => node.chef_environment == "development" ? "debug" : "info", - "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" => data_bag['nickserv_password'], - "HUBOT_IRC_UNFLOOD" => "100", - "HUBOT_RSS_PRINTSUMMARY" => "false", - "HUBOT_RSS_PRINTERROR" => "false", - "HUBOT_RSS_IRCCOLORS" => "true", - "REDIS_URL" => "redis://localhost:6379/botka", - "EXPRESS_PORT" => node[app_name]['http_port'], - "HUBOT_AUTH_ADMIN" => "derbumi,galfert,gregkare,slvrbckt,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_PUBLIC" => "true", - "GCM_API_KEY" => data_bag['gcm_api_key'], - "VAPID_SUBJECT" => "https://kosmos.org", - "VAPID_PUBLIC_KEY" => data_bag['vapid_public_key'], - "VAPID_PRIVATE_KEY" => data_bag['vapid_private_key'] - } - ) - notifies :run, "execute[systemctl daemon-reload]", :delayed - notifies :restart, "service[#{app_name}]", :delayed - end - - service app_name do - action [:enable, :start] - end -end - -# -# Nginx reverse proxy -# -unless node.chef_environment == "development" - include_recipe "kosmos-base::letsencrypt" - include_recipe "kosmos-nginx" - - template "#{node['nginx']['dir']}/sites-available/#{node[app_name]['domain']}" do - source 'nginx_conf_hubot.erb' - owner node["nginx"]["user"] - mode 0640 - variables express_port: node[app_name]['http_port'], - server_name: node[app_name]['domain'], - ssl_cert: "/etc/letsencrypt/live/#{node[app_name]['domain']}/fullchain.pem", - ssl_key: "/etc/letsencrypt/live/#{node[app_name]['domain']}/privkey.pem" - notifies :reload, 'service[nginx]', :delayed - end - - nginx_site node[app_name]['domain'] do - action :enable - end - - nginx_certbot_site node[app_name]['domain'] -end diff --git a/site-cookbooks/kosmos-hubot/recipes/default.rb b/site-cookbooks/kosmos-hubot/recipes/default.rb deleted file mode 100644 index bd18edc..0000000 --- a/site-cookbooks/kosmos-hubot/recipes/default.rb +++ /dev/null @@ -1,12 +0,0 @@ -# -# Cookbook Name:: kosmos-hubot -# Recipe:: default -# - -include_recipe 'redisio::default' -include_recipe 'redisio::enable' -include_recipe "kosmos-nodejs" - -include_recipe "kosmos-hubot::_user" -include_recipe "kosmos-hubot::hal8000" -include_recipe "kosmos-hubot::botka_freenode" diff --git a/site-cookbooks/kosmos-hubot/recipes/hal8000.rb b/site-cookbooks/kosmos-hubot/recipes/hal8000.rb deleted file mode 100644 index 20a5983..0000000 --- a/site-cookbooks/kosmos-hubot/recipes/hal8000.rb +++ /dev/null @@ -1,103 +0,0 @@ -# -# Cookbook Name:: kosmos-hubot -# Recipe:: hal8000 -# - -build_essential 'hal8000' do - compile_time true -end - -include_recipe 'redisio::default' -include_recipe 'redisio::enable' -include_recipe "kosmos-nodejs" -include_recipe "kosmos-hubot::_user" - -unless node.chef_environment == "development" - include_recipe 'firewall' - firewall_rule 'hubot_express_hal8000_freenode' do - port node['hal8000']['http_port'] - protocol :tcp - command :allow - end -end - -hal8000_freenode_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', 'hal8000_freenode') - -hal8000_path = "/opt/hal8000" -application hal8000_path do - owner "hubot" - group "hubot" - - git do - user "hubot" - group "hubot" - repository "https://gitea.kosmos.org/kosmos/hal8000.git" - revision "master" - end - - file "#{name}/external-scripts.json" do - mode "0640" - owner "hubot" - group "hubot" - content [ - "hubot-help", - "hubot-read-tweet", - "hubot-redis-brain", - "hubot-rules", - "hubot-shipit", - "hubot-plusplus", - "hubot-tell", - "hubot-seen", - "hubot-incoming-webhook", - "hubot-auth", - "hubot-schedule" - ].to_json - end - - npm_install do - user "hubot" - end - - execute "systemctl daemon-reload" do - command "systemctl daemon-reload" - action :nothing - end - - template "/lib/systemd/system/hal8000_nodejs.service" do - source 'nodejs.systemd.service.erb' - owner 'root' - group 'root' - mode '0644' - variables( - user: "hubot", - group: "hubot", - app_dir: hal8000_path, - entry: "#{hal8000_path}/bin/hubot -a irc", - environment: { - # "HUBOT_LOG_LEVEL" => "error", - "HUBOT_IRC_SERVER" => "irc.freenode.net", - "HUBOT_IRC_ROOMS" => "#5apps,#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub", - "HUBOT_IRC_NICK" => "hal8000", - "HUBOT_IRC_NICKSERV_USERNAME" => "hal8000", - "HUBOT_IRC_NICKSERV_PASSWORD" => hal8000_freenode_data_bag_item['nickserv_password'], - "HUBOT_IRC_UNFLOOD" => "100", - "HUBOT_RSS_PRINTSUMMARY" => "false", - "HUBOT_RSS_PRINTERROR" => "false", - "HUBOT_RSS_IRCCOLORS" => "true", - "HUBOT_PLUSPLUS_POINTS_TERM" => "karma,karma", - "HUBOT_RSS_HEADER" => "Update:", - "HUBOT_AUTH_ADMIN" => "bkero,derbumi,galfert,gregkare,slvrbckt,raucao", - "HUBOT_HELP_REPLY_IN_PRIVATE" => "true", - "WEBHOOK_TOKEN" => hal8000_freenode_data_bag_item['webhook_token'], - "EXPRESS_PORT" => node['hal8000']['http_port'] - } - ) - notifies :run, "execute[systemctl daemon-reload]", :delayed - notifies :restart, "service[hal8000_nodejs]", :delayed - end - - service "hal8000_nodejs" do - action [:enable, :start] - end -end -