eMudhra CA follow-up: patched Node.js releases, Cinc, CAcert; migrating off nodejs-4 #687

Merged
raucao merged 18 commits from chore/emudhra into master 2026-10-28 15:19:22 +00:00
18 Commits
Author SHA1 Message Date
raucao 0405459db0 Document remaining items for hubot migration 2026-10-28 18:22:24 +04:00
raucao 34db4dee8f Retire nodejs-4; add role[hubot] to nodejs-5
Drop the nodejs-4 node object (host is powered off) and give nodejs-5
role[hubot], so hubot runs on Node 22 there.
2026-10-28 18:22:24 +04:00
raucao 54e838d77d credentials: consolidate the hubot secrets into one data bag
Read the hal8000 webhook token from credentials/hubot in the mediawiki and
alertmanager recipes, and drop the now-unused botka_irc-libera-chat,
hal8000_xmpp and hal8000_freenode bags.
2026-10-28 18:22:23 +04:00
raucao 69d0f72f87 kosmos_redis: relax the chef_version constraint
Use ">= 18.0" instead of "~> 18.0" so newer Chef/Cinc releases converge.
2026-10-28 18:22:23 +04:00
raucao e53df92b57 kosmos-hubot: scope the nginx upstream to the production environment
search(:node, 'role:hubot') also matched retired nodes outside production
(e.g. nodejs-4 in _default), so the vhosts could proxy to a dead host and
return 502. Restrict the search to chef_environment:production and pick
deterministically.
2026-10-28 18:22:23 +04:00
raucao 086b31a387 kosmos-hubot: declare bot firewall rules at the recipe top level
The per-bot firewall_rule declared inside the kosmos_hubot_bot custom
resource was not collected by the ufw provider when it rebuilt the rules
file, so the bots' HTTP ports were never opened. Declare the rules in the
default recipe instead, matching the pattern used by the other cookbooks,
and drop the now-unused firewall property from the resource.
2026-10-28 18:22:23 +04:00
raucao d3062d701f hubot: drop the unused hubot-auth script
hubot-auth is CoffeeScript-only (needs porting) and nothing in the bots calls
robot.auth; remove it from hal8000's external scripts and drop HUBOT_AUTH_ADMIN
from both bots.
2026-10-28 18:22:22 +04:00
raucao cc9b324a18 Refactor kosmos-hubot to a data-driven model
Replace the per-bot and per-vhost recipes with a single data-driven setup.

- resources/bot.rb (kosmos_hubot_bot): git checkout, npm install, generated
  external-scripts.json, extra files, and one hardened systemd unit for every
  hubot (Type=simple, Restart=always, RestartSec=2, TimeoutSec=10, PrivateTmp,
  ProtectSystem=full, NoNewPrivileges, PrivateDevices)
- recipes/default.rb: shared setup + loop over node['kosmos-hubot']['bots'];
  recipes/nginx.rb: loop over node['kosmos-hubot']['vhosts'];
  recipes/hal8000_extras.rb: augments the hal8000 bot (searched IPFS/RSK hosts,
  kredits .env, wallet) and declares no resources itself
- bot config and vhosts now live in attributes; secrets come from the encrypted
  credentials/hubot bag via secret_env
- Node 22.23.4; kosmos_redis replaces redisio; REDIS_URL uses ?<prefix>; the
  adapter is passed as -a <module>; botka gains hubot-incoming-webhook
- roles/hubot, nginx_proxy, openresty_proxy and the chef-nodes pointer updated
2026-10-28 18:22:22 +04:00
raucao b04e2e153a Remove the dormant wormhole bot
wormhole has no run-list entry on any node; drop its recipe and data bag.
2026-10-28 18:22:22 +04:00
raucao 93fd33a3ef Remove host config for xmpp bots 2026-10-28 18:22:22 +04:00
raucao 552427a10b Track nodejs-5 and the kredits-github migration
Update the nodes submodule (nodejs-5 added, kredits-github moved off nodejs-4) and add the nodejs-5 client.
2026-10-28 18:22:21 +04:00
raucao 44f86d3f07 Serve kredits-github via openresty, on Node 22
Move kredits-github onto Node 22.23.4 and behind the openresty reverse proxy
on the proxy hosts, replacing its own nginx + the custom haproxy entry.

- pin Node 22.23.4; run the app with HOST=0.0.0.0 / NODE_ENV=production and
  open port 3000 to 10.1.1.0/24 so the proxy can reach it over ZeroTier
- create /opt/kredits-github owned by the deploy user before cloning
- add kredits-github::nginx_proxy (tls_cert_for + openresty_site, upstream
  from role:kredits_github) and register it in the openresty_proxy run list
- drop the app-node nginx recipe/template and its role entry
2026-10-28 18:22:21 +04:00
raucao bd4a6501ab Update Ubuntu base image to release-20261017
Refresh the noble cloud image so newly created VMs start with fewer pending
package upgrades. Old base images are left in place.
2026-10-28 18:22:21 +04:00
raucao fc55b0e062 Upgrade RTL to v0.15.15
Pin v0.15.15 and set blockExplorerUrl (config-only since 0.15.14). Discard
local checkout changes before the pinned checkout, and use
`npm ci --omit=dev --legacy-peer-deps` per upstream guidance.
2026-10-28 18:22:21 +04:00
raucao 5bb1499371 Move Node services onto patched releases for the eMudhra CA incident
Bump Node to patched releases (mastodon/sockethub 24.22.1, RTL 22.23.4).
Force the pinned major's latest patch in kosmos-nodejs: nodejs_install only
selects the repo major and a bare `package nodejs` never upgrades an already
installed package.

For hosts stuck on Node 16 (no patched 16.x), run the services with
NODE_OPTIONS=--use-openssl-ca so they use the patched system trust store:
ipfs-pinner, kredits-github, hubot botka/hal8000, sockethub.
2026-10-28 18:22:20 +04:00
raucao c76921da78 Vendor CAcert roots instead of fetching from cacert.org
cacert.org is intermittently unreachable, which fails bootstraps at the
remote_file step. Ship both roots in the cookbook and install them with
cookbook_file; contents match what was already installed fleet-wide.
2026-10-28 18:22:20 +04:00
raucao 6a9ff1eea0 Support Cinc in kosmos-base
Resolve the client config dir at runtime (Chef::Config[:config_file] /
:client_d_dir) instead of hardcoding /etc/chef, and create client.d when
missing so fresh nodes work.

Reload only the attributes file we just wrote, not the whole client.rb:
reloading client.rb reset chef_server_url and dropped knife-zero's -S (TCP)
override, so later server calls fell back to socketless chefzero and failed
with No socketless Cinc Zero server.
2026-10-28 18:22:20 +04:00
raucao 1c96ef42c6 Use Cinc by default for knife-zero bootstraps 2026-10-28 18:22:20 +04:00