From 225d606807dac494dd01b2ff0535f21beebb413c Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Thu, 15 Jun 2023 03:37:08 +0200 Subject: [PATCH] Remove references of the shared key, which isn't required anymore. --- src/main.cr | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/main.cr b/src/main.cr index dce5161..63d70a2 100644 --- a/src/main.cr +++ b/src/main.cr @@ -31,16 +31,15 @@ class DNSManager::Service < IPC property authd : AuthD::Client - def initialize(@configuration, @authd_key : String) + def initialize(@configuration) super() @storage = DNSManager::Storage.new @configuration.storage_directory, @configuration.recreate_indexes - @logged_users = Hash(Int32, AuthD::User::Public).new + @logged_users = Hash(Int32, AuthD::User::Public).new # TODO: auth service isn't in the FDs pool. # If the service crashes, dnsmanagerd won't know it. @authd = AuthD::Client.new - authd.key = @authd_key self.timer @configuration.ipc_timer self.service_init @configuration.service_name @@ -156,9 +155,6 @@ def main # Configuration file is for dnsmanagerd. Baguette::Configuration::Auth.get || Baguette::Configuration::Auth.new end - if key_file = authd_configuration.shared_key_file - authd_configuration.shared_key = File.read(key_file).chomp - end # DNSManagerd configuration. configuration = if no_configuration @@ -177,11 +173,6 @@ def main configuration.verbosity = opt.to_i end - parser.on "-k key-file", "--key-file file", "Key file." do |opt| - authd_configuration.shared_key = File.read(opt).chomp - Baguette::Log.debug "Authd key: #{authd_configuration.shared_key.not_nil!}" - end - # IPC Service options parser.on "-s service_name", "--service_name service_name", "Service name (IPC)." do |service_name| Baguette::Log.info "Service name: #{service_name}" @@ -200,19 +191,12 @@ def main end end - if authd_configuration.shared_key.nil? - Baguette::Log.error "No authd key file: cannot continue" - exit 1 - end - if simulation pp! authd_configuration, configuration exit 0 end - authd_key = authd_configuration.shared_key.not_nil! - - service = DNSManager::Service.new configuration, authd_key + service = DNSManager::Service.new configuration service.run end