From 4bd0f9d6add4fd910413f5155a650ae64fc34816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 12 Jan 2023 11:39:50 +0800 Subject: [PATCH] Configure Webhook URL for lndhub.go --- site-cookbooks/kosmos-bitcoin/recipes/lndhub-go.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos-bitcoin/recipes/lndhub-go.rb b/site-cookbooks/kosmos-bitcoin/recipes/lndhub-go.rb index 797e231..7f788b5 100644 --- a/site-cookbooks/kosmos-bitcoin/recipes/lndhub-go.rb +++ b/site-cookbooks/kosmos-bitcoin/recipes/lndhub-go.rb @@ -19,6 +19,12 @@ postgres_user = node['lndhub-go']['postgres']['user'] postgres_db = node['lndhub-go']['postgres']['database'] postgres_port = node['lndhub-go']['postgres']['port'] +begin + akkounts_host = search(:node, "role:akkounts").first["knife_zero"]["host"] +rescue + node['lndhub-go']['webhook_url'] = "http://#{akkounts_host}:3000/webhooks/lndhub" +end + git source_dir do repository node['lndhub-go']['repo'] revision node['lndhub-go']['revision'] @@ -58,7 +64,8 @@ template "#{source_dir}/.env" do default_rate_limit: node['lndhub-go']['default_rate_limit'], strict_rate_limit: node['lndhub-go']['strict_rate_limit'], burst_rate_limit: node['lndhub-go']['burst_rate_limit'], - branding: node['lndhub-go']['branding'] + branding: node['lndhub-go']['branding'], + webhook_url: node['lndhub-go']['webhook_url'] } notifies :restart, 'service[lndhub-go]', :delayed end