From 3ad35832835fa0554b6fa28b74e9b7d21283392b Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Thu, 16 Mar 2023 18:37:12 +0900 Subject: Listen on Unix socket instead of TCP --- src/cli.cr | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/cli.cr') diff --git a/src/cli.cr b/src/cli.cr index 8cc79be..ecec1f8 100644 --- a/src/cli.cr +++ b/src/cli.cr @@ -27,26 +27,39 @@ enum Subcommand end struct Configuration + @sock : String + getter sock @db : Path getter db - @api : String - getter api + @css : Path + getter css + @opennic_local : Path getter opennic_local @opennic_remote : String getter opennic_remote + @opennic_api : String + getter opennic_api + @icann_local : Path getter icann_local @icann_remote : String getter icann_remote + @icann_api : String + getter icann_api def initialize(ini) + @sock = ini["general"]["sock"] @db = Path[ini["general"]["db"]] - @api = ini["general"]["api"] + @css = Path[ini["general"]["css"]] + @opennic_local = Path[ini["opennic"]["local"]] @opennic_remote = ini["opennic"]["remote"] + @opennic_api = ini["opennic"]["api"] + @icann_local = Path[ini["icann"]["local"]] @icann_remote = ini["icann"]["remote"] + @icann_api = ini["icann"]["api"] end end @@ -115,7 +128,7 @@ end in .serve? server = Server.new cfg.not_nil! server.listen port do |address| - puts "Listening on http://#{address}" + puts "Listening on #{address}" end in .usage? die parser -- cgit 1.4.1