mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-07 11:36:55 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
173a3effda | ||
|
|
34f05f4b2f |
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.13.5"
|
||||
".": "0.12.1"
|
||||
}
|
||||
63
CHANGELOG.md
63
CHANGELOG.md
@@ -1,68 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## [0.13.5](https://github.com/stoatchat/stoatchat/compare/v0.13.4...v0.13.5) (2026-05-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* dont panic on hash missing when deleting files ([#755](https://github.com/stoatchat/stoatchat/issues/755)) ([c902077](https://github.com/stoatchat/stoatchat/commit/c902077cf51076fee11712eb732dc8a8f786fc4b))
|
||||
|
||||
## [0.13.4](https://github.com/stoatchat/stoatchat/compare/v0.13.3...v0.13.4) (2026-05-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add TLS feature to livekit-api crate ([#753](https://github.com/stoatchat/stoatchat/issues/753)) ([6cfee1f](https://github.com/stoatchat/stoatchat/commit/6cfee1f601c1e084df7c8f1e7a5e8a560d1dd514))
|
||||
|
||||
## [0.13.3](https://github.com/stoatchat/stoatchat/compare/v0.13.2...v0.13.3) (2026-05-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* don't automatically set up rabbitmq in delta ([#749](https://github.com/stoatchat/stoatchat/issues/749)) ([7647cfc](https://github.com/stoatchat/stoatchat/commit/7647cfc8d93aba99f5faef13eb3d970097540d76))
|
||||
* don't declare queues which seem to cause the backend to crash in prod ([7647cfc](https://github.com/stoatchat/stoatchat/commit/7647cfc8d93aba99f5faef13eb3d970097540d76))
|
||||
|
||||
## [0.13.2](https://github.com/stoatchat/stoatchat/compare/v0.13.1...v0.13.2) (2026-05-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update default exchange to `revolt.default` ([#746](https://github.com/stoatchat/stoatchat/issues/746)) ([fcb8091](https://github.com/stoatchat/stoatchat/commit/fcb8091cd7a00d7f26c798daa33aae4b923b2a8b))
|
||||
|
||||
## [0.13.1](https://github.com/stoatchat/stoatchat/compare/v0.13.0...v0.13.1) (2026-05-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* amqprs startup bug ([#744](https://github.com/stoatchat/stoatchat/issues/744)) ([1100eaf](https://github.com/stoatchat/stoatchat/commit/1100eaf46f849f2509ae01ac497556ca33bde778))
|
||||
|
||||
## [0.13.0](https://github.com/stoatchat/stoatchat/compare/v0.12.1...v0.13.0) (2026-05-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add embed support for YouTube Shorts ([#734](https://github.com/stoatchat/stoatchat/issues/734)) ([d46c7f7](https://github.com/stoatchat/stoatchat/commit/d46c7f7f3c04524c0639c3e0a122626f8e0b3bf7))
|
||||
* add emoji rename endpoint ([#714](https://github.com/stoatchat/stoatchat/issues/714)) ([23ad135](https://github.com/stoatchat/stoatchat/commit/23ad1359834bb7d07a460b8678d6a6ebffc73eb0))
|
||||
* add legal links to root payload ([#733](https://github.com/stoatchat/stoatchat/issues/733)) ([21d8201](https://github.com/stoatchat/stoatchat/commit/21d82018cf84ab0fdd10613d254b9562aea8eea3))
|
||||
* add role icon support ([#724](https://github.com/stoatchat/stoatchat/issues/724)) ([841985d](https://github.com/stoatchat/stoatchat/commit/841985d3b994df1c6eefab2fc7ecbd77ab22c493))
|
||||
* Add webhook endpoints for editing and deleting messages ([#682](https://github.com/stoatchat/stoatchat/issues/682)) ([6f3441c](https://github.com/stoatchat/stoatchat/commit/6f3441cf4acac2a8e6e1bf07a279a153b80f7956))
|
||||
* automatically sanitise usernames on create/update ([#689](https://github.com/stoatchat/stoatchat/issues/689)) ([e937697](https://github.com/stoatchat/stoatchat/commit/e93769786c7669485a659ee471630740d3cea702))
|
||||
* blacklist private ip ranges and add january domain blocklist ([#731](https://github.com/stoatchat/stoatchat/issues/731)) ([6b41db9](https://github.com/stoatchat/stoatchat/commit/6b41db984bb491b2e58324309cc70d8c14e0b814))
|
||||
* Rewrite acks ([#741](https://github.com/stoatchat/stoatchat/issues/741)) ([ab5bd47](https://github.com/stoatchat/stoatchat/commit/ab5bd47a39ee889de0b5ae6e7b560620853daead))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add new_user_hours to configuration limits ([#729](https://github.com/stoatchat/stoatchat/issues/729)) ([279f5d5](https://github.com/stoatchat/stoatchat/commit/279f5d5fd7af2df55902c706859ec07f569cdb1e))
|
||||
* add reconnection policy to Redis subscriber to prevent ghost state ([#708](https://github.com/stoatchat/stoatchat/issues/708)) ([057f2bb](https://github.com/stoatchat/stoatchat/commit/057f2bb8b359f8b942741a30ff54eeb8fbe3e0b1))
|
||||
* docker compose file had personal url in it ([#742](https://github.com/stoatchat/stoatchat/issues/742)) ([0719985](https://github.com/stoatchat/stoatchat/commit/0719985ac5636590f91e6f9ec4b68f3eded70c13))
|
||||
* don't strip ICC from exif ([#735](https://github.com/stoatchat/stoatchat/issues/735)) ([d76a711](https://github.com/stoatchat/stoatchat/commit/d76a71141f3e508f6308ba52fa28eaeb56fb3438))
|
||||
* dont send notification in fcm ([#721](https://github.com/stoatchat/stoatchat/issues/721)) ([89171e9](https://github.com/stoatchat/stoatchat/commit/89171e9bd0f15711157e78c6eec0fe7b480de93a))
|
||||
* encode filenames in redirects ([#737](https://github.com/stoatchat/stoatchat/issues/737)) ([9fd7128](https://github.com/stoatchat/stoatchat/commit/9fd7128f800badbd184baf943d4f799e601201e4))
|
||||
* january ip redirects & domain resolver ([#738](https://github.com/stoatchat/stoatchat/issues/738)) ([356491e](https://github.com/stoatchat/stoatchat/commit/356491e934b274f9e895df883dd63ef0b3123510))
|
||||
* update message length validation to remove upper limit ([#723](https://github.com/stoatchat/stoatchat/issues/723)) ([ed4fd5e](https://github.com/stoatchat/stoatchat/commit/ed4fd5ebfe6d0ea534a0898da4afdc1f4e2cd6c5))
|
||||
* use correct response for NoEffect errors ([#732](https://github.com/stoatchat/stoatchat/issues/732)) ([5378cd2](https://github.com/stoatchat/stoatchat/commit/5378cd22b4c7d85f44c31a6af0dda00941b80d5c))
|
||||
|
||||
## [0.12.1](https://github.com/stoatchat/stoatchat/compare/v0.12.0...v0.12.1) (2026-04-10)
|
||||
|
||||
|
||||
|
||||
82
Cargo.lock
generated
82
Cargo.lock
generated
@@ -570,7 +570,7 @@ dependencies = [
|
||||
"futures-util",
|
||||
"log",
|
||||
"pin-project-lite 0.2.17",
|
||||
"tungstenite 0.17.3",
|
||||
"tungstenite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5048,14 +5048,11 @@ dependencies = [
|
||||
"prost",
|
||||
"rand 0.9.2",
|
||||
"reqwest 0.12.28",
|
||||
"rustls-native-certs 0.6.3",
|
||||
"scopeguard",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"thiserror 2.0.18",
|
||||
"tokio-rustls 0.24.1",
|
||||
"tokio-tungstenite",
|
||||
"url",
|
||||
]
|
||||
|
||||
@@ -7422,22 +7419,16 @@ dependencies = [
|
||||
"http-body 1.0.1",
|
||||
"http-body-util",
|
||||
"hyper 1.9.0",
|
||||
"hyper-rustls 0.27.7",
|
||||
"hyper-util",
|
||||
"js-sys",
|
||||
"log",
|
||||
"percent-encoding",
|
||||
"pin-project-lite 0.2.17",
|
||||
"quinn",
|
||||
"rustls 0.23.37",
|
||||
"rustls-native-certs 0.8.3",
|
||||
"rustls-pki-types",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"sync_wrapper 1.0.2",
|
||||
"tokio 1.51.0",
|
||||
"tokio-rustls 0.26.4",
|
||||
"tower",
|
||||
"tower-http 0.6.8",
|
||||
"tower-service",
|
||||
@@ -7513,7 +7504,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-autumn"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"axum-macros",
|
||||
@@ -7554,7 +7545,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-bonfire"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"async-channel 2.5.0",
|
||||
"async-std",
|
||||
@@ -7585,7 +7576,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-coalesced"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"indexmap 2.13.1",
|
||||
"lru",
|
||||
@@ -7594,7 +7585,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-config"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"cached",
|
||||
@@ -7611,7 +7602,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-crond"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"futures-lite",
|
||||
"iso8601-timestamp",
|
||||
@@ -7631,7 +7622,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-database"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"amqprs",
|
||||
"async-lock 2.8.0",
|
||||
@@ -7682,7 +7673,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-delta"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"amqprs",
|
||||
"async-channel 2.5.0",
|
||||
@@ -7731,7 +7722,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-files"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"aes-gcm",
|
||||
"anyhow",
|
||||
@@ -7759,7 +7750,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-gifbox"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"axum-extra",
|
||||
@@ -7782,7 +7773,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-january"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"async-recursion",
|
||||
"axum",
|
||||
@@ -7812,7 +7803,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-models"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"indexmap 2.13.1",
|
||||
"iso8601-timestamp",
|
||||
@@ -7831,14 +7822,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-parser"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"logos",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "revolt-permissions"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"async-trait",
|
||||
@@ -7853,7 +7844,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-presence"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"log",
|
||||
@@ -7865,7 +7856,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-pushd"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"amqprs",
|
||||
"anyhow",
|
||||
@@ -7896,7 +7887,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-ratelimits"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"authifier",
|
||||
@@ -7913,7 +7904,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-result"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"log",
|
||||
@@ -7929,7 +7920,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-voice-ingress"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
dependencies = [
|
||||
"amqprs",
|
||||
"async-std",
|
||||
@@ -9900,21 +9891,6 @@ dependencies = [
|
||||
"tokio 1.51.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-tungstenite"
|
||||
version = "0.20.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"log",
|
||||
"rustls 0.21.12",
|
||||
"rustls-native-certs 0.6.3",
|
||||
"tokio 1.51.0",
|
||||
"tokio-rustls 0.24.1",
|
||||
"tungstenite 0.20.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.7.18"
|
||||
@@ -10170,26 +10146,6 @@ dependencies = [
|
||||
"utf-8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tungstenite"
|
||||
version = "0.20.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"bytes 1.11.1",
|
||||
"data-encoding",
|
||||
"http 0.2.12",
|
||||
"httparse",
|
||||
"log",
|
||||
"rand 0.8.5",
|
||||
"rustls 0.21.12",
|
||||
"sha1",
|
||||
"thiserror 1.0.69",
|
||||
"url",
|
||||
"utf-8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typed-builder"
|
||||
version = "0.22.0"
|
||||
|
||||
20
Cargo.toml
20
Cargo.toml
@@ -192,13 +192,13 @@ futures-lite = "2.6.1"
|
||||
vergen = "7.5.0"
|
||||
|
||||
# Local packages
|
||||
revolt-coalesced = { version = "0.13.5", path = "crates/core/coalesced" }
|
||||
revolt-config = { version = "0.13.5", path = "crates/core/config" }
|
||||
revolt-database = { version = "0.13.5", path = "crates/core/database" }
|
||||
revolt-files = { version = "0.13.5", path = "crates/core/files" }
|
||||
revolt-models = { version = "0.13.5", path = "crates/core/models" }
|
||||
revolt-parser = { version = "0.13.5", path = "crates/core/parser" }
|
||||
revolt-permissions = { version = "0.13.5", path = "crates/core/permissions" }
|
||||
revolt-presence = { version = "0.13.5", path = "crates/core/presence" }
|
||||
revolt-ratelimits = { version = "0.13.5", path = "crates/core/ratelimits" }
|
||||
revolt-result = { version = "0.13.5", path = "crates/core/result" }
|
||||
revolt-coalesced = { version = "0.12.0", path = "crates/core/coalesced" }
|
||||
revolt-config = { version = "0.12.0", path = "crates/core/config" }
|
||||
revolt-database = { version = "0.12.0", path = "crates/core/database" }
|
||||
revolt-files = { version = "0.12.0", path = "crates/core/files" }
|
||||
revolt-models = { version = "0.12.0", path = "crates/core/models" }
|
||||
revolt-parser = { version = "0.12.0", path = "crates/core/parser" }
|
||||
revolt-permissions = { version = "0.12.0", path = "crates/core/permissions" }
|
||||
revolt-presence = { version = "0.12.0", path = "crates/core/presence" }
|
||||
revolt-ratelimits = { version = "0.12.0", path = "crates/core/ratelimits" }
|
||||
revolt-result = { version = "0.12.0", path = "crates/core/result" }
|
||||
|
||||
@@ -61,7 +61,7 @@ secret = "ZjCofRlfm6GGtjlifmNpCDkcQbEIIVC0"
|
||||
# S3 protocol endpoint
|
||||
endpoint = "http://127.0.0.1:14009"
|
||||
# S3 region name
|
||||
region = "minio"
|
||||
region = "us-east-1"
|
||||
# S3 protocol key ID
|
||||
access_key_id = "minioautumn"
|
||||
# S3 protocol access key
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-bonfire"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-coalesced"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>", "Zomatree <me@zomatree.live>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-config"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -30,7 +30,7 @@ host = "rabbit"
|
||||
port = 5672
|
||||
username = "rabbituser"
|
||||
password = "rabbitpass"
|
||||
default_exchange = "revolt.default"
|
||||
default_exchange = "revolt"
|
||||
|
||||
[rabbit.queues]
|
||||
acks = "internal.ack"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-database"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -98,6 +98,6 @@ authifier = { workspace = true }
|
||||
amqprs = { workspace = true }
|
||||
|
||||
# Voice
|
||||
livekit-api = { workspace = true, features = ["rustls-tls-native-roots"], optional = true }
|
||||
livekit-api = { workspace = true, optional = true }
|
||||
livekit-protocol = { workspace = true, optional = true }
|
||||
livekit-runtime = { workspace = true, features = ["tokio"], optional = true }
|
||||
|
||||
@@ -29,7 +29,7 @@ impl AMQP {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn new_auto() -> revolt_result::Result<AMQP> {
|
||||
pub async fn new_auto() -> AMQP {
|
||||
let config = revolt_config::config().await;
|
||||
|
||||
let connection = Connection::open(&OpenConnectionArguments::new(
|
||||
@@ -46,26 +46,21 @@ impl AMQP {
|
||||
.await
|
||||
.expect("Failed to open RabbitMQ channel");
|
||||
|
||||
let mut resp = AMQP::new(connection, channel);
|
||||
//resp.configure_channels().await?;
|
||||
Ok(resp)
|
||||
}
|
||||
|
||||
pub async fn repoen_channel(&mut self) {
|
||||
self.channel = self
|
||||
.connection
|
||||
.open_channel(None)
|
||||
channel
|
||||
.exchange_declare(
|
||||
ExchangeDeclareArguments::new(&config.pushd.exchange, "direct")
|
||||
.durable(true)
|
||||
.finish(),
|
||||
)
|
||||
.await
|
||||
.expect("Failed to open RabbitMQ channel");
|
||||
.expect("Failed to declare exchange");
|
||||
|
||||
AMQP::new(connection, channel)
|
||||
}
|
||||
|
||||
pub async fn configure_channels(&mut self) -> revolt_result::Result<()> {
|
||||
pub async fn configure_channels(&self) -> revolt_result::Result<()> {
|
||||
let config = revolt_config::config().await;
|
||||
|
||||
if !self.channel.is_open() {
|
||||
self.repoen_channel().await;
|
||||
}
|
||||
|
||||
self.channel
|
||||
.exchange_declare(
|
||||
ExchangeDeclareArguments::new(
|
||||
|
||||
@@ -95,7 +95,7 @@ macro_rules! database_test {
|
||||
db.drop_database().await;
|
||||
|
||||
#[allow(clippy::redundant_closure_call)]
|
||||
(|$db: $crate::Database| $test)(db.clone()).await;
|
||||
std::boxed::Box::pin((|$db: $crate::Database| $test)(db.clone())).await;
|
||||
|
||||
db.drop_database().await
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-files"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-models"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-parser"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Zomatree <me@zomatree.live>", "Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-permissions"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-presence"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-ratelimits"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
authors = ["Zomatree <me@zomatree.live>", "Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-result"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-crond"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -11,24 +11,22 @@ pub async fn task(db: Database) -> Result<()> {
|
||||
let files = db.fetch_deleted_attachments().await?;
|
||||
|
||||
for file in files {
|
||||
if let Some(hash) = &file.hash {
|
||||
let count = db
|
||||
.count_file_hash_references(hash)
|
||||
let count = db
|
||||
.count_file_hash_references(file.hash.as_ref().expect("no `hash` present"))
|
||||
.await?;
|
||||
|
||||
// No other files reference this file on disk anymore
|
||||
if count <= 1 {
|
||||
let file_hash = db
|
||||
.fetch_attachment_hash(file.hash.as_ref().expect("no `hash` present"))
|
||||
.await?;
|
||||
|
||||
// No other files reference this file on disk anymore
|
||||
if count <= 1 {
|
||||
let file_hash = db
|
||||
.fetch_attachment_hash(hash)
|
||||
.await?;
|
||||
// Delete from S3
|
||||
delete_from_s3(&file_hash.bucket_id, &file_hash.path).await?;
|
||||
|
||||
// Delete from S3
|
||||
delete_from_s3(&file_hash.bucket_id, &file_hash.path).await?;
|
||||
|
||||
// Delete the hash
|
||||
db.delete_attachment_hash(&file_hash.id).await?;
|
||||
info!("Deleted file hash {}", file_hash.id);
|
||||
}
|
||||
// Delete the hash
|
||||
db.delete_attachment_hash(&file_hash.id).await?;
|
||||
info!("Deleted file hash {}", file_hash.id);
|
||||
}
|
||||
|
||||
// Delete the file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-pushd"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
publish = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-voice-ingress"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-delta"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <paulmakles@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
@@ -119,10 +119,10 @@ pub async fn web() -> Rocket<Build> {
|
||||
.await
|
||||
.expect("Failed to declare exchange");
|
||||
|
||||
let mut amqp = AMQP::new(connection, channel);
|
||||
// amqp.configure_channels()
|
||||
// .await
|
||||
// .expect("Failed to configure channels");
|
||||
let amqp = AMQP::new(connection, channel);
|
||||
amqp.configure_channels()
|
||||
.await
|
||||
.expect("Failed to configure channels");
|
||||
|
||||
// Launch background task workers
|
||||
revolt_database::tasks::start_workers(db.clone(), amqp.clone());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-autumn"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
publish = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-gifbox"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
publish = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-january"
|
||||
version = "0.13.5"
|
||||
version = "0.12.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
publish = false
|
||||
|
||||
@@ -4,7 +4,6 @@ use mime::Mime;
|
||||
use pdk_ip_filter_lib::IpFilter;
|
||||
use regex::Regex;
|
||||
use reqwest::{
|
||||
dns::{Addrs, Name, Resolve},
|
||||
header::{self, CONTENT_TYPE},
|
||||
redirect, Client, Response,
|
||||
};
|
||||
@@ -12,7 +11,6 @@ use revolt_config::{config, report_internal_error};
|
||||
use revolt_files::{create_thumbnail, decode_image, image_size_vec, is_valid_image, video_size};
|
||||
use revolt_models::v0::{Embed, Image, ImageSize, Video};
|
||||
use revolt_result::{create_error, Error, Result, ToRevoltError};
|
||||
use std::net::{IpAddr, SocketAddr};
|
||||
use std::{
|
||||
io::{Cursor, Write},
|
||||
str::FromStr,
|
||||
@@ -23,7 +21,6 @@ use url::{Host, Url};
|
||||
lazy_static! {
|
||||
/// Request client
|
||||
static ref CLIENT: Client = reqwest::Client::builder()
|
||||
.dns_resolver(CachedDnsResolver {})
|
||||
.timeout(Duration::from_secs(10)) // TODO config
|
||||
.connect_timeout(Duration::from_secs(5)) // TODO config
|
||||
.redirect(redirect::Policy::none())
|
||||
@@ -61,73 +58,18 @@ lazy_static! {
|
||||
.time_to_live(Duration::from_secs(60)) // For up to 1 minute
|
||||
.build();
|
||||
|
||||
static ref DNS_CACHE: moka::future::Cache<String, Vec<SocketAddr>> = moka::future::Cache::builder()
|
||||
.max_capacity(10_000)
|
||||
.time_to_idle(Duration::from_secs(30))
|
||||
.build();
|
||||
|
||||
static ref IP_BLOCKLIST: IpFilter = IpFilter::block(&[
|
||||
"0.0.0.0/8",
|
||||
"10.0.0.0/8",
|
||||
"192.168.0.0/16",
|
||||
"127.0.0.0/8",
|
||||
"172.16.0.0/12",
|
||||
"169.254.0.0/16",
|
||||
"::1",
|
||||
"fc00::/7",
|
||||
"fc00::/7"
|
||||
]
|
||||
).unwrap();
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct IPRequest {
|
||||
url: Url,
|
||||
ip: IpAddr,
|
||||
pub blocked: bool,
|
||||
}
|
||||
|
||||
impl From<IPRequest> for Url {
|
||||
fn from(value: IPRequest) -> Self {
|
||||
let mut url = value.url.clone();
|
||||
url.set_host(Some(&value.ip.to_string()))
|
||||
.map(|_| url)
|
||||
.unwrap_or(value.url)
|
||||
}
|
||||
}
|
||||
|
||||
struct CachedDnsResolver {}
|
||||
|
||||
impl reqwest::dns::Resolve for CachedDnsResolver {
|
||||
fn resolve(&self, name: Name) -> reqwest::dns::Resolving {
|
||||
Box::pin(async move {
|
||||
{
|
||||
if let Some(addrs) = DNS_CACHE.get(&name.as_str().to_string()).await {
|
||||
let resp: Addrs = Box::new(addrs.clone().into_iter());
|
||||
return Ok(resp);
|
||||
}
|
||||
}
|
||||
|
||||
let mut lookup = name.as_str().to_string();
|
||||
if !lookup.contains(":") {
|
||||
lookup += ":0";
|
||||
}
|
||||
|
||||
let fallback: Vec<SocketAddr> = tokio::net::lookup_host(&lookup)
|
||||
.await
|
||||
.map_err(|e| -> Box<dyn std::error::Error + Send + Sync> { Box::new(e) })?
|
||||
.collect();
|
||||
|
||||
{
|
||||
DNS_CACHE
|
||||
.insert(name.as_str().to_string().clone(), fallback.clone())
|
||||
.await;
|
||||
let addrs: Addrs = Box::new(fallback.clone().into_iter());
|
||||
Ok(addrs)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Information about a successful request
|
||||
pub struct Request {
|
||||
response: Response,
|
||||
@@ -333,12 +275,7 @@ impl Request {
|
||||
let mut url = url;
|
||||
let url_host_str = url.host_str().ok_or(create_error!(ProxyError))?.to_string();
|
||||
|
||||
let mut blocker = Request::url_is_blacklisted(&url).await?;
|
||||
|
||||
if blocker.blocked {
|
||||
return Err(create_error!(InvalidOperation));
|
||||
}
|
||||
|
||||
Request::url_is_blacklisted(&url).await?;
|
||||
let mut redirect_count = 0;
|
||||
|
||||
loop {
|
||||
@@ -367,13 +304,9 @@ impl Request {
|
||||
let location = location.to_str().map_err(|_| create_error!(ProxyError))?;
|
||||
url = Url::from_str(location).to_internal_error()?;
|
||||
|
||||
blocker = Request::url_is_blacklisted(&url).await?;
|
||||
|
||||
if blocker.blocked {
|
||||
return Err(create_error!(InvalidOperation));
|
||||
if !Request::url_is_blacklisted(&url).await? {
|
||||
continue;
|
||||
}
|
||||
|
||||
continue;
|
||||
} else {
|
||||
return Err(create_error!(ProxyError));
|
||||
}
|
||||
@@ -418,25 +351,17 @@ impl Request {
|
||||
Ok(Request::exists(proper_url).await)
|
||||
}
|
||||
|
||||
pub async fn url_is_blacklisted(url: &Url) -> Result<IPRequest> {
|
||||
let resolved_address: IpAddr;
|
||||
|
||||
pub async fn url_is_blacklisted(url: &Url) -> Result<bool> {
|
||||
if let Some(host) = url.host() {
|
||||
match host {
|
||||
Host::Ipv4(ipv4) => {
|
||||
resolved_address = ipv4.into();
|
||||
if !IP_BLOCKLIST.is_allowed(&ipv4.to_string()) {
|
||||
return Err(create_error!(InvalidOperation));
|
||||
}
|
||||
}
|
||||
Host::Ipv6(ipv6) => {
|
||||
resolved_address = ipv6.into();
|
||||
if !IP_BLOCKLIST.is_allowed(&ipv6.to_string()) {
|
||||
let url_str = ipv4.to_string();
|
||||
if !IP_BLOCKLIST.is_allowed(&url_str) {
|
||||
return Err(create_error!(InvalidOperation));
|
||||
}
|
||||
}
|
||||
Host::Domain(domain) => {
|
||||
let domain = domain.to_string();
|
||||
let mut domain = domain.to_string();
|
||||
|
||||
let config = config().await;
|
||||
|
||||
@@ -447,22 +372,14 @@ impl Request {
|
||||
return Err(create_error!(InvalidOperation));
|
||||
}
|
||||
|
||||
if !domain.contains(":") {
|
||||
domain += ":80";
|
||||
}
|
||||
|
||||
// Second step: resolve the IP and check the blocklist
|
||||
let resolver = CachedDnsResolver {};
|
||||
if let Ok(mut resolved_ip) = resolver
|
||||
.resolve(
|
||||
Name::from_str(&domain)
|
||||
.map_err(|_| create_error!(ProxyError))
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
if let Ok(mut resolved_ip) = tokio::net::lookup_host(domain.clone()).await {
|
||||
if let Some(resolved_ip) = resolved_ip.next() {
|
||||
resolved_address = resolved_ip.ip();
|
||||
let resolved_string = resolved_address.to_string();
|
||||
if !IP_BLOCKLIST.is_allowed(&resolved_string)
|
||||
|| resolved_string.contains("::ffff:")
|
||||
{
|
||||
if !IP_BLOCKLIST.is_allowed(&resolved_ip.ip().to_string()) {
|
||||
return Err(create_error!(InvalidOperation));
|
||||
}
|
||||
} else {
|
||||
@@ -472,15 +389,10 @@ impl Request {
|
||||
return Err(create_error!(ProxyError));
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
} else {
|
||||
return Err(create_error!(ProxyError));
|
||||
};
|
||||
|
||||
Ok(IPRequest {
|
||||
url: url.clone(),
|
||||
ip: resolved_address,
|
||||
blocked: false,
|
||||
})
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.13.5
|
||||
0.12.1
|
||||
|
||||
Reference in New Issue
Block a user