mirror of
https://gitlab.com/mangadex-pub/mangadex_at_home.git
synced 2024-11-17 00:22:32 +01:00
Actually fix client_hostname
thing
This commit is contained in:
parent
002a328f2d
commit
a4bd6ef121
@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
- [2020-07-29] Fixed stupid libsodium bugs [@carbotaniuman].
|
- [2020-07-29] Fixed stupid libsodium bugs [@carbotaniuman].
|
||||||
- [2020-07-29] Fixed issues from the Great Cache Propagation [@carbotaniuman].
|
- [2020-07-29] Fixed issues from the Great Cache Propagation [@carbotaniuman].
|
||||||
|
- [2020-08-03] Fix `client_hostname` stuff [@carbotaniuman].
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
@ -20,9 +20,12 @@ package mdnet.base
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature
|
import com.fasterxml.jackson.databind.DeserializationFeature
|
||||||
import com.fasterxml.jackson.module.kotlin.KotlinModule
|
import com.fasterxml.jackson.module.kotlin.KotlinModule
|
||||||
|
import java.net.InetAddress
|
||||||
import mdnet.base.ServerHandlerJackson.auto
|
import mdnet.base.ServerHandlerJackson.auto
|
||||||
import mdnet.base.settings.ClientSettings
|
import mdnet.base.settings.ClientSettings
|
||||||
import mdnet.base.settings.ServerSettings
|
import mdnet.base.settings.ServerSettings
|
||||||
|
import org.apache.http.client.config.RequestConfig
|
||||||
|
import org.apache.http.impl.client.HttpClients
|
||||||
import org.http4k.client.ApacheClient
|
import org.http4k.client.ApacheClient
|
||||||
import org.http4k.core.Body
|
import org.http4k.core.Body
|
||||||
import org.http4k.core.Method
|
import org.http4k.core.Method
|
||||||
@ -41,7 +44,16 @@ object ServerHandlerJackson : ConfigurableJackson(
|
|||||||
)
|
)
|
||||||
|
|
||||||
class ServerHandler(private var settings: ClientSettings) {
|
class ServerHandler(private var settings: ClientSettings) {
|
||||||
private val client = ApacheClient()
|
private val client = ApacheClient(client = HttpClients.custom()
|
||||||
|
.setDefaultRequestConfig(
|
||||||
|
RequestConfig.custom()
|
||||||
|
.apply {
|
||||||
|
if (settings.clientHostname != "0.0.0.0") {
|
||||||
|
setLocalAddress(InetAddress.getByName(settings.clientHostname))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.build())
|
||||||
|
.build())
|
||||||
|
|
||||||
fun logoutFromControl(): Boolean {
|
fun logoutFromControl(): Boolean {
|
||||||
LOGGER.info { "Disconnecting from the control server" }
|
LOGGER.info { "Disconnecting from the control server" }
|
||||||
|
@ -19,7 +19,6 @@ along with this MangaDex@Home. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
/* ktlint-disable no-wildcard-imports */
|
/* ktlint-disable no-wildcard-imports */
|
||||||
package mdnet.base.server
|
package mdnet.base.server
|
||||||
|
|
||||||
import java.net.InetAddress
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
import java.util.concurrent.atomic.AtomicReference
|
import java.util.concurrent.atomic.AtomicReference
|
||||||
import mdnet.base.data.Statistics
|
import mdnet.base.data.Statistics
|
||||||
@ -53,11 +52,6 @@ fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSetting
|
|||||||
.setConnectTimeout(3000)
|
.setConnectTimeout(3000)
|
||||||
.setSocketTimeout(3000)
|
.setSocketTimeout(3000)
|
||||||
.setConnectionRequestTimeout(3000)
|
.setConnectionRequestTimeout(3000)
|
||||||
.apply {
|
|
||||||
if (clientSettings.clientHostname != "0.0.0.0") {
|
|
||||||
setLocalAddress(InetAddress.getByName(clientSettings.clientHostname))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.build())
|
.build())
|
||||||
.setMaxConnTotal(3000)
|
.setMaxConnTotal(3000)
|
||||||
.setMaxConnPerRoute(3000)
|
.setMaxConnPerRoute(3000)
|
||||||
|
@ -69,8 +69,10 @@ class ImageServer(
|
|||||||
private val client: HttpHandler
|
private val client: HttpHandler
|
||||||
) {
|
) {
|
||||||
init {
|
init {
|
||||||
transaction(database) {
|
synchronized(database) {
|
||||||
SchemaUtils.create(ImageData)
|
transaction(database) {
|
||||||
|
SchemaUtils.create(ImageData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val executor = Executors.newCachedThreadPool()
|
private val executor = Executors.newCachedThreadPool()
|
||||||
|
Loading…
Reference in New Issue
Block a user