mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-07-16 00:58:49 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b4c08abce5 |
@@ -1014,7 +1014,7 @@ pub(super) async fn resolve_true_destination(
|
|||||||
let resolver: &MatrixResolver = if no_cache {
|
let resolver: &MatrixResolver = if no_cache {
|
||||||
&MatrixResolverBuilder::new()
|
&MatrixResolverBuilder::new()
|
||||||
.dangerous_tls_accept_invalid_certs(self.services.server.config.allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure)
|
.dangerous_tls_accept_invalid_certs(self.services.server.config.allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure)
|
||||||
.http_client(self.services.client.default.clone())
|
.http_client(self.services.client.dns.clone())
|
||||||
.build()?
|
.build()?
|
||||||
} else {
|
} else {
|
||||||
&self.services.client.matrix_resolver
|
&self.services.client.matrix_resolver
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ pub(super) async fn fetch_support_well_known(&self, server_name: OwnedServerName
|
|||||||
let response = self
|
let response = self
|
||||||
.services
|
.services
|
||||||
.client
|
.client
|
||||||
.default
|
.external_resource
|
||||||
.get(format!("https://{server_name}/.well-known/matrix/support"))
|
.get(format!("https://{server_name}/.well-known/matrix/support"))
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ async fn check(&self) -> Result<()> {
|
|||||||
let response = self
|
let response = self
|
||||||
.services
|
.services
|
||||||
.client
|
.client
|
||||||
.default
|
.external_resource
|
||||||
.get(CHECK_FOR_ANNOUNCEMENTS_URL)
|
.get(CHECK_FOR_ANNOUNCEMENTS_URL)
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
|
|||||||
+14
-19
@@ -16,9 +16,9 @@ pub struct Service {
|
|||||||
pub matrix_resolver: Arc<MatrixResolver>,
|
pub matrix_resolver: Arc<MatrixResolver>,
|
||||||
pub dns_resolver: Arc<TokioResolver>,
|
pub dns_resolver: Arc<TokioResolver>,
|
||||||
|
|
||||||
pub default: reqwest::Client,
|
pub dns: reqwest::Client,
|
||||||
pub url_preview: reqwest::Client,
|
pub url_preview: reqwest::Client,
|
||||||
pub extern_media: reqwest::Client,
|
pub external_resource: reqwest::Client,
|
||||||
pub federation: reqwest::Client,
|
pub federation: reqwest::Client,
|
||||||
pub federation_slow: reqwest::Client,
|
pub federation_slow: reqwest::Client,
|
||||||
pub sender: reqwest::Client,
|
pub sender: reqwest::Client,
|
||||||
@@ -35,17 +35,17 @@ fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
|||||||
|
|
||||||
let dns_resolver = get_dns_resolver(args.server)?;
|
let dns_resolver = get_dns_resolver(args.server)?;
|
||||||
|
|
||||||
|
let dns_client = base(&args.server.config)?
|
||||||
|
.connect_timeout(Duration::from_secs(args.server.config.well_known_conn_timeout))
|
||||||
|
.read_timeout(Duration::from_secs(args.server.config.well_known_timeout))
|
||||||
|
.timeout(Duration::from_secs(args.server.config.well_known_timeout))
|
||||||
|
.pool_max_idle_per_host(0)
|
||||||
|
.redirect(redirect::Policy::limited(4))
|
||||||
|
.build()?;
|
||||||
|
|
||||||
let matrix_resolver = Arc::new(MatrixResolverBuilder::new()
|
let matrix_resolver = Arc::new(MatrixResolverBuilder::new()
|
||||||
.dangerous_tls_accept_invalid_certs(args.server.config.allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure)
|
.dangerous_tls_accept_invalid_certs(args.server.config.allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure)
|
||||||
.http_client(
|
.http_client(dns_client.clone())
|
||||||
base(&args.server.config)?
|
|
||||||
.connect_timeout(Duration::from_secs(args.server.config.well_known_conn_timeout))
|
|
||||||
.read_timeout(Duration::from_secs(args.server.config.well_known_timeout))
|
|
||||||
.timeout(Duration::from_secs(args.server.config.well_known_timeout))
|
|
||||||
.pool_max_idle_per_host(0)
|
|
||||||
.redirect(redirect::Policy::limited(4))
|
|
||||||
.build()?
|
|
||||||
)
|
|
||||||
.dns_resolver(dns_resolver.clone())
|
.dns_resolver(dns_resolver.clone())
|
||||||
.build()?);
|
.build()?);
|
||||||
let matrix_dns_resolver = matrix_resolver.create_dns_resolver();
|
let matrix_dns_resolver = matrix_resolver.create_dns_resolver();
|
||||||
@@ -69,23 +69,19 @@ fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
|||||||
matrix_resolver,
|
matrix_resolver,
|
||||||
dns_resolver,
|
dns_resolver,
|
||||||
|
|
||||||
default: base(config)?
|
dns: dns_client,
|
||||||
.dns_resolver(matrix_dns_resolver.clone())
|
|
||||||
.build()?,
|
|
||||||
|
|
||||||
url_preview: base(config)
|
url_preview: base(config)
|
||||||
.and_then(|builder| {
|
.and_then(|builder| {
|
||||||
builder_interface(builder, url_preview_bind_iface.as_deref())
|
builder_interface(builder, url_preview_bind_iface.as_deref())
|
||||||
})?
|
})?
|
||||||
.local_address(url_preview_bind_addr)
|
.local_address(url_preview_bind_addr)
|
||||||
.dns_resolver(matrix_dns_resolver.clone())
|
|
||||||
.timeout(Duration::from_secs(config.url_preview_timeout))
|
.timeout(Duration::from_secs(config.url_preview_timeout))
|
||||||
.redirect(redirect::Policy::limited(3))
|
.redirect(redirect::Policy::limited(3))
|
||||||
.user_agent(url_preview_user_agent)
|
.user_agent(url_preview_user_agent)
|
||||||
.build()?,
|
.build()?,
|
||||||
|
|
||||||
extern_media: base(config)?
|
external_resource: base(config)?
|
||||||
.dns_resolver(matrix_dns_resolver.clone())
|
|
||||||
.redirect(redirect::Policy::limited(3))
|
.redirect(redirect::Policy::limited(3))
|
||||||
.build()?,
|
.build()?,
|
||||||
|
|
||||||
@@ -128,7 +124,7 @@ fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
|||||||
.build()?,
|
.build()?,
|
||||||
|
|
||||||
appservice: base(config)?
|
appservice: base(config)?
|
||||||
.dns_resolver(matrix_dns_resolver.clone())
|
.dns_resolver(matrix_dns_resolver)
|
||||||
.connect_timeout(Duration::from_secs(5))
|
.connect_timeout(Duration::from_secs(5))
|
||||||
.read_timeout(Duration::from_secs(config.appservice_timeout))
|
.read_timeout(Duration::from_secs(config.appservice_timeout))
|
||||||
.timeout(Duration::from_secs(config.appservice_timeout))
|
.timeout(Duration::from_secs(config.appservice_timeout))
|
||||||
@@ -138,7 +134,6 @@ fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
|||||||
.build()?,
|
.build()?,
|
||||||
|
|
||||||
pusher: base(config)?
|
pusher: base(config)?
|
||||||
.dns_resolver(matrix_dns_resolver)
|
|
||||||
.connect_timeout(Duration::from_secs(config.pusher_conn_timeout))
|
.connect_timeout(Duration::from_secs(config.pusher_conn_timeout))
|
||||||
.timeout(Duration::from_secs(config.pusher_timeout))
|
.timeout(Duration::from_secs(config.pusher_timeout))
|
||||||
.pool_max_idle_per_host(1)
|
.pool_max_idle_per_host(1)
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ async fn location_request(&self, location: &str) -> Result<FileMeta> {
|
|||||||
let response = self
|
let response = self
|
||||||
.services
|
.services
|
||||||
.client
|
.client
|
||||||
.extern_media
|
.external_resource
|
||||||
.get(location)
|
.get(location)
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user