Skip to content

Commit

Permalink
feat: init crond crate
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Nov 27, 2024
1 parent b9ae333 commit acc4317
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"crates/core/*",
"crates/services/*",
"crates/bindings/*",
"crates/daemons/*",
]

[patch.crates-io]
Expand Down
11 changes: 9 additions & 2 deletions crates/core/database/src/models/users/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub static DISCRIMINATOR_SEARCH_SPACE: Lazy<HashSet<String>> = Lazy::new(|| {
.collect::<HashSet<String>>();

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));
}
Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 14 additions & 0 deletions crates/daemons/crond/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "crond"
version = "0.7.19"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <[email protected]>"]
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" }
3 changes: 3 additions & 0 deletions crates/daemons/crond/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

0 comments on commit acc4317

Please sign in to comment.