mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Allow to configure some http server details
This commit is contained in:
@ -38,6 +38,17 @@ docspell.server {
|
||||
port = 7880
|
||||
}
|
||||
|
||||
# Options for tuning the http server
|
||||
server-options {
|
||||
enable-http-2 = false
|
||||
|
||||
# Maximum allowed connections
|
||||
max-connections = 1024
|
||||
|
||||
# Timeout for waiting for the first output of the response
|
||||
response-timeout = 45s
|
||||
}
|
||||
|
||||
# This is a hard limit to restrict the size of a batch that is
|
||||
# returned when searching for items. The user can set this limit
|
||||
# within the client config, but it is restricted by the server to
|
||||
|
@ -13,7 +13,7 @@ import docspell.ftssolr.SolrConfig
|
||||
import docspell.logging.LogConfig
|
||||
import docspell.oidc.ProviderConfig
|
||||
import docspell.pubsub.naive.PubSubConfig
|
||||
import docspell.restserver.Config.OpenIdConfig
|
||||
import docspell.restserver.Config.{OpenIdConfig, ServerOptions}
|
||||
import docspell.restserver.auth.OpenId
|
||||
import docspell.restserver.http4s.InternalHeader
|
||||
|
||||
@ -26,6 +26,7 @@ case class Config(
|
||||
internalUrl: LenientUri,
|
||||
logging: LogConfig,
|
||||
bind: Config.Bind,
|
||||
serverOptions: ServerOptions,
|
||||
backend: BackendConfig,
|
||||
auth: Login.Config,
|
||||
showClassificationSettings: Boolean,
|
||||
@ -50,6 +51,11 @@ case class Config(
|
||||
|
||||
object Config {
|
||||
|
||||
case class ServerOptions(
|
||||
responseTimeout: Duration,
|
||||
enableHttp2: Boolean,
|
||||
maxConnections: Int
|
||||
)
|
||||
case class Bind(address: String, port: Int)
|
||||
|
||||
case class AdminEndpoint(secret: String)
|
||||
|
@ -52,6 +52,9 @@ object RestServer {
|
||||
BlazeServerBuilder[F]
|
||||
.bindHttp(cfg.bind.port, cfg.bind.address)
|
||||
.withoutBanner
|
||||
.withResponseHeaderTimeout(cfg.serverOptions.responseTimeout.toScala)
|
||||
.enableHttp2(cfg.serverOptions.enableHttp2)
|
||||
.withMaxConnections(cfg.serverOptions.maxConnections)
|
||||
.withHttpWebSocketApp(
|
||||
createHttpApp(setting, pubSub, restApp)
|
||||
)
|
||||
|
Reference in New Issue
Block a user