Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8153f5f17a | ||
|
|
99a80f723d | ||
|
|
4f13f5899b | ||
|
|
5362e84730 | ||
|
|
be89e62d54 | ||
|
|
a72134f4ad | ||
|
|
69ae767175 | ||
|
|
2aff76c369 | ||
|
|
01e0f9e558 | ||
|
|
8ea8f50fb8 | ||
|
|
68bcfcb626 | ||
|
|
9632a0dc1b | ||
|
|
a4a0934475 | ||
|
|
2061794305 | ||
|
|
3a7ebad883 | ||
|
|
6daa8223b2 | ||
|
|
4a58d6eae0 | ||
|
|
a8a2e491b0 | ||
|
|
f98f09a5ea | ||
|
|
7a4e12a732 |
@@ -48,15 +48,6 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
# Build the image
|
|
||||||
- name: Build base image
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: ghcr.io/${{ github.repository_owner }}/base:latest
|
|
||||||
|
|
||||||
# Authenticate with Docker Hub and GHCR
|
# Authenticate with Docker Hub and GHCR
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@@ -72,6 +63,15 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Build the image
|
||||||
|
- name: Build base image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags: ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
|
||||||
# revoltchat/server
|
# revoltchat/server
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-delta
|
id: meta-delta
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"rust-analyzer.checkOnSave.command": "clippy",
|
"rust-analyzer.check.command": "clippy",
|
||||||
"nixEnvSelector.suggestion": false,
|
"nixEnvSelector.suggestion": false,
|
||||||
"nixEnvSelector.nixFile": "${workspaceFolder}/default.nix"
|
"nixEnvSelector.nixFile": "${workspaceFolder}/default.nix"
|
||||||
}
|
}
|
||||||
Generated
+177
-164
@@ -58,7 +58,7 @@ version = "0.7.8"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9"
|
checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
@@ -70,7 +70,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
|
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"version_check",
|
"version_check",
|
||||||
"zerocopy",
|
"zerocopy",
|
||||||
@@ -139,9 +139,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.95"
|
version = "1.0.98"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04"
|
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
||||||
|
dependencies = [
|
||||||
|
"backtrace",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arbitrary"
|
name = "arbitrary"
|
||||||
@@ -443,9 +446,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "authifier"
|
name = "authifier"
|
||||||
version = "1.0.10"
|
version = "1.0.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "edfe88c4a9fcf24b18a216b27c9766966af2a40603d24c7782237afd6ca0d5cd"
|
checksum = "b1a03b810b342b4c584cdc1cfc40d1ec763b1d653ef4086f7494740f35d9e1f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -454,7 +457,7 @@ dependencies = [
|
|||||||
"chrono",
|
"chrono",
|
||||||
"futures",
|
"futures",
|
||||||
"handlebars",
|
"handlebars",
|
||||||
"iso8601-timestamp 0.1.11",
|
"iso8601-timestamp",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lettre",
|
"lettre",
|
||||||
"log",
|
"log",
|
||||||
@@ -470,6 +473,7 @@ dependencies = [
|
|||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"sha1",
|
||||||
"totp-lite",
|
"totp-lite",
|
||||||
"ulid 0.5.0",
|
"ulid 0.5.0",
|
||||||
"validator 0.15.0",
|
"validator 0.15.0",
|
||||||
@@ -2055,7 +2059,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e9b3460f44bea8cd47f45a0c70892f1eff856d97cd55358b2f73f663789f6190"
|
checksum = "e9b3460f44bea8cd47f45a0c70892f1eff856d97cd55358b2f73f663789f6190"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ct-codecs",
|
"ct-codecs",
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2674,10 +2678,22 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"libc",
|
"libc",
|
||||||
"wasi",
|
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "getrandom"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"r-efi",
|
||||||
|
"wasi 0.14.2+wasi-0.2.4",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getset"
|
name = "getset"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
@@ -3647,17 +3663,6 @@ dependencies = [
|
|||||||
"waker-fn",
|
"waker-fn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "iso8601-timestamp"
|
|
||||||
version = "0.1.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b088f3296223f11d6bd70998132653b30b6f39e6ab4be055c0bda486fa8d11c7"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array 0.14.7",
|
|
||||||
"serde",
|
|
||||||
"time",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iso8601-timestamp"
|
name = "iso8601-timestamp"
|
||||||
version = "0.2.17"
|
version = "0.2.17"
|
||||||
@@ -3996,16 +4001,6 @@ dependencies = [
|
|||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libloading"
|
|
||||||
version = "0.8.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"windows-targets 0.52.6",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libm"
|
name = "libm"
|
||||||
version = "0.2.11"
|
version = "0.2.11"
|
||||||
@@ -4333,7 +4328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
|
checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"wasi",
|
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -4499,43 +4494,6 @@ dependencies = [
|
|||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "neon"
|
|
||||||
version = "1.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7d75440242411c87dc39847b0e33e961ec1f10326a9d8ecf9c1ea64a3b3c13dc"
|
|
||||||
dependencies = [
|
|
||||||
"getrandom",
|
|
||||||
"libloading",
|
|
||||||
"neon-macros",
|
|
||||||
"once_cell",
|
|
||||||
"semver",
|
|
||||||
"send_wrapper",
|
|
||||||
"smallvec",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "neon-macros"
|
|
||||||
version = "1.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c6813fde79b646e47e7ad75f480aa80ef76a5d9599e2717407961531169ee38b"
|
|
||||||
dependencies = [
|
|
||||||
"quote 1.0.38",
|
|
||||||
"syn 2.0.94",
|
|
||||||
"syn-mid",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "neon-serde4"
|
|
||||||
version = "1.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8778b4afaa506e067da24566623873c38797987be593232a4f9ad82c84bb3eb3"
|
|
||||||
dependencies = [
|
|
||||||
"neon",
|
|
||||||
"num",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "new_debug_unreachable"
|
name = "new_debug_unreachable"
|
||||||
version = "1.0.6"
|
version = "1.0.6"
|
||||||
@@ -4577,19 +4535,6 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "num"
|
|
||||||
version = "0.4.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
|
|
||||||
dependencies = [
|
|
||||||
"num-complex",
|
|
||||||
"num-integer",
|
|
||||||
"num-iter",
|
|
||||||
"num-rational",
|
|
||||||
"num-traits",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-bigint"
|
name = "num-bigint"
|
||||||
version = "0.4.6"
|
version = "0.4.6"
|
||||||
@@ -4617,15 +4562,6 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "num-complex"
|
|
||||||
version = "0.4.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
|
||||||
dependencies = [
|
|
||||||
"num-traits",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-conv"
|
name = "num-conv"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5012,7 +4948,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc"
|
checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
"thiserror 2.0.9",
|
"thiserror 2.0.12",
|
||||||
"ucd-trie",
|
"ucd-trie",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5465,7 +5401,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"raw-cpuid",
|
"raw-cpuid",
|
||||||
"wasi",
|
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
@@ -5509,6 +5445,12 @@ version = "0.4.8"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49"
|
checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "r-efi"
|
||||||
|
version = "5.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "radium"
|
name = "radium"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
@@ -5545,6 +5487,16 @@ dependencies = [
|
|||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
|
||||||
|
dependencies = [
|
||||||
|
"rand_chacha 0.9.0",
|
||||||
|
"rand_core 0.9.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand_chacha"
|
name = "rand_chacha"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
@@ -5565,6 +5517,16 @@ dependencies = [
|
|||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_chacha"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
|
||||||
|
dependencies = [
|
||||||
|
"ppv-lite86",
|
||||||
|
"rand_core 0.9.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand_core"
|
name = "rand_core"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
@@ -5586,7 +5548,16 @@ version = "0.6.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_core"
|
||||||
|
version = "0.9.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom 0.3.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5983,7 +5954,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-autumn"
|
name = "revolt-autumn"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"axum-macros",
|
"axum-macros",
|
||||||
@@ -6020,7 +5991,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-bonfire"
|
name = "revolt-bonfire"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-channel 2.3.1",
|
"async-channel 2.3.1",
|
||||||
"async-std",
|
"async-std",
|
||||||
@@ -6050,7 +6021,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-config"
|
name = "revolt-config"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"cached",
|
"cached",
|
||||||
@@ -6061,12 +6032,13 @@ dependencies = [
|
|||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"revolt-result",
|
"revolt-result",
|
||||||
"sentry",
|
"sentry",
|
||||||
|
"sentry-anyhow",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-crond"
|
name = "revolt-crond"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"revolt-config",
|
"revolt-config",
|
||||||
@@ -6078,7 +6050,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-database"
|
name = "revolt-database"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"amqprs",
|
"amqprs",
|
||||||
"async-lock 2.8.0",
|
"async-lock 2.8.0",
|
||||||
@@ -6095,7 +6067,7 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"indexmap 1.9.3",
|
"indexmap 1.9.3",
|
||||||
"isahc",
|
"isahc",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"linkify 0.8.1",
|
"linkify 0.8.1",
|
||||||
"log",
|
"log",
|
||||||
"lru 0.11.1",
|
"lru 0.11.1",
|
||||||
@@ -6128,7 +6100,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-delta"
|
name = "revolt-delta"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"amqprs",
|
"amqprs",
|
||||||
"async-channel 1.9.0",
|
"async-channel 1.9.0",
|
||||||
@@ -6140,7 +6112,7 @@ dependencies = [
|
|||||||
"env_logger",
|
"env_logger",
|
||||||
"futures",
|
"futures",
|
||||||
"impl_ops",
|
"impl_ops",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"lettre",
|
"lettre",
|
||||||
"linkify 0.6.0",
|
"linkify 0.6.0",
|
||||||
"log",
|
"log",
|
||||||
@@ -6175,7 +6147,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-files"
|
name = "revolt-files"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"aws-config",
|
"aws-config",
|
||||||
@@ -6198,7 +6170,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-january"
|
name = "revolt-january"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
"axum",
|
"axum",
|
||||||
@@ -6226,10 +6198,10 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-models"
|
name = "revolt-models"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 1.9.3",
|
"indexmap 1.9.3",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"num_enum 0.6.1",
|
"num_enum 0.6.1",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -6243,29 +6215,16 @@ dependencies = [
|
|||||||
"validator 0.16.1",
|
"validator 0.16.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "revolt-nodejs-bindings"
|
|
||||||
version = "0.8.4"
|
|
||||||
dependencies = [
|
|
||||||
"async-std",
|
|
||||||
"neon",
|
|
||||||
"neon-serde4",
|
|
||||||
"revolt-config",
|
|
||||||
"revolt-database",
|
|
||||||
"revolt-result",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-parser"
|
name = "revolt-parser"
|
||||||
version = "0.1.0"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"logos",
|
"logos",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-permissions"
|
name = "revolt-permissions"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -6280,7 +6239,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-presence"
|
name = "revolt-presence"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"log",
|
"log",
|
||||||
@@ -6291,21 +6250,23 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-pushd"
|
name = "revolt-pushd"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"amqprs",
|
"amqprs",
|
||||||
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"authifier",
|
"authifier",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"fcm_v1",
|
"fcm_v1",
|
||||||
"isahc",
|
"isahc",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"log",
|
"log",
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"revolt-config",
|
"revolt-config",
|
||||||
"revolt-database",
|
"revolt-database",
|
||||||
"revolt-models",
|
"revolt-models",
|
||||||
"revolt-presence",
|
"revolt-presence",
|
||||||
|
"revolt-result",
|
||||||
"revolt_a2",
|
"revolt_a2",
|
||||||
"revolt_optional_struct",
|
"revolt_optional_struct",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -6317,7 +6278,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-result"
|
name = "revolt-result"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"revolt_okapi",
|
"revolt_okapi",
|
||||||
@@ -6448,7 +6409,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
"libc",
|
"libc",
|
||||||
"spin",
|
"spin",
|
||||||
"untrusted",
|
"untrusted",
|
||||||
@@ -6517,12 +6478,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rocket_authifier"
|
name = "rocket_authifier"
|
||||||
version = "1.0.10"
|
version = "1.0.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c2aa1bfaee106d088b78de7c3cc2a8ab2c9e05a0286b6b912f0b18ea656b329e"
|
checksum = "c1f98a5be96ac4144ee1adc809c1594e8212032b8a08d9bc4cef70735dfd976e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"authifier",
|
"authifier",
|
||||||
"iso8601-timestamp 0.1.11",
|
"iso8601-timestamp",
|
||||||
"revolt_okapi",
|
"revolt_okapi",
|
||||||
"revolt_rocket_okapi",
|
"revolt_rocket_okapi",
|
||||||
"rocket",
|
"rocket",
|
||||||
@@ -7001,12 +6962,6 @@ version = "1.0.24"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba"
|
checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "send_wrapper"
|
|
||||||
version = "0.6.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sentry"
|
name = "sentry"
|
||||||
version = "0.31.8"
|
version = "0.31.8"
|
||||||
@@ -7016,9 +6971,9 @@ dependencies = [
|
|||||||
"httpdate",
|
"httpdate",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
"reqwest 0.11.27",
|
"reqwest 0.11.27",
|
||||||
"sentry-backtrace",
|
"sentry-backtrace 0.31.8",
|
||||||
"sentry-contexts",
|
"sentry-contexts",
|
||||||
"sentry-core",
|
"sentry-core 0.31.8",
|
||||||
"sentry-debug-images",
|
"sentry-debug-images",
|
||||||
"sentry-panic",
|
"sentry-panic",
|
||||||
"sentry-tracing",
|
"sentry-tracing",
|
||||||
@@ -7026,6 +6981,17 @@ dependencies = [
|
|||||||
"ureq",
|
"ureq",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sentry-anyhow"
|
||||||
|
version = "0.38.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3c93cfb800654dc846ccbeb35254a2f6f194aaf7e187223fd90aeb7afafe722c"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"sentry-backtrace 0.38.1",
|
||||||
|
"sentry-core 0.38.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sentry-backtrace"
|
name = "sentry-backtrace"
|
||||||
version = "0.31.8"
|
version = "0.31.8"
|
||||||
@@ -7035,7 +7001,18 @@ dependencies = [
|
|||||||
"backtrace",
|
"backtrace",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"regex",
|
"regex",
|
||||||
"sentry-core",
|
"sentry-core 0.31.8",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sentry-backtrace"
|
||||||
|
version = "0.38.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8dace796060e4ad10e3d1405b122ae184a8b2e71dce05ae450e4f81b7686b0d9"
|
||||||
|
dependencies = [
|
||||||
|
"backtrace",
|
||||||
|
"regex",
|
||||||
|
"sentry-core 0.38.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7048,7 +7025,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"os_info",
|
"os_info",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"sentry-core",
|
"sentry-core 0.31.8",
|
||||||
"uname",
|
"uname",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -7060,7 +7037,18 @@ checksum = "901f761681f97db3db836ef9e094acdd8756c40215326c194201941947164ef1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"sentry-types",
|
"sentry-types 0.31.8",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sentry-core"
|
||||||
|
version = "0.38.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7426d4beec270cfdbb50f85f0bb2ce176ea57eed0b11741182a163055a558187"
|
||||||
|
dependencies = [
|
||||||
|
"sentry-types 0.38.1",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
@@ -7073,7 +7061,7 @@ checksum = "afdb263e73d22f39946f6022ed455b7561b22ff5553aca9be3c6a047fa39c328"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"findshlibs",
|
"findshlibs",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"sentry-core",
|
"sentry-core 0.31.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7082,8 +7070,8 @@ version = "0.31.8"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "74fbf1c163f8b6a9d05912e1b272afa27c652e8b47ea60cb9a57ad5e481eea99"
|
checksum = "74fbf1c163f8b6a9d05912e1b272afa27c652e8b47ea60cb9a57ad5e481eea99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sentry-backtrace",
|
"sentry-backtrace 0.31.8",
|
||||||
"sentry-core",
|
"sentry-core 0.31.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7092,8 +7080,8 @@ version = "0.31.8"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "82eabcab0a047040befd44599a1da73d3adb228ff53b5ed9795ae04535577704"
|
checksum = "82eabcab0a047040befd44599a1da73d3adb228ff53b5ed9795ae04535577704"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sentry-backtrace",
|
"sentry-backtrace 0.31.8",
|
||||||
"sentry-core",
|
"sentry-core 0.31.8",
|
||||||
"tracing-core",
|
"tracing-core",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
]
|
]
|
||||||
@@ -7115,6 +7103,23 @@ dependencies = [
|
|||||||
"uuid",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sentry-types"
|
||||||
|
version = "0.38.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "04b6c9287202294685cb1f749b944dbbce8160b81a1061ecddc073025fed129f"
|
||||||
|
dependencies = [
|
||||||
|
"debugid",
|
||||||
|
"hex",
|
||||||
|
"rand 0.9.1",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror 2.0.12",
|
||||||
|
"time",
|
||||||
|
"url",
|
||||||
|
"uuid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.217"
|
version = "1.0.217"
|
||||||
@@ -7597,17 +7602,6 @@ dependencies = [
|
|||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "syn-mid"
|
|
||||||
version = "0.6.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b5dc35bb08dd1ca3dfb09dce91fd2d13294d6711c88897d9a9d60acf39bce049"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote 1.0.38",
|
|
||||||
"syn 2.0.94",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sync_wrapper"
|
name = "sync_wrapper"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
@@ -7756,7 +7750,7 @@ checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"fastrand 2.3.0",
|
"fastrand 2.3.0",
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
@@ -7793,11 +7787,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "2.0.9"
|
version = "2.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc"
|
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror-impl 2.0.9",
|
"thiserror-impl 2.0.12",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7813,9 +7807,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror-impl"
|
name = "thiserror-impl"
|
||||||
version = "2.0.9"
|
version = "2.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4"
|
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.38",
|
"quote 1.0.38",
|
||||||
@@ -8300,6 +8294,7 @@ checksum = "220b18413e1fe5e85a5580b22f44241f82404a66c792c9f3c9eda74c52d9a22e"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -8308,7 +8303,7 @@ version = "1.1.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "04f903f293d11f31c0c29e4148f6dc0d033a7f80cebc0282bea147611667d289"
|
checksum = "04f903f293d11f31c0c29e4148f6dc0d033a7f80cebc0282bea147611667d289"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"web-time",
|
"web-time",
|
||||||
]
|
]
|
||||||
@@ -8568,7 +8563,7 @@ version = "1.11.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a"
|
checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom 0.2.15",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -8715,13 +8710,22 @@ version = "0.11.0+wasi-snapshot-preview1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi"
|
||||||
|
version = "0.14.2+wasi-0.2.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3"
|
||||||
|
dependencies = [
|
||||||
|
"wit-bindgen-rt",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasix"
|
name = "wasix"
|
||||||
version = "0.12.21"
|
version = "0.12.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d"
|
checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wasi",
|
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -9170,6 +9174,15 @@ dependencies = [
|
|||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wit-bindgen-rt"
|
||||||
|
version = "0.39.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.6.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "write16"
|
name = "write16"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|||||||
+3
-4
@@ -6,7 +6,6 @@ members = [
|
|||||||
"crates/bonfire",
|
"crates/bonfire",
|
||||||
"crates/core/*",
|
"crates/core/*",
|
||||||
"crates/services/*",
|
"crates/services/*",
|
||||||
"crates/bindings/*",
|
|
||||||
"crates/daemons/*",
|
"crates/daemons/*",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -16,6 +15,6 @@ redis23 = { package = "redis", version = "0.23.3", git = "https://github.com/rev
|
|||||||
# I'm 99% sure this is overloading the GitHub worker
|
# I'm 99% sure this is overloading the GitHub worker
|
||||||
# hence builds have been failing since, let's just
|
# hence builds have been failing since, let's just
|
||||||
# disable it for now. In the future, we could use this
|
# disable it for now. In the future, we could use this
|
||||||
# if we were rolling our own CI.
|
# if we were rolling our own CI (that is now).
|
||||||
# [profile.release]
|
[profile.release]
|
||||||
# lto = true
|
lto = true
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM --platform="${BUILDPLATFORM}" rust:1.77.2-slim-bookworm
|
FROM --platform="${BUILDPLATFORM}" rust:1.86.0-slim-bookworm
|
||||||
USER 0:0
|
USER 0:0
|
||||||
WORKDIR /home/rust/src
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
@@ -17,13 +17,13 @@ RUN sh /tmp/build-image-layer.sh tools
|
|||||||
|
|
||||||
# Build all dependencies
|
# Build all dependencies
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
COPY crates/bindings/node/Cargo.toml ./crates/bindings/node/
|
|
||||||
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
||||||
COPY crates/delta/Cargo.toml ./crates/delta/
|
COPY crates/delta/Cargo.toml ./crates/delta/
|
||||||
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
||||||
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
||||||
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
||||||
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
||||||
|
COPY crates/core/parser/Cargo.toml ./crates/core/parser/
|
||||||
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
||||||
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
||||||
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM rust:1.77.2-slim-bookworm
|
FROM rust:1.86.0-slim-bookworm
|
||||||
USER 0:0
|
USER 0:0
|
||||||
WORKDIR /home/rust/src
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
@@ -13,13 +13,13 @@ COPY scripts/build-image-layer.sh /tmp/
|
|||||||
|
|
||||||
# Build all dependencies
|
# Build all dependencies
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
COPY crates/bindings/node/Cargo.toml ./crates/bindings/node/
|
|
||||||
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
||||||
COPY crates/delta/Cargo.toml ./crates/delta/
|
COPY crates/delta/Cargo.toml ./crates/delta/
|
||||||
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
||||||
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
||||||
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
||||||
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
||||||
|
COPY crates/core/parser/Cargo.toml ./crates/core/parser/
|
||||||
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
||||||
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
||||||
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ The services and libraries that power the Revolt service.<br/>
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
| Crate | Path | Description | |
|
| Crate | Path | Description | |
|
||||||
| ------------------ | -------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------ | -------------------------------------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `core/config` | [crates/core/config](crates/core/config) | Core: Configuration |     |
|
| `core/config` | [crates/core/config](crates/core/config) | Core: Configuration |     |
|
||||||
| `core/database` | [crates/core/database](crates/core/database) | Core: Database Implementation |     |
|
| `core/database` | [crates/core/database](crates/core/database) | Core: Database Implementation |     |
|
||||||
| `core/files` | [crates/core/files](crates/core/files) | Core: S3 and encryption subroutines |     |
|
| `core/files` | [crates/core/files](crates/core/files) | Core: S3 and encryption subroutines |     |
|
||||||
@@ -25,7 +25,6 @@ The services and libraries that power the Revolt service.<br/>
|
|||||||
| `bonfire` | [crates/bonfire](crates/bonfire) | WebSocket events server |  |
|
| `bonfire` | [crates/bonfire](crates/bonfire) | WebSocket events server |  |
|
||||||
| `services/january` | [crates/services/january](crates/services/january) | Proxy server |  |
|
| `services/january` | [crates/services/january](crates/services/january) | Proxy server |  |
|
||||||
| `services/autumn` | [crates/services/autumn](crates/services/autumn) | File server |  |
|
| `services/autumn` | [crates/services/autumn](crates/services/autumn) | File server |  |
|
||||||
| `bindings/node` | [crates/bindings/node](crates/bindings/node) | Node.js bindings for the Revolt software |  |
|
|
||||||
| `daemons/crond` | [crates/daemons/crond](crates/daemons/crond) | Timed data clean up daemon server |  |
|
| `daemons/crond` | [crates/daemons/crond](crates/daemons/crond) | Timed data clean up daemon server |  |
|
||||||
| `daemons/pushd` | [crates/daemons/pushd](crates/daemons/pushd) | Push notification daemon server |  |
|
| `daemons/pushd` | [crates/daemons/pushd](crates/daemons/pushd) | Push notification daemon server |  |
|
||||||
|
|
||||||
@@ -34,10 +33,10 @@ The services and libraries that power the Revolt service.<br/>
|
|||||||
|
|
||||||
## Minimum Supported Rust Version
|
## Minimum Supported Rust Version
|
||||||
|
|
||||||
Rust 1.76 or higher.
|
Rust 1.86.0 or higher.
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
> The events server has a significant performance regression between Rust 1.77.2 and 1.78.0 onwards, see [issue #341](https://github.com/revoltchat/backend/issues/341).
|
> The events server has a significant performance regression between Rust 1.77.2 and 1.78.0 onwards, see [issue #341](https://github.com/revoltchat/backend/issues/341). This is currently solved by build time options but we are looking for a proper fix.
|
||||||
|
|
||||||
## Development Guide
|
## Development Guide
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ from_address = "development@revolt.chat"
|
|||||||
reply_to = "support@revolt.chat"
|
reply_to = "support@revolt.chat"
|
||||||
port = 14025
|
port = 14025
|
||||||
use_tls = false
|
use_tls = false
|
||||||
|
use_starttls = false
|
||||||
|
|
||||||
[files.s3]
|
[files.s3]
|
||||||
# S3 protocol endpoint
|
# S3 protocol endpoint
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
target
|
|
||||||
index.node
|
|
||||||
**/node_modules
|
|
||||||
**/.DS_Store
|
|
||||||
npm-debug.log*
|
|
||||||
cargo.log
|
|
||||||
cross.log
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "revolt-nodejs-bindings"
|
|
||||||
version = "0.8.4"
|
|
||||||
description = "Node.js bindings for the Revolt software"
|
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
|
||||||
license = "MIT"
|
|
||||||
edition = "2021"
|
|
||||||
exclude = ["index.node"]
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
crate-type = ["cdylib"]
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
neon = "1.0.0"
|
|
||||||
neon-serde4 = "1.0.0"
|
|
||||||
|
|
||||||
serde = { version = "1", features = ["derive"] }
|
|
||||||
|
|
||||||
async-std = "1.12.0"
|
|
||||||
|
|
||||||
revolt-config = { version = "0.8.4", path = "../../core/config" }
|
|
||||||
revolt-result = { version = "0.8.4", path = "../../core/result" }
|
|
||||||
revolt-database = { version = "0.8.4", path = "../../core/database" }
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
# revolt.node
|
|
||||||
|
|
||||||
**revolt.node:** Node.js bindings for the Revolt software
|
|
||||||
|
|
||||||
This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon).
|
|
||||||
|
|
||||||
## Building revolt.node
|
|
||||||
|
|
||||||
Building revolt.node requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support).
|
|
||||||
|
|
||||||
To run the build, run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`.
|
|
||||||
|
|
||||||
## Exploring revolt.node
|
|
||||||
|
|
||||||
After building revolt.node, you can explore its exports at the Node console:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ npm i
|
|
||||||
$ npm run build
|
|
||||||
$ node
|
|
||||||
> require('.').hello()
|
|
||||||
'hello node'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Available Scripts
|
|
||||||
|
|
||||||
In the project directory, you can run:
|
|
||||||
|
|
||||||
#### `npm install`
|
|
||||||
|
|
||||||
Installs the project, including running `npm run build`.
|
|
||||||
|
|
||||||
#### `npm run build`
|
|
||||||
|
|
||||||
Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`.
|
|
||||||
|
|
||||||
Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm run build` and similar commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html):
|
|
||||||
|
|
||||||
```
|
|
||||||
npm run build -- --feature=beetle
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `npm run debug`
|
|
||||||
|
|
||||||
Similar to `npm run build` but generates a debug build with `cargo`.
|
|
||||||
|
|
||||||
#### `npm run cross`
|
|
||||||
|
|
||||||
Similar to `npm run build` but uses [cross-rs](https://github.com/cross-rs/cross) to cross-compile for another platform. Use the [`CARGO_BUILD_TARGET`](https://doc.rust-lang.org/cargo/reference/config.html#buildtarget) environment variable to select the build target.
|
|
||||||
|
|
||||||
#### `npm test`
|
|
||||||
|
|
||||||
Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/).
|
|
||||||
|
|
||||||
## Project Layout
|
|
||||||
|
|
||||||
The directory structure of this project is:
|
|
||||||
|
|
||||||
```
|
|
||||||
revolt.node/
|
|
||||||
├── Cargo.toml
|
|
||||||
├── README.md
|
|
||||||
├── src/
|
|
||||||
| └── lib.rs
|
|
||||||
├── index.node
|
|
||||||
├── package.json
|
|
||||||
└── target/
|
|
||||||
```
|
|
||||||
|
|
||||||
| Entry | Purpose |
|
|
||||||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. |
|
|
||||||
| `README.md` | This file. |
|
|
||||||
| `src/` | The directory tree containing the Rust source code for the project. |
|
|
||||||
| `lib.rs` | Entry point for the Rust source code. |
|
|
||||||
| `index.node` | The main module, a [Node addon](https://nodejs.org/api/addons.html) generated by the build and pointed to by `"main"` in `package.json`. |
|
|
||||||
| `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. |
|
|
||||||
| `target/` | Binary artifacts generated by the Rust build. |
|
|
||||||
|
|
||||||
## Learn More
|
|
||||||
|
|
||||||
Learn more about:
|
|
||||||
|
|
||||||
- [Neon](https://neon-bindings.com).
|
|
||||||
- [Rust](https://www.rust-lang.org).
|
|
||||||
- [Node](https://nodejs.org).
|
|
||||||
Vendored
-84
@@ -1,84 +0,0 @@
|
|||||||
import { Channel, User } from "revolt-api";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Opaque type for Revolt database
|
|
||||||
*/
|
|
||||||
export declare interface Database {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Opaque type for Revolt database
|
|
||||||
*/
|
|
||||||
export declare interface OpaqueUser {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Error type from Revolt backend
|
|
||||||
*/
|
|
||||||
export declare interface Err {
|
|
||||||
type: string;
|
|
||||||
location: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialises background tasks and logging, must be called before anything else!
|
|
||||||
* Can be called multiple times!
|
|
||||||
*/
|
|
||||||
export declare function init();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a new handle to the Revolt database
|
|
||||||
* @returns {Database} Handle
|
|
||||||
*/
|
|
||||||
export declare function database(): Database;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch user from database
|
|
||||||
* @param {string} userId User's ID
|
|
||||||
* @this {Database}
|
|
||||||
*/
|
|
||||||
export declare function database_fetch_user(userId: string): OpaqueUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch user from database
|
|
||||||
* @param {string} username Username
|
|
||||||
* @param {string} discriminator Discriminator
|
|
||||||
* @this {Database}
|
|
||||||
*/
|
|
||||||
export declare function database_fetch_user_by_username(
|
|
||||||
username: string,
|
|
||||||
discriminator: string
|
|
||||||
): OpaqueUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets model data as JSON
|
|
||||||
* @this {OpaqueUser}
|
|
||||||
*/
|
|
||||||
export declare function model_data(): User;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets error if the model failed to fetch
|
|
||||||
* @this {OpaqueUser}
|
|
||||||
*/
|
|
||||||
export declare function model_error(): Err;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a direct message channel between two users
|
|
||||||
* @param {string} userA User A ID
|
|
||||||
* @param {string} userB User B ID
|
|
||||||
* @returns Existing or newly created channel
|
|
||||||
*/
|
|
||||||
export declare function proc_channels_create_dm(
|
|
||||||
userA: string,
|
|
||||||
userB: string
|
|
||||||
): Promise<Channel & { error: Err }>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Suspend a user
|
|
||||||
* @param {string} user User
|
|
||||||
* @param {number} duration Duration (in days), set to 0 for indefinite
|
|
||||||
* @param {string} reason Pipe-separated list of reasons (e.g. reason1|reason2|reason3)
|
|
||||||
*/
|
|
||||||
export declare function proc_users_suspend(
|
|
||||||
user: OpaqueUser,
|
|
||||||
duration: number,
|
|
||||||
reason: string
|
|
||||||
): Promise<{ error: Err }>;
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "revolt-nodejs-bindings",
|
|
||||||
"version": "0.7.15-rev0.0.3",
|
|
||||||
"description": "Node.js bindings for the Revolt software",
|
|
||||||
"main": "index.node",
|
|
||||||
"scripts": {
|
|
||||||
"test": "cargo test",
|
|
||||||
"cargo-build": "cargo build --message-format=json > cargo.log",
|
|
||||||
"cross-build": "cross build --message-format=json > cross.log",
|
|
||||||
"postcargo-build": "neon dist < cargo.log",
|
|
||||||
"postcross-build": "neon dist -m /target < cross.log",
|
|
||||||
"debug": "npm run cargo-build --",
|
|
||||||
"build": "npm run cargo-build -- --release",
|
|
||||||
"cross": "npm run cross-build -- --release"
|
|
||||||
},
|
|
||||||
"author": "Paul Makles",
|
|
||||||
"license": "AGPL-3.0",
|
|
||||||
"devDependencies": {
|
|
||||||
"@neon-rs/cli": "0.1.73"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/revoltchat/backend"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"revolt",
|
|
||||||
"chat"
|
|
||||||
],
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/revoltchat/backend/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/revoltchat/backend#readme",
|
|
||||||
"dependencies": {
|
|
||||||
"revolt-api": "^0.7.15"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
-117
@@ -1,117 +0,0 @@
|
|||||||
lockfileVersion: '6.0'
|
|
||||||
|
|
||||||
settings:
|
|
||||||
autoInstallPeers: true
|
|
||||||
excludeLinksFromLockfile: false
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
revolt-api:
|
|
||||||
specifier: ^0.7.15
|
|
||||||
version: 0.7.15
|
|
||||||
|
|
||||||
devDependencies:
|
|
||||||
'@neon-rs/cli':
|
|
||||||
specifier: 0.1.73
|
|
||||||
version: 0.1.73
|
|
||||||
|
|
||||||
packages:
|
|
||||||
|
|
||||||
/@cargo-messages/android-arm-eabi@0.1.72:
|
|
||||||
resolution: {integrity: sha512-gGZxIM1mj+Y5x+ULND6ZCNr7f70OJi9wDlycSK8hGONy9wrChN6JAIHryddC5cqcwlYAoQ6IDcDFElnhAYbybA==}
|
|
||||||
cpu: [arm]
|
|
||||||
os: [android]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/darwin-arm64@0.1.72:
|
|
||||||
resolution: {integrity: sha512-EAzN5MLaXPljZKZDO5qR+aBs44eSq2ZbEnS7AI/FziE3MzeXbrGOS3fLba5+7yWPFXJyZolXzePm8N1EBv8ovg==}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [darwin]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/darwin-x64@0.1.72:
|
|
||||||
resolution: {integrity: sha512-RLo6j8s3nYbjdd1LDct4wamfChyRit7zokUuxtIYCu9XOlltkN5vnj1vwnrPvoqCMZ/7CbbuHFwSTn9A71de/w==}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [darwin]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/linux-arm-gnueabihf@0.1.72:
|
|
||||||
resolution: {integrity: sha512-tHsRshuzfjrX6SDW3jg6al8vMNLTMgczGnVYl5RuBZf/yrAUuwe30KxA9ge6w6mW6Ox797DyBchzAc9OLgTgmQ==}
|
|
||||||
cpu: [arm]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/linux-x64-gnu@0.1.72:
|
|
||||||
resolution: {integrity: sha512-VGtL6CCnUbhsP4aYuBNT5kfrAL7o0qjrxw97a+ax13t+nJd26tVEEIKHMu5drvvS/Nm/hn7sLT8zMnnCv0pvHg==}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/win32-arm64-msvc@0.1.72:
|
|
||||||
resolution: {integrity: sha512-V93Cgz39K+yqa3MveNbhh29pYCp8izK5uEavjPoxlNxAbsMCWH+s0verGDdUcfGxjR1H2V7oZ4FszPqR2SqMRQ==}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [win32]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/win32-x64-msvc@0.1.72:
|
|
||||||
resolution: {integrity: sha512-knz3uSrO0OSbq3U5VWfCY8FB4NsM43BOWLZ7x4sfaMOC1XWv+IyvDdkLe6DhJx8KUw46KIAimYs9YROrp6l46Q==}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [win32]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@neon-rs/cli@0.1.73:
|
|
||||||
resolution: {integrity: sha512-1kv8S/feB6UQWQQwsnGfkSkEBOtlFDNExnioL81E2BwvUWgjQPaseHgpi2EpWVgsPUgur5eBm4QowmlpWkD4/w==}
|
|
||||||
hasBin: true
|
|
||||||
optionalDependencies:
|
|
||||||
'@cargo-messages/android-arm-eabi': 0.1.72
|
|
||||||
'@cargo-messages/darwin-arm64': 0.1.72
|
|
||||||
'@cargo-messages/darwin-x64': 0.1.72
|
|
||||||
'@cargo-messages/linux-arm-gnueabihf': 0.1.72
|
|
||||||
'@cargo-messages/linux-x64-gnu': 0.1.72
|
|
||||||
'@cargo-messages/win32-arm64-msvc': 0.1.72
|
|
||||||
'@cargo-messages/win32-x64-msvc': 0.1.72
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/axios@0.26.1:
|
|
||||||
resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==}
|
|
||||||
dependencies:
|
|
||||||
follow-redirects: 1.15.6
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- debug
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/follow-redirects@1.15.6:
|
|
||||||
resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
|
|
||||||
engines: {node: '>=4.0'}
|
|
||||||
peerDependencies:
|
|
||||||
debug: '*'
|
|
||||||
peerDependenciesMeta:
|
|
||||||
debug:
|
|
||||||
optional: true
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/lodash.defaultsdeep@4.6.1:
|
|
||||||
resolution: {integrity: sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/revolt-api@0.7.15:
|
|
||||||
resolution: {integrity: sha512-rWRnjBFvoXt/RHRxHg9KuP+x1Jk61KdsOpKOczVJg5tIqGDmqp/6QZHw5rJTtG+wCH3Ah3YKwY+MM5NHfg1W3Q==}
|
|
||||||
dependencies:
|
|
||||||
axios: 0.26.1
|
|
||||||
lodash.defaultsdeep: 4.6.1
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- debug
|
|
||||||
dev: false
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
#[macro_use]
|
|
||||||
extern crate serde;
|
|
||||||
|
|
||||||
use std::sync::OnceLock;
|
|
||||||
|
|
||||||
use neon::prelude::*;
|
|
||||||
use revolt_database::{Database, DatabaseInfo};
|
|
||||||
|
|
||||||
fn js_init(mut cx: FunctionContext) -> JsResult<JsUndefined> {
|
|
||||||
// static INIT: OnceLock<()> = OnceLock::new();
|
|
||||||
// if INIT.get().is_none() {
|
|
||||||
// INIT.get_or_init(|| {
|
|
||||||
// async_std::task::block_on(async {
|
|
||||||
// revolt_config::configure!(api);
|
|
||||||
|
|
||||||
// match DatabaseInfo::Auto.connect().await {
|
|
||||||
// Ok(db) => {
|
|
||||||
// let authifier_db = db.clone().to_authifier().await.database;
|
|
||||||
// revolt_database::tasks::start_workers(db, authifier_db);
|
|
||||||
// Ok(())
|
|
||||||
// }
|
|
||||||
// Err(err) => Err(err),
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .or_else(|err| cx.throw_error(err))
|
|
||||||
// .unwrap();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
Ok(cx.undefined())
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DatabaseBinding(Database, Channel);
|
|
||||||
impl Finalize for DatabaseBinding {}
|
|
||||||
impl DatabaseBinding {
|
|
||||||
fn take(&self) -> (Database, Channel) {
|
|
||||||
(self.0.clone(), self.1.clone())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn js_database(mut cx: FunctionContext) -> JsResult<JsBox<DatabaseBinding>> {
|
|
||||||
let db = async_std::task::block_on(DatabaseInfo::Auto.connect())
|
|
||||||
.or_else(|err| cx.throw_error(err))?;
|
|
||||||
|
|
||||||
let channel = cx.channel();
|
|
||||||
Ok(cx.boxed(DatabaseBinding(db, channel)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implementations for models
|
|
||||||
#[derive(Clone)]
|
|
||||||
#[allow(clippy::large_enum_variant)]
|
|
||||||
enum Model {
|
|
||||||
User(revolt_database::User),
|
|
||||||
Error(revolt_result::Error),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Model {
|
|
||||||
fn give(&self) -> Model {
|
|
||||||
self.clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Finalize for Model {}
|
|
||||||
|
|
||||||
macro_rules! shim_boxed {
|
|
||||||
($cx: ident, $name: ident, $model: ident, $( $variable: ident $type: ident $id: expr )+, $cmd: ident, $( $arg: expr, )+) => {
|
|
||||||
fn $name(mut cx: FunctionContext) -> JsResult<JsPromise> {
|
|
||||||
$(
|
|
||||||
let $variable = cx.argument::<$type>($id)?.value(&mut cx);
|
|
||||||
)+
|
|
||||||
|
|
||||||
let (db, channel) = cx.this::<JsBox<DatabaseBinding>>()?.take();
|
|
||||||
let (deferred, promise) = cx.promise();
|
|
||||||
|
|
||||||
async_std::task::spawn(async move {
|
|
||||||
let result = db.$cmd($($arg,)+).await;
|
|
||||||
deferred.settle_with(&channel, move |mut cx| {
|
|
||||||
Ok(cx.boxed(match result {
|
|
||||||
Ok(value) => Model::$model(value),
|
|
||||||
Err(error) => Model::Error(error)
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(promise)
|
|
||||||
}
|
|
||||||
|
|
||||||
$cx.export_function(stringify!($name), $name)?;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
fn js_data(mut cx: FunctionContext) -> JsResult<JsValue> {
|
|
||||||
match cx.this::<JsBox<Model>>()?.give() {
|
|
||||||
Model::Error(_) => neon_serde4::to_value(&mut cx, &None::<()>),
|
|
||||||
Model::User(user) => neon_serde4::to_value(&mut cx, &user),
|
|
||||||
}
|
|
||||||
.or_else(|e| cx.throw_error(e.to_string()))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn js_error(mut cx: FunctionContext) -> JsResult<JsValue> {
|
|
||||||
let value = match cx.this::<JsBox<Model>>()?.give() {
|
|
||||||
Model::Error(err) => Some(err),
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
|
|
||||||
neon_serde4::to_value(&mut cx, &value).or_else(|e| cx.throw_error(e.to_string()))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Basic data implementation
|
|
||||||
#[derive(Serialize, Deserialize)]
|
|
||||||
struct ResultBinding<T> {
|
|
||||||
#[serde(flatten)]
|
|
||||||
value: Option<T>,
|
|
||||||
error: Option<revolt_result::Error>,
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! shim {
|
|
||||||
($cx: ident, $name: ident, $( $variable: ident $type: ident $id: expr )*, $( $model: ident $modelType: ident $modelId: expr )*, | $db: ident | $closure: expr, $( $arg: expr, )+) => {
|
|
||||||
fn $name(mut cx: FunctionContext) -> JsResult<JsPromise> {
|
|
||||||
$(
|
|
||||||
let $variable = cx.argument::<$type>($id)?.value(&mut cx);
|
|
||||||
)*
|
|
||||||
|
|
||||||
$(
|
|
||||||
let mut $model = if let Model::$modelType(value) = cx.argument::<JsBox<Model>>($modelId)?.give() {
|
|
||||||
value
|
|
||||||
} else {
|
|
||||||
unreachable!()
|
|
||||||
};
|
|
||||||
)*
|
|
||||||
|
|
||||||
let (db, channel) = cx.this::<JsBox<DatabaseBinding>>()?.take();
|
|
||||||
let (deferred, promise) = cx.promise();
|
|
||||||
|
|
||||||
async_std::task::spawn(async move {
|
|
||||||
#[allow(clippy::redundant_closure_call)]
|
|
||||||
let result = (|$db: $crate::Database| $closure)(db.clone()).await;
|
|
||||||
deferred.settle_with(&channel, move |mut cx| {
|
|
||||||
neon_serde4::to_value(
|
|
||||||
&mut cx,
|
|
||||||
&match result {
|
|
||||||
Ok(value) => ResultBinding {
|
|
||||||
value: Some(value),
|
|
||||||
error: None,
|
|
||||||
},
|
|
||||||
Err(error) => ResultBinding {
|
|
||||||
value: None,
|
|
||||||
error: Some(error),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.or_else(|e| cx.throw_error(e.to_string()))
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(promise)
|
|
||||||
}
|
|
||||||
|
|
||||||
$cx.export_function(stringify!($name), $name)?;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[neon::main]
|
|
||||||
fn main(mut cx: ModuleContext) -> NeonResult<()> {
|
|
||||||
// initialise required background stuff
|
|
||||||
cx.export_function("init", js_init)?;
|
|
||||||
|
|
||||||
// database & model stuff
|
|
||||||
cx.export_function("database", js_database)?;
|
|
||||||
cx.export_function("model_data", js_data)?;
|
|
||||||
cx.export_function("model_error", js_error)?;
|
|
||||||
|
|
||||||
shim_boxed!(
|
|
||||||
cx,
|
|
||||||
database_fetch_user,
|
|
||||||
User,
|
|
||||||
user_id JsString 0,
|
|
||||||
fetch_user,
|
|
||||||
&user_id,
|
|
||||||
);
|
|
||||||
|
|
||||||
shim_boxed!(
|
|
||||||
cx,
|
|
||||||
database_fetch_user_by_username,
|
|
||||||
User,
|
|
||||||
username JsString 0
|
|
||||||
discriminator JsString 1,
|
|
||||||
fetch_user_by_username,
|
|
||||||
&username, &discriminator,
|
|
||||||
);
|
|
||||||
|
|
||||||
// procedure calls
|
|
||||||
shim!(
|
|
||||||
cx,
|
|
||||||
proc_channels_create_dm,
|
|
||||||
user_a JsString 0
|
|
||||||
user_b JsString 1,
|
|
||||||
,
|
|
||||||
|db| async move {
|
|
||||||
let user_a = db.fetch_user(&user_a).await?;
|
|
||||||
let user_b = db.fetch_user(&user_b).await?;
|
|
||||||
revolt_database::Channel::create_dm(&db, &user_a, &user_b).await
|
|
||||||
},
|
|
||||||
&userA, &userB,
|
|
||||||
);
|
|
||||||
|
|
||||||
shim!(
|
|
||||||
cx,
|
|
||||||
proc_users_suspend,
|
|
||||||
duration JsNumber 1
|
|
||||||
reason JsString 2,
|
|
||||||
user User 0,
|
|
||||||
|db| async move {
|
|
||||||
let duration = duration as usize;
|
|
||||||
user.suspend(&db, if duration == 0 { None } else { Some(duration) }, Some(reason.split('|').map(|x| x.to_owned()).collect())).await
|
|
||||||
},
|
|
||||||
&user,
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
const Internal = require(".");
|
|
||||||
|
|
||||||
// playing around with class wrapper, not practical
|
|
||||||
class Model {
|
|
||||||
constructor(model) {
|
|
||||||
this.model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return Internal.model_data.bind(this.model)();
|
|
||||||
}
|
|
||||||
|
|
||||||
error() {
|
|
||||||
return Internal.model_error.bind(this.model)();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class User extends Model {
|
|
||||||
constructor(db, user) {
|
|
||||||
super(user);
|
|
||||||
this.db = db;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Database {
|
|
||||||
constructor() {
|
|
||||||
this.db = Internal.database();
|
|
||||||
}
|
|
||||||
|
|
||||||
async fetchUser(userId) {
|
|
||||||
return new User(
|
|
||||||
this,
|
|
||||||
await Internal.database_fetch_user.bind(this.db)(userId)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async fetchUserByUsername(username, discriminator) {
|
|
||||||
return new User(
|
|
||||||
this,
|
|
||||||
await Internal.database_fetch_user_by_username.bind(this.db)(
|
|
||||||
username,
|
|
||||||
discriminator
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const db = new Database();
|
|
||||||
db.fetchUserByUsername("dos", "7624").then((user) => console.info(user.data()));
|
|
||||||
db.fetchUserByUsername("dos", "1111").then((user) => console.info(user.data()));
|
|
||||||
db.fetchUserByUsername("dos", "1111").then((user) =>
|
|
||||||
console.info(user.error())
|
|
||||||
);
|
|
||||||
Generated
-6
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "bindings",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-bonfire"
|
name = "revolt-bonfire"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
@@ -36,12 +36,12 @@ async-std = { version = "1.8.0", features = [
|
|||||||
] }
|
] }
|
||||||
|
|
||||||
# core
|
# core
|
||||||
authifier = { version = "1.0.10" }
|
authifier = { version = "1.0.15" }
|
||||||
revolt-result = { path = "../core/result" }
|
revolt-result = { path = "../core/result" }
|
||||||
revolt-models = { path = "../core/models" }
|
revolt-models = { path = "../core/models" }
|
||||||
revolt-config = { path = "../core/config" }
|
revolt-config = { path = "../core/config" }
|
||||||
revolt-database = { path = "../core/database" }
|
revolt-database = { path = "../core/database" }
|
||||||
revolt-permissions = { version = "0.8.4", path = "../core/permissions" }
|
revolt-permissions = { version = "0.8.6", path = "../core/permissions" }
|
||||||
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
|
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
|
||||||
|
|
||||||
# redis
|
# redis
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ impl State {
|
|||||||
.iter()
|
.iter()
|
||||||
.find(|e| matches!(e, ReadyPayloadFields::UserSettings(_)))
|
.find(|e| matches!(e, ReadyPayloadFields::UserSettings(_)))
|
||||||
{
|
{
|
||||||
Some(db.fetch_user_settings(&user.id, &keys).await?)
|
Some(db.fetch_user_settings(&user.id, keys).await?)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
@@ -199,12 +199,11 @@ impl State {
|
|||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Make all users appear from our perspective.
|
// Make all users appear from our perspective.
|
||||||
let mut users: Vec<v0::User> = join_all(users
|
let mut users: Vec<v0::User> = join_all(users.into_iter().map(|other_user| async {
|
||||||
.into_iter()
|
|
||||||
.map(|other_user| async {
|
|
||||||
let is_online = online_ids.contains(&other_user.id);
|
let is_online = online_ids.contains(&other_user.id);
|
||||||
other_user.into_known(&user, is_online).await
|
other_user.into_known(&user, is_online).await
|
||||||
})).await;
|
}))
|
||||||
|
.await;
|
||||||
|
|
||||||
// Make sure we see our own user correctly.
|
// Make sure we see our own user correctly.
|
||||||
users.push(user.into_self(true).await);
|
users.push(user.into_self(true).await);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::{collections::HashSet, net::SocketAddr, sync::Arc};
|
|||||||
use async_tungstenite::WebSocketStream;
|
use async_tungstenite::WebSocketStream;
|
||||||
use authifier::AuthifierEvent;
|
use authifier::AuthifierEvent;
|
||||||
use fred::{
|
use fred::{
|
||||||
error::{RedisError, RedisErrorKind},
|
error::RedisErrorKind,
|
||||||
interfaces::{ClientLike, EventInterface, PubsubInterface},
|
interfaces::{ClientLike, EventInterface, PubsubInterface},
|
||||||
types::RedisConfig,
|
types::RedisConfig,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-config"
|
name = "revolt-config"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
@@ -9,9 +9,10 @@ description = "Revolt Backend: Configuration"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
anyhow = ["dep:sentry-anyhow"]
|
||||||
report-macros = ["revolt-result"]
|
report-macros = ["revolt-result"]
|
||||||
test = ["async-std"]
|
test = ["async-std"]
|
||||||
default = ["test"]
|
default = ["test", "anyhow"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Utility
|
# Utility
|
||||||
@@ -32,6 +33,7 @@ pretty_env_logger = "0.4.0"
|
|||||||
|
|
||||||
# Sentry
|
# Sentry
|
||||||
sentry = "0.31.5"
|
sentry = "0.31.5"
|
||||||
|
sentry-anyhow = { version = "0.38.1", optional = true }
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
revolt-result = { version = "0.8.4", path = "../result", optional = true }
|
revolt-result = { version = "0.8.6", path = "../result", optional = true }
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ authifier_shield_key = ""
|
|||||||
voso_legacy_token = ""
|
voso_legacy_token = ""
|
||||||
# Whether services are behind the Cloudflare network
|
# Whether services are behind the Cloudflare network
|
||||||
trust_cloudflare = false
|
trust_cloudflare = false
|
||||||
|
# easypwned endpoint
|
||||||
|
easypwned = ""
|
||||||
|
|
||||||
[api.security.captcha]
|
[api.security.captcha]
|
||||||
# hCaptcha configuration
|
# hCaptcha configuration
|
||||||
@@ -273,4 +275,5 @@ api = ""
|
|||||||
events = ""
|
events = ""
|
||||||
files = ""
|
files = ""
|
||||||
proxy = ""
|
proxy = ""
|
||||||
|
pushd = ""
|
||||||
crond = ""
|
crond = ""
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use once_cell::sync::Lazy;
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
pub use sentry::{capture_error, capture_message, Level};
|
pub use sentry::{capture_error, capture_message, Level};
|
||||||
|
pub use sentry_anyhow::capture_anyhow;
|
||||||
|
|
||||||
#[cfg(feature = "report-macros")]
|
#[cfg(feature = "report-macros")]
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
@@ -123,6 +124,7 @@ pub struct ApiSmtp {
|
|||||||
pub reply_to: Option<String>,
|
pub reply_to: Option<String>,
|
||||||
pub port: Option<i32>,
|
pub port: Option<i32>,
|
||||||
pub use_tls: Option<bool>,
|
pub use_tls: Option<bool>,
|
||||||
|
pub use_starttls: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
@@ -168,6 +170,7 @@ pub struct ApiSecurity {
|
|||||||
pub voso_legacy_token: String,
|
pub voso_legacy_token: String,
|
||||||
pub captcha: ApiSecurityCaptcha,
|
pub captcha: ApiSecurityCaptcha,
|
||||||
pub trust_cloudflare: bool,
|
pub trust_cloudflare: bool,
|
||||||
|
pub easypwned: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
@@ -177,7 +180,7 @@ pub struct ApiWorkers {
|
|||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct ApiUsers {
|
pub struct ApiUsers {
|
||||||
pub early_adopter_cutoff: Option<u64>
|
pub early_adopter_cutoff: Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
@@ -341,6 +344,7 @@ pub struct Sentry {
|
|||||||
pub events: String,
|
pub events: String,
|
||||||
pub files: String,
|
pub files: String,
|
||||||
pub proxy: String,
|
pub proxy: String,
|
||||||
|
pub pushd: String,
|
||||||
pub crond: String,
|
pub crond: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-database"
|
name = "revolt-database"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
@@ -24,19 +24,19 @@ default = ["mongodb", "async-std-runtime", "tasks"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core
|
# Core
|
||||||
revolt-config = { version = "0.8.4", path = "../config", features = [
|
revolt-config = { version = "0.8.6", path = "../config", features = [
|
||||||
"report-macros",
|
"report-macros",
|
||||||
] }
|
] }
|
||||||
revolt-result = { version = "0.8.4", path = "../result" }
|
revolt-result = { version = "0.8.6", path = "../result" }
|
||||||
revolt-models = { version = "0.8.4", path = "../models", features = [
|
revolt-models = { version = "0.8.6", path = "../models", features = [
|
||||||
"validator",
|
"validator",
|
||||||
] }
|
] }
|
||||||
revolt-presence = { version = "0.8.4", path = "../presence" }
|
revolt-presence = { version = "0.8.6", path = "../presence" }
|
||||||
revolt-permissions = { version = "0.8.4", path = "../permissions", features = [
|
revolt-permissions = { version = "0.8.6", path = "../permissions", features = [
|
||||||
"serde",
|
"serde",
|
||||||
"bson",
|
"bson",
|
||||||
] }
|
] }
|
||||||
revolt-parser = { version = "0.1.0", path = "../parser" }
|
revolt-parser = { version = "0.8.6", path = "../parser" }
|
||||||
|
|
||||||
# Utility
|
# Utility
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
@@ -97,7 +97,7 @@ web-push = "0.10.0"
|
|||||||
revolt_a2 = { version = "0.10", default-features = false, features = ["ring"] }
|
revolt_a2 = { version = "0.10", default-features = false, features = ["ring"] }
|
||||||
|
|
||||||
# Authifier
|
# Authifier
|
||||||
authifier = { version = "1.0.10", features = ["rocket_impl"] }
|
authifier = { version = "1.0.15", features = ["rocket_impl"] }
|
||||||
|
|
||||||
# RabbitMQ
|
# RabbitMQ
|
||||||
amqprs = { version = "1.7.0" }
|
amqprs = { version = "1.7.0" }
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ mod reference;
|
|||||||
|
|
||||||
use authifier::config::Captcha;
|
use authifier::config::Captcha;
|
||||||
use authifier::config::EmailVerificationConfig;
|
use authifier::config::EmailVerificationConfig;
|
||||||
|
use authifier::config::PasswordScanning;
|
||||||
use authifier::config::ResolveIp;
|
use authifier::config::ResolveIp;
|
||||||
use authifier::config::SMTPSettings;
|
use authifier::config::SMTPSettings;
|
||||||
use authifier::config::Shield;
|
use authifier::config::Shield;
|
||||||
@@ -102,6 +103,13 @@ impl Database {
|
|||||||
let config = config().await;
|
let config = config().await;
|
||||||
|
|
||||||
let mut auth_config = authifier::Config {
|
let mut auth_config = authifier::Config {
|
||||||
|
password_scanning: if config.api.security.easypwned.is_empty() {
|
||||||
|
Default::default()
|
||||||
|
} else {
|
||||||
|
PasswordScanning::EasyPwned {
|
||||||
|
endpoint: config.api.security.easypwned,
|
||||||
|
}
|
||||||
|
},
|
||||||
email_verification: if !config.api.smtp.host.is_empty() {
|
email_verification: if !config.api.smtp.host.is_empty() {
|
||||||
EmailVerificationConfig::Enabled {
|
EmailVerificationConfig::Enabled {
|
||||||
smtp: SMTPSettings {
|
smtp: SMTPSettings {
|
||||||
@@ -118,6 +126,7 @@ impl Database {
|
|||||||
),
|
),
|
||||||
port: config.api.smtp.port,
|
port: config.api.smtp.port,
|
||||||
use_tls: config.api.smtp.use_tls,
|
use_tls: config.api.smtp.use_tls,
|
||||||
|
use_starttls: config.api.smtp.use_starttls,
|
||||||
},
|
},
|
||||||
expiry: Default::default(),
|
expiry: Default::default(),
|
||||||
templates: if config.production {
|
templates: if config.production {
|
||||||
@@ -134,6 +143,15 @@ impl Database {
|
|||||||
url: format!("{}/login/reset/", config.hosts.app),
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
html: Some(include_str!("../../templates/reset.html").into()),
|
html: Some(include_str!("../../templates/reset.html").into()),
|
||||||
},
|
},
|
||||||
|
reset_existing: Template {
|
||||||
|
title: "You already have a Revolt account, reset your password."
|
||||||
|
.into(),
|
||||||
|
text: include_str!("../../templates/reset-existing.txt").into(),
|
||||||
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
|
html: Some(
|
||||||
|
include_str!("../../templates/reset-existing.html").into(),
|
||||||
|
),
|
||||||
|
},
|
||||||
deletion: Template {
|
deletion: Template {
|
||||||
title: "Confirm account deletion.".into(),
|
title: "Confirm account deletion.".into(),
|
||||||
text: include_str!("../../templates/deletion.txt").into(),
|
text: include_str!("../../templates/deletion.txt").into(),
|
||||||
@@ -156,9 +174,16 @@ impl Database {
|
|||||||
url: format!("{}/login/reset/", config.hosts.app),
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
html: None,
|
html: None,
|
||||||
},
|
},
|
||||||
|
reset_existing: Template {
|
||||||
|
title: "Reset your password.".into(),
|
||||||
|
text: include_str!("../../templates/reset.whitelabel.txt").into(),
|
||||||
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
|
html: None,
|
||||||
|
},
|
||||||
deletion: Template {
|
deletion: Template {
|
||||||
title: "Confirm account deletion.".into(),
|
title: "Confirm account deletion.".into(),
|
||||||
text: include_str!("../../templates/deletion.whitelabel.txt").into(),
|
text: include_str!("../../templates/deletion.whitelabel.txt")
|
||||||
|
.into(),
|
||||||
url: format!("{}/delete/", config.hosts.app),
|
url: format!("{}/delete/", config.hosts.app),
|
||||||
html: None,
|
html: None,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ struct MigrationInfo {
|
|||||||
revision: i32,
|
revision: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const LATEST_REVISION: i32 = 31;
|
pub const LATEST_REVISION: i32 = 33; // MUST BE +1 to last migration
|
||||||
|
|
||||||
pub async fn migrate_database(db: &MongoDb) {
|
pub async fn migrate_database(db: &MongoDb) {
|
||||||
let migrations = db.col::<Document>("migrations");
|
let migrations = db.col::<Document>("migrations");
|
||||||
@@ -1128,6 +1128,17 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if revision <= 32 {
|
||||||
|
info!(
|
||||||
|
"Running migration [revision 32 / 12-05-2025]: (Authifier) Add last_seen to sessions."
|
||||||
|
);
|
||||||
|
|
||||||
|
let db = authifier::Database::MongoDb(authifier::database::MongoDb(db.db()));
|
||||||
|
db.run_migration(authifier::Migration::M2025_02_20AddLastSeenToSession)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
// Reminder to update LATEST_REVISION when adding new migrations.
|
// Reminder to update LATEST_REVISION when adding new migrations.
|
||||||
LATEST_REVISION.max(revision)
|
LATEST_REVISION.max(revision)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use revolt_config::config;
|
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
use ulid::Ulid;
|
use ulid::Ulid;
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ mod tests {
|
|||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
db.insert_webhook(&webhook).await.unwrap();
|
webhook.create(&db).await.unwrap();
|
||||||
|
|
||||||
let mut updated_webhook = webhook.clone();
|
let mut updated_webhook = webhook.clone();
|
||||||
updated_webhook
|
updated_webhook
|
||||||
|
|||||||
@@ -328,13 +328,10 @@ impl Channel {
|
|||||||
|
|
||||||
db.insert_channel(&channel).await?;
|
db.insert_channel(&channel).await?;
|
||||||
|
|
||||||
match &channel {
|
if let Channel::DirectMessage { .. } = &channel {
|
||||||
Channel::DirectMessage { .. } => {
|
|
||||||
let event = EventV1::ChannelCreate(channel.clone().into());
|
let event = EventV1::ChannelCreate(channel.clone().into());
|
||||||
event.clone().private(user_a.id.clone()).await;
|
event.clone().private(user_a.id.clone()).await;
|
||||||
event.private(user_b.id.clone()).await;
|
event.private(user_b.id.clone()).await;
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(channel)
|
Ok(channel)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ auto_derived_partial!(
|
|||||||
/// Size of this file (in bytes)
|
/// Size of this file (in bytes)
|
||||||
pub size: isize,
|
pub size: isize,
|
||||||
},
|
},
|
||||||
"PartialFile"
|
"PartialFileHash"
|
||||||
);
|
);
|
||||||
|
|
||||||
auto_derived!(
|
auto_derived!(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use iso8601_timestamp::Timestamp;
|
|||||||
use revolt_config::{config, FeaturesLimits};
|
use revolt_config::{config, FeaturesLimits};
|
||||||
use revolt_models::v0::{
|
use revolt_models::v0::{
|
||||||
self, BulkMessageResponse, DataMessageSend, Embed, MessageAuthor, MessageFlags, MessageSort,
|
self, BulkMessageResponse, DataMessageSend, Embed, MessageAuthor, MessageFlags, MessageSort,
|
||||||
MessageWebhook, PushNotification, ReplyIntent, SendableEmbed, Text
|
MessageWebhook, PushNotification, ReplyIntent, SendableEmbed, Text,
|
||||||
};
|
};
|
||||||
use revolt_permissions::{calculate_channel_permissions, ChannelPermission, PermissionValue};
|
use revolt_permissions::{calculate_channel_permissions, ChannelPermission, PermissionValue};
|
||||||
use revolt_result::{ErrorType, Result};
|
use revolt_result::{ErrorType, Result};
|
||||||
@@ -286,9 +286,9 @@ impl Message {
|
|||||||
.map_err(|_| create_error!(InvalidOperation))?;
|
.map_err(|_| create_error!(InvalidOperation))?;
|
||||||
|
|
||||||
// Check the message is not empty
|
// Check the message is not empty
|
||||||
if (data.content.as_ref().map_or(true, |v| v.is_empty()))
|
if (data.content.as_ref().is_none_or(|v| v.is_empty()))
|
||||||
&& (data.attachments.as_ref().map_or(true, |v| v.is_empty()))
|
&& (data.attachments.as_ref().is_none_or(|v| v.is_empty()))
|
||||||
&& (data.embeds.as_ref().map_or(true, |v| v.is_empty()))
|
&& (data.embeds.as_ref().is_none_or(|v| v.is_empty()))
|
||||||
{
|
{
|
||||||
return Err(create_error!(EmptyMessage));
|
return Err(create_error!(EmptyMessage));
|
||||||
}
|
}
|
||||||
@@ -382,7 +382,7 @@ impl Message {
|
|||||||
mut user_mentions,
|
mut user_mentions,
|
||||||
mut role_mentions,
|
mut role_mentions,
|
||||||
mut mentions_everyone,
|
mut mentions_everyone,
|
||||||
mut mentions_online
|
mut mentions_online,
|
||||||
} = message_mentions;
|
} = message_mentions;
|
||||||
|
|
||||||
if allow_mass_mentions && server_id.is_some() && !role_mentions.is_empty() {
|
if allow_mass_mentions && server_id.is_some() && !role_mentions.is_empty() {
|
||||||
@@ -489,7 +489,9 @@ impl Message {
|
|||||||
|
|
||||||
let valid_members = db.fetch_members(server.as_str(), &mentions_vec[..]).await;
|
let valid_members = db.fetch_members(server.as_str(), &mentions_vec[..]).await;
|
||||||
if let Ok(valid_members) = valid_members {
|
if let Ok(valid_members) = valid_members {
|
||||||
let valid_mentions = HashSet::<&String, RandomState>::from_iter(valid_members.iter().map(|m| &m.id.user));
|
let valid_mentions = HashSet::<&String, RandomState>::from_iter(
|
||||||
|
valid_members.iter().map(|m| &m.id.user),
|
||||||
|
);
|
||||||
|
|
||||||
user_mentions.retain(|m| valid_mentions.contains(m)); // quick pass, validate mentions are in the server
|
user_mentions.retain(|m| valid_mentions.contains(m)); // quick pass, validate mentions are in the server
|
||||||
|
|
||||||
@@ -503,7 +505,8 @@ impl Message {
|
|||||||
.members_can_see_channel()
|
.members_can_see_channel()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
user_mentions.retain(|m| *member_channel_view_perms.get(m).unwrap_or(&false));
|
user_mentions
|
||||||
|
.retain(|m| *member_channel_view_perms.get(m).unwrap_or(&false));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
revolt_config::capture_error(&valid_members.unwrap_err());
|
revolt_config::capture_error(&valid_members.unwrap_err());
|
||||||
@@ -517,7 +520,9 @@ impl Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !user_mentions.is_empty() {
|
if !user_mentions.is_empty() {
|
||||||
message.mentions.replace(user_mentions.into_iter().collect());
|
message
|
||||||
|
.mentions
|
||||||
|
.replace(user_mentions.into_iter().collect());
|
||||||
}
|
}
|
||||||
|
|
||||||
if !role_mentions.is_empty() {
|
if !role_mentions.is_empty() {
|
||||||
@@ -651,7 +656,7 @@ impl Message {
|
|||||||
pub async fn send(
|
pub async fn send(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
amqp: Option<&AMQP>, // this is optional mostly for tests.
|
_amqp: Option<&AMQP>, // this is optional mostly for tests.
|
||||||
author: MessageAuthor<'_>,
|
author: MessageAuthor<'_>,
|
||||||
user: Option<v0::User>,
|
user: Option<v0::User>,
|
||||||
member: Option<v0::Member>,
|
member: Option<v0::Member>,
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ impl SnapshotContent {
|
|||||||
Ok((
|
Ok((
|
||||||
SnapshotContent::Message {
|
SnapshotContent::Message {
|
||||||
message,
|
message,
|
||||||
prior_context: prior_context.into_iter().map(Into::into).collect(),
|
prior_context: prior_context.into_iter().collect(),
|
||||||
leading_context: leading_context.into_iter().map(Into::into).collect(),
|
leading_context: leading_context.into_iter().collect(),
|
||||||
},
|
},
|
||||||
files,
|
files,
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ auto_derived!(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[allow(clippy::disallowed_methods)]
|
||||||
impl ServerBan {
|
impl ServerBan {
|
||||||
/// Create ban
|
/// Create ban
|
||||||
pub async fn create(
|
pub async fn create(
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ impl Member {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update member data
|
/// Update member data
|
||||||
pub async fn update<'a>(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
partial: PartialMember,
|
partial: PartialMember,
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ impl Role {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update server data
|
/// Update server data
|
||||||
pub async fn update<'a>(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
server_id: &str,
|
server_id: &str,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use iso8601_timestamp::Timestamp;
|
|||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
use revolt_config::{config, FeaturesLimits};
|
use revolt_config::{config, FeaturesLimits};
|
||||||
use revolt_models::v0::{self, UserFlags, UserBadges};
|
use revolt_models::v0::{self, UserBadges, UserFlags};
|
||||||
use revolt_presence::filter_online;
|
use revolt_presence::filter_online;
|
||||||
use revolt_result::{create_error, Result};
|
use revolt_result::{create_error, Result};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
@@ -349,16 +349,13 @@ impl User {
|
|||||||
) -> Result<Vec<v0::User>> {
|
) -> Result<Vec<v0::User>> {
|
||||||
let online_ids = filter_online(ids).await;
|
let online_ids = filter_online(ids).await;
|
||||||
|
|
||||||
Ok(join_all(
|
Ok(
|
||||||
db
|
join_all(db.fetch_users(ids).await?.into_iter().map(|user| async {
|
||||||
.fetch_users(ids)
|
|
||||||
.await?
|
|
||||||
.into_iter()
|
|
||||||
.map(|user| async {
|
|
||||||
let is_online = online_ids.contains(&user.id);
|
let is_online = online_ids.contains(&user.id);
|
||||||
user.into_known(perspective, is_online).await
|
user.into_known(perspective, is_online).await
|
||||||
})
|
}))
|
||||||
).await)
|
.await,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find a free discriminator for a given username
|
/// Find a free discriminator for a given username
|
||||||
@@ -639,7 +636,7 @@ impl User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update user data
|
/// Update user data
|
||||||
pub async fn update<'a>(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
partial: PartialUser,
|
partial: PartialUser,
|
||||||
@@ -817,7 +814,7 @@ impl User {
|
|||||||
|
|
||||||
if let Some(cutoff) = config.api.users.early_adopter_cutoff {
|
if let Some(cutoff) = config.api.users.early_adopter_cutoff {
|
||||||
if Ulid::from_string(&self.id).unwrap().timestamp_ms() < cutoff {
|
if Ulid::from_string(&self.id).unwrap().timestamp_ms() < cutoff {
|
||||||
return badges + UserBadges::EarlyAdopter as u32
|
return badges + UserBadges::EarlyAdopter as u32;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use revolt_rocket_okapi::{
|
|||||||
|
|
||||||
use crate::User;
|
use crate::User;
|
||||||
|
|
||||||
impl<'r> OpenApiFromRequest<'r> for User {
|
impl OpenApiFromRequest<'_> for User {
|
||||||
fn from_request_input(
|
fn from_request_input(
|
||||||
_gen: &mut OpenApiGenerator,
|
_gen: &mut OpenApiGenerator,
|
||||||
_name: String,
|
_name: String,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ use crate::{Database, Message, AMQP};
|
|||||||
|
|
||||||
use deadqueue::limited::Queue;
|
use deadqueue::limited::Queue;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
use revolt_config::capture_message;
|
||||||
use revolt_models::v0::PushNotification;
|
use revolt_models::v0::PushNotification;
|
||||||
use rocket::form::validate::Contains;
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
collections::{HashMap, HashSet},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
@@ -65,6 +65,7 @@ pub async fn queue_ack(channel: String, user: String, event: AckEvent) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Do not add more than one message per event.
|
||||||
pub async fn queue_message(channel: String, event: AckEvent) {
|
pub async fn queue_message(channel: String, event: AckEvent) {
|
||||||
Q.try_push(Data {
|
Q.try_push(Data {
|
||||||
channel,
|
channel,
|
||||||
@@ -114,7 +115,7 @@ pub async fn handle_ack_event(
|
|||||||
}
|
}
|
||||||
AckEvent::ProcessMessage { messages } => {
|
AckEvent::ProcessMessage { messages } => {
|
||||||
let mut users: HashSet<&String> = HashSet::new();
|
let mut users: HashSet<&String> = HashSet::new();
|
||||||
debug!(
|
info!(
|
||||||
"Processing {} messages from channel {}",
|
"Processing {} messages from channel {}",
|
||||||
messages.len(),
|
messages.len(),
|
||||||
messages[0].1.channel
|
messages[0].1.channel
|
||||||
@@ -125,7 +126,7 @@ pub async fn handle_ack_event(
|
|||||||
users.extend(recipents.iter());
|
users.extend(recipents.iter());
|
||||||
});
|
});
|
||||||
|
|
||||||
debug!("Found {} users to notify.", users.len());
|
info!("Found {} users to notify.", users.len());
|
||||||
|
|
||||||
for user in users {
|
for user in users {
|
||||||
let message_ids: Vec<String> = messages
|
let message_ids: Vec<String> = messages
|
||||||
@@ -143,7 +144,7 @@ pub async fn handle_ack_event(
|
|||||||
db.add_mention_to_unread(channel, user, &message_ids)
|
db.add_mention_to_unread(channel, user, &message_ids)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
debug!("Added {} mentions for user {}", message_ids.len(), &user);
|
info!("Added {} mentions for user {}", message_ids.len(), &user);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut mass_mentions = vec![];
|
let mut mass_mentions = vec![];
|
||||||
@@ -232,7 +233,7 @@ pub async fn worker(db: Database, amqp: AMQP) {
|
|||||||
revolt_config::capture_error(&err);
|
revolt_config::capture_error(&err);
|
||||||
error!("{err:?} for {event:?}. ({user:?}, {channel})");
|
error!("{err:?} for {event:?}. ({user:?}, {channel})");
|
||||||
} else {
|
} else {
|
||||||
debug!("User {user:?} ack in {channel} with {event:?}");
|
info!("User {user:?} ack in {channel} with {event:?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,6 +248,8 @@ pub async fn worker(db: Database, amqp: AMQP) {
|
|||||||
mut event,
|
mut event,
|
||||||
}) = Q.try_pop()
|
}) = Q.try_pop()
|
||||||
{
|
{
|
||||||
|
info!("Took next ack from queue, now {} remaining", Q.len());
|
||||||
|
|
||||||
let key: (Option<String>, String, u8) = (
|
let key: (Option<String>, String, u8) = (
|
||||||
user,
|
user,
|
||||||
channel,
|
channel,
|
||||||
@@ -261,15 +264,17 @@ pub async fn worker(db: Database, amqp: AMQP) {
|
|||||||
if let AckEvent::ProcessMessage { messages: existing } =
|
if let AckEvent::ProcessMessage { messages: existing } =
|
||||||
&mut task.data.event
|
&mut task.data.event
|
||||||
{
|
{
|
||||||
// add the new message to the list of messages to be processed.
|
if let Some(new_event) = new_data.pop() {
|
||||||
existing.append(new_data);
|
|
||||||
|
|
||||||
// if the message contains a mass mention, do not delay it any further.
|
// if the message contains a mass mention, do not delay it any further.
|
||||||
if new_data[0].1.contains_mass_push_mention() {
|
if new_event.1.contains_mass_push_mention() {
|
||||||
|
// add the new message to the list of messages to be processed.
|
||||||
|
existing.push(new_event);
|
||||||
task.run_immediately();
|
task.run_immediately();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
existing.push(new_event);
|
||||||
|
|
||||||
// put a cap on the amount of messages that can be queued, for particularly active channels
|
// put a cap on the amount of messages that can be queued, for particularly active channels
|
||||||
if (existing.length() as u16)
|
if (existing.length() as u16)
|
||||||
< revolt_config::config()
|
< revolt_config::config()
|
||||||
@@ -280,6 +285,11 @@ pub async fn worker(db: Database, amqp: AMQP) {
|
|||||||
{
|
{
|
||||||
task.delay();
|
task.delay();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let err_msg = format!("Got zero-length message event: {event:?}");
|
||||||
|
capture_message(&err_msg, revolt_config::Level::Warning);
|
||||||
|
info!("{err_msg}")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
panic!("Somehow got an ack message in the add mention arm");
|
panic!("Somehow got an ack message in the add mention arm");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use revolt_models::v0::*;
|
use revolt_models::v0::*;
|
||||||
use revolt_permissions::{calculate_user_permissions, UserPermission};
|
use revolt_permissions::{calculate_user_permissions, UserPermission};
|
||||||
|
|
||||||
use crate::{util::permissions::DatabasePermissionQuery, Database, FileUsedFor};
|
use crate::{util::permissions::DatabasePermissionQuery, Database};
|
||||||
|
|
||||||
impl crate::Bot {
|
impl crate::Bot {
|
||||||
pub fn into_public_bot(self, user: crate::User) -> PublicBot {
|
pub fn into_public_bot(self, user: crate::User) -> PublicBot {
|
||||||
@@ -488,7 +488,7 @@ impl crate::Message {
|
|||||||
reactions: self.reactions,
|
reactions: self.reactions,
|
||||||
interactions: self.interactions.into(),
|
interactions: self.interactions.into(),
|
||||||
masquerade: self.masquerade.map(Into::into),
|
masquerade: self.masquerade.map(Into::into),
|
||||||
flags: self.flags.map(|flags| flags as u32).unwrap_or_default(),
|
flags: self.flags.unwrap_or_default(),
|
||||||
pinned: self.pinned,
|
pinned: self.pinned,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -517,7 +517,7 @@ impl From<crate::PartialMessage> for PartialMessage {
|
|||||||
reactions: value.reactions,
|
reactions: value.reactions,
|
||||||
interactions: value.interactions.map(Into::into),
|
interactions: value.interactions.map(Into::into),
|
||||||
masquerade: value.masquerade.map(Into::into),
|
masquerade: value.masquerade.map(Into::into),
|
||||||
flags: value.flags.map(|flags| flags as u32),
|
flags: value.flags,
|
||||||
pinned: value.pinned,
|
pinned: value.pinned,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ impl<'z> BulkDatabasePermissionQuery<'z> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn channel(self, channel: &'z Channel) -> BulkDatabasePermissionQuery {
|
pub fn channel(self, channel: &'z Channel) -> BulkDatabasePermissionQuery<'z> {
|
||||||
BulkDatabasePermissionQuery {
|
BulkDatabasePermissionQuery {
|
||||||
channel: Some(channel.clone()),
|
channel: Some(channel.clone()),
|
||||||
..self
|
..self
|
||||||
@@ -109,7 +109,7 @@ impl<'z> BulkDatabasePermissionQuery<'z> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn members(self, members: &'z [Member]) -> BulkDatabasePermissionQuery {
|
pub fn members(self, members: &'z [Member]) -> BulkDatabasePermissionQuery<'z> {
|
||||||
BulkDatabasePermissionQuery {
|
BulkDatabasePermissionQuery {
|
||||||
members: Some(members.to_owned()),
|
members: Some(members.to_owned()),
|
||||||
cached_member_perms: None,
|
cached_member_perms: None,
|
||||||
@@ -120,7 +120,7 @@ impl<'z> BulkDatabasePermissionQuery<'z> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn users(self, users: &'z [User]) -> BulkDatabasePermissionQuery {
|
pub fn users(self, users: &'z [User]) -> BulkDatabasePermissionQuery<'z> {
|
||||||
BulkDatabasePermissionQuery {
|
BulkDatabasePermissionQuery {
|
||||||
users: Some(users.to_owned()),
|
users: Some(users.to_owned()),
|
||||||
cached_member_perms: None,
|
cached_member_perms: None,
|
||||||
|
|||||||
@@ -305,16 +305,14 @@ impl PermissionQuery for DatabasePermissionQuery<'_> {
|
|||||||
|
|
||||||
/// Are we a recipient of this channel?
|
/// Are we a recipient of this channel?
|
||||||
async fn are_we_part_of_the_channel(&mut self) -> bool {
|
async fn are_we_part_of_the_channel(&mut self) -> bool {
|
||||||
if let Some(channel) = &self.channel {
|
if let Some(
|
||||||
match channel {
|
|
||||||
Cow::Borrowed(Channel::DirectMessage { recipients, .. })
|
Cow::Borrowed(Channel::DirectMessage { recipients, .. })
|
||||||
| Cow::Owned(Channel::DirectMessage { recipients, .. })
|
| Cow::Owned(Channel::DirectMessage { recipients, .. })
|
||||||
| Cow::Borrowed(Channel::Group { recipients, .. })
|
| Cow::Borrowed(Channel::Group { recipients, .. })
|
||||||
| Cow::Owned(Channel::Group { recipients, .. }) => {
|
| Cow::Owned(Channel::Group { recipients, .. }),
|
||||||
|
) = &self.channel
|
||||||
|
{
|
||||||
recipients.contains(&self.perspective.id)
|
recipients.contains(&self.perspective.id)
|
||||||
}
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
@@ -420,7 +418,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use user
|
/// Use user
|
||||||
pub fn user(self, user: &'a User) -> DatabasePermissionQuery {
|
pub fn user(self, user: &'a User) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
user: Some(Cow::Borrowed(user)),
|
user: Some(Cow::Borrowed(user)),
|
||||||
..self
|
..self
|
||||||
@@ -428,7 +426,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use channel
|
/// Use channel
|
||||||
pub fn channel(self, channel: &'a Channel) -> DatabasePermissionQuery {
|
pub fn channel(self, channel: &'a Channel) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
channel: Some(Cow::Borrowed(channel)),
|
channel: Some(Cow::Borrowed(channel)),
|
||||||
..self
|
..self
|
||||||
@@ -436,7 +434,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use server
|
/// Use server
|
||||||
pub fn server(self, server: &'a Server) -> DatabasePermissionQuery {
|
pub fn server(self, server: &'a Server) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
server: Some(Cow::Borrowed(server)),
|
server: Some(Cow::Borrowed(server)),
|
||||||
..self
|
..self
|
||||||
@@ -444,7 +442,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use member
|
/// Use member
|
||||||
pub fn member(self, member: &'a Member) -> DatabasePermissionQuery {
|
pub fn member(self, member: &'a Member) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
member: Some(Cow::Borrowed(member)),
|
member: Some(Cow::Borrowed(member)),
|
||||||
..self
|
..self
|
||||||
|
|||||||
@@ -0,0 +1,188 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
<meta name="x-apple-disable-message-reformatting">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<style type="text/css">
|
||||||
|
body,table,td{font-family:Helvetica,Arial,sans-serif !important}.ExternalClass{width:100%}.ExternalClass,.ExternalClass p,.ExternalClass span,.ExternalClass font,.ExternalClass td,.ExternalClass div{line-height:150%}a{text-decoration:none}*{color:inherit}a[x-apple-data-detectors],u+#body a,#MessageViewBody a{color:inherit;text-decoration:none;font-size:inherit;font-family:inherit;font-weight:inherit;line-height:inherit}img{-ms-interpolation-mode:bicubic}table:not([class^=s-]){font-family:Helvetica,Arial,sans-serif;mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;border-collapse:collapse}table:not([class^=s-]) td{border-spacing:0px;border-collapse:collapse}@media screen and (max-width: 600px){.w-full,.w-full>tbody>tr>td{width:100% !important}.w-24,.w-24>tbody>tr>td{width:96px !important}.p-lg-10:not(table),.p-lg-10:not(.btn)>tbody>tr>td,.p-lg-10.btn td a{padding:0 !important}.p-3:not(table),.p-3:not(.btn)>tbody>tr>td,.p-3.btn td a{padding:12px !important}.p-6:not(table),.p-6:not(.btn)>tbody>tr>td,.p-6.btn td a{padding:24px !important}*[class*=s-lg-]>tbody>tr>td{font-size:0 !important;line-height:0 !important;height:0 !important}.s-4>tbody>tr>td{font-size:16px !important;line-height:16px !important;height:16px !important}.s-6>tbody>tr>td{font-size:24px !important;line-height:24px !important;height:24px !important}.s-10>tbody>tr>td{font-size:40px !important;line-height:40px !important;height:40px !important}}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="bg-light" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
|
<table class="bg-light body" valign="top" role="presentation" border="0" cellpadding="0" cellspacing="0" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td valign="top" style="line-height: 24px; font-size: 16px; margin: 0;" align="left" bgcolor="#f7fafc">
|
||||||
|
<table class="container" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td align="center" style="line-height: 24px; font-size: 16px; margin: 0; padding: 0 16px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
|
<table align="center" role="presentation">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="600">
|
||||||
|
<![endif]-->
|
||||||
|
<table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px; margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<img class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="card p-6 p-lg-10 space-y-4" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; width: 100%; overflow: hidden; border: 1px solid #e2e8f0;" bgcolor="#ffffff">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; width: 100%; margin: 0; padding: 40px;" align="left" bgcolor="#ffffff">
|
||||||
|
<h1 class="h3 fw-700" style="padding-top: 0; padding-bottom: 0; font-weight: 700 !important; vertical-align: baseline; font-size: 28px; line-height: 33.6px; margin: 0;" align="left">Password Reset</h1>
|
||||||
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">
|
||||||
|
You tried to create a new account with or try to re-verify this email
|
||||||
|
but there is already an existing verified account under this email.
|
||||||
|
</p>
|
||||||
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">
|
||||||
|
If you wish, you can now proceed to reset the password on it, click
|
||||||
|
below to continue.
|
||||||
|
</p>
|
||||||
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="btn btn-primary p-3 fw-700" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; font-weight: 700 !important;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; font-weight: 700 !important; margin: 0;" align="center" bgcolor="#0d6efd">
|
||||||
|
<a href="{{url}}" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: block; font-weight: 700 !important; white-space: nowrap; background-color: #0d6efd; padding: 12px; border: 1px solid #0d6efd;">Reset</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||||
|
This email is intended for {{email}}<br>
|
||||||
|
Sent from Revolt<br>
|
||||||
|
Made in Europe
|
||||||
|
</div>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<div class="text-muted text-xs" style="color: #718096; font-size: 12px; line-height: 14.4px;">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br>
|
||||||
|
Registered Company Number: 16260658<br>
|
||||||
|
Registered Office:<br>
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br>
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<style>
|
||||||
|
/* Add custom classes and styles that you want inlined here */
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="bg-light">
|
||||||
|
<div class="container">
|
||||||
|
<img
|
||||||
|
class="ax-center my-10 w-24"
|
||||||
|
src="https://app.revolt.chat/assets/logo_round.png"
|
||||||
|
/>
|
||||||
|
<div class="card p-6 p-lg-10 space-y-4">
|
||||||
|
<h1 class="h3 fw-700">Password Reset</h1>
|
||||||
|
<p>
|
||||||
|
You tried to create a new account with or try to re-verify this email
|
||||||
|
but there is already an existing verified account under this email.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If you wish, you can now proceed to reset the password on it, click
|
||||||
|
below to continue.
|
||||||
|
</p>
|
||||||
|
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Reset</a>
|
||||||
|
</div>
|
||||||
|
<div class="text-muted text-center my-6">
|
||||||
|
This email is intended for {{email}}<br />
|
||||||
|
Sent from Revolt<br />
|
||||||
|
Made in Europe
|
||||||
|
</div>
|
||||||
|
<div class="text-muted text-xs my-6 ax-center">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br />
|
||||||
|
Registered Company Number: 16260658<br />
|
||||||
|
Registered Office:<br />
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
You tried to create a new account with or try
|
||||||
|
to re-verify this email but there is already
|
||||||
|
an existing verified account under this email.
|
||||||
|
|
||||||
|
If you wish, you can now proceed to reset the
|
||||||
|
password on it, click below to continue.
|
||||||
|
|
||||||
|
Please navigate to: {{url}}
|
||||||
|
|
||||||
|
This email is intended for {{email}}
|
||||||
|
Sent by Revolt
|
||||||
|
Made in Europe
|
||||||
|
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||||
|
|
||||||
|
Registration Number: 16260658
|
||||||
|
Registered Office:
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-files"
|
name = "revolt-files"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
@@ -20,10 +20,10 @@ typenum = "1.17.0"
|
|||||||
aws-config = "1.5.5"
|
aws-config = "1.5.5"
|
||||||
aws-sdk-s3 = { version = "1.46.0", features = ["behavior-version-latest"] }
|
aws-sdk-s3 = { version = "1.46.0", features = ["behavior-version-latest"] }
|
||||||
|
|
||||||
revolt-config = { version = "0.8.4", path = "../config", features = [
|
revolt-config = { version = "0.8.6", path = "../config", features = [
|
||||||
"report-macros",
|
"report-macros",
|
||||||
] }
|
] }
|
||||||
revolt-result = { version = "0.8.4", path = "../result" }
|
revolt-result = { version = "0.8.6", path = "../result" }
|
||||||
|
|
||||||
# image processing
|
# image processing
|
||||||
jxl-oxide = "0.8.1"
|
jxl-oxide = "0.8.1"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-models"
|
name = "revolt-models"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
@@ -20,8 +20,8 @@ default = ["serde", "partials", "rocket"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core
|
# Core
|
||||||
revolt-config = { version = "0.8.4", path = "../config" }
|
revolt-config = { version = "0.8.6", path = "../config" }
|
||||||
revolt-permissions = { version = "0.8.4", path = "../permissions" }
|
revolt-permissions = { version = "0.8.6", path = "../permissions" }
|
||||||
|
|
||||||
# Utility
|
# Utility
|
||||||
regex = "1.11"
|
regex = "1.11"
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ impl Interactions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> MessageAuthor<'a> {
|
impl MessageAuthor<'_> {
|
||||||
pub fn id(&self) -> &str {
|
pub fn id(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
MessageAuthor::User(user) => &user.id,
|
MessageAuthor::User(user) => &user.id,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-parser"
|
name = "revolt-parser"
|
||||||
version = "0.1.0"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
license = "AGPL-3.0-or-later"
|
||||||
|
description = "Revolt Backend: Message Parser"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
logos = { version = "*" }
|
logos = { version = "0.15" }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-permissions"
|
name = "revolt-permissions"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
@@ -21,7 +21,7 @@ async-std = { version = "1.8.0", features = ["attributes"] }
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core
|
# Core
|
||||||
revolt-result = { version = "0.8.4", path = "../result" }
|
revolt-result = { version = "0.8.6", path = "../result" }
|
||||||
|
|
||||||
# Utility
|
# Utility
|
||||||
auto_ops = "0.3.0"
|
auto_ops = "0.3.0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-presence"
|
name = "revolt-presence"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-result"
|
name = "revolt-result"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-crond"
|
name = "revolt-crond"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -16,7 +16,7 @@ log = "0.4"
|
|||||||
tokio = { version = "1" }
|
tokio = { version = "1" }
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
revolt-database = { version = "0.8.4", path = "../../core/database" }
|
revolt-database = { version = "0.8.6", path = "../../core/database" }
|
||||||
revolt-result = { version = "0.8.4", path = "../../core/result" }
|
revolt-result = { version = "0.8.6", path = "../../core/result" }
|
||||||
revolt-config = { version = "0.8.4", path = "../../core/config" }
|
revolt-config = { version = "0.8.6", path = "../../core/config" }
|
||||||
revolt-files = { version = "0.8.4", path = "../../core/files" }
|
revolt-files = { version = "0.8.6", path = "../../core/files" }
|
||||||
|
|||||||
@@ -1,19 +1,24 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-pushd"
|
name = "revolt-pushd"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
revolt-config = { version = "0.8.4", path = "../../core/config" }
|
revolt-result = { version = "0.8.6", path = "../../core/result" }
|
||||||
revolt-database = { version = "0.8.4", path = "../../core/database" }
|
revolt-config = { version = "0.8.6", path = "../../core/config", features = [
|
||||||
revolt-models = { version = "0.8.4", path = "../../core/models", features = [
|
"report-macros",
|
||||||
|
] }
|
||||||
|
revolt-database = { version = "0.8.6", path = "../../core/database" }
|
||||||
|
revolt-models = { version = "0.8.6", path = "../../core/models", features = [
|
||||||
"validator",
|
"validator",
|
||||||
] }
|
] }
|
||||||
revolt-presence = { version = "0.8.1", path = "../../core/presence", features = [
|
revolt-presence = { version = "0.8.6", path = "../../core/presence", features = [
|
||||||
"redis-is-patched",
|
"redis-is-patched",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
|
anyhow = { version = "1.0.98" }
|
||||||
|
|
||||||
amqprs = { version = "1.7.0" }
|
amqprs = { version = "1.7.0" }
|
||||||
fcm_v1 = "0.3.0"
|
fcm_v1 = "0.3.0"
|
||||||
web-push = "0.10.0"
|
web-push = "0.10.0"
|
||||||
@@ -23,7 +28,7 @@ tokio = "1.39.2"
|
|||||||
async-trait = "0.1.81"
|
async-trait = "0.1.81"
|
||||||
ulid = "1.0.0"
|
ulid = "1.0.0"
|
||||||
|
|
||||||
authifier = "1.0.10"
|
authifier = "1.0.15"
|
||||||
|
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.4.0"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use amqprs::{
|
|||||||
consumer::AsyncConsumer,
|
consumer::AsyncConsumer,
|
||||||
BasicProperties, Deliver,
|
BasicProperties, Deliver,
|
||||||
};
|
};
|
||||||
|
use anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use revolt_database::{events::rabbit::*, Database};
|
use revolt_database::{events::rabbit::*, Database};
|
||||||
@@ -54,21 +55,16 @@ impl FRAcceptedConsumer {
|
|||||||
channel: None,
|
channel: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
async fn consume_event(
|
||||||
#[async_trait]
|
|
||||||
impl AsyncConsumer for FRAcceptedConsumer {
|
|
||||||
/// This consumer handles delegating messages into their respective platform queues.
|
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &Channel,
|
_channel: &Channel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: FRAcceptedPayload = serde_json::from_str(content.as_str()).unwrap();
|
let payload: FRAcceptedPayload = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
debug!("Received FR accept event");
|
debug!("Received FR accept event");
|
||||||
|
|
||||||
@@ -111,11 +107,34 @@ impl AsyncConsumer for FRAcceptedConsumer {
|
|||||||
.insert("endpoint".to_string(), sub.endpoint.clone());
|
.insert("endpoint".to_string(), sub.endpoint.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
let payload = serde_json::to_string(&sendable).unwrap();
|
let payload = serde_json::to_string(&sendable)?;
|
||||||
|
|
||||||
publish_message(self, payload.into(), args).await;
|
publish_message(self, payload.into(), args).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for FRAcceptedConsumer {
|
||||||
|
/// This consumer handles delegating messages into their respective platform queues.
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &Channel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process friend request accepted event: {err:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use amqprs::{
|
|||||||
consumer::AsyncConsumer,
|
consumer::AsyncConsumer,
|
||||||
BasicProperties, Deliver,
|
BasicProperties, Deliver,
|
||||||
};
|
};
|
||||||
|
use anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use revolt_database::{events::rabbit::*, Database};
|
use revolt_database::{events::rabbit::*, Database};
|
||||||
@@ -54,21 +55,16 @@ impl FRReceivedConsumer {
|
|||||||
channel: None,
|
channel: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
async fn consume_event(
|
||||||
#[async_trait]
|
|
||||||
impl AsyncConsumer for FRReceivedConsumer {
|
|
||||||
/// This consumer handles delegating messages into their respective platform queues.
|
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &Channel,
|
_channel: &Channel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: FRReceivedPayload = serde_json::from_str(content.as_str()).unwrap();
|
let payload: FRReceivedPayload = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
debug!("Received FR received event");
|
debug!("Received FR received event");
|
||||||
|
|
||||||
@@ -111,11 +107,34 @@ impl AsyncConsumer for FRReceivedConsumer {
|
|||||||
.insert("endpoint".to_string(), sub.endpoint.clone());
|
.insert("endpoint".to_string(), sub.endpoint.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
let payload = serde_json::to_string(&sendable).unwrap();
|
let payload = serde_json::to_string(&sendable)?;
|
||||||
|
|
||||||
publish_message(self, payload.into(), args).await;
|
publish_message(self, payload.into(), args).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for FRReceivedConsumer {
|
||||||
|
/// This consumer handles delegating messages into their respective platform queues.
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &Channel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process friend request received event: {err:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use amqprs::{
|
|||||||
consumer::AsyncConsumer,
|
consumer::AsyncConsumer,
|
||||||
BasicProperties, Deliver,
|
BasicProperties, Deliver,
|
||||||
};
|
};
|
||||||
|
use anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use revolt_database::{events::rabbit::*, Database};
|
use revolt_database::{events::rabbit::*, Database};
|
||||||
@@ -54,21 +55,16 @@ impl GenericConsumer {
|
|||||||
channel: None,
|
channel: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
async fn consume_event(
|
||||||
#[async_trait]
|
|
||||||
impl AsyncConsumer for GenericConsumer {
|
|
||||||
/// This consumer handles delegating messages into their respective platform queues.
|
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &Channel,
|
_channel: &Channel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: MessageSentPayload = serde_json::from_str(content.as_str()).unwrap();
|
let payload: MessageSentPayload = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
debug!("Received message event on origin");
|
debug!("Received message event on origin");
|
||||||
|
|
||||||
@@ -117,11 +113,34 @@ impl AsyncConsumer for GenericConsumer {
|
|||||||
.insert("endpoint".to_string(), sub.endpoint.clone());
|
.insert("endpoint".to_string(), sub.endpoint.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
let payload = serde_json::to_string(&sendable).unwrap();
|
let payload = serde_json::to_string(&sendable)?;
|
||||||
|
|
||||||
publish_message(self, payload.into(), args).await;
|
publish_message(self, payload.into(), args).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for GenericConsumer {
|
||||||
|
/// This consumer handles delegating messages into their respective platform queues.
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &Channel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process generic event: {err:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use amqprs::{
|
|||||||
consumer::AsyncConsumer,
|
consumer::AsyncConsumer,
|
||||||
BasicProperties, Deliver,
|
BasicProperties, Deliver,
|
||||||
};
|
};
|
||||||
|
use anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use revolt_database::{
|
use revolt_database::{
|
||||||
events::rabbit::*, util::bulk_permissions::BulkDatabasePermissionQuery, Database, Member,
|
events::rabbit::*, util::bulk_permissions::BulkDatabasePermissionQuery, Database, Member,
|
||||||
@@ -61,7 +62,11 @@ impl MassMessageConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn fire_notification_for_users(&mut self, push: &PushNotification, users: &[String]) {
|
async fn fire_notification_for_users(
|
||||||
|
&mut self,
|
||||||
|
push: &PushNotification,
|
||||||
|
users: &[String],
|
||||||
|
) -> Result<()> {
|
||||||
if let Ok(sessions) = self
|
if let Ok(sessions) = self
|
||||||
.authifier_db
|
.authifier_db
|
||||||
.find_sessions_with_subscription(users)
|
.find_sessions_with_subscription(users)
|
||||||
@@ -105,29 +110,26 @@ impl MassMessageConsumer {
|
|||||||
.insert("endpoint".to_string(), sub.endpoint.clone());
|
.insert("endpoint".to_string(), sub.endpoint.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
let payload = serde_json::to_string(&sendable).unwrap();
|
let payload = serde_json::to_string(&sendable)?;
|
||||||
|
|
||||||
publish_message(self, payload.into(), args).await;
|
publish_message(self, payload.into(), args).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
Ok(())
|
||||||
#[async_trait]
|
}
|
||||||
impl AsyncConsumer for MassMessageConsumer {
|
|
||||||
/// This consumer handles adding mentions for all the users affected by a mass mention ping, and then sends out push notifications
|
async fn consume_event(
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &Channel,
|
_channel: &Channel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let config = revolt_config::config().await;
|
let config = revolt_config::config().await;
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: MassMessageSentPayload = serde_json::from_str(content.as_str()).unwrap();
|
let payload: MassMessageSentPayload = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
debug!("Received mass message event");
|
debug!("Received mass message event");
|
||||||
|
|
||||||
@@ -159,8 +161,7 @@ impl AsyncConsumer for MassMessageConsumer {
|
|||||||
let mut db_query = self
|
let mut db_query = self
|
||||||
.db
|
.db
|
||||||
.fetch_all_members_chunked(&payload.server_id)
|
.fetch_all_members_chunked(&payload.server_id)
|
||||||
.await
|
.await?;
|
||||||
.expect("Failed to fetch members from database");
|
|
||||||
|
|
||||||
let mut exhausted = false;
|
let mut exhausted = false;
|
||||||
let ack_chnl = vec![push.channel.id().to_string()];
|
let ack_chnl = vec![push.channel.id().to_string()];
|
||||||
@@ -203,7 +204,8 @@ impl AsyncConsumer for MassMessageConsumer {
|
|||||||
target_users, online_users
|
target_users, online_users
|
||||||
);
|
);
|
||||||
|
|
||||||
self.fire_notification_for_users(&push, &target_users).await;
|
self.fire_notification_for_users(&push, &target_users)
|
||||||
|
.await?;
|
||||||
|
|
||||||
if exhausted {
|
if exhausted {
|
||||||
break;
|
break;
|
||||||
@@ -211,19 +213,11 @@ impl AsyncConsumer for MassMessageConsumer {
|
|||||||
}
|
}
|
||||||
} else if let Some(roles) = &push.message.role_mentions {
|
} else if let Some(roles) = &push.message.role_mentions {
|
||||||
// role mentions
|
// role mentions
|
||||||
let _role_members = self
|
let mut role_members = self
|
||||||
.db
|
.db
|
||||||
.fetch_all_members_with_roles_chunked(&payload.server_id, roles)
|
.fetch_all_members_with_roles_chunked(&payload.server_id, roles)
|
||||||
.await;
|
.await?;
|
||||||
|
|
||||||
debug!("role members: {:?}", _role_members);
|
|
||||||
|
|
||||||
if _role_members.is_err() {
|
|
||||||
revolt_config::capture_error(&_role_members.err().unwrap());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut role_members = _role_members.unwrap();
|
|
||||||
let mut chunk = vec![];
|
let mut chunk = vec![];
|
||||||
let mut exhausted = false;
|
let mut exhausted = false;
|
||||||
|
|
||||||
@@ -266,10 +260,33 @@ impl AsyncConsumer for MassMessageConsumer {
|
|||||||
|
|
||||||
debug!("targets: {:?}", targets);
|
debug!("targets: {:?}", targets);
|
||||||
|
|
||||||
self.fire_notification_for_users(&push, &targets).await;
|
self.fire_notification_for_users(&push, &targets).await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for MassMessageConsumer {
|
||||||
|
/// This consumer handles adding mentions for all the users affected by a mass mention ping, and then sends out push notifications
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &Channel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process mass message event: {err:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use amqprs::{
|
|||||||
consumer::AsyncConsumer,
|
consumer::AsyncConsumer,
|
||||||
BasicProperties, Deliver,
|
BasicProperties, Deliver,
|
||||||
};
|
};
|
||||||
|
use anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use revolt_database::{events::rabbit::*, Database};
|
use revolt_database::{events::rabbit::*, Database};
|
||||||
@@ -54,21 +55,16 @@ impl MessageConsumer {
|
|||||||
channel: None,
|
channel: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
async fn consume_event(
|
||||||
#[async_trait]
|
|
||||||
impl AsyncConsumer for MessageConsumer {
|
|
||||||
/// This consumer handles delegating messages into their respective platform queues.
|
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &Channel,
|
_channel: &Channel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: MessageSentPayload = serde_json::from_str(content.as_str()).unwrap();
|
let payload: MessageSentPayload = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
debug!("Received message event on origin");
|
debug!("Received message event on origin");
|
||||||
|
|
||||||
@@ -117,11 +113,34 @@ impl AsyncConsumer for MessageConsumer {
|
|||||||
.insert("endpoint".to_string(), sub.endpoint.clone());
|
.insert("endpoint".to_string(), sub.endpoint.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
let payload = serde_json::to_string(&sendable).unwrap();
|
let payload = serde_json::to_string(&sendable)?;
|
||||||
|
|
||||||
publish_message(self, payload.into(), args).await;
|
publish_message(self, payload.into(), args).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for MessageConsumer {
|
||||||
|
/// This consumer handles delegating messages into their respective platform queues.
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &Channel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process message event: {err:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use std::{borrow::Cow, collections::BTreeMap, io::Cursor};
|
use std::{borrow::Cow, collections::BTreeMap, io::Cursor};
|
||||||
|
|
||||||
use amqprs::{channel::Channel as AmqpChannel, consumer::AsyncConsumer, BasicProperties, Deliver};
|
use amqprs::{channel::Channel as AmqpChannel, consumer::AsyncConsumer, BasicProperties, Deliver};
|
||||||
|
use anyhow::{anyhow, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use base64::{
|
use base64::{
|
||||||
engine::{self},
|
engine::{self},
|
||||||
@@ -122,20 +123,16 @@ impl ApnsOutboundConsumer {
|
|||||||
|
|
||||||
Ok(ApnsOutboundConsumer { db, client })
|
Ok(ApnsOutboundConsumer { db, client })
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
async fn consume_event(
|
||||||
#[async_trait]
|
|
||||||
impl AsyncConsumer for ApnsOutboundConsumer {
|
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &AmqpChannel,
|
_channel: &AmqpChannel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: PayloadToService = serde_json::from_str(content.as_str()).unwrap();
|
let payload: PayloadToService = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
let payload_options = NotificationOptions {
|
let payload_options = NotificationOptions {
|
||||||
apns_id: None,
|
apns_id: None,
|
||||||
@@ -159,7 +156,7 @@ impl AsyncConsumer for ApnsOutboundConsumer {
|
|||||||
alert.from_user.username, alert.from_user.discriminator
|
alert.from_user.username, alert.from_user.discriminator
|
||||||
)))
|
)))
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap(),
|
.ok_or_else(|| anyhow!("missing name"))?,
|
||||||
)];
|
)];
|
||||||
|
|
||||||
let apn_payload = Payload {
|
let apn_payload = Payload {
|
||||||
@@ -205,7 +202,7 @@ impl AsyncConsumer for ApnsOutboundConsumer {
|
|||||||
alert.accepted_user.username, alert.accepted_user.discriminator
|
alert.accepted_user.username, alert.accepted_user.discriminator
|
||||||
)))
|
)))
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap(),
|
.ok_or_else(|| anyhow!("missing name"))?,
|
||||||
)];
|
)];
|
||||||
|
|
||||||
let apn_payload = Payload {
|
let apn_payload = Payload {
|
||||||
@@ -355,5 +352,27 @@ impl AsyncConsumer for ApnsOutboundConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for ApnsOutboundConsumer {
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &AmqpChannel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process APN event: {err:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use std::{collections::HashMap, time::Duration};
|
|||||||
|
|
||||||
use amqprs::{channel::Channel as AmqpChannel, consumer::AsyncConsumer, BasicProperties, Deliver};
|
use amqprs::{channel::Channel as AmqpChannel, consumer::AsyncConsumer, BasicProperties, Deliver};
|
||||||
|
|
||||||
|
use anyhow::{anyhow, bail, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use fcm_v1::{
|
use fcm_v1::{
|
||||||
android::AndroidConfig,
|
android::AndroidConfig,
|
||||||
@@ -64,22 +65,16 @@ impl FcmOutboundConsumer {
|
|||||||
),
|
),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
async fn consume_event(
|
||||||
#[async_trait]
|
|
||||||
impl AsyncConsumer for FcmOutboundConsumer {
|
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &AmqpChannel,
|
_channel: &AmqpChannel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: PayloadToService = serde_json::from_str(content.as_str()).unwrap();
|
let payload: PayloadToService = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
let config = revolt_config::config().await;
|
|
||||||
|
|
||||||
#[allow(clippy::needless_late_init)]
|
#[allow(clippy::needless_late_init)]
|
||||||
let resp: Result<Message, FcmError>;
|
let resp: Result<Message, FcmError>;
|
||||||
@@ -94,7 +89,7 @@ impl AsyncConsumer for FcmOutboundConsumer {
|
|||||||
alert.from_user.username, alert.from_user.discriminator
|
alert.from_user.username, alert.from_user.discriminator
|
||||||
)))
|
)))
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap();
|
.ok_or_else(|| anyhow!("missing name"))?;
|
||||||
|
|
||||||
let mut data = HashMap::new();
|
let mut data = HashMap::new();
|
||||||
data.insert(
|
data.insert(
|
||||||
@@ -122,7 +117,7 @@ impl AsyncConsumer for FcmOutboundConsumer {
|
|||||||
alert.accepted_user.username, alert.accepted_user.discriminator
|
alert.accepted_user.username, alert.accepted_user.discriminator
|
||||||
)))
|
)))
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap();
|
.ok_or_else(|| anyhow!("missing name"))?;
|
||||||
|
|
||||||
let mut data: HashMap<String, Value> = HashMap::new();
|
let mut data: HashMap<String, Value> = HashMap::new();
|
||||||
data.insert(
|
data.insert(
|
||||||
@@ -175,7 +170,7 @@ impl AsyncConsumer for FcmOutboundConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PayloadKind::BadgeUpdate(_) => {
|
PayloadKind::BadgeUpdate(_) => {
|
||||||
panic!("FCM cannot handle badge updates, and they should not be sent here.")
|
bail!("FCM cannot handle badge updates and they should not be sent here.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,5 +190,27 @@ impl AsyncConsumer for FcmOutboundConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for FcmOutboundConsumer {
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &AmqpChannel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process FCM event: {err:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use amqprs::{channel::Channel as AmqpChannel, consumer::AsyncConsumer, BasicProperties, Deliver};
|
use amqprs::{channel::Channel as AmqpChannel, consumer::AsyncConsumer, BasicProperties, Deliver};
|
||||||
|
|
||||||
|
use anyhow::{anyhow, bail, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use base64::{
|
use base64::{
|
||||||
engine::{self},
|
engine::{self},
|
||||||
Engine as _,
|
Engine as _,
|
||||||
};
|
};
|
||||||
use revolt_database::{events::rabbit::*, Database};
|
use revolt_database::{events::rabbit::*, Database};
|
||||||
// use revolt_models::v0::{Channel, PushNotification};
|
|
||||||
use web_push::{
|
use web_push::{
|
||||||
ContentEncoding, IsahcWebPushClient, SubscriptionInfo, SubscriptionKeys, VapidSignatureBuilder,
|
ContentEncoding, IsahcWebPushClient, SubscriptionInfo, SubscriptionKeys, VapidSignatureBuilder,
|
||||||
WebPushClient, WebPushError, WebPushMessageBuilder,
|
WebPushClient, WebPushError, WebPushMessageBuilder,
|
||||||
@@ -21,11 +21,11 @@ pub struct VapidOutboundConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl VapidOutboundConsumer {
|
impl VapidOutboundConsumer {
|
||||||
pub async fn new(db: Database) -> Result<VapidOutboundConsumer, &'static str> {
|
pub async fn new(db: Database) -> Result<VapidOutboundConsumer> {
|
||||||
let config = revolt_config::config().await;
|
let config = revolt_config::config().await;
|
||||||
|
|
||||||
if config.pushd.vapid.private_key.is_empty() | config.pushd.vapid.public_key.is_empty() {
|
if config.pushd.vapid.private_key.is_empty() | config.pushd.vapid.public_key.is_empty() {
|
||||||
return Err("No Vapid keys present");
|
bail!("no Vapid keys present");
|
||||||
}
|
}
|
||||||
|
|
||||||
let web_push_private_key = engine::general_purpose::URL_SAFE_NO_PAD
|
let web_push_private_key = engine::general_purpose::URL_SAFE_NO_PAD
|
||||||
@@ -38,28 +38,30 @@ impl VapidOutboundConsumer {
|
|||||||
pkey: web_push_private_key,
|
pkey: web_push_private_key,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
async fn consume_event(
|
||||||
#[async_trait]
|
|
||||||
impl AsyncConsumer for VapidOutboundConsumer {
|
|
||||||
async fn consume(
|
|
||||||
&mut self,
|
&mut self,
|
||||||
channel: &AmqpChannel,
|
_channel: &AmqpChannel,
|
||||||
deliver: Deliver,
|
_deliver: Deliver,
|
||||||
basic_properties: BasicProperties,
|
_basic_properties: BasicProperties,
|
||||||
content: Vec<u8>,
|
content: Vec<u8>,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let content = String::from_utf8(content).unwrap();
|
let content = String::from_utf8(content)?;
|
||||||
let payload: PayloadToService = serde_json::from_str(content.as_str()).unwrap();
|
let payload: PayloadToService = serde_json::from_str(content.as_str())?;
|
||||||
|
|
||||||
let config = revolt_config::config().await;
|
|
||||||
|
|
||||||
let subscription = SubscriptionInfo {
|
let subscription = SubscriptionInfo {
|
||||||
endpoint: payload.extras.get("endpoint").unwrap().clone(),
|
endpoint: payload
|
||||||
|
.extras
|
||||||
|
.get("endpoint")
|
||||||
|
.ok_or_else(|| anyhow!("missing endpoint"))?
|
||||||
|
.clone(),
|
||||||
keys: SubscriptionKeys {
|
keys: SubscriptionKeys {
|
||||||
auth: payload.token,
|
auth: payload.token,
|
||||||
p256dh: payload.extras.get("p256dh").unwrap().clone(),
|
p256dh: payload
|
||||||
|
.extras
|
||||||
|
.get("p256dh")
|
||||||
|
.ok_or_else(|| anyhow!("missing p256dh"))?
|
||||||
|
.clone(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -76,12 +78,12 @@ impl AsyncConsumer for VapidOutboundConsumer {
|
|||||||
alert.from_user.username, alert.from_user.discriminator
|
alert.from_user.username, alert.from_user.discriminator
|
||||||
)))
|
)))
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap();
|
.ok_or_else(|| anyhow!("missing name"))?;
|
||||||
|
|
||||||
let mut body = HashMap::new();
|
let mut body = HashMap::new();
|
||||||
body.insert("body", format!("{} sent you a friend request", name));
|
body.insert("body", format!("{} sent you a friend request", name));
|
||||||
|
|
||||||
payload_body = serde_json::to_string(&body).unwrap();
|
payload_body = serde_json::to_string(&body)?;
|
||||||
}
|
}
|
||||||
PayloadKind::FRAccepted(alert) => {
|
PayloadKind::FRAccepted(alert) => {
|
||||||
let name = alert
|
let name = alert
|
||||||
@@ -92,21 +94,21 @@ impl AsyncConsumer for VapidOutboundConsumer {
|
|||||||
alert.accepted_user.username, alert.accepted_user.discriminator
|
alert.accepted_user.username, alert.accepted_user.discriminator
|
||||||
)))
|
)))
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap();
|
.ok_or_else(|| anyhow!("missing name"))?;
|
||||||
|
|
||||||
let mut body = HashMap::new();
|
let mut body = HashMap::new();
|
||||||
body.insert("body", format!("{} accepted your friend request", name));
|
body.insert("body", format!("{} accepted your friend request", name));
|
||||||
|
|
||||||
payload_body = serde_json::to_string(&body).unwrap();
|
payload_body = serde_json::to_string(&body)?;
|
||||||
}
|
}
|
||||||
PayloadKind::Generic(alert) => {
|
PayloadKind::Generic(alert) => {
|
||||||
payload_body = serde_json::to_string(&alert).unwrap();
|
payload_body = serde_json::to_string(&alert)?;
|
||||||
}
|
}
|
||||||
PayloadKind::MessageNotification(alert) => {
|
PayloadKind::MessageNotification(alert) => {
|
||||||
payload_body = serde_json::to_string(&alert).unwrap();
|
payload_body = serde_json::to_string(&alert)?;
|
||||||
}
|
}
|
||||||
PayloadKind::BadgeUpdate(_) => {
|
PayloadKind::BadgeUpdate(_) => {
|
||||||
panic!("Vapid cannot handle badge updates, and they should not be sent here.")
|
bail!("Vapid cannot handle badge updates and they should not be sent here.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,28 +124,40 @@ impl AsyncConsumer for VapidOutboundConsumer {
|
|||||||
Ok(msg) => {
|
Ok(msg) => {
|
||||||
if let Err(err) = self.client.send(msg).await {
|
if let Err(err) = self.client.send(msg).await {
|
||||||
if err == WebPushError::Unauthorized {
|
if err == WebPushError::Unauthorized {
|
||||||
if let Err(err) = self
|
self.db
|
||||||
.db
|
|
||||||
.remove_push_subscription_by_session_id(&payload.session_id)
|
.remove_push_subscription_by_session_id(&payload.session_id)
|
||||||
.await
|
.await?;
|
||||||
{
|
|
||||||
revolt_config::capture_error(&err);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
Err(err) => Err(err.into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => Err(err.into()),
|
||||||
revolt_config::capture_error(&err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(err) => {
|
|
||||||
revolt_config::capture_error(&err);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => Err(err.into()),
|
||||||
revolt_config::capture_error(&err);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
#[async_trait]
|
||||||
|
impl AsyncConsumer for VapidOutboundConsumer {
|
||||||
|
async fn consume(
|
||||||
|
&mut self,
|
||||||
|
channel: &AmqpChannel,
|
||||||
|
deliver: Deliver,
|
||||||
|
basic_properties: BasicProperties,
|
||||||
|
content: Vec<u8>,
|
||||||
|
) {
|
||||||
|
if let Err(err) = self
|
||||||
|
.consume_event(channel, deliver, basic_properties, content)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
revolt_config::capture_anyhow(&err);
|
||||||
|
eprintln!("Failed to process Vapid event: {err:?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ use consumers::{
|
|||||||
|
|
||||||
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let config = config().await;
|
// Configure logging and environment
|
||||||
pretty_env_logger::init();
|
revolt_config::configure!(pushd);
|
||||||
|
|
||||||
// Setup database
|
// Setup database
|
||||||
let db = revolt_database::DatabaseInfo::Auto.connect().await.unwrap();
|
let db = revolt_database::DatabaseInfo::Auto.connect().await.unwrap();
|
||||||
@@ -52,6 +52,8 @@ async fn main() {
|
|||||||
// This'll require some interesting shimming if we need to add more events once this is in prod (different payloads between prod and test),
|
// This'll require some interesting shimming if we need to add more events once this is in prod (different payloads between prod and test),
|
||||||
// but that sounds like a problem for future us.
|
// but that sounds like a problem for future us.
|
||||||
|
|
||||||
|
let config = config().await;
|
||||||
|
|
||||||
// inbound: generic
|
// inbound: generic
|
||||||
connections.push(
|
connections.push(
|
||||||
make_queue_and_consume(
|
make_queue_and_consume(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-delta"
|
name = "revolt-delta"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = ["Paul Makles <paulmakles@gmail.com>"]
|
authors = ["Paul Makles <paulmakles@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
@@ -52,10 +52,11 @@ async-std = { version = "1.8.0", features = [
|
|||||||
lettre = "0.10.0-alpha.4"
|
lettre = "0.10.0-alpha.4"
|
||||||
|
|
||||||
# web
|
# web
|
||||||
|
|
||||||
rocket = { version = "0.5.1", default-features = false, features = ["json"] }
|
rocket = { version = "0.5.1", default-features = false, features = ["json"] }
|
||||||
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", rev = "072d90359b23e9b291df6b672c07c93de9c46011" }
|
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", rev = "072d90359b23e9b291df6b672c07c93de9c46011" }
|
||||||
rocket_empty = { version = "0.1.1", features = ["schema"] }
|
rocket_empty = { version = "0.1.1", features = ["schema"] }
|
||||||
rocket_authifier = { version = "1.0.10" }
|
rocket_authifier = { version = "1.0.15" }
|
||||||
rocket_prometheus = "0.10.0-rc.3"
|
rocket_prometheus = "0.10.0-rc.3"
|
||||||
|
|
||||||
# spec generation
|
# spec generation
|
||||||
@@ -66,7 +67,7 @@ revolt_rocket_okapi = { version = "0.10.0", features = ["swagger"] }
|
|||||||
amqprs = { version = "1.7.0" }
|
amqprs = { version = "1.7.0" }
|
||||||
|
|
||||||
# core
|
# core
|
||||||
authifier = "1.0.10"
|
authifier = "1.0.15"
|
||||||
revolt-config = { path = "../core/config" }
|
revolt-config = { path = "../core/config" }
|
||||||
revolt-database = { path = "../core/database", features = [
|
revolt-database = { path = "../core/database", features = [
|
||||||
"rocket-impl",
|
"rocket-impl",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use futures::future::join_all;
|
|
||||||
use revolt_database::{
|
use revolt_database::{
|
||||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||||
Channel, Database, User,
|
Channel, Database, User,
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ use revolt_permissions::{calculate_channel_permissions, ChannelPermission};
|
|||||||
use revolt_result::{create_error, Result};
|
use revolt_result::{create_error, Result};
|
||||||
use rocket::{serde::json::Json, State};
|
use rocket::{serde::json::Json, State};
|
||||||
use rocket_empty::EmptyResponse;
|
use rocket_empty::EmptyResponse;
|
||||||
use serde::Deserialize;
|
|
||||||
use validator::Validate;
|
use validator::Validate;
|
||||||
|
|
||||||
/// # Bulk Delete Messages
|
/// # Bulk Delete Messages
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
use iso8601_timestamp::Timestamp;
|
use iso8601_timestamp::Timestamp;
|
||||||
use revolt_config::config;
|
|
||||||
use revolt_database::{
|
use revolt_database::{
|
||||||
tasks,
|
tasks,
|
||||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
use revolt_database::{
|
use revolt_database::{
|
||||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||||
Channel, Database, User,
|
Database, User,
|
||||||
};
|
};
|
||||||
use revolt_models::v0;
|
use revolt_models::v0;
|
||||||
use revolt_permissions::{calculate_channel_permissions, ChannelPermission, Override};
|
use revolt_permissions::{calculate_channel_permissions, ChannelPermission, Override};
|
||||||
use revolt_result::{create_error, Result};
|
use revolt_result::{create_error, Result};
|
||||||
use rocket::{serde::json::Json, State};
|
use rocket::{serde::json::Json, State};
|
||||||
use serde::Deserialize;
|
|
||||||
|
|
||||||
/// # Set Role Permission
|
/// # Set Role Permission
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use revolt_database::{
|
|||||||
Database, EmojiParent, User,
|
Database, EmojiParent, User,
|
||||||
};
|
};
|
||||||
use revolt_permissions::{calculate_server_permissions, ChannelPermission};
|
use revolt_permissions::{calculate_server_permissions, ChannelPermission};
|
||||||
use revolt_result::{create_error, Result};
|
use revolt_result::Result;
|
||||||
|
|
||||||
use rocket::State;
|
use rocket::State;
|
||||||
use rocket_empty::EmptyResponse;
|
use rocket_empty::EmptyResponse;
|
||||||
@@ -18,7 +18,6 @@ pub async fn delete_emoji(
|
|||||||
user: User,
|
user: User,
|
||||||
emoji_id: Reference,
|
emoji_id: Reference,
|
||||||
) -> Result<EmptyResponse> {
|
) -> Result<EmptyResponse> {
|
||||||
|
|
||||||
// Fetch the emoji
|
// Fetch the emoji
|
||||||
let emoji = emoji_id.as_emoji(db).await?;
|
let emoji = emoji_id.as_emoji(db).await?;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use revolt_config::{config, Settings};
|
use revolt_config::Settings;
|
||||||
use revolt_rocket_okapi::{revolt_okapi::openapi3::OpenApi, settings::OpenApiSettings};
|
use revolt_rocket_okapi::{revolt_okapi::openapi3::OpenApi, settings::OpenApiSettings};
|
||||||
pub use rocket::http::Status;
|
pub use rocket::http::Status;
|
||||||
pub use rocket::response::Redirect;
|
pub use rocket::response::Redirect;
|
||||||
|
|||||||
@@ -4,12 +4,9 @@ use revolt_database::{
|
|||||||
};
|
};
|
||||||
use revolt_models::v0;
|
use revolt_models::v0;
|
||||||
|
|
||||||
use revolt_permissions::{
|
use revolt_permissions::{calculate_server_permissions, ChannelPermission};
|
||||||
calculate_channel_permissions, calculate_server_permissions, ChannelPermission,
|
|
||||||
};
|
|
||||||
use revolt_result::{create_error, Result};
|
use revolt_result::{create_error, Result};
|
||||||
use rocket::{serde::json::Json, State};
|
use rocket::{serde::json::Json, State};
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use validator::Validate;
|
use validator::Validate;
|
||||||
|
|
||||||
/// # Ban User
|
/// # Ban User
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use revolt_database::{
|
use revolt_database::{
|
||||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||||
Database, PartialServer, Server, User,
|
Database, PartialServer, User,
|
||||||
};
|
};
|
||||||
use revolt_models::v0;
|
use revolt_models::v0;
|
||||||
use revolt_permissions::{
|
use revolt_permissions::{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use revolt_models::v0;
|
|||||||
use revolt_permissions::{calculate_server_permissions, ChannelPermission};
|
use revolt_permissions::{calculate_server_permissions, ChannelPermission};
|
||||||
use revolt_result::{create_error, Result};
|
use revolt_result::{create_error, Result};
|
||||||
use rocket::{serde::json::Json, State};
|
use rocket::{serde::json::Json, State};
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use validator::Validate;
|
use validator::Validate;
|
||||||
|
|
||||||
/// # Edit Role
|
/// # Edit Role
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use revolt_database::{util::reference::Reference, Database};
|
|||||||
use revolt_models::v0;
|
use revolt_models::v0;
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
use rocket::{serde::json::Json, State};
|
use rocket::{serde::json::Json, State};
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
/// # Fetch User Flags
|
/// # Fetch User Flags
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -588,6 +588,7 @@ pub enum PullRequestEvent {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[allow(clippy::large_enum_variant)]
|
#[allow(clippy::large_enum_variant)]
|
||||||
pub enum BaseEvent {
|
pub enum BaseEvent {
|
||||||
|
#[allow(dead_code)]
|
||||||
Star(StarEvent),
|
Star(StarEvent),
|
||||||
Ping,
|
Ping,
|
||||||
Push(PushEvent),
|
Push(PushEvent),
|
||||||
@@ -829,7 +830,7 @@ pub async fn webhook_execute_github(
|
|||||||
})
|
})
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("\n"),
|
.join("\n"),
|
||||||
1000
|
1000,
|
||||||
);
|
);
|
||||||
|
|
||||||
SendableEmbed {
|
SendableEmbed {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-autumn"
|
name = "revolt-autumn"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
|
|
||||||
@@ -43,12 +43,12 @@ tracing = "0.1"
|
|||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
|
|
||||||
# Core crates
|
# Core crates
|
||||||
revolt-files = { version = "0.8.4", path = "../../core/files" }
|
revolt-files = { version = "0.8.6", path = "../../core/files" }
|
||||||
revolt-config = { version = "0.8.4", path = "../../core/config" }
|
revolt-config = { version = "0.8.6", path = "../../core/config" }
|
||||||
revolt-database = { version = "0.8.4", path = "../../core/database", features = [
|
revolt-database = { version = "0.8.6", path = "../../core/database", features = [
|
||||||
"axum-impl",
|
"axum-impl",
|
||||||
] }
|
] }
|
||||||
revolt-result = { version = "0.8.4", path = "../../core/result", features = [
|
revolt-result = { version = "0.8.6", path = "../../core/result", features = [
|
||||||
"utoipa",
|
"utoipa",
|
||||||
"axum",
|
"axum",
|
||||||
] }
|
] }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-january"
|
name = "revolt-january"
|
||||||
version = "0.8.4"
|
version = "0.8.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
|
|
||||||
@@ -32,13 +32,13 @@ tracing = "0.1"
|
|||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
|
|
||||||
# Core crates
|
# Core crates
|
||||||
revolt-config = { version = "0.8.4", path = "../../core/config" }
|
revolt-config = { version = "0.8.6", path = "../../core/config" }
|
||||||
revolt-models = { version = "0.8.4", path = "../../core/models" }
|
revolt-models = { version = "0.8.6", path = "../../core/models" }
|
||||||
revolt-result = { version = "0.8.4", path = "../../core/result", features = [
|
revolt-result = { version = "0.8.6", path = "../../core/result", features = [
|
||||||
"utoipa",
|
"utoipa",
|
||||||
"axum",
|
"axum",
|
||||||
] }
|
] }
|
||||||
revolt-files = { version = "0.8.4", path = "../../core/files" }
|
revolt-files = { version = "0.8.6", path = "../../core/files" }
|
||||||
|
|
||||||
# Axum / web server
|
# Axum / web server
|
||||||
axum = { version = "0.7.5" }
|
axum = { version = "0.7.5" }
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
publish:
|
publish:
|
||||||
|
cargo publish --package revolt-parser
|
||||||
cargo publish --package revolt-config
|
cargo publish --package revolt-config
|
||||||
cargo publish --package revolt-result
|
cargo publish --package revolt-result
|
||||||
cargo publish --package revolt-files
|
cargo publish --package revolt-files
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ tools() {
|
|||||||
|
|
||||||
deps() {
|
deps() {
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
crates/bindings/node/src \
|
|
||||||
crates/bonfire/src \
|
crates/bonfire/src \
|
||||||
crates/delta/src \
|
crates/delta/src \
|
||||||
crates/core/config/src \
|
crates/core/config/src \
|
||||||
@@ -45,7 +44,6 @@ deps() {
|
|||||||
tee crates/daemons/crond/src/main.rs |
|
tee crates/daemons/crond/src/main.rs |
|
||||||
tee crates/daemons/pushd/src/main.rs
|
tee crates/daemons/pushd/src/main.rs
|
||||||
echo '' |
|
echo '' |
|
||||||
tee crates/bindings/node/src/lib.rs |
|
|
||||||
tee crates/core/config/src/lib.rs |
|
tee crates/core/config/src/lib.rs |
|
||||||
tee crates/core/database/src/lib.rs |
|
tee crates/core/database/src/lib.rs |
|
||||||
tee crates/core/files/src/lib.rs |
|
tee crates/core/files/src/lib.rs |
|
||||||
@@ -56,9 +54,9 @@ deps() {
|
|||||||
tee crates/core/result/src/lib.rs
|
tee crates/core/result/src/lib.rs
|
||||||
|
|
||||||
if [ -z "$TARGETARCH" ]; then
|
if [ -z "$TARGETARCH" ]; then
|
||||||
cargo build -j 24 --locked --release
|
cargo build -j 10 --locked --release
|
||||||
else
|
else
|
||||||
cargo build -j 24 --locked --release --target "${BUILD_TARGET}"
|
cargo build -j 10 --locked --release --target "${BUILD_TARGET}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,9 +75,9 @@ apps() {
|
|||||||
crates/core/result/src/lib.rs
|
crates/core/result/src/lib.rs
|
||||||
|
|
||||||
if [ -z "$TARGETARCH" ]; then
|
if [ -z "$TARGETARCH" ]; then
|
||||||
cargo build -j 24 --locked --release
|
cargo build -j 10 --locked --release
|
||||||
else
|
else
|
||||||
cargo build -j 24 --locked --release --target "${BUILD_TARGET}"
|
cargo build -j 10 --locked --release --target "${BUILD_TARGET}"
|
||||||
mv target _target && mv _target/"${BUILD_TARGET}" target
|
mv target _target && mv _target/"${BUILD_TARGET}" target
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user