25 Commits

Author SHA1 Message Date
96bab62af1 Merge pull request 'Set up Blossom server on blossom.kosmos.org' (#630) from feature/blossom_server into master
Reviewed-on: #630
Reviewed-by: Greg <greg@kosmos.org>
2026-05-26 12:49:54 +00:00
2169e7904c Add LDAP support for blossom-server
Only available in our feature branch atm
2026-05-19 16:32:03 +02:00
5a4905aa97 Upgrade deno 2026-05-14 07:52:45 +02:00
21e31440a7 Update node config 2026-05-14 07:52:12 +02:00
894ae3f77e Add new garage node 2026-05-14 07:51:53 +02:00
8afe2ad05d Update blossom whitelist 2026-05-14 07:51:23 +02:00
ef6e4e3319 Upgrade blossom-server 2026-05-14 07:50:48 +02:00
f8ce544452 Set up Blossom server on blossom.kosmos.org 2026-04-18 16:37:00 +04:00
36e9ea8a01 Merge pull request 'Upgrade .NET and BTCPay Server' (#629) from chore/upgrade_btcpay into master
Reviewed-on: #629
Reviewed-by: Greg <greg@kosmos.org>
2026-04-17 15:02:40 +00:00
2c2780a9f0 Update node info 2026-04-17 18:57:32 +04:00
6bcdd3f4d6 Upgrade .NET and BTCPay 2026-04-17 18:56:54 +04:00
abc3f7a0cd Update node info 2026-04-17 15:47:10 +04:00
6d35c0a415 Update node info 2026-04-14 10:36:48 +04:00
be0d7105d3 Merge pull request 'Migrate PostgreSQL cluster to PG14' (#625) from feature/postgresql_migration into master
Reviewed-on: #625
Reviewed-by: Greg <greg@kosmos.org>
2026-04-12 14:16:22 +00:00
b24a6107d2 Merge branch 'master' into feature/postgresql_migration 2026-04-12 18:15:01 +04:00
ba361ad09f Merge pull request 'Create new VMs with Ubuntu 24.04' (#628) from feature/ubuntu_noble into master
Reviewed-on: #628
Reviewed-by: Greg <greg@kosmos.org>
2026-04-12 11:32:49 +00:00
94be0a3543 Merge pull request 'Upgrade rskj to v9.0.1 and Ubuntu 24.04' (#627) from chore/upgrade_rskj into master
Reviewed-on: #627
Reviewed-by: Greg <greg@kosmos.org>
2026-04-12 11:31:26 +00:00
29fb3ae9c9 Automatically determine OS package name
Co-authored-by: Greg Karékinian <greg@karekinian.com>
2026-04-12 10:32:53 +00:00
3a1c3e20b8 Add new RSK testnet VM 2026-04-12 10:32:53 +00:00
d7782ba41e Upgrade rskj to v9.0.1 and Ubuntu 24.04 2026-04-12 10:32:53 +00:00
22d459b558 Create new VMs with Ubuntu 24.04 2026-04-12 08:54:47 +04:00
5ed5af6d50 Use hardware clock sync on Ubuntu 24.04+ VMs 2026-04-12 08:53:50 +04:00
9bf21e8317 Merge pull request 'Slow down Gitea 404s to mess with scrapers/bots' (#626) from chore/gitea_scraping into master
Reviewed-on: #626
Reviewed-by: Greg <greg@kosmos.org>
2026-04-11 17:08:16 +00:00
aaed9a56d1 Slow down Gitea 404s to mess with scrapers/bots
Seems to have helped quite a lot for dealing with AI scrapers using
up all available server resources
2026-04-11 15:37:38 +04:00
41e6b29b97 Add AGENTS.md 2026-04-11 15:36:54 +04:00
36 changed files with 402 additions and 57 deletions

3
.gitmodules vendored
View File

@@ -10,3 +10,6 @@
[submodule "site-cookbooks/deno"]
path = site-cookbooks/deno
url = git@gitea.kosmos.org:kosmos/deno-cookbook.git
[submodule "site-cookbooks/blossom"]
path = site-cookbooks/blossom
url = git@gitea.kosmos.org:kosmos/blossom-cookbook.git

41
AGENTS.md Normal file
View File

@@ -0,0 +1,41 @@
# AGENTS.md
Welcome, AI Agent! This file contains essential context and rules for interacting with the Kosmos Chef repository. Read this carefully before planning or executing any changes.
## 🏢 Project Overview
This repository contains the infrastructure automation code used by Kosmos to provision and configure bare metal servers (KVM hosts) and Ubuntu virtual machines (KVM guests).
We use **Chef Infra**, managed locally via **Knife Zero** (agentless Chef), and **Berkshelf** for dependency management.
## 📂 Directory Structure & Rules
* **`site-cookbooks/`**: 🟢 **EDITABLE.** This directory contains all custom, internal cookbooks written specifically for Kosmos services (e.g., `kosmos-postgresql`, `kosmos_gitea`, `kosmos-mastodon`). *Active development happens here.*
* **`cookbooks/`**: 🔴 **DO NOT EDIT.** This directory contains third-party/community cookbooks that are vendored. These are managed by Berkshelf. Modifying them directly will result in lost changes.
* **`roles/`**: 🟢 **EDITABLE.** Contains Chef roles written in Ruby (e.g., `base.rb`, `kvm_guest.rb`, `postgresql_primary.rb`). These define run-lists and role-specific default attributes for servers.
* **`environments/`**: Contains Chef environment definitions (like `production.rb`).
* **`data_bags/`**: Contains data bag configurations, often encrypted. Be cautious and do not expose secrets. (Note: Agents should not manage data bag secrets directly unless provided the `.chef/encrypted_data_bag_secret`).
* **`nodes/`**: Contains JSON state files for bootstrapped nodes. *Agents typically do not edit these directly unless cleaning up a deleted node.*
* **`Berksfile`**: Defines community cookbook dependencies.
* **`Vagrantfile` / `.kitchen/`**: Used for local virtualization and integration testing.
## 🛠️ Tooling & Workflows
1. **Dependency Management (Berkshelf)**
If a new community cookbook is required:
- Add it to the `Berksfile` at the root.
- Instruct the user to run `berks install` and `berks vendor cookbooks/ --delete` (or run it via the `bash` tool if permitted).
2. **Provisioning (Knife Zero)**
- Bootstrapping and converging nodes is done using `knife zero`.
- *Example:* `knife zero converge name:server-name.kosmos.org`
3. **Code Style & Conventions**
- Chef recipes, resources, and roles are written in **Ruby**.
- Follow standard Chef and Ruby (RuboCop) idioms. Look at neighboring files in `site-cookbooks/` or `roles/` to match formatting and naming conventions.
## 🚨 Core Directives for AI Agents
1. **Infrastructure as Code**: Manual server configurations are highly discouraged. All changes must be codified in a cookbook or role.
2. **Test Safety Nets**: Look for `.kitchen.yml` within specific `site-cookbooks/<name>` to understand if local integration tests are available.
3. **No Assumptions**: Do not assume standard test commands. Check `README.md` and repository config files first.
4. **Secret Handling**: Avoid hardcoding passwords or API keys in recipes or roles. Assume sensitive information is managed via Chef `data_bags`.

4
clients/garage-16.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "garage-16",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqYCUN4WNP05pjbxVJd1/\nvmDZU6XRrVVZS5piSSRzs+uxrcUQZew9oe8YwnB9Acf7nl1igS1Fa3e3TyVdrdrM\n+zKLIszJfZw8qH0BhUHYhIm5o+NXeUDR6zor5/4msq9yyXxMFM3FY6HSnz1IBY6P\n43GdArRqAhccGZTBzvowHZvVTkG553oYF1ETxlUWn+9l142YZufNK+B2JGUGSnf3\nS0A2vlQi7DGHBcUaPPqCLeaXB1cQ4Q6SqMvnExpi0xTdY2QXLlSIBJvJVowLtQKs\npS5qHxwCabMY/uHVoEKxgmMcGvjp4L0PoaXRcev5I2sDfbLuz1VxYfatjgI/1psg\ntwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-testnet-6",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl1p4+F536/peA4XWMJtm\njggPl6yJb42V5bg3kDa8SHoIoQgXn59d3BclZ1Oz2+JhFd3Rrn4FN3Z1wzGpP+gA\nnxQOfgRG1ucahh7Nxaw3IdoHm7r/EdEOc9FrxvGJ+09YnmLfzn4iVQpsUiOiNVS7\n0LXtMXYtsjD+o6BTbOhGU8FMmGhMhQfXFVgoDdTiM/Q62zPw8Vtpa3yFpFJAu+dA\n+mm5h5W6FnaWJXM2arn3PxDOt+JQSWp5PYG4goU1FFreU9iFuoeGEfLy8unlbbXt\ne96QhNuCkOA15xqta0Z3oL7IlXWns7dLgZYlpZT9zaExIs3AEDaQcleacQPzXKSG\nswIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,24 @@
{
"id": "blossom",
"admin_password": {
"encrypted_data": "Gd6AzFmySL0p+xo1PnRn9p4Fwge1m3CQj+NRLIUD8P9u1C8=\n",
"iv": "l6KVzF9xEEBRRAmh\n",
"auth_tag": "P791KMh9TxuHiWJpDKxWQA==\n",
"version": 3,
"cipher": "aes-256-gcm"
},
"s3_access_key": {
"encrypted_data": "S8jB2LDQOxI/p5ugggW1Sk50TS9TJe9sLv04O/VD9/v22SSM7J6ETomTA+Hd\n",
"iv": "dUIIZbdAT9q72ioX\n",
"auth_tag": "+5fCNOuTE/+FqdV6rDNbkw==\n",
"version": 3,
"cipher": "aes-256-gcm"
},
"s3_secret_key": {
"encrypted_data": "soT63l2frBJDNmHetXmEPvNYBsTpvTyR95FA2rxuZXvVE7hMj21La8/0Amk7\nv+mHOBUMaGG9BTLN0tVFkL0+lGPXdZJTbtDHgluk5l6lLPyc8KY=\n",
"iv": "RuXs2pL9C/wpwJ/w\n",
"auth_tag": "nu7dE2udTkxaUZCR42h09w==\n",
"version": 3,
"cipher": "aes-256-gcm"
}
}

View File

@@ -18,6 +18,16 @@
"relay_url": "wss://nostr.kosmos.org"
}
},
"blossom": {
"domain": "blossom.kosmos.org",
"storage": {
"s3": {
"endpoint": "s3.kosmos.org",
"region": "garage",
"bucket": "blossom"
}
}
},
"discourse": {
"domain": "community.kosmos.org"
},

View File

@@ -67,13 +67,13 @@
"cloud": null,
"chef_packages": {
"chef": {
"version": "18.2.7",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.2.7/lib",
"version": "18.10.17",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.10.17/lib",
"chef_effortless": null
},
"ohai": {
"version": "18.1.4",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.1.4/lib/ohai"
"version": "18.2.13",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.13/lib/ohai"
}
}
},

View File

@@ -8,7 +8,7 @@
"automatic": {
"fqdn": "bitcoin-2",
"os": "linux",
"os_version": "5.4.0-163-generic",
"os_version": "5.4.0-216-generic",
"hostname": "bitcoin-2",
"ipaddress": "192.168.122.148",
"roles": [

View File

@@ -46,6 +46,7 @@
"kosmos_garage::default",
"kosmos_garage::firewall_rpc",
"kosmos_assets::nginx_site",
"kosmos_blossom::nginx",
"kosmos_discourse::nginx",
"kosmos_drone::nginx",
"kosmos_garage::nginx_web",
@@ -112,13 +113,13 @@
"cloud": null,
"chef_packages": {
"chef": {
"version": "18.2.7",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.2.7/lib",
"version": "18.10.17",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.10.17/lib",
"chef_effortless": null
},
"ohai": {
"version": "18.1.4",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.1.4/lib/ohai"
"version": "18.2.13",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.13/lib/ohai"
}
}
},

View File

@@ -39,6 +39,7 @@
"kosmos_garage::default",
"kosmos_garage::firewall_rpc",
"kosmos_assets::nginx_site",
"kosmos_blossom::nginx",
"kosmos_discourse::nginx",
"kosmos_drone::nginx",
"kosmos_garage::nginx_web",
@@ -105,13 +106,13 @@
"cloud": null,
"chef_packages": {
"chef": {
"version": "18.2.7",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.2.7/lib",
"version": "18.10.17",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.10.17/lib",
"chef_effortless": null
},
"ohai": {
"version": "18.1.4",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.1.4/lib/ohai"
"version": "18.2.13",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.13/lib/ohai"
}
}
},

63
nodes/garage-16.json Normal file
View File

@@ -0,0 +1,63 @@
{
"name": "garage-16",
"chef_environment": "production",
"normal": {
"knife_zero": {
"host": "10.1.1.153"
}
},
"automatic": {
"fqdn": "garage-16",
"os": "linux",
"os_version": "6.8.0-106-generic",
"hostname": "garage-16",
"ipaddress": "192.168.122.182",
"roles": [
"base",
"kvm_guest",
"garage_node"
],
"recipes": [
"kosmos-base",
"kosmos-base::default",
"kosmos_kvm::guest",
"kosmos_garage",
"kosmos_garage::default",
"kosmos_garage::firewall_rpc",
"kosmos_garage::firewall_apis",
"apt::default",
"timezone_iii::default",
"timezone_iii::debian",
"kosmos-base::journald_conf",
"kosmos-base::systemd_emails",
"apt::unattended-upgrades",
"kosmos-base::firewall",
"kosmos-postfix::default",
"postfix::default",
"postfix::_common",
"postfix::_attributes",
"postfix::sasl_auth",
"hostname::default",
"firewall::default"
],
"platform": "ubuntu",
"platform_version": "24.04",
"cloud": null,
"chef_packages": {
"chef": {
"version": "18.10.17",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.10.17/lib",
"chef_effortless": null
},
"ohai": {
"version": "18.2.13",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.13/lib/ohai"
}
}
},
"run_list": [
"role[base]",
"role[kvm_guest]",
"role[garage_node]"
]
}

View File

@@ -8,7 +8,7 @@
"automatic": {
"fqdn": "leo",
"os": "linux",
"os_version": "5.15.0-164-generic",
"os_version": "5.15.0-173-generic",
"hostname": "leo",
"ipaddress": "5.9.81.116",
"roles": [

View File

@@ -30,6 +30,7 @@
"timezone_iii::debian",
"ntp::default",
"ntp::apparmor",
"kosmos-base::journald_conf",
"kosmos-base::systemd_emails",
"apt::unattended-upgrades",
"kosmos-base::firewall",

60
nodes/rsk-testnet-6.json Normal file
View File

@@ -0,0 +1,60 @@
{
"name": "rsk-testnet-6",
"normal": {
"knife_zero": {
"host": "10.1.1.20"
}
},
"automatic": {
"fqdn": "rsk-testnet-6",
"os": "linux",
"os_version": "6.8.0-107-generic",
"hostname": "rsk-testnet-6",
"ipaddress": "192.168.122.231",
"roles": [
"base",
"kvm_guest",
"rskj_testnet"
],
"recipes": [
"kosmos-base",
"kosmos-base::default",
"kosmos_kvm::guest",
"kosmos_rsk::rskj",
"apt::default",
"timezone_iii::default",
"timezone_iii::debian",
"kosmos-base::journald_conf",
"kosmos-base::systemd_emails",
"apt::unattended-upgrades",
"kosmos-base::firewall",
"kosmos-postfix::default",
"postfix::default",
"postfix::_common",
"postfix::_attributes",
"postfix::sasl_auth",
"hostname::default",
"kosmos_rsk::firewall",
"firewall::default"
],
"platform": "ubuntu",
"platform_version": "24.04",
"cloud": null,
"chef_packages": {
"chef": {
"version": "18.10.17",
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.10.17/lib",
"chef_effortless": null
},
"ohai": {
"version": "18.2.13",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.13/lib/ohai"
}
}
},
"run_list": [
"role[base]",
"role[kvm_guest]",
"role[rskj_testnet]"
]
}

View File

@@ -16,7 +16,8 @@
"base",
"kvm_guest",
"strfry",
"ldap_client"
"ldap_client",
"blossom"
],
"recipes": [
"kosmos-base",
@@ -28,6 +29,8 @@
"kosmos_strfry::policies",
"kosmos_strfry::firewall",
"kosmos_strfry::substr",
"kosmos_blossom",
"kosmos_blossom::default",
"apt::default",
"timezone_iii::default",
"timezone_iii::debian",
@@ -43,7 +46,8 @@
"postfix::_attributes",
"postfix::sasl_auth",
"hostname::default",
"deno::default"
"deno::default",
"blossom::default"
],
"platform": "ubuntu",
"platform_version": "22.04",
@@ -63,6 +67,7 @@
"run_list": [
"role[base]",
"role[kvm_guest]",
"role[strfry]"
"role[strfry]",
"role[blossom]"
]
}

16
roles/blossom.rb Normal file
View File

@@ -0,0 +1,16 @@
name "blossom"
override_attributes(
"blossom" => {
"allowed_pubkeys" => [
# "b3e1b7c0ef48294bd856203bfd460625de95d3afb894e5f09b14cd1f0e7097cf",
# "07e188a1ff87ce171d517b8ed2bb7a31b1d3453a0db3b15379ec07b724d232f3",
# "898a73f2c1f9a9f42d9ef4ac363622f92fdd4290c8f190340a0862d8e0f70046"
]
},
)
run_list %w(
role[ldap_client]
kosmos_blossom::default
)

View File

@@ -19,6 +19,7 @@ production_run_list = %w(
role[openresty]
role[garage_gateway]
kosmos_assets::nginx_site
kosmos_blossom::nginx
kosmos_discourse::nginx
kosmos_drone::nginx
kosmos_garage::nginx_web

View File

@@ -86,9 +86,6 @@ node.default['lndhub-go']['branding'] = {
'footer' => 'about=https://kosmos.org'
}
node.default['dotnet']['ms_packages_src_url'] = "https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb"
node.default['dotnet']['ms_packages_src_checksum'] = "4df5811c41fdded83eb9e2da9336a8dfa5594a79dc8a80133bd815f4f85b9991"
node.default['nbxplorer']['repo'] = 'https://github.com/dgarage/NBXplorer'
node.default['nbxplorer']['revision'] = 'v2.5.26'
node.default['nbxplorer']['source_dir'] = '/opt/nbxplorer'
@@ -98,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.1.1'
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"

View File

@@ -5,29 +5,16 @@
build_essential
apt_repository 'universe' do
uri 'http://archive.ubuntu.com/ubuntu/'
distribution 'focal'
components ['universe']
remote_file "/opt/dotnet-install.sh" do
source "https://dot.net/v1/dotnet-install.sh"
mode "0755"
end
apt_package 'apt-transport-https'
remote_file '/opt/packages-microsoft-prod.deb' do
source node['dotnet']['ms_packages_src_url']
checksum node['dotnet']['ms_packages_src_checksum']
action :create_if_missing
execute "install_dotnet_10" do
command "/opt/dotnet-install.sh -c 10.0 --install-dir /usr/share/dotnet"
not_if '/usr/share/dotnet/dotnet --version | grep -q "^10\."'
end
dpkg_package 'packages-microsoft-prod' do
source '/opt/packages-microsoft-prod.deb'
action :install
notifies :run, 'execute[apt_update]'
link "/usr/bin/dotnet" do
to "/usr/share/dotnet/dotnet"
end
execute 'apt_update' do
command 'apt update'
action :nothing
end
apt_package 'dotnet-sdk-8.0'

View File

@@ -0,0 +1 @@
# No attributes here, use the blossom cookbook's attributes

View File

@@ -0,0 +1,6 @@
name 'kosmos_blossom'
description 'Configures Blossom server for Kosmos infrastructure'
version '0.1.0'
depends 'blossom'
depends 'kosmos-base'
depends 'kosmos_openresty'

View File

@@ -0,0 +1,38 @@
#
# Cookbook Name:: kosmos_blossom
# Recipe:: default
#
credentials = Chef::EncryptedDataBagItem.load('credentials', 'blossom')
ldap_credentials = Chef::EncryptedDataBagItem.load('credentials', 'dirsrv')
node.default['blossom']['repo_url'] = 'https://github.com/67P/blossom-server.git'
node.default['blossom']['revision'] = 'feature/ldap'
node.default['blossom']['storage']['backend'] = 's3'
node.default['blossom']['storage']['s3']['access_key'] = credentials['s3_access_key']
node.default['blossom']['storage']['s3']['secret_key'] = credentials['s3_secret_key']
node.default['blossom']['allow_anonymous_uploads'] = false
node.default['blossom']['ldap']['enabled'] = true
node.default['blossom']['ldap']['url'] = 'ldap://ldap.kosmos.local:389'
node.default['blossom']['ldap']['bind_dn'] = ldap_credentials["service_dn"]
node.default['blossom']['ldap']['password'] = ldap_credentials["service_password"]
node.default['blossom']['ldap']['search_dn'] = "ou=kosmos.org,cn=users,dc=kosmos,dc=org"
node.default['blossom']['ldap']['search_filter'] = "(nostrKey={pubkey})"
node.default['blossom']['dashboard']['enabled'] = true
node.default['blossom']['dashboard']['username'] = credentials['admin_username'] || 'admin'
node.default['blossom']['dashboard']['password'] = credentials['admin_password']
node.default['blossom']['landing']['title'] = 'Kosmos Blossom Server'
include_recipe 'blossom::default'
firewall_rule 'blossom' do
port node['blossom']['port']
source '10.1.1.0/24'
protocol :tcp
command :allow
end

View File

@@ -0,0 +1,28 @@
#
# Cookbook Name:: kosmos_blossom
# Recipe:: nginx
#
domain = node['blossom']['domain']
blossom_node = search(:node, 'role:blossom').first
if blossom_node.nil?
Chef::Log.warn("No node found with 'blossom' role. Not configuring nginx site.")
return
end
tls_cert_for domain do
auth 'gandi_dns'
action :create
end
openresty_site domain do
template 'nginx_conf_blossom.erb'
variables domain: domain,
upstream_host: blossom_node['knife_zero']['host'],
upstream_port: node['blossom']['port'],
max_size_mb: node['blossom']['max_size'] / 1024 / 1024,
ssl_cert: "/etc/letsencrypt/live/#{domain}/fullchain.pem",
ssl_key: "/etc/letsencrypt/live/#{domain}/privkey.pem"
end

View File

@@ -0,0 +1,26 @@
upstream _blossom {
server <%= @upstream_host %>:<%= @upstream_port %>;
}
server {
server_name <%= @domain %>;
listen <%= "#{node['openresty']['listen_ip']}:" if node['openresty']['listen_ip'] %>443 ssl http2;
listen <%= "[#{node['openresty']['listen_ipv6']}]" %>:443 ssl http2;
access_log "/var/log/nginx/<%= @domain %>.access.log";
error_log "/var/log/nginx/<%= @domain %>.error.log";
client_max_body_size <%= @max_size_mb %>M;
ssl_certificate <%= @ssl_cert %>;
ssl_certificate_key <%= @ssl_key %>;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://_blossom;
proxy_http_version 1.1;
}
}

View File

@@ -18,6 +18,8 @@ server {
client_max_body_size 121M;
proxy_intercept_errors on;
location ~ ^/(avatars|repo-avatars)/.*$ {
proxy_buffers 1024 8k;
proxy_pass http://_gitea_web;
@@ -52,5 +54,18 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
error_page 404 = @slow_404;
}
# Slow down 404 responses to make scraping random URLs less attractive
location @slow_404 {
internal;
default_type text/plain;
content_by_lua_block {
ngx.sleep(10)
ngx.status = 404
ngx.say("Not Found")
ngx.exit(ngx.HTTP_NOT_FOUND)
}
}
}

View File

@@ -1,9 +1,9 @@
release = "20260320"
img_filename = "ubuntu-22.04-server-cloudimg-amd64-disk-kvm"
release = "20260321"
img_filename = "ubuntu-24.04-server-cloudimg-amd64"
node.default["kosmos_kvm"]["host"]["qemu_base_image"] = {
"url" => "https://cloud-images.ubuntu.com/releases/jammy/release-#{release}/#{img_filename}.img",
"checksum" => "f7173eb7137b4f0ebeaea8fffe68ecdab1e3c787bde1fd8dfdf27103554332b3",
"url" => "https://cloud-images.ubuntu.com/releases/noble/release-#{release}/#{img_filename}.img",
"checksum" => "5c3ddb00f60bc455dac0862fabe9d8bacec46c33ac1751143c5c3683404b110d",
"path" => "/var/lib/libvirt/images/base/#{img_filename}-#{release}.qcow2"
}

View File

@@ -70,7 +70,7 @@ virt-install \
--vcpus "$CPUS" \
--cpu host \
--arch x86_64 \
--osinfo detect=on,name=ubuntujammy \
--osinfo detect=on,name=ubuntu24.04 \
--hvm \
--virt-type kvm \
--disk "$IMAGE_PATH" \

View File

@@ -1,5 +1,8 @@
source 'https://supermarket.chef.io'
cookbook 'kosmos-nginx', path: '../../site-cookbooks/kosmos-nginx'
cookbook 'kosmos_openresty', path: '../../site-cookbooks/kosmos_openresty'
cookbook 'kosmos-base', path: '../../site-cookbooks/kosmos-base'
cookbook 'openresty', path: '../../site-cookbooks/openresty'
cookbook 'kosmos-postfix', path: '../../site-cookbooks/kosmos-postfix'
metadata

View File

@@ -1,4 +1,4 @@
node.default['rskj']['version'] = '7.0.0~jammy'
node.default['rskj']['version'] = "9.0.1~#{node['lsb']['codename']}"
node.default['rskj']['network'] = 'testnet'
node.default['rskj']['nginx']['domain'] = nil

View File

@@ -34,9 +34,9 @@ verifier:
name: inspec
platforms:
- name: ubuntu-22.04
- name: ubuntu-24.04
driver:
image: dokken/ubuntu-22.04
image: dokken/ubuntu-24.04
privileged: true
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:

View File

@@ -3,7 +3,7 @@ maintainer 'Kosmos Developers'
maintainer_email 'ops@kosmos.org'
license 'MIT'
description 'Installs/configures RSKj and related software'
version '0.4.0'
version '0.5.0'
chef_version '>= 18.2'
issues_url 'https://gitea.kosmos.org/kosmos/chef/issues'
source_url 'https://gitea.kosmos.org/kosmos/chef'

View File

@@ -20,10 +20,19 @@ apt_repository 'rskj' do
end
apt_package 'openjdk-17-jdk'
apt_package 'debconf-utils'
execute 'preseed-rskj-license' do
command 'echo "rskj shared/accepted-rsk-license-v1-1 boolean true" | debconf-set-selections'
not_if 'debconf-get-selections | grep -q "shared/accepted-rsk-license-v1-1.*true"'
end
execute 'preseed-rskj-config' do
command "echo \"rskj shared/config select #{node['rskj']['network']}\" | debconf-set-selections"
not_if "debconf-get-selections | grep -q \"shared/config.*#{node['rskj']['network']}\""
end
apt_package 'rskj' do
response_file 'rskj-preseed.cfg.erb'
response_file_variables network: node['rskj']['network']
options '--assume-yes'
version node['rskj']['version']
end

View File

@@ -1,6 +1,6 @@
#_preseed_V1
# Do you agree to the terms of the applicable licenses?
rskj shared/accepted-rsk-license-v1-1 select true
rskj shared/accepted-rsk-license-v1-1 boolean true
# Choose a configuration environment to run your node.
# Choices: mainnet, testnet, regtest
rskj shared/config select <%= @network %>

View File

@@ -9,7 +9,7 @@ end
describe package('rskj') do
it { should be_installed }
its('version') { should eq '7.0.0~jammy' }
its('version') { should eq '9.0.1~noble' }
end
describe service('rsk') do