Skip to content

Commit

Permalink
feat: add SENTRY_DSN env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Aug 10, 2023
1 parent a0580c5 commit f5f7028
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 61 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions crates/bonfire/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-bonfire"
version = "0.6.5"
version = "0.6.6"
license = "AGPL-3.0-or-later"
edition = "2021"

Expand All @@ -25,7 +25,11 @@ serde = "1.0.136"
# async
futures = "0.3.21"
async-tungstenite = { version = "0.17.0", features = ["async-std-runtime"] }
async-std = { version = "1.8.0", features = ["tokio1", "tokio02", "attributes"] }
async-std = { version = "1.8.0", features = [
"tokio1",
"tokio02",
"attributes",
] }

# core
revolt-presence = { path = "../core/presence", features = [ "redis-is-patched" ] }
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
10 changes: 5 additions & 5 deletions crates/core/database/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-database"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <[email protected]>"]
Expand All @@ -22,10 +22,10 @@ default = ["mongodb", "async-std-runtime"]

[dependencies]
# Core
revolt-result = { version = "0.6.5", path = "../result" }
revolt-models = { version = "0.6.5", path = "../models" }
revolt-presence = { version = "0.6.5", path = "../presence" }
revolt-permissions = { version = "0.6.5", path = "../permissions", features = [
revolt-result = { version = "0.6.6", path = "../result" }
revolt-models = { version = "0.6.6", path = "../models" }
revolt-presence = { version = "0.6.6", path = "../presence" }
revolt-permissions = { version = "0.6.6", path = "../permissions", features = [
"serde",
"bson",
] }
Expand Down
4 changes: 2 additions & 2 deletions crates/core/models/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-models"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <[email protected]>"]
Expand All @@ -18,7 +18,7 @@ default = ["serde", "partials"]

[dependencies]
# Core
revolt-permissions = { version = "0.6.5", path = "../permissions" }
revolt-permissions = { version = "0.6.6", path = "../permissions" }

# Serialisation
indexmap = "1.9.3"
Expand Down
14 changes: 7 additions & 7 deletions crates/core/permissions/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[package]
name = "revolt-permissions"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <[email protected]>" ]
authors = ["Paul Makles <[email protected]>"]
description = "Revolt Backend: Permission Logic"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
bson = ["dep:bson"]
serde = [ "dep:serde" ]
schemas = [ "dep:schemars" ]
try-from-primitive = [ "dep:num_enum" ]
serde = ["dep:serde"]
schemas = ["dep:schemars"]
try-from-primitive = ["dep:num_enum"]


[dev-dependencies]
Expand All @@ -30,7 +30,7 @@ async-trait = "0.1.51"

# Serialisation
serde = { version = "1", features = ["derive"], optional = true }
bson = { version = "2.1.0", optional = true}
bson = { version = "2.1.0", optional = true }

# Spec Generation
schemars = { version = "0.8.8", optional = true }
schemars = { version = "0.8.8", optional = true }
4 changes: 2 additions & 2 deletions crates/core/presence/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "revolt-presence"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <[email protected]>" ]
authors = ["Paul Makles <[email protected]>"]
description = "Revolt Backend: User Presence"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
14 changes: 7 additions & 7 deletions crates/core/result/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "revolt-result"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <[email protected]>" ]
authors = ["Paul Makles <[email protected]>"]
description = "Revolt Backend: Result and Error types"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
serde = [ "dep:serde" ]
schemas = [ "dep:schemars" ]
rocket = [ "dep:rocket", "dep:serde_json" ]
okapi = [ "dep:revolt_rocket_okapi", "dep:revolt_okapi" ]
serde = ["dep:serde"]
schemas = ["dep:schemars"]
rocket = ["dep:rocket", "dep:serde_json"]
okapi = ["dep:revolt_rocket_okapi", "dep:revolt_okapi"]

default = [ "serde" ]
default = ["serde"]

[dependencies]
# Serialisation
Expand Down
25 changes: 17 additions & 8 deletions crates/delta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-delta"
version = "0.6.5"
version = "0.6.6"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <[email protected]>"]
edition = "2018"
Expand Down Expand Up @@ -38,29 +38,38 @@ futures = "0.3.8"
chrono = "0.4.15"
async-channel = "1.6.1"
reqwest = { version = "0.11.4", features = ["json"] }
async-std = { version = "1.8.0", features = ["tokio1", "tokio02", "attributes"] }
async-std = { version = "1.8.0", features = [
"tokio1",
"tokio02",
"attributes",
] }

# internal util
lettre = "0.10.0-alpha.4"

# web
rocket = { version = "0.5.0-rc.2", default-features = false, features = ["json"] }
rocket = { version = "0.5.0-rc.2", default-features = false, features = [
"json",
] }
rocket_empty = { version = "0.1.1", features = ["schema"] }
rocket_authifier = { version = "1.0.7" }
rocket_prometheus = "0.10.0-rc.3"

# spec generation
schemars = "0.8.8"
revolt_rocket_okapi = { version = "0.9.1", features = [ "swagger" ] }
revolt_rocket_okapi = { version = "0.9.1", features = ["swagger"] }

# quark
revolt-quark = { path = "../quark" }

# core
revolt-database = { path = "../core/database", features = [ "rocket-impl", "redis-is-patched" ] }
revolt-models = { path = "../core/models", features = [ "schemas", "validator" ] }
revolt-result = { path = "../core/result", features = [ "rocket", "okapi" ] }
revolt-permissions = { path = "../core/permissions", features = [ "schemas" ] }
revolt-database = { path = "../core/database", features = [
"rocket-impl",
"redis-is-patched",
] }
revolt-models = { path = "../core/models", features = ["schemas", "validator"] }
revolt-result = { path = "../core/result", features = ["rocket", "okapi"] }
revolt-permissions = { path = "../core/permissions", features = ["schemas"] }

[build-dependencies]
vergen = "7.5.0"
24 changes: 13 additions & 11 deletions crates/quark/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "revolt-quark"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
license = "AGPL-3.0-or-later"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
mongo = [ "mongodb" ]
mongo = ["mongodb"]
rocket_impl = [
"rocket",
"rocket_empty",
Expand All @@ -18,11 +18,11 @@ rocket_impl = [

"authifier/database-mongodb",
"authifier/rocket_impl",
"authifier/okapi_impl"
"authifier/okapi_impl",
]

test = [ "async-std", "mongo", "mongodb/async-std-runtime", "rocket_impl" ]
default = [ "test" ]
test = ["async-std", "mongo", "mongodb/async-std-runtime", "rocket_impl"]
default = ["test"]

[dependencies]
# Serialisation
Expand All @@ -39,7 +39,7 @@ bson = { version = "2.1.0", features = ["chrono-0_4"] }
# Spec Generation
schemars = "0.8.8"
revolt_okapi = "0.9.1"
revolt_rocket_okapi = { version = "0.9.1", features = [ "swagger" ] }
revolt_rocket_okapi = { version = "0.9.1", features = ["swagger"] }

# Databases
redis-kiss = { version = "0.1.4" }
Expand Down Expand Up @@ -81,18 +81,20 @@ web-push = "0.7.2"

# Implementations
rocket_http = { optional = true, version = "0.5.0-rc.2" }
rocket = { optional = true, version = "0.5.0-rc.2", default-features = false, features = ["json"] }
rocket_empty = { version = "0.1.1", optional = true, features = [ "schema" ] }
rocket = { optional = true, version = "0.5.0-rc.2", default-features = false, features = [
"json",
] }
rocket_empty = { version = "0.1.1", optional = true, features = ["schema"] }
rocket_cors = { optional = true, git = "https://github.com/lawliet89/rocket_cors", rev = "c17e8145baa4790319fdb6a473e465b960f55e7c" }

# Authifier
authifier = { version = "1.0.7", features = [ "async-std-runtime" ] }
authifier = { version = "1.0.7", features = ["async-std-runtime"] }

# Sentry
sentry = "0.25.0"

# Core
revolt-result = { path = "../core/result", features = [ "serde", "schemas" ] }
revolt-presence = { path = "../core/presence", features = [ "redis-is-patched" ] }
revolt-result = { path = "../core/result", features = ["serde", "schemas"] }
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
revolt-database = { path = "../core/database" }
revolt-models = { path = "../core/models" }
20 changes: 12 additions & 8 deletions crates/quark/src/util/log.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Configure logging and common Rust variables
pub fn setup_logging(release: &'static str) -> sentry::ClientInitGuard {
pub fn setup_logging(release: &'static str) -> Option<sentry::ClientInitGuard> {
dotenv::dotenv().ok();

if std::env::var("RUST_LOG").is_err() {
Expand All @@ -13,13 +13,17 @@ pub fn setup_logging(release: &'static str) -> sentry::ClientInitGuard {
pretty_env_logger::init();
info!("Starting {release}");

sentry::init((
"https://[email protected]/2",
sentry::ClientOptions {
release: Some(release.into()),
..Default::default()
},
))
if let Ok(dsn) = std::env::var("SENTRY_DSN") {
Some(sentry::init((
dsn,
sentry::ClientOptions {
release: Some(release.into()),
..Default::default()
},
)))
} else {
None
}
}

#[macro_export]
Expand Down

0 comments on commit f5f7028

Please sign in to comment.