Deploy / deploy (push) Failing after 3s
Replaces the free-string, direct-KV-mutate state model in answers.rs
with a proper event log (events/store.rs, JetStream-backed, CAS via
expected_last_subject_sequence) and three pure state machines
(aggregates/{applicant,subscriber,project}.rs). Closes a real
lost-update race in the old transition_answer (concurrent decisions on
the same item could both win, publishing contradictory events). KV
buckets become best-effort read-model projections, not the source of
truth. Content-declared transition targets are now validated at
load/reload time against the real compiled transition tables, not
accepted as arbitrary strings.
Buckets renamed to describe their content, not their relation to the
app (portal_applicants -> applicants, etc); "inquiry" folded into a
richer "project" concept.
ResourceSpec generalized beyond a single KV bucket: Kv | GiteaStarred |
GiteaOrgRepos | Url sources, with an optional jq filter (via the jaq
crate) to shape live data for the frontend. Url source is SSRF-guarded
(https-only, rejects loopback/private/link-local, real DNS resolve).
New headless question_lint binary (validates content against compiled
transition tables with no NATS/OIDC/server involved) and a one-time
backfill_events binary (dry-run by default) for migrating existing KV
data onto the new event log.
Questions get an optional `responsible` contact plus a lightweight
"report this question" action.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
135 lines
3.7 KiB
TOML
135 lines
3.7 KiB
TOML
[package]
|
|
name = "portal"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[dependencies]
|
|
leptos = { version = "0.8" }
|
|
leptos_meta = { version = "0.8" }
|
|
leptos_router = { version = "0.8" }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
|
|
# --- server only ---
|
|
leptos_axum = { version = "0.8", optional = true }
|
|
axum = { version = "0.8", features = ["multipart"], optional = true }
|
|
aws-sdk-s3 = { version = "1", optional = true }
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal"], optional = true }
|
|
tower = { version = "0.5", optional = true }
|
|
tower-http = { version = "0.6", features = ["fs"], optional = true }
|
|
tower-sessions = { version = "0.14", optional = true }
|
|
async-nats = { version = "0.38", optional = true }
|
|
arc-swap = { version = "1", optional = true }
|
|
url = { version = "2", optional = true }
|
|
serde_yaml = { version = "0.9", optional = true }
|
|
sha2 = { version = "0.10", optional = true }
|
|
openidconnect = { version = "4", optional = true }
|
|
# For pulling the `groups` custom claim out of the already-verified ID
|
|
# token's raw JWT payload - see server/oidc.rs::extract_groups_claim.
|
|
base64 = { version = "0.22", optional = true }
|
|
chrono = { version = "0.4", features = ["serde"], optional = true }
|
|
uuid = { version = "1", features = ["v4", "serde"], optional = true }
|
|
dotenvy = { version = "0.15", optional = true }
|
|
anyhow = { version = "1", optional = true }
|
|
futures = { version = "0.3", optional = true }
|
|
tracing = { version = "0.1", optional = true }
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
|
|
# jq-filter evaluation for ResourceSource's optional `jq` field
|
|
# (src/resource.rs) - pure Rust, no shell-out to a `jq` binary.
|
|
jaq-core = { version = "3", optional = true }
|
|
jaq-std = { version = "3", optional = true }
|
|
jaq-json = { version = "2", features = ["sync"], optional = true }
|
|
|
|
# --- browser only ---
|
|
wasm-bindgen = { version = "0.2", optional = true }
|
|
wasm-bindgen-futures = { version = "0.4", optional = true }
|
|
js-sys = { version = "0.3", optional = true }
|
|
console_error_panic_hook = { version = "0.1", optional = true }
|
|
web-sys = { version = "0.3", features = [
|
|
"Blob",
|
|
"File",
|
|
"FileList",
|
|
"FormData",
|
|
"HtmlInputElement",
|
|
"Request",
|
|
"RequestInit",
|
|
"Response",
|
|
"Window",
|
|
], optional = true }
|
|
|
|
[features]
|
|
default = []
|
|
hydrate = [
|
|
"leptos/hydrate",
|
|
"dep:wasm-bindgen",
|
|
"dep:wasm-bindgen-futures",
|
|
"dep:js-sys",
|
|
"dep:console_error_panic_hook",
|
|
"dep:web-sys",
|
|
]
|
|
ssr = [
|
|
"leptos/ssr",
|
|
"leptos_meta/ssr",
|
|
"leptos_router/ssr",
|
|
"dep:leptos_axum",
|
|
"dep:axum",
|
|
"dep:aws-sdk-s3",
|
|
"dep:tokio",
|
|
"dep:tower",
|
|
"dep:tower-http",
|
|
"dep:tower-sessions",
|
|
"dep:async-nats",
|
|
"dep:arc-swap",
|
|
"dep:url",
|
|
"dep:serde_yaml",
|
|
"dep:sha2",
|
|
"dep:openidconnect",
|
|
"dep:base64",
|
|
"dep:chrono",
|
|
"dep:uuid",
|
|
"dep:dotenvy",
|
|
"dep:anyhow",
|
|
"dep:futures",
|
|
"dep:tracing",
|
|
"dep:tracing-subscriber",
|
|
"dep:jaq-core",
|
|
"dep:jaq-std",
|
|
"dep:jaq-json",
|
|
]
|
|
|
|
[dev-dependencies]
|
|
proptest = "1"
|
|
|
|
[[bin]]
|
|
name = "question_lint"
|
|
path = "src/bin/question_lint.rs"
|
|
required-features = ["ssr"]
|
|
|
|
[[bin]]
|
|
name = "backfill_events"
|
|
path = "src/bin/backfill_events.rs"
|
|
required-features = ["ssr"]
|
|
|
|
[profile.wasm-release]
|
|
inherits = "release"
|
|
opt-level = 'z'
|
|
lto = true
|
|
codegen-units = 1
|
|
|
|
[package.metadata.leptos]
|
|
output-name = "portal"
|
|
site-root = "target/site"
|
|
site-pkg-dir = "pkg"
|
|
style-file = "style/main.css"
|
|
assets-dir = "public"
|
|
site-addr = "127.0.0.1:3010"
|
|
reload-port = 3011
|
|
bin-features = ["ssr"]
|
|
bin-default-features = false
|
|
lib-features = ["hydrate"]
|
|
lib-default-features = false
|
|
lib-profile-release = "wasm-release"
|