Author SHA1 Message Date
raucaoandgreg 2beff22afc Add new Redis node 2026-08-01 13:29:04 +02:00
raucaoandgreg 5e8ac6de93 Update backup ignorelist 2026-08-01 13:22:05 +02:00
greg e051a6b505 Add new Redis node 2026-08-01 13:20:26 +02:00
raucaoandgreg cafc4b6f62 Make create_vm work on all OS versions in use
Makes it work with the same cloudinit code on Ubuntu 20.04 by mounting
it from a custom ISO as CD-ROM
2026-08-01 13:18:30 +02:00
greg e2cb6032a5 Update nodes submodule 2026-08-01 11:21:32 +02:00
greg 1d4c415dd8 Update Gitea to 1.27.1
The webhooks allowed list was moved to the security part of the config
file

This is running on gitea-2
2026-08-01 11:17:13 +02:00
18 changed files with 16 additions and 128 deletions
+1 -2
View File
@@ -127,8 +127,7 @@
"description": "Members-only nostr relay for kosmos.org users",
"pubkey": "b3e1b7c0ef48294bd856203bfd460625de95d3afb894e5f09b14cd1f0e7097cf",
"contact": "ops@kosmos.org",
"icon": "https://assets.kosmos.org/img/app-icon-256px.png",
"privacy": "https://accounts.kosmos.org/privacy"
"icon": "https://assets.kosmos.org/img/app-icon-256px.png"
},
"write_policy": {
"plugin": "/opt/strfry/strfry-policy.ts"
+1 -1
Submodule nodes updated: ad6d254fab...13c12de574
+1 -1
View File
@@ -8,7 +8,7 @@ version '0.3.0'
chef_version '>= 18.0'
depends 'kosmos_openresty'
depends "ark"
depends "kosmos-nodejs"
depends "postgresql"
depends "kosmos_postgresql"
depends "backup"
@@ -27,24 +27,12 @@ end
package "libpq-dev"
package "libvips"
package "unzip"
bun_version = "1.3.14"
bun_checksum = "951ee2aee855f08595aeec6225226a298d3fea83a3dcd6465c09cbccdf7e848f"
node.override["kosmos_nodejs"]["version"] = "22.23.1"
include_recipe 'kosmos-nodejs'
npm_package "bun"
ark "bun" do
url "https://github.com/oven-sh/bun/releases/download/bun-v#{bun_version}/bun-linux-x64.zip"
checksum bun_checksum
creates "bun"
path "/usr/local/bun/#{bun_version}/bin"
action :cherry_pick
end
link "/usr/local/bin/bun" do
to "/usr/local/bun/#{bun_version}/bin/bun"
end
ruby_version = "3.3.12"
ruby_version = "3.3.8"
ruby_path = "/opt/ruby_build/builds/#{ruby_version}"
bundle_path = "#{ruby_path}/bin/bundle"
rails_env = node.chef_environment == "development" ? "development" : "production"
@@ -246,7 +234,7 @@ systemd_unit "akkounts.service" do
ExecStart: "#{bundle_path} exec puma -C config/puma.rb --pidfile #{deploy_path}/tmp/puma.pid",
ExecReload: "#{bundle_path} exec pumactl -F config/puma.rb --pidfile #{deploy_path}/tmp/puma.pid phased-restart",
PIDFile: "#{deploy_path}/tmp/puma.pid",
TimeoutSec: "30",
TimeoutSec: "10",
Restart: "always",
},
Install: {
@@ -87,7 +87,7 @@ node.default['lndhub-go']['branding'] = {
}
node.default['nbxplorer']['repo'] = 'https://github.com/dgarage/NBXplorer'
node.default['nbxplorer']['revision'] = 'v2.6.10'
node.default['nbxplorer']['revision'] = 'v2.5.26'
node.default['nbxplorer']['source_dir'] = '/opt/nbxplorer'
node.default['nbxplorer']['config_path'] = "/home/#{node['bitcoin']['username']}/.nbxplorer/Main/settings.config"
node.default['nbxplorer']['port'] = '24445'
@@ -95,7 +95,7 @@ node.default['nbxplorer']['postgres']['database'] = 'nbxplorer'
node.default['nbxplorer']['postgres']['user'] = 'nbxplorer'
node.default['btcpay']['repo'] = 'https://github.com/btcpayserver/btcpayserver'
node.default['btcpay']['revision'] = 'v2.4.2'
node.default['btcpay']['revision'] = 'v2.3.7'
node.default['btcpay']['source_dir'] = '/opt/btcpay'
node.default['btcpay']['config_path'] = "/home/#{node['bitcoin']['username']}/.btcpayserver/Main/settings.config"
node.default['btcpay']['log_path'] = "/home/#{node['bitcoin']['username']}/.btcpayserver/debug.log"
@@ -21,7 +21,7 @@ bash 'build_btcpay' do
systemctl stop btcpayserver.service
./build.sh
EOH
environment "DOTNET_CLI_TELEMETRY_OPTOUT" => "1"
environment "DOTNET_CLI_TELEMETRY_OPTOUT" => 1
action :nothing
notifies :restart, "service[btcpayserver]", :delayed
end
+1 -1
View File
@@ -3,7 +3,7 @@
# Recipe:: rtl
#
node.override["kosmos_nodejs"]["version"] = "22.23.1"
node.override["kosmos_nodejs"]["version"] = "18.20.8"
include_recipe 'kosmos-nodejs'
app_name = "rtl"
-14
View File
@@ -2,20 +2,6 @@
This file is used to list changes made in each version of the kosmos_gitea cookbook.
# 0.2.2
- Add `config.yaml` for the gitea actions runner, enabling the built-in cache
server (listening on the Docker bridge gateway `172.17.0.1`) and bumping
`runner.capacity` to 2 for concurrent job execution. Each runner gets a unique
cache port derived from `cache_base_port` (8088) + its index in the runners
data bag.
- Set `container.network` to a user-defined Docker bridge network
(`gitea-actions`, subnet `172.20.0.0/16`) so job containers get DNS resolution
for service containers (e.g. `redis`) while keeping the cache server reachable
at the network gateway `172.20.0.1`.
- Open the cache port in the firewall for Docker bridge traffic
(`172.20.0.0/16`), fixing `Request timeout` errors from `actions/cache`.
# 0.1.0
Initial release.
@@ -25,17 +25,3 @@ node.default["gitea"]["config"] = {
node.default["gitea"]["runner"]["version"] = "2.0.0"
node.default["gitea"]["runner"]["checksum"] = "447156b33407ee045409f5552bd4a188a315cdd4085b4b498d8d4a9ad26c9f73"
node.default["gitea"]["runner"]["cache_base_port"] = 8088
node.default["gitea"]["runner"]["config"] = {
"runner" => {
"capacity" => 2
},
"container" => {
"network" => "gitea-actions" # User-defined bridge network: provides DNS for service containers
},
"cache" => {
"enabled" => true,
"host" => "172.20.0.1" # Gateway of the gitea-actions network, reachable from job containers
# Port is set per-runner (cache_base_port + index) in the runner recipe
}
}
@@ -1,25 +0,0 @@
# Increase if you have very long User-Agent strings
map_hash_bucket_size 256;
# Bot user agents
map $http_user_agent $bot_name {
default "";
~*ClaudeBot "claude";
~*Sogou "sogou";
~*meta-externalagent "meta-externalagent";
# add more as needed
}
# Decide the rate-limit key (per-IP for each bot in this example)
map $bot_name $bot_limit_key {
default "";
"claude" $binary_remote_addr;
"sogou" $binary_remote_addr;
"meta-externalagent" $binary_remote_addr;
}
# Shared memory zone only non-empty keys are counted
limit_req_zone $bot_limit_key zone=bots:20m rate=240r/m; # 4r/s per IP+bot
# Status code returned when the limit is exceeded
limit_req_status 429;
+1 -1
View File
@@ -4,7 +4,7 @@ maintainer_email 'ops@kosmos.org'
license 'MIT'
description 'Installs/configures Gitea'
long_description 'Installs/configures Gitea'
version '0.2.2'
version '0.2.1'
chef_version '>= 14.0'
depends "firewall"
@@ -17,14 +17,6 @@ tls_cert_for domain do
action :create
end
# Slow down requests from bots
cookbook_file "#{node["openresty"]["dir"]}/conf.d/rate_limits.conf" do
source "rate_limits.conf"
owner "root"
group "root"
mode "0644"
end
openresty_site domain do
template "nginx_conf_web.erb"
variables server_name: domain,
+2 -27
View File
@@ -35,39 +35,14 @@ directory "#{working_directory}/runners" do
mode "0700"
end
execute "create_gitea_actions_network" do
command "docker network create --subnet 172.20.0.0/16 gitea-actions"
not_if "docker network inspect gitea-actions"
end
runners.each_with_index do |runner, index|
runners.each do |runner|
runner_name = "gitea-runner-#{runner["org"]}"
runner_dir = "#{working_directory}/runners/#{runner["org"]}"
cache_port = node["gitea"]["runner"]["cache_base_port"] + index
directory runner_dir do
mode "0700"
end
runner_config = node["gitea"]["runner"]["config"].to_hash
runner_config["cache"] = runner_config["cache"].merge("port" => cache_port)
firewall_rule "runner_cache_#{runner["org"]}" do
command :allow
port cache_port
protocol :tcp
source "172.20.0.0/16"
end
template "#{runner_dir}/config.yaml" do
source "runner.config.yaml.erb"
mode "0640"
owner "root"
group "root"
variables(config: runner_config)
notifies :restart, "service[#{runner_name}]", :delayed
end
bash "register_#{runner["org"]}_runner" do
cwd runner_dir
code <<-EOF
@@ -92,7 +67,7 @@ gitea_runner register \
Type: "simple",
WorkingDirectory: runner_dir,
Environment: "HOME=/root",
ExecStart: "/usr/local/bin/gitea_runner daemon --config #{runner_dir}/config.yaml",
ExecStart: "/usr/local/bin/gitea_runner daemon",
ExecStartPre: "/bin/sleep 3", # Wait for Gitea's API to be up when restarting at the same time
Restart: "always",
},
@@ -20,9 +20,6 @@ server {
proxy_intercept_errors on;
# Rate limit for bots. Defined in /etc/openresty/conf.d/rate_limits.conf
limit_req zone=bots burst=10; # allow a larger spike for asset bursts
location ~ ^/(avatars|repo-avatars)/.*$ {
proxy_buffers 1024 8k;
proxy_pass http://_gitea_web;
@@ -1 +0,0 @@
<%= @config.to_yaml.sub(/^---\n/, '') %>
@@ -89,11 +89,6 @@ jobs = node["kosmos_prometheus"]["jobs"].merge(
"query" => "role:garage_node",
"port" => 3903
},
# strfry relay metrics
"strfry" => {
"query" => "role:strfry",
"port" => 7777
},
}.transform_values do |config|
{
"targets" => search(:node, config["query"]).map do |n|
@@ -31,10 +31,6 @@ server {
proxy_pass http://_substr;
}
location /metrics {
return 404;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;