Remove references of the shared key, which isn't required anymore.
This commit is contained in:
		
							parent
							
								
									fd2d5d8962
								
							
						
					
					
						commit
						225d606807
					
				
					 1 changed files with 3 additions and 19 deletions
				
			
		
							
								
								
									
										20
									
								
								src/main.cr
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								src/main.cr
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -31,7 +31,7 @@ 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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +40,6 @@ class DNSManager::Service < IPC
 | 
			
		|||
		# 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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue