Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c59aad43c8 | ||
|
|
19e72babc9 | ||
|
|
bfcdb13d6d | ||
|
|
878c1a83ad | ||
|
|
471e0f55e4 | ||
|
|
08127218ce | ||
|
|
b69202c222 | ||
|
|
b3494b12fc | ||
|
|
7703475868 | ||
|
|
4be3bdc4c3 | ||
|
|
3e26e7e89d |
No files matched your search
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build documentation
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # To push a branch
|
||||||
|
pages: write # To push to a GitHub Pages site
|
||||||
|
id-token: write # To update the deployment status
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install latest mdbook
|
||||||
|
run: |
|
||||||
|
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
|
||||||
|
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
|
||||||
|
mkdir mdbook
|
||||||
|
curl -sSL $url | tar -xz --directory=./mdbook
|
||||||
|
echo `pwd`/mdbook >> $GITHUB_PATH
|
||||||
|
- name: Build Book
|
||||||
|
run: |
|
||||||
|
cd doc
|
||||||
|
mdbook build
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v4
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: "doc/book"
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
name: "CLA Assistant"
|
|
||||||
on:
|
|
||||||
issue_comment:
|
|
||||||
types: [created]
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened,closed,synchronize]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
CLAssistant:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "CLA Assistant"
|
|
||||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
|
||||||
# Beta Release
|
|
||||||
uses: cla-assistant/github-action@v2.1.3-beta
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# the below token should have repo scope and must be manually added by you in the repository's secret
|
|
||||||
PERSONAL_ACCESS_TOKEN : ${{ secrets.PAT }}
|
|
||||||
with:
|
|
||||||
path-to-signatures: 'signatures/version1/cla.json'
|
|
||||||
path-to-document: 'https://github.com/revoltchat/cla/blob/master/CLA.md' # e.g. a CLA or a DCO document
|
|
||||||
# branch should not be protected
|
|
||||||
branch: 'master'
|
|
||||||
allowlist: insertish,bot*
|
|
||||||
|
|
||||||
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
|
|
||||||
remote-organization-name: revoltchat
|
|
||||||
remote-repository-name: cla
|
|
||||||
create-file-commit-message: 'cla(create): creating file for storing CLA Signatures'
|
|
||||||
signed-commit-message: 'cla(sign): $contributorName has signed the CLA in #$pullRequestNo'
|
|
||||||
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
|
|
||||||
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
|
|
||||||
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
|
|
||||||
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
|
|
||||||
#use-dco-flag: true - If you are using DCO instead of CLA
|
|
||||||
@@ -10,6 +10,7 @@ on:
|
|||||||
- ".github/**"
|
- ".github/**"
|
||||||
- "!.github/workflows/docker.yml"
|
- "!.github/workflows/docker.yml"
|
||||||
- ".vscode/**"
|
- ".vscode/**"
|
||||||
|
- "doc/**"
|
||||||
- ".gitignore"
|
- ".gitignore"
|
||||||
- "LICENSE"
|
- "LICENSE"
|
||||||
- "README"
|
- "README"
|
||||||
|
|||||||
@@ -2,6 +2,14 @@ name: Rust build, test, and generate specification
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- ".github/**"
|
||||||
|
- "!.github/workflows/rust.yaml"
|
||||||
|
- ".vscode/**"
|
||||||
|
- "doc/**"
|
||||||
|
- ".gitignore"
|
||||||
|
- "LICENSE"
|
||||||
|
- "README"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
|
|||||||
Generated
+8
-8
@@ -3408,7 +3408,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-bonfire"
|
name = "revolt-bonfire"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"async-tungstenite",
|
"async-tungstenite",
|
||||||
@@ -3435,7 +3435,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-config"
|
name = "revolt-config"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"cached",
|
"cached",
|
||||||
@@ -3451,7 +3451,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-database"
|
name = "revolt-database"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-lock",
|
"async-lock",
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
@@ -3497,7 +3497,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-delta"
|
name = "revolt-delta"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"async-std",
|
"async-std",
|
||||||
@@ -3543,7 +3543,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-models"
|
name = "revolt-models"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"iso8601-timestamp 0.2.11",
|
"iso8601-timestamp 0.2.11",
|
||||||
@@ -3560,7 +3560,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-permissions"
|
name = "revolt-permissions"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -3575,7 +3575,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-presence"
|
name = "revolt-presence"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"log",
|
"log",
|
||||||
@@ -3586,7 +3586,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-result"
|
name = "revolt-result"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"revolt_okapi",
|
"revolt_okapi",
|
||||||
"revolt_rocket_okapi",
|
"revolt_rocket_okapi",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-bonfire"
|
name = "revolt-bonfire"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ 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.7.1", path = "../core/permissions" }
|
revolt-permissions = { version = "0.7.2", path = "../core/permissions" }
|
||||||
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
|
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
|
||||||
|
|
||||||
# redis
|
# redis
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ mod websocket;
|
|||||||
#[async_std::main]
|
#[async_std::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
// Configure requirements for Bonfire.
|
// Configure requirements for Bonfire.
|
||||||
revolt_config::configure!();
|
revolt_config::configure!(events);
|
||||||
database::connect().await;
|
database::connect().await;
|
||||||
|
|
||||||
// Clean up the current region information.
|
// Clean up the current region information.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-config"
|
name = "revolt-config"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
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,5 +1,3 @@
|
|||||||
sentry_dsn = ""
|
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
mongodb = "mongodb://database"
|
mongodb = "mongodb://database"
|
||||||
redis = "redis://redis/"
|
redis = "redis://redis/"
|
||||||
@@ -14,7 +12,6 @@ voso_legacy = ""
|
|||||||
voso_legacy_ws = ""
|
voso_legacy_ws = ""
|
||||||
|
|
||||||
[api]
|
[api]
|
||||||
staging = false
|
|
||||||
|
|
||||||
[api.registration]
|
[api.registration]
|
||||||
invite_only = false
|
invite_only = false
|
||||||
@@ -68,3 +65,7 @@ background_size = 6000000
|
|||||||
icon_size = 2500000
|
icon_size = 2500000
|
||||||
banner_size = 6000000
|
banner_size = 6000000
|
||||||
emoji_size = 500000
|
emoji_size = 500000
|
||||||
|
|
||||||
|
[sentry]
|
||||||
|
api = ""
|
||||||
|
events = ""
|
||||||
@@ -96,7 +96,6 @@ pub struct ApiWorkers {
|
|||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct Api {
|
pub struct Api {
|
||||||
pub staging: bool,
|
|
||||||
pub registration: ApiRegistration,
|
pub registration: ApiRegistration,
|
||||||
pub smtp: ApiSmtp,
|
pub smtp: ApiSmtp,
|
||||||
pub vapid: ApiVapid,
|
pub vapid: ApiVapid,
|
||||||
@@ -141,13 +140,19 @@ pub struct Features {
|
|||||||
pub webhooks_enabled: bool,
|
pub webhooks_enabled: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
pub struct Sentry {
|
||||||
|
pub api: String,
|
||||||
|
pub events: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct Settings {
|
pub struct Settings {
|
||||||
pub database: Database,
|
pub database: Database,
|
||||||
pub hosts: Hosts,
|
pub hosts: Hosts,
|
||||||
pub api: Api,
|
pub api: Api,
|
||||||
pub features: Features,
|
pub features: Features,
|
||||||
pub sentry_dsn: String,
|
pub sentry: Sentry,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Settings {
|
impl Settings {
|
||||||
@@ -191,7 +196,7 @@ pub async fn config() -> Settings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Configure logging and common Rust variables
|
/// Configure logging and common Rust variables
|
||||||
pub async fn setup_logging(release: &'static str) -> Option<sentry::ClientInitGuard> {
|
pub async fn setup_logging(release: &'static str, dsn: String) -> Option<sentry::ClientInitGuard> {
|
||||||
dotenv::dotenv().ok();
|
dotenv::dotenv().ok();
|
||||||
|
|
||||||
if std::env::var("RUST_LOG").is_err() {
|
if std::env::var("RUST_LOG").is_err() {
|
||||||
@@ -205,12 +210,11 @@ pub async fn setup_logging(release: &'static str) -> Option<sentry::ClientInitGu
|
|||||||
pretty_env_logger::init();
|
pretty_env_logger::init();
|
||||||
log::info!("Starting {release}");
|
log::info!("Starting {release}");
|
||||||
|
|
||||||
let config = config().await;
|
if dsn.is_empty() {
|
||||||
if config.sentry_dsn.is_empty() {
|
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(sentry::init((
|
Some(sentry::init((
|
||||||
config.sentry_dsn,
|
dsn,
|
||||||
sentry::ClientOptions {
|
sentry::ClientOptions {
|
||||||
release: Some(release.into()),
|
release: Some(release.into()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
@@ -221,12 +225,12 @@ pub async fn setup_logging(release: &'static str) -> Option<sentry::ClientInitGu
|
|||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! configure {
|
macro_rules! configure {
|
||||||
() => {
|
($application: ident) => {
|
||||||
let _sentry = $crate::setup_logging(concat!(
|
let config = $crate::config().await;
|
||||||
env!("CARGO_PKG_NAME"),
|
let _sentry = $crate::setup_logging(
|
||||||
"@",
|
concat!(env!("CARGO_PKG_NAME"), "@", env!("CARGO_PKG_VERSION")),
|
||||||
env!("CARGO_PKG_VERSION")
|
config.sentry.$application,
|
||||||
))
|
)
|
||||||
.await;
|
.await;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-database"
|
name = "revolt-database"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
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>"]
|
||||||
@@ -23,13 +23,13 @@ default = ["mongodb", "async-std-runtime", "tasks"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core
|
# Core
|
||||||
revolt-config = { version = "0.7.1", path = "../config" }
|
revolt-config = { version = "0.7.2", path = "../config" }
|
||||||
revolt-result = { version = "0.7.1", path = "../result" }
|
revolt-result = { version = "0.7.2", path = "../result" }
|
||||||
revolt-models = { version = "0.7.1", path = "../models", features = [
|
revolt-models = { version = "0.7.2", path = "../models", features = [
|
||||||
"validator",
|
"validator",
|
||||||
] }
|
] }
|
||||||
revolt-presence = { version = "0.7.1", path = "../presence" }
|
revolt-presence = { version = "0.7.2", path = "../presence" }
|
||||||
revolt-permissions = { version = "0.7.1", path = "../permissions", features = [
|
revolt-permissions = { version = "0.7.2", path = "../permissions", features = [
|
||||||
"serde",
|
"serde",
|
||||||
"bson",
|
"bson",
|
||||||
] }
|
] }
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ use crate::{
|
|||||||
bson::{doc, from_bson, from_document, to_document, Bson, DateTime, Document},
|
bson::{doc, from_bson, from_document, to_document, Bson, DateTime, Document},
|
||||||
options::FindOptions,
|
options::FindOptions,
|
||||||
},
|
},
|
||||||
MongoDb, DISCRIMINATOR_SEARCH_SPACE,
|
Invite, MongoDb, DISCRIMINATOR_SEARCH_SPACE,
|
||||||
};
|
};
|
||||||
|
use bson::oid::ObjectId;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
use revolt_permissions::DEFAULT_WEBHOOK_PERMISSIONS;
|
use revolt_permissions::DEFAULT_WEBHOOK_PERMISSIONS;
|
||||||
@@ -19,7 +20,7 @@ struct MigrationInfo {
|
|||||||
revision: i32,
|
revision: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const LATEST_REVISION: i32 = 26;
|
pub const LATEST_REVISION: i32 = 27;
|
||||||
|
|
||||||
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");
|
||||||
@@ -983,6 +984,91 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
|||||||
.expect("Failed to create ratelimit_events index.");
|
.expect("Failed to create ratelimit_events index.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if revision <= 26 {
|
||||||
|
info!("Running migration [revision 26 / 15-05-2024]: fix invites being incorrectly serialized with wrong enum tagging.");
|
||||||
|
|
||||||
|
auto_derived!(
|
||||||
|
pub enum OldInvite {
|
||||||
|
Server {
|
||||||
|
#[serde(rename = "_id")]
|
||||||
|
code: String,
|
||||||
|
server: String,
|
||||||
|
creator: String,
|
||||||
|
channel: String,
|
||||||
|
},
|
||||||
|
Group {
|
||||||
|
#[serde(rename = "_id")]
|
||||||
|
code: String,
|
||||||
|
creator: String,
|
||||||
|
channel: String,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
|
struct Outer {
|
||||||
|
_id: ObjectId,
|
||||||
|
#[serde(flatten)]
|
||||||
|
invite: OldInvite,
|
||||||
|
}
|
||||||
|
|
||||||
|
let invites = db
|
||||||
|
.db()
|
||||||
|
.collection::<Outer>("channel_invites")
|
||||||
|
.find(
|
||||||
|
doc! {
|
||||||
|
"type": { "$exists": false }
|
||||||
|
},
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("failed to find invites")
|
||||||
|
.filter_map(|s| async { s.ok() })
|
||||||
|
.collect::<Vec<Outer>>()
|
||||||
|
.await
|
||||||
|
.into_iter()
|
||||||
|
.map(|invite| match invite.invite {
|
||||||
|
OldInvite::Server {
|
||||||
|
code,
|
||||||
|
server,
|
||||||
|
creator,
|
||||||
|
channel,
|
||||||
|
} => Invite::Server {
|
||||||
|
code,
|
||||||
|
server,
|
||||||
|
creator,
|
||||||
|
channel,
|
||||||
|
},
|
||||||
|
OldInvite::Group {
|
||||||
|
code,
|
||||||
|
creator,
|
||||||
|
channel,
|
||||||
|
} => Invite::Group {
|
||||||
|
code,
|
||||||
|
creator,
|
||||||
|
channel,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.collect::<Vec<Invite>>();
|
||||||
|
|
||||||
|
db.db()
|
||||||
|
.collection("channel_invites")
|
||||||
|
.insert_many(invites, None)
|
||||||
|
.await
|
||||||
|
.expect("failed to insert corrected invite");
|
||||||
|
|
||||||
|
db.db()
|
||||||
|
.collection::<Outer>("channel_invites")
|
||||||
|
.delete_many(
|
||||||
|
doc! {
|
||||||
|
"type": { "$exists": false }
|
||||||
|
},
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("failed to find invites");
|
||||||
|
}
|
||||||
|
|
||||||
// Need to migrate fields on attachments, change `user_id`, `object_id`, etc to `parent`.
|
// Need to migrate fields on attachments, change `user_id`, `object_id`, etc to `parent`.
|
||||||
|
|
||||||
// Reminder to update LATEST_REVISION when adding new migrations.
|
// Reminder to update LATEST_REVISION when adding new migrations.
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ static ALPHABET: [char; 54] = [
|
|||||||
|
|
||||||
auto_derived!(
|
auto_derived!(
|
||||||
/// Invite
|
/// Invite
|
||||||
|
#[serde(tag = "type")]
|
||||||
pub enum Invite {
|
pub enum Invite {
|
||||||
/// Invite to a specific server channel
|
/// Invite to a specific server channel
|
||||||
Server {
|
Server {
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ impl User {
|
|||||||
db.fetch_user(
|
db.fetch_user(
|
||||||
&db.fetch_bot_by_token(token)
|
&db.fetch_bot_by_token(token)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_error!(InternalError))?
|
.map_err(|_| create_error!(InvalidSession))?
|
||||||
.id,
|
.id,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ impl AbstractUsers for MongoDb {
|
|||||||
.map_err(|_| create_database_error!("find_one", "sessions"))?
|
.map_err(|_| create_database_error!("find_one", "sessions"))?
|
||||||
.ok_or_else(|| create_error!(InvalidSession))?;
|
.ok_or_else(|| create_error!(InvalidSession))?;
|
||||||
|
|
||||||
self.fetch_user(&session.id).await
|
self.fetch_user(&session.user_id).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetch multiple users by their ids
|
/// Fetch multiple users by their ids
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-models"
|
name = "revolt-models"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
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>"]
|
||||||
@@ -19,8 +19,8 @@ default = ["serde", "partials", "rocket"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core
|
# Core
|
||||||
revolt-config = { version = "0.7.1", path = "../config" }
|
revolt-config = { version = "0.7.2", path = "../config" }
|
||||||
revolt-permissions = { version = "0.7.1", path = "../permissions" }
|
revolt-permissions = { version = "0.7.2", path = "../permissions" }
|
||||||
|
|
||||||
# Utility
|
# Utility
|
||||||
regex = "1"
|
regex = "1"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use super::{Channel, File, Server, User};
|
|||||||
|
|
||||||
auto_derived!(
|
auto_derived!(
|
||||||
/// Invite
|
/// Invite
|
||||||
|
#[serde(tag = "type")]
|
||||||
pub enum Invite {
|
pub enum Invite {
|
||||||
/// Invite to a specific server channel
|
/// Invite to a specific server channel
|
||||||
Server {
|
Server {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-permissions"
|
name = "revolt-permissions"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
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>"]
|
||||||
@@ -21,7 +21,7 @@ async-std = { version = "1.8.0", features = ["attributes"] }
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core
|
# Core
|
||||||
revolt-result = { version = "0.7.1", path = "../result" }
|
revolt-result = { version = "0.7.2", 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.7.1"
|
version = "0.7.2"
|
||||||
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.7.1"
|
version = "0.7.2"
|
||||||
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-delta"
|
name = "revolt-delta"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
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"
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ pub async fn authifier_config() -> AuthifierConfig {
|
|||||||
#[launch]
|
#[launch]
|
||||||
async fn rocket() -> _ {
|
async fn rocket() -> _ {
|
||||||
// Configure logging and environment
|
// Configure logging and environment
|
||||||
revolt_config::configure!();
|
revolt_config::configure!(api);
|
||||||
|
|
||||||
// Start web server
|
// Start web server
|
||||||
web().await
|
web().await
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ in pkgs.mkShell {
|
|||||||
pkgs.rustfmt
|
pkgs.rustfmt
|
||||||
pkgs.pkgconfig
|
pkgs.pkgconfig
|
||||||
pkgs.openssl.dev
|
pkgs.openssl.dev
|
||||||
|
|
||||||
|
# mdbook
|
||||||
|
pkgs.mdbook
|
||||||
];
|
];
|
||||||
|
|
||||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
book
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[book]
|
||||||
|
authors = []
|
||||||
|
language = "en"
|
||||||
|
multilingual = false
|
||||||
|
src = "src"
|
||||||
|
title = "Revolt Backend"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Summary
|
||||||
|
|
||||||
|
- [Introduction](./hello.md)
|
||||||
|
- [Project Structure]()
|
||||||
|
- [Testing]()
|
||||||
|
- [Writing a new database test]()
|
||||||
|
- [Writing a new API test]()
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Revolt Backend
|
||||||
|
|
||||||
|
Welcome to the developer documentation for the Revolt backend.
|
||||||
|
|
||||||
|
This is very much incomplete and needs more work!
|
||||||
Reference in new issue
Block a user