mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 02:18:50 +00:00
Fix telemetry_id if missing
This commit is contained in:
@@ -67,13 +67,6 @@ class Firezone
|
||||
node.consume_attributes('firezone' => secrets)
|
||||
rescue Errno::ENOENT
|
||||
begin
|
||||
telemetry_id = if node['firezone'] && node['firezone']['telemetry_id']
|
||||
Chef::Log.warn 'Using telemetry_id from firezone.json. This value should really be managed in secrets.json. Writing to secrets.json.'
|
||||
node['firezone']['telemetry_id']
|
||||
else
|
||||
Chef::Log.warn 'No telemetry_id set! Generating and writing one to secrets.json. If this Firezone installation has multiple hosts, you must duplicate the secrets.json file exactly across all hosts.'
|
||||
SecureRandom.uuid()
|
||||
end
|
||||
secret_key_base = if node['firezone'] && node['firezone']['secret_key_base']
|
||||
Chef::Log.warn 'Using secret_key_base from firezone.json. This value should really be managed in secrets.json. Writing to secrets.json.'
|
||||
node['firezone']['secret_key_base']
|
||||
@@ -118,7 +111,6 @@ class Firezone
|
||||
end
|
||||
|
||||
secrets = {
|
||||
'telemetry_id' => telemetry_id,
|
||||
'secret_key_base' => secret_key_base,
|
||||
'live_view_signing_salt' => live_view_signing_salt,
|
||||
'cookie_signing_salt' => cookie_signing_salt,
|
||||
|
||||
@@ -39,6 +39,8 @@ Firezone::Config.load_or_create_secrets!(
|
||||
node
|
||||
)
|
||||
|
||||
node.default['firezone']['telemetry_id'] ||= SecureRandom.uuid()
|
||||
|
||||
node.default['firezone']['wireguard_public_key'] =
|
||||
`echo '#{node['firezone']['wireguard_private_key']}' | #{node['firezone']['install_directory']}/embedded/bin/wg pubkey`.chomp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user