# Unlicense — cochranblock.org
# Contributors: Mattbusel (XFactor), GotEmCoach, KOVA, Claude Opus 4.6, SuperNinja, Composer 1.5, Google Gemini Pro 3

[package]
name = "cochranblock"
version = "0.10.0"
edition = "2024"
authors = ["Michael Cochran <mcochran@cochranblock.org>"]
description = "Zero-cloud website in a single Rust binary. 15MB on x86, 8.2MB on ARM. $10/month infrastructure. cargo install and run."
license = "Unlicense"
repository = "https://github.com/cochranblock/cochranblock"
homepage = "https://cochranblock.org"
documentation = "https://cochranblock.github.io/cochranblock/"
keywords = ["zero-cloud", "single-binary", "website", "rust-web", "axum"]
categories = ["web-programming::http-server"]
readme = "README.md"
include = [
    "build.rs",
    "src/**/*",
    "assets/**/*",
    "content/**/*",
    "Cargo.toml",
    "UNLICENSE",
    "README.md",
]

# tests = rough draft. exopack for quantifiable quality. Release strips both.
# admin = db, auth, sessions, crypto, dns, config. Default = static only.
# dev = developer routes (/dev/source, /dev/rules, etc). Default = off.
# approuter = register with approuter on startup. Release binary only; -test never gets approuter-client.
[features]
default = []
tests = ["exopack", "colored", "admin", "dev"]
admin = []
dev = []
approuter = ["dep:approuter-client"]

[lib]
name = "cochranblock"
path = "src/lib.rs"
crate-type = ["lib", "cdylib"]

# Server binary: serves cochranblock.org. With --features approuter registers with approuter.
# Without approuter feature: runs as installable offline app, opens browser.
[[bin]]
name = "cochranblock"
path = "src/bin/cochranblock.rs"

# Test binary: full. Tests + self-eval (screenshot). Never gets approuter-client.
[[bin]]
name = "cochranblock-test"
path = "src/bin/cochranblock-test.rs"
required-features = ["tests"]

[dependencies]
aes-gcm = "0.10"
argon2 = "0.5"
base64 = "0.21"
dirs = "5"
hkdf = "0.12"
axum = "0.7"
axum-extra = { version = "0.9", features = ["cookie"] }
tower-http = { version = "0.5", features = ["compression-gzip", "compression-deflate", "compression-zstd", "trace", "set-header"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
urlencoding = "2"
bincode = { version = "2", features = ["serde"] }
redb = "2"
zstd = "0.13"
include_packed = "0.1"
mime_guess = "2"
clap = { version = "4", features = ["derive"] }
thiserror = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-appender = "0.2"
chrono = { version = "0.4", features = ["serde"] }
chrono-tz = "0.9"
uuid = { version = "1", features = ["v4"] }
reqwest = { version = "0.12", features = ["blocking", "json", "cookies", "rustls-tls"], default-features = false }
sha2 = "0.10"
colored = { version = "2", optional = true }
tempfile = "3"
rand = "0.8"
time = "0.3"
exopack = { version = "0.2", optional = true, features = ["screenshot", "interface", "triple_sims", "devtools"] }
dotenvy = "0.15"
open = "5"
approuter-client = { version = "0.2", optional = true }
lettre = { version = "0.11", default-features = false, features = ["smtp-transport", "builder", "rustls-tls", "tokio1-rustls-tls"] }
axum-server = { version = "0.7", features = ["tls-rustls"] }
rustls = { version = "0.23", features = ["ring"] }
rcgen = "0.14"
# openssl removed — rustls handles all TLS. Zero C dependencies.

[build-dependencies]
include_packed = { version = "0.1", features = ["build"] }

[profile.release]
# Full P27 Diamond Rust Binary Architecture. Was size-Diamond (opt-level='s',
# lto=true). Now speed-Diamond for a request-serving binary where runtime
# dominates. Cross-crate inlining, generic dedup, maximum LLVM optimization.
# Compile time roughly 2-3x longer; runtime hot paths ~15-30% faster.
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
panic = "abort"
overflow-checks = false
debug = false
incremental = false