Merge branch 'master' into feature/535-liquor_cabinet
This commit is contained in:
@@ -11,6 +11,8 @@ node.default['akkounts']['smtp']['domain'] = 'kosmos.org'
|
||||
node.default['akkounts']['smtp']['auth_method'] = 'plain'
|
||||
node.default['akkounts']['smtp']['enable_starttls'] = 'auto'
|
||||
|
||||
node.default['akkounts']['btcpay']['store_id'] = nil
|
||||
|
||||
node.default['akkounts']['ejabberd']['admin_url'] = nil
|
||||
|
||||
node.default['akkounts']['lndhub']['api_url'] = nil
|
||||
|
||||
@@ -20,6 +20,7 @@ user deploy_user do
|
||||
end
|
||||
|
||||
package "libpq-dev"
|
||||
package "libvips"
|
||||
|
||||
include_recipe 'redisio::default'
|
||||
include_recipe 'redisio::enable'
|
||||
@@ -70,6 +71,8 @@ end
|
||||
|
||||
if btcpay_host
|
||||
env[:btcpay_api_url] = "http://#{btcpay_host}:23001/api/v1"
|
||||
env[:btcpay_store_id] = node['akkounts']['btcpay']['store_id']
|
||||
env[:btcpay_auth_token] = credentials["btcpay_auth_token"]
|
||||
end
|
||||
|
||||
env[:discourse_public_url] = "https://#{node['discourse']['domain']}"
|
||||
@@ -104,6 +107,7 @@ 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_admin_token] = credentials["lndhub_admin_token"]
|
||||
env[:lndhub_public_url] = node["akkounts"]["lndhub"]["public_url"]
|
||||
env[:lndhub_public_key] = node["akkounts"]["lndhub"]["public_key"]
|
||||
if postgres_readonly_host
|
||||
|
||||
@@ -18,7 +18,7 @@ server {
|
||||
access_log <%= node[:openresty][:log_dir] %>/<%= @domain %>.access.log json;
|
||||
error_log <%= node[:openresty][:log_dir] %>/<%= @domain %>.error.log warn;
|
||||
|
||||
location /kredits/ {
|
||||
location / {
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
||||
@@ -31,6 +31,6 @@ server {
|
||||
proxy_buffers 1024 8k;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_pass http://_akkounts_api/api/kredits/;
|
||||
proxy_pass http://_akkounts_api/api/;
|
||||
}
|
||||
}
|
||||
|
||||
11
site-cookbooks/kosmos_redis/recipes/backup.rb
Normal file
11
site-cookbooks/kosmos_redis/recipes/backup.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Cookbook Name:: kosmos_redis
|
||||
# Recipe:: backup
|
||||
#
|
||||
|
||||
databases = node['redisio']['servers'].map do |server, _|
|
||||
"dump-#{server['port']}"
|
||||
end
|
||||
node.override["backup"]["redis"]["databases"] = databases
|
||||
|
||||
include_recipe "backup"
|
||||
@@ -3,16 +3,10 @@
|
||||
# Recipe:: default
|
||||
#
|
||||
|
||||
node.normal['redisio']['servers'] = [{
|
||||
'port' => '6379',
|
||||
'protected_mode' => 'no'
|
||||
}]
|
||||
|
||||
include_recipe 'redisio::default'
|
||||
include_recipe 'redisio::enable'
|
||||
|
||||
unless node.chef_environment == "development"
|
||||
include_recipe "kosmos_redis::firewall"
|
||||
|
||||
# Backup the databases to S3
|
||||
databases = node['redisio']['servers'].map do |server, _|
|
||||
"dump-#{server['port']}"
|
||||
end
|
||||
node.override["backup"]["redis"]["databases"] = databases
|
||||
include_recipe "backup"
|
||||
end
|
||||
|
||||
19
site-cookbooks/kosmos_redis/recipes/replica.rb
Normal file
19
site-cookbooks/kosmos_redis/recipes/replica.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# Cookbook Name:: kosmos_redis
|
||||
# Recipe:: replica
|
||||
#
|
||||
|
||||
primary_host = search(:node, 'role:redis_server').first['knife_zero']['host'] rescue nil
|
||||
|
||||
if primary_host.nil?
|
||||
Chef::Log.warn("No node found with 'redis_server' role. Stopping here.")
|
||||
return
|
||||
end
|
||||
|
||||
node.normal['redisio']['servers'] = [{
|
||||
'port' => '6379',
|
||||
'replicaof' => { 'address' => primary_host, 'port' => '6379' }
|
||||
}]
|
||||
|
||||
include_recipe 'redisio::default'
|
||||
include_recipe 'redisio::enable'
|
||||
Reference in New Issue
Block a user