[package]
name = "pulsate"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
description = "Pulsate — a reverse-proxy gateway in one binary: TLS, caching, WAF, observability, admin API, and WASM plugins."
readme = "README.md"
homepage = "https://github.com/squaretick/pulsate"
documentation = "https://docs.rs/pulsate"
keywords = ["gateway", "reverse-proxy", "http", "proxy", "tls"]
categories = [
    "network-programming",
    "web-programming::http-server",
    "command-line-utilities",
]

# A shared `run()` lives in src/lib.rs. Both binaries are thin wrappers: the
# full name `pulsate` and the short alias `p8` (identical behavior).
[[bin]]
name = "pulsate"
path = "src/main.rs"

[[bin]]
name = "p8"
path = "src/bin/p8.rs"

[dependencies]
pulsate-core.workspace = true
pulsate-rt.workspace = true
pulsate-cli.workspace = true
clap.workspace = true
anyhow.workspace = true

[lints]
workspace = true

# --- Debian / Ubuntu package (cargo-deb) ---------------------------------------
[package.metadata.deb]
maintainer = "NAHSV Healthlinko <webmaster@squaretick.dev>"
copyright = "2026, NAHSV Healthlinko Private Limited"
section = "net"
priority = "optional"
extended-description = """\
Pulsate is a reverse-proxy gateway: automatic TLS, caching, a WAF, rate \
limiting, observability, a loopback admin API and dashboard, and a sandboxed \
WASM plugin host — in a single static binary configured by one file.\
"""
assets = [
    ["target/release/pulsate", "usr/bin/", "755"],
    ["packaging/pulsate.flow", "etc/pulsate/pulsate.flow", "644"],
    ["packaging/systemd/pulsate.service", "lib/systemd/system/pulsate.service", "644"],
    ["README.md", "usr/share/doc/pulsate/README.md", "644"],
]
conf-files = ["/etc/pulsate/pulsate.flow"]

# --- RPM package (cargo-generate-rpm) ------------------------------------------
[package.metadata.generate-rpm]
assets = [
    { source = "target/release/pulsate", dest = "/usr/bin/pulsate", mode = "755" },
    { source = "packaging/pulsate.flow", dest = "/etc/pulsate/pulsate.flow", mode = "644", config = true },
    { source = "packaging/systemd/pulsate.service", dest = "/lib/systemd/system/pulsate.service", mode = "644" },
    { source = "README.md", dest = "/usr/share/doc/pulsate/README.md", mode = "644", doc = true },
]

# --- cargo-binstall: fetch prebuilt release binaries instead of compiling ------
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/pulsate-v{ version }-{ target }.{ archive-suffix }"
pkg-fmt = "tgz"
bin-dir = "{ bin }{ binary-ext }"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"
