diff --git a/.gitignore b/.gitignore index f9de1bc6..1ceecb16 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ _site/ /website/site/templates/shortcodes/config.env.txt /docker/docs /docker/dev-log + +.idea/* +sbt.json diff --git a/modules/joex/src/main/scala/docspell/joex/JoexServer.scala b/modules/joex/src/main/scala/docspell/joex/JoexServer.scala index a680844d..36568b9f 100644 --- a/modules/joex/src/main/scala/docspell/joex/JoexServer.scala +++ b/modules/joex/src/main/scala/docspell/joex/JoexServer.scala @@ -19,8 +19,8 @@ import docspell.store.Store import docspell.store.records.RInternalSetting import org.http4s.HttpApp -import org.http4s.blaze.client.BlazeClientBuilder import org.http4s.blaze.server.BlazeServerBuilder +import org.http4s.ember.client.EmberClientBuilder import org.http4s.implicits._ import org.http4s.server.Router import org.http4s.server.middleware.Logger @@ -46,7 +46,7 @@ object JoexServer { pools.connectEC ) settings <- Resource.eval(store.transact(RInternalSetting.create)) - httpClient <- BlazeClientBuilder[F].resource + httpClient <- EmberClientBuilder.default[F].build pubSub <- NaivePubSub( cfg.pubSubConfig(settings.internalRouteKey), store, @@ -64,7 +64,7 @@ object JoexServer { ).orNotFound // With Middlewares in place - finalHttpApp = Logger.httpApp(false, false)(httpApp) + finalHttpApp = Logger.httpApp(logHeaders = false, logBody = false)(httpApp) } yield App(finalHttpApp, signal, exitCode) diff --git a/modules/joex/src/main/scala/docspell/joex/hk/CheckNodesTask.scala b/modules/joex/src/main/scala/docspell/joex/hk/CheckNodesTask.scala index 68256465..7f9de5ae 100644 --- a/modules/joex/src/main/scala/docspell/joex/hk/CheckNodesTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/hk/CheckNodesTask.scala @@ -15,8 +15,8 @@ import docspell.scheduler.Task import docspell.store.Store import docspell.store.records._ -import org.http4s.blaze.client.BlazeClientBuilder import org.http4s.client.Client +import org.http4s.ember.client.EmberClientBuilder object CheckNodesTask { def apply[F[_]: Async]( @@ -27,8 +27,7 @@ object CheckNodesTask { if (cfg.enabled) for { _ <- ctx.logger.info("Check nodes reachability") - ec = scala.concurrent.ExecutionContext.global - _ <- BlazeClientBuilder[F].withExecutionContext(ec).resource.use { client => + _ <- EmberClientBuilder.default[F].build.use { client => checkNodes(ctx.logger, store, client) } _ <- ctx.logger.info( diff --git a/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala b/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala index b9b5b5ef..1674235c 100644 --- a/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala +++ b/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala @@ -12,9 +12,9 @@ import cats.implicits._ import docspell.common.{Ident, LenientUri} import docspell.joexapi.model.{AddonSupport, BasicResult} -import org.http4s.blaze.client.BlazeClientBuilder import org.http4s.circe.CirceEntityDecoder import org.http4s.client.Client +import org.http4s.ember.client.EmberClientBuilder import org.http4s.{Method, Request, Uri} trait JoexClient[F[_]] { @@ -73,5 +73,5 @@ object JoexClient { } def resource[F[_]: Async]: Resource[F, JoexClient[F]] = - BlazeClientBuilder[F].resource.map(apply[F]) + EmberClientBuilder.default[F].build.map(apply[F]) } diff --git a/modules/notification/api/src/main/scala/docspell/notification/api/Channel.scala b/modules/notification/api/src/main/scala/docspell/notification/api/Channel.scala index fa9f785f..6753db88 100644 --- a/modules/notification/api/src/main/scala/docspell/notification/api/Channel.scala +++ b/modules/notification/api/src/main/scala/docspell/notification/api/Channel.scala @@ -30,7 +30,8 @@ sealed trait Channel { } object Channel { - implicit val jsonConfig = Configuration.default.withDiscriminator("channelType") + implicit val jsonConfig: Configuration = + Configuration.default.withDiscriminator("channelType") final case class Mail( id: Ident, @@ -38,7 +39,7 @@ object Channel { connection: Ident, recipients: Nel[MailAddress] ) extends Channel { - val channelType = ChannelType.Mail + val channelType: ChannelType = ChannelType.Mail def fold[A]( f1: Mail => A, f2: Gotify => A, @@ -85,7 +86,7 @@ object Channel { roomId: String, accessToken: Password ) extends Channel { - val channelType = ChannelType.Matrix + val channelType: ChannelType = ChannelType.Matrix def fold[A]( f1: Mail => A, f2: Gotify => A, @@ -101,7 +102,7 @@ object Channel { final case class Http(id: Ident, name: Option[String], url: LenientUri) extends Channel { - val channelType = ChannelType.Http + val channelType: ChannelType = ChannelType.Http def fold[A]( f1: Mail => A, f2: Gotify => A, diff --git a/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala b/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala index f46bce0b..5727be0d 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala @@ -24,9 +24,9 @@ import docspell.store.Store import docspell.store.records.RInternalSetting import org.http4s._ -import org.http4s.blaze.client.BlazeClientBuilder import org.http4s.blaze.server.BlazeServerBuilder import org.http4s.dsl.Http4sDsl +import org.http4s.ember.client.EmberClientBuilder import org.http4s.headers.Location import org.http4s.implicits._ import org.http4s.server.Router @@ -83,7 +83,7 @@ object RestServer { (RestApp[F], NaivePubSub[F], RInternalSetting) ] = for { - httpClient <- BlazeClientBuilder[F].resource + httpClient <- EmberClientBuilder.default[F].build store <- Store.create[F]( cfg.backend.jdbc, cfg.backend.databaseSchema, diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 44895a7f..bc0dbc94 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -239,7 +239,7 @@ object Dependencies { val fs2 = fs2Core ++ fs2Io val http4sClient = Seq( - "org.http4s" %% "http4s-blaze-client" % "0.23.14" + "org.http4s" %% "http4s-ember-client" % Http4sVersion ) val http4sCirce = Seq(