Skip to content

Commit

Permalink
Minor cleanup (#846)
Browse files Browse the repository at this point in the history
* Remove dirs2 and atty

dirs2 was unused and atty is unmaintained and can be replaced
with std::io::IsTerminal

Also auto-formatted the manifest

* Cleanup deny

Several configs for crates not in the graph, constrain the targets to
realistic ones to not bother checking platforms that don't matter for
production

* Use std::io::IsTerminal instead of atty

* Fix compile errors when `instrument` feature is enabled
  • Loading branch information
Jake-Shadle authored Nov 3, 2023
1 parent 0a2b4e6 commit 0ee3ffe
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 23 deletions.
43 changes: 35 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,45 @@
members = [".", "./macros", "./agones"]

[workspace.dependencies]
kube = { version = "0.84.0", features = ["derive", "runtime", "rustls-tls", "client"], default-features = false }
kube = { version = "0.84.0", features = [
"derive",
"runtime",
"rustls-tls",
"client",
], default-features = false }
k8s-openapi = { version = "0.18.0", features = ["v1_25", "schemars"] }
tokio = { version = "1.32.0", features = ["rt-multi-thread", "fs", "signal", "test-util", "parking_lot", "tracing"] }
tokio = { version = "1.32.0", features = [
"rt-multi-thread",
"fs",
"signal",
"test-util",
"parking_lot",
"tracing",
] }
base64 = "0.21.0"
tracing = "0.1.37"
futures = "0.3.28"

[package]
name = "quilkin"
version = "0.8.0-dev"
authors = ["Mark Mandel <[email protected]>", "Ifeanyi Ubah <[email protected]>", "Erin Power <[email protected]>"]
authors = [
"Mark Mandel <[email protected]>",
"Ifeanyi Ubah <[email protected]>",
"Erin Power <[email protected]>",
]
license = "Apache-2.0"
description = "Quilkin is a non-transparent UDP proxy specifically designed for use with large scale multiplayer dedicated game server deployments, to ensure security, access control, telemetry data, metrics and more."
homepage = "https://github.com/googleforgames/quilkin"
repository = "https://github.com/googleforgames/quilkin"
readme = "README.md"
keywords = ["proxy", "game-server", "game-development", "networking", "multiplayer"]
keywords = [
"proxy",
"game-server",
"game-development",
"networking",
"multiplayer",
]
categories = ["game-development", "network-programming"]
edition = "2021"
exclude = ["docs", "build", "examples", "image"]
Expand All @@ -58,7 +80,6 @@ cached = "0.46.0"
chrono = "0.4.31"
clap = { version = "4.4.6", features = ["cargo", "derive", "env"] }
dashmap = { version = "5.5.3", features = ["serde"] }
dirs2 = "3.0.1"
either = "1.9.0"
enum-map = "2.6.3"
eyre = "0.6.8"
Expand Down Expand Up @@ -98,10 +119,13 @@ url = { version = "2.4.1", features = ["serde"] }
uuid = { version = "1.4.1", default-features = false, features = ["v4"] }
lasso = { version = "0.7.2", features = ["multi-threaded"] }
kube.workspace = true
trust-dns-resolver = { version = "0.23.0", features = ["tokio", "tokio-rustls", "dns-over-https-rustls"] }
trust-dns-resolver = { version = "0.23.0", features = [
"tokio",
"tokio-rustls",
"dns-over-https-rustls",
] }
async-trait = "0.1.73"
nom = "7.1.3"
atty = "0.2.14"
strum = "0.25.0"
strum_macros = "0.25.2"

Expand All @@ -118,7 +142,10 @@ tempfile = "3.8.0"
rand = "0.8.5"

[build-dependencies]
tonic-build = { version = "0.10.2", default_features = false, features = ["transport", "prost"] }
tonic-build = { version = "0.10.2", default_features = false, features = [
"transport",
"prost",
] }
prost-build = "0.12.1"
built = { version = "0.7.0", features = ["git2"] }
protobuf-src = { version = "1.1.0", optional = true }
Expand Down
19 changes: 9 additions & 10 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
targets = [
{ triple = "x86_64-unknown-linux-gnu" },
{ triple = "x86_64-unknown-linux-musl" },
{ triple = "aarch64-unknown-linux-gnu" },
{ triple = "aarch64-unknown-linux-musl" },
]

[advisories]
ignore = [
# time 0.1 vulnerability, we don't use any affected APIs
"RUSTSEC-2020-0071"
]
ignore = []

# This section is considered when running `cargo deny check licenses`
# More documentation for the licenses section can be found here:
Expand All @@ -30,14 +33,10 @@ default = "allow"
exceptions = [
# Each entry is the crate and version constraint, and its specific allow
# list
{ name ="webpki-roots", version = "0.25.0", allow = ["MPL-2.0"] },
{ name ="webpki-roots", version = "0.23.0", allow = ["MPL-2.0"] },
{ name ="option-ext", version = "0.2.0", allow = ["MPL-2.0"] }
{ name = "webpki-roots", version = "0.25.0", allow = ["MPL-2.0"] },
]

[[licenses.clarify]]
name = "ring"
expression = "MIT AND ISC AND OpenSSL"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
3 changes: 2 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ impl Cli {

match self.log_format {
LogFormats::Auto => {
if atty::isnt(atty::Stream::Stdout) {
use std::io::IsTerminal;
if !std::io::stdout().is_terminal() {
subscriber.json().init();
} else {
subscriber.init();
Expand Down
4 changes: 2 additions & 2 deletions src/filters/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ impl Drop {

#[async_trait::async_trait]
impl Filter for Drop {
#[cfg_attr(feature = "instrument", tracing::instrument(skip(self, ctx)))]
#[cfg_attr(feature = "instrument", tracing::instrument(skip_all))]
async fn read(&self, _: &mut ReadContext) -> Result<(), FilterError> {
Err(FilterError::new("intentionally dropped"))
}

#[cfg_attr(feature = "instrument", tracing::instrument(skip(self, ctx)))]
#[cfg_attr(feature = "instrument", tracing::instrument(skip_all))]
async fn write(&self, _: &mut WriteContext) -> Result<(), FilterError> {
Err(FilterError::new("intentionally dropped"))
}
Expand Down
4 changes: 2 additions & 2 deletions src/filters/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ impl Pass {

#[async_trait::async_trait]
impl Filter for Pass {
#[cfg_attr(feature = "instrument", tracing::instrument(skip(self, ctx)))]
#[cfg_attr(feature = "instrument", tracing::instrument(skip_all))]
async fn read(&self, _: &mut ReadContext) -> Result<(), FilterError> {
Ok(())
}

#[cfg_attr(feature = "instrument", tracing::instrument(skip(self, ctx)))]
#[cfg_attr(feature = "instrument", tracing::instrument(skip_all))]
async fn write(&self, _: &mut WriteContext) -> Result<(), FilterError> {
Ok(())
}
Expand Down

0 comments on commit 0ee3ffe

Please sign in to comment.