Set up Redis VM, upgrade all cookbooks for Chef 18, major cleanup #496

Merged
raucao merged 28 commits from feature/488-redis_server into master 2023-07-01 12:22:39 +00:00
6 changed files with 39 additions and 23 deletions
Showing only changes of commit 0506b75115 - Show all commits

View File

@ -2,14 +2,17 @@
"name": "production",
"override_attributes": {
"akkounts": {
"discourse": {
"public_url": "https://community.kosmos.org"
"ejabberd": {
"admin_url": "https://xmpp.kosmos.org:5443/admin"
},
"lndhub": {
"public_url": "https://lndhub.kosmos.org",
"public_key": "024cd3be18617f39cf645851e3ba63f51fc13f0bb09e3bb25e6fd4de556486d946"
}
},
"discourse": {
"domain": "community.kosmos.org"
},
"garage": {
"replication_mode": "2",
"s3_api_root_domain": ".s3.garage.kosmos.org",
@ -20,6 +23,7 @@
]
},
"gitea": {
"domain": "gitea.kosmos.org",
"postgresql_host": "pg.kosmos.local:5432",
"config": {
"storage": {
@ -31,6 +35,7 @@
}
},
"kosmos-mastodon": {
"domain": "kosmos.social",
"s3_endpoint": "http://localhost:3900",
"s3_region": "garage",
"s3_bucket": "kosmos-social",
@ -40,6 +45,9 @@
"mastodon.w7nooprauv6yrnhzh2ajpcnj3doinked2aaztlwfyt6u6pva2qdxqhid.onion"
]
},
"mediawiki": {
"url": "https://wiki.kosmos.org"
},
"sentry": {
"allowed_ips": "10.1.1.0/24"
}

View File

@ -2,6 +2,7 @@ node.default['akkounts']['repo'] = 'https://gitea.kosmos.org/kosmos/akkounts.git
node.default['akkounts']['revision'] = 'master'
node.default['akkounts']['port'] = 3000
node.default['akkounts']['domain'] = 'accounts.kosmos.org'
node.default['akkounts']['primary_domain'] = 'kosmos.org'
node.default['akkounts_api']['domain'] = 'api.kosmos.org'
@ -10,7 +11,7 @@ node.default['akkounts']['smtp']['domain'] = 'kosmos.org'
node.default['akkounts']['smtp']['auth_method'] = 'plain'
node.default['akkounts']['smtp']['enable_starttls'] = 'auto'
node.default['akkounts']['discourse']['public_url'] = nil
node.default['akkounts']['ejabberd']['admin_url'] = nil
node.default['akkounts']['lndhub']['api_url'] = nil
node.default['akkounts']['lndhub']['public_url'] = nil

View File

@ -39,6 +39,7 @@ lndhub_host = search(:node, "role:lndhub").first["knife_zero"]["host"] rescue ni
webhooks_allowed_ips = [lndhub_host].compact.uniq.join(',')
env = {
primary_domain: node['akkounts']['primary_domain'],
akkounts_domain: node['akkounts']['domain'],
rails_serve_static_files: true
}
@ -65,24 +66,9 @@ if btcpay_host
env[:btcpay_api_url] = "http://#{btcpay_host}:23001/api/v1"
end
env[:discourse_public_url] = node['akkounts']['discourse']['public_url']
env[:discourse_public_url] = "https://#{node['discourse']['domain']}"
env[:discourse_connect_secret] = credentials['discourse_connect_secret']
if lndhub_host
node.override["akkounts"]["lndhub"]["api_url"] = "http://#{lndhub_host}:3026"
env[:lndhub_legacy_api_url] = node["akkounts"]["lndhub"]["api_url"]
env[:lndhub_api_url] = node["akkounts"]["lndhub"]["api_url"]
env[:lndhub_public_url] = node["akkounts"]["lndhub"]["public_url"]
env[:lndhub_public_key] = node["akkounts"]["lndhub"]["public_key"]
if postgres_readonly_host
env[:lndhub_admin_ui] = true
env[:lndhub_pg_host] = postgres_readonly_host
env[:lndhub_pg_database] = node['akkounts']['lndhub']['postgres_db']
env[:lndhub_pg_username] = credentials['postgresql_username']
env[:lndhub_pg_password] = credentials['postgresql_password']
end
end
ejabberd_private_ip_addresses = []
search(:node, "role:ejabberd").each do |node|
ejabberd_private_ip_addresses << node["knife_zero"]["host"]
@ -101,8 +87,29 @@ end
if ejabberd_private_ip_addresses.size > 0
env[:ejabberd_api_url] = "http://xmpp.kosmos.local/api"
env[:ejabberd_admin_url] = node['akkounts']['ejabberd']['admin_url']
end
env[:gitea_public_url] = "https://#{node['gitea']['domain']}"
if lndhub_host
node.override["akkounts"]["lndhub"]["api_url"] = "http://#{lndhub_host}:3026"
env[:lndhub_legacy_api_url] = node["akkounts"]["lndhub"]["api_url"]
env[:lndhub_api_url] = node["akkounts"]["lndhub"]["api_url"]
env[:lndhub_public_url] = node["akkounts"]["lndhub"]["public_url"]
env[:lndhub_public_key] = node["akkounts"]["lndhub"]["public_key"]
if postgres_readonly_host
env[:lndhub_admin_ui] = true
env[:lndhub_pg_host] = postgres_readonly_host
env[:lndhub_pg_database] = node['akkounts']['lndhub']['postgres_db']
env[:lndhub_pg_username] = credentials['postgresql_username']
env[:lndhub_pg_password] = credentials['postgresql_password']
end
end
env[:mastodon_public_url] = "https://#{node['kosmos-mastodon']['domain']}"
env[:mediawiki_public_url] = node['mediawiki']['url']
systemd_unit "akkounts.service" do
content({
Unit: {

View File

@ -4,7 +4,7 @@ node.default["kosmos-mastodon"]["directory"] = "/opt/mastodon"
node.default["kosmos-mastodon"]["bind_ip"] = "127.0.0.1"
node.default["kosmos-mastodon"]["app_port"] = 3000
node.default["kosmos-mastodon"]["streaming_port"] = 4000
node.default["kosmos-mastodon"]["server_name"] = "kosmos.social"
node.default["kosmos-mastodon"]["domain"] = "kosmos.social"
node.default["kosmos-mastodon"]["alternate_domains"] = []
node.default["kosmos-mastodon"]["redis_url"] = "redis://localhost:6379/0"
node.default["kosmos-mastodon"]["sidekiq_threads"] = 25

View File

@ -158,14 +158,14 @@ application mastodon_path do
owner mastodon_user
group mastodon_user
variables redis_url: node["kosmos-mastodon"]["redis_url"],
domain: node["kosmos-mastodon"]["server_name"],
domain: node["kosmos-mastodon"]["domain"],
alternate_domains: node["kosmos-mastodon"]["alternate_domains"],
paperclip_secret: mastodon_credentials['paperclip_secret'],
secret_key_base: mastodon_credentials['secret_key_base'],
otp_secret: mastodon_credentials['otp_secret'],
smtp_login: mastodon_credentials['smtp_user_name'],
smtp_password: mastodon_credentials['smtp_password'],
smtp_from_address: "mail@#{node['kosmos-mastodon']['server_name']}",
smtp_from_address: "mail@#{node['kosmos-mastodon']['domain']}",
s3_endpoint: node["kosmos-mastodon"]["s3_endpoint"],
s3_region: node["kosmos-mastodon"]["s3_region"],
s3_bucket: node["kosmos-mastodon"]["s3_bucket"],

View File

@ -6,7 +6,7 @@
include_recipe "kosmos-nginx"
app_dir = node["kosmos-mastodon"]["directory"]
server_name = node["kosmos-mastodon"]["server_name"]
server_name = node["kosmos-mastodon"]["domain"]
is_proxy = node.roles.include?('nginx_proxy') rescue nil
upstream_hosts = []