Refactor tor usage entirely

Use a custom resource and separate recipe for service configs with
pre-set keys and hostnames
This commit is contained in:
Râu Cao
2023-07-30 12:39:41 +02:00
parent 68b56789c5
commit 0f12a54eab
8 changed files with 18 additions and 33 deletions

View File

@@ -5,6 +5,17 @@
tor_services = data_bag_item('credentials', 'tor')['services']
tor_service "ejabberd" do
hostname tor_services['ejabberd']['hostname']
public_key tor_services['ejabberd']['public_key']
secret_key tor_services['ejabberd']['secret_key']
# TODO configure IP from node attribute
# (This is hardcoded for draco atm)
ports [ "5222 148.251.237.73:5222",
"5223 148.251.237.73:5223",
"5269 148.251.237.73:5269" ]
end
tor_service "web" do
hostname tor_services['web']['hostname']
public_key tor_services['web']['public_key']

View File

@@ -5,8 +5,8 @@ provides :tor_service
property :name, [String], name_property: true
property :hostname, [String], required: true
property :public_key, [String], required: true
property :secret_key, [String], required: true
property :public_key, [String], required: true # base64 encoded content of generated key file
property :secret_key, [String], required: true # base64 encoded content of generated key file
property :ports, [Array], required: true
default_action :create