-
-
Notifications
You must be signed in to change notification settings - Fork 303
/
Copy pathCargo.toml
124 lines (111 loc) · 3.77 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
[package]
name = "ninja"
version = "0.9.37"
edition = "2021"
description = "Reverse engineered ChatGPT proxy"
license = "GPL3.0"
homepage = "https://github.com/gngpp/ninja"
repository = "https://github.com/gngpp/ninja.git"
readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.75"
clap = { version = "4.4.3", features = ["derive", "env"] }
serde = {version = "1.0.188", features = ["derive"] }
openai = { path = "./crates/openai" }
mitm = { path = "./crates/mitm", optional = true }
cidr = "0.2.2"
toml = "0.8.0"
url = "2.4.1"
tokio = { version = "1.35.1", default-features = false, features = ["rt"], optional = true }
serde_json = { version = "1.0.108", optional = true }
inquire = { version = "0.6.2", optional = true }
colored_json = { version = "4.0.0", optional = true }
indicatif = { version = "0.17.7", optional = true }
json_to_table = { version = "0.7.0", optional = true }
tabled = { version = "0.12.2", optional = true }
self_update = { path = "./crates/self_update", default-features = false, features = ["archive-tar", "compression-flate2"] }
reqwest = { package = "reqwest-impersonate", version ="0.11.49", default-features = false, features = ["impersonate"] }
# self update
zip = { version = "0.6", default-features = false, features = ["time"], optional = true }
tempfile = "3"
semver = "1.0"
# allocator
tcmalloc = { version = "0.3.0", optional = true }
snmalloc-rs = { version = "0.3.4", optional = true }
rpmalloc = { version = "0.2.2", optional = true }
jemallocator = { package = "tikv-jemallocator", version = "0.5.4", optional = true }
mimalloc = { version = "0.1.39", default-features = false, optional = true }
[target.'cfg(target_family = "unix")'.dependencies]
daemonize = "0.5.0"
nix = { version = "0.27.1", features = ["signal", "user", "ptrace"]}
[target.'cfg(target_os = "linux")'.dependencies]
sysctl = "0.5.4"
[dev-dependencies]
futures-util = "0.3.28"
serde_json = "1.0.107"
tokio = { version = "1.35.1", default-features = false, features = ["rt"] }
reqwest = { package = "reqwest-impersonate", version ="0.11.49", default-features = false, features = [
"boring-tls", "impersonate","json", "cookies", "stream", "multipart", "socks", "blocking"
] }
base64 = "0.21.4"
viuer = "0.6.2"
hex = "0.4.3"
sha2 = "0.10.8"
env_logger = "0.10.0"
csv = "1.3.0"
scraper = "0.18.1"
regex = "1.10.2"
redis = { version = "0.23.3", features = ["tokio-comp", "tokio-rustls-comp"]}
redis-macros = { version = "0.2.1"}
openai = { path = "./crates/openai" }
[features]
default = ["serve", "mitm", "self_update"]
self_update = ["dep:serde_json"]
mitm = ["openai/preauth", "dep:mitm"]
terminal = [
"openai/api",
"dep:tokio",
"dep:serde_json",
"dep:inquire",
"dep:colored_json",
"dep:indicatif",
"dep:json_to_table",
"dep:tabled"
]
serve = ["limit"]
limit = ["openai/limit", "openai/serve"]
# Enable jemalloc for binaries
jemalloc = ["jemallocator"]
# Enable bundled tcmalloc
tcmalloc = ["tcmalloc/bundled"]
# Enable snmalloc for binaries
snmalloc = ["snmalloc-rs"]
# Enable bundled rpmalloc
rpmalloc = ["dep:rpmalloc"]
# Enable mimalloc for binaries
mimalloc = ["dep:mimalloc"]
[[bin]]
name = "ninja"
path = "src/main.rs"
[[example]]
name = "chatgpt"
required-features = ["openai/api"]
[profile.release]
lto = true
opt-level = 'z'
codegen-units = 1
strip = true
panic = "abort"
[package.metadata.deb]
maintainer = "gngpp <gngppz@gmail.com>"
copyright = "2023, gngpp <gngppz@gmail.com>"
license-file = ["LICENSE", "4"]
extended-description = "Reverse engineered ChatGPT proxy (bypass Cloudflare 403 Access Denied)"
depends = "$auto"
section = "utility"
priority = "optional"
assets = [
["target/release/ninja", "usr/bin/ninja", "755"],
["README.md", "usr/share/doc/ninja/README", "644"],
]