diff --git a/src/config.cr b/src/config.cr index 77740f3..1fbd8ce 100644 --- a/src/config.cr +++ b/src/config.cr @@ -25,8 +25,10 @@ class Config property fileameLength : Int32 = 3 # In MiB property size_limit : Int16 = 512 - # TCP port + # Port on which the uploader will bind property port : Int32 = 8080 + # IP address on which the uploader will bind + property host : String = "127.0.0.1" # A file path where do you want to place a unix socket (THIS WILL DISABLE ACCESS # BY IP ADDRESS) property unix_socket : String? diff --git a/src/file-uploader-crystal.cr b/src/file-uploader-crystal.cr index eb9ea2b..850c4a2 100644 --- a/src/file-uploader-crystal.cr +++ b/src/file-uploader-crystal.cr @@ -15,6 +15,7 @@ require "./lib/**" CONFIG = Config.load Kemal.config.port = CONFIG.port +Kemal.config.host_binding = CONFIG.host Kemal.config.shutdown_message = false Kemal.config.app_name = "file-uploader-crystal" # https://github.com/iv-org/invidious/blob/90e94d4e6cc126a8b7a091d12d7a5556bfe369d5/src/invidious.cr#L136C1-L136C61