From acc4317246ad0410f1f7e3b274d5e1549d940ff8 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Wed, 27 Nov 2024 16:56:30 +0000 Subject: [PATCH] feat: init crond crate --- Cargo.lock | 8 ++++++++ Cargo.toml | 1 + crates/core/database/src/models/users/model.rs | 11 +++++++++-- crates/daemons/crond/Cargo.toml | 14 ++++++++++++++ crates/daemons/crond/src/main.rs | 3 +++ 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 crates/daemons/crond/Cargo.toml create mode 100644 crates/daemons/crond/src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 4b4641931..1d9cd243c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1573,6 +1573,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crond" +version = "0.7.19" +dependencies = [ + "revolt-database", + "revolt-files", +] + [[package]] name = "crossbeam-channel" version = "0.5.13" diff --git a/Cargo.toml b/Cargo.toml index 61f6fa514..b0e931867 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/core/*", "crates/services/*", "crates/bindings/*", + "crates/daemons/*", ] [patch.crates-io] diff --git a/crates/core/database/src/models/users/model.rs b/crates/core/database/src/models/users/model.rs index 9a250ad67..20286b160 100644 --- a/crates/core/database/src/models/users/model.rs +++ b/crates/core/database/src/models/users/model.rs @@ -152,7 +152,7 @@ pub static DISCRIMINATOR_SEARCH_SPACE: Lazy> = Lazy::new(|| { .collect::>(); for discrim in [ - 123, 1234, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, + 123, 1234, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 1488, ] { set.remove(&format!("{:0>4}", discrim)); } @@ -293,7 +293,14 @@ impl User { } // Ensure none of the following substrings show up in the username - const BLOCKED_SUBSTRINGS: &[&str] = &["```"]; + const BLOCKED_SUBSTRINGS: &[&str] = &[ + "```", + "discord.gg", + "rvlt.gg", + "guilded.gg", + "https://", + "http://", + ]; for substr in BLOCKED_SUBSTRINGS { if username_lowercase.contains(substr) { diff --git a/crates/daemons/crond/Cargo.toml b/crates/daemons/crond/Cargo.toml new file mode 100644 index 000000000..85ec4349a --- /dev/null +++ b/crates/daemons/crond/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "crond" +version = "0.7.19" +license = "AGPL-3.0-or-later" +authors = ["Paul Makles "] +edition = "2021" +description = "Revolt Daemon Service: Timed data clean up tasks" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +# Core +revolt-database = { version = "0.7.19", path = "../../core/database" } +revolt-files = { version = "0.7.19", path = "../../core/files" } diff --git a/crates/daemons/crond/src/main.rs b/crates/daemons/crond/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/crates/daemons/crond/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}