feat(webserver): add host option to the configuration
All checks were successful
File-uploader-crystal CI / build (push) Successful in 1m41s

This commit is contained in:
Fijxu 2025-01-02 19:06:05 -03:00
parent c554b772c8
commit a4562ca005
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
2 changed files with 4 additions and 1 deletions

View file

@ -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?

View file

@ -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