[package]
name = "snow-scanner"
version = "1.0.0"
authors = ["William Desportes <williamdes@wdes.fr>"]
edition = "2021"
rust-version = "1.81.0"  # MSRV
description = "A program to scan internet and find scanners"
homepage = "https://github.com/wdes/snow-scanner/tree/v1.2.0-dev#readme"
repository = "https://github.com/wdes/snow-scanner"
readme = "README.md"
keywords = ["dns", "validator"]
categories = ["command-line-utilities"]
license = "MPL-2.0"
include = [
    "/src/**/*.rs",
    "/Cargo.toml",
    "/LICENSE",
]

[badges]
github = { repository = "security", branch = "master" }
is-it-maintained-issue-resolution = { repository = "security" }
is-it-maintained-open-issues = { repository = "security" }
maintenance = { status = "passively-maintained" }

# docker pull clux/muslrust:stable
#  docker run -v $PWD:/volume --rm -t clux/muslrust:stable cargo build --release
[[bin]]
name = "snow-scanner"
path = "src/main.rs"

[workspace]

members = [
    "src/worker"
]

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

[features]

# Enable unstable features, requires nightly
# Currently only used to enable rusts official ip support
unstable = []

[dependencies]
rocket_db_pools = { git = "https://github.com/rwf2/Rocket/", rev = "3bf9ef02d6e803fe9f753777f5a829dda6d2453d", default-features = false, features = ["diesel_mysql"] }
snow-scanner-worker = {path = "./src/worker"}
diesel.workspace = true
dns-ptr-resolver.workspace = true
hickory-resolver.workspace = true
uuid.workspace = true
rocket.workspace = true
rocket_ws.workspace = true
ws.workspace = true
chrono.workspace = true
serde.workspace = true
serde_json.workspace = true
cidr.workspace = true
weighted-rs.workspace = true

[workspace.dependencies]
# mariadb-dev on Alpine
# "mysqlclient-src" "mysql_backend"
diesel = { version = "^2", default-features = false, features = ["mysql", "chrono", "uuid"] }
ws = { package = "rocket_ws", version = "0.1.1" }

dns-ptr-resolver = {git = "https://github.com/wdes/dns-ptr-resolver.git"}
hickory-resolver = { version = "0.24.1", default-features = false, features = ["tokio-runtime", "dns-over-h3", "dns-over-https", "dns-over-quic"]}

rocket = { git = "https://github.com/rwf2/Rocket/", rev = "3bf9ef02d6e803fe9f753777f5a829dda6d2453d"}
rocket_ws = { git = "https://github.com/rwf2/Rocket/", rev = "3bf9ef02d6e803fe9f753777f5a829dda6d2453d"}
chrono = "0.4.38"
uuid = { version = "1.10.0", default-features = false, features = ["v7", "serde", "std"] }
cidr = "0.3.0"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
weighted-rs = "0.1.3"

[package.metadata.deb]
maintainer = "William Desportes <williamdes@wdes.fr>"
copyright = "2022-2025, William Desportes <williamdes@wdes.fr>"
license-file = ["../LICENSE"]
extended-description = """\
Find hidden IPs in the internet snow."""
depends = "$auto"
section = "rust"
priority = "optional"
assets = [
    { source = "README.md", dest = "usr/share/doc/snow-scanner/README", mode = "644"},
    { source = "../data/collections/*/*", dest = "usr/share/snow-scanner/data/collections", mode = "644"},
    { source = "../data/scanners/*", dest = "usr/share/snow-scanner/data/scanners", mode = "644"},
    { source = "target/release/snow-scanner", dest = "usr/bin/snow-scanner", mode = "777"},
    { source = "target/release/snow-scanner-worker", dest = "usr/bin/snow-scanner-worker", mode = "777"},
]

maintainer-scripts = "debian/"
systemd-units = [
    { unit-name = "snow-scanner", enable = true, start = false, restart-after-upgrade = true, stop-on-upgrade = true },
    { unit-name = "snow-scanner-worker", enable = true, start = false, restart-after-upgrade = true, stop-on-upgrade = true }
]

conf-files = [
    "/etc/snow-scanner/.env",
    "/etc/snow-scanner/worker.env"
]
