# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
name = "trojan"
version = "0.9.1"
authors = ["trojan-rust <164051043+trojan-rust@users.noreply.github.com>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A Rust implementation of the Trojan protocol"
homepage = "https://github.com/trojan-rust/trojan-rust"
documentation = "https://docs.rs/trojan"
readme = "README.md"
keywords = [
    "trojan",
    "proxy",
    "tls",
    "network",
]
categories = ["network-programming"]
license = "GPL-3.0-only"
repository = "https://github.com/trojan-rust/trojan-rust"
resolver = "2"

[features]
agent = [
    "cli",
    "dep:trojan-agent",
]
cert = [
    "cli",
    "dep:trojan-cert",
]
cli = [
    "trojan-auth/cli",
    "dep:clap",
    "dep:tokio",
]
default = [
    "cli",
    "cert",
    "sql-sqlite",
    "sql-mysql",
    "sql-postgres",
    "sql-tls-rustls",
    "agent",
]
sql-mysql = ["trojan-auth/sql-mysql"]
sql-postgres = ["trojan-auth/sql-postgres"]
sql-sqlite = ["trojan-auth/sql-sqlite"]
sql-tls-native = ["trojan-auth/sql-tls-native"]
sql-tls-rustls = ["trojan-auth/sql-tls-rustls"]
upgrade = [
    "cli",
    "dep:reqwest",
    "dep:serde",
    "dep:serde_json",
    "dep:self-replace",
    "dep:flate2",
    "dep:tar",
    "dep:sha2",
    "dep:hex",
    "dep:tokio-util",
    "dep:futures-util",
    "dep:tempfile",
    "dep:zip",
]

[lib]
name = "trojan"
path = "src/lib.rs"

[[bin]]
name = "trojan"
path = "src/main.rs"
required-features = ["cli"]

[dependencies.clap]
version = "4"
features = ["derive"]
optional = true

[dependencies.flate2]
version = "1"
optional = true

[dependencies.futures-util]
version = "0.3"
optional = true

[dependencies.hex]
version = "0.4"
optional = true

[dependencies.reqwest]
version = "0.12"
features = [
    "json",
    "stream",
    "rustls-tls",
]
optional = true
default-features = false

[dependencies.rustls]
version = "0.23"
features = [
    "aws_lc_rs",
    "logging",
    "std",
    "tls12",
]
default-features = false

[dependencies.self-replace]
version = "1"
optional = true

[dependencies.serde]
version = "1"
features = ["derive"]
optional = true

[dependencies.serde_json]
version = "1"
optional = true

[dependencies.sha2]
version = "0.10"
optional = true

[dependencies.tar]
version = "0.4"
optional = true

[dependencies.tempfile]
version = "3"
optional = true

[dependencies.tokio]
version = "1"
features = [
    "rt-multi-thread",
    "macros",
]
optional = true

[dependencies.tokio-util]
version = "0.7"
features = ["io"]
optional = true

[dependencies.trojan-agent]
version = "0.9.1"
optional = true

[dependencies.trojan-auth]
version = "0.9.1"

[dependencies.trojan-cert]
version = "0.9.1"
optional = true

[dependencies.trojan-client]
version = "0.9.1"

[dependencies.trojan-config]
version = "0.9.1"

[dependencies.trojan-core]
version = "0.9.1"

[dependencies.trojan-metrics]
version = "0.9.1"

[dependencies.trojan-proto]
version = "0.9.1"

[dependencies.trojan-relay]
version = "0.9.1"

[dependencies.trojan-server]
version = "0.9.1"

[target."cfg(windows)".dependencies.zip]
version = "8"
features = ["deflate"]
optional = true
default-features = false

[lints.clippy]
assertions_on_result_states = "warn"
cast_possible_truncation = "warn"
cast_possible_wrap = "warn"
cast_sign_loss = "warn"
error_impl_error = "warn"
exit = "warn"
or_fun_call = "warn"
ptr_as_ptr = "warn"
tests_outside_test_module = "warn"
undocumented_unsafe_blocks = "warn"

[lints.rust]
missing_debug_implementations = "warn"

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true
