visa.buildfor.life keeps the immigration records of the foreigners B4L looks after. This first phase is the base the deadlines and extension packs build on (docs/PLAN.md, phases 2 to 7). - One Rust binary (axum 0.8, minijinja, sqlx on PostgreSQL) with its templates, static files and migrations compiled in. - Login through Kanidm (OpenID Connect with PKCE and a nonce, ES256), client visa-web, group visa; sessions in PostgreSQL keyed by the SHA-256 of the cookie. VISA_INSECURE_NO_LOGIN=1 for loopback development only. - Same-site check and form token on every POST; a CSP without inline script or style; security headers. - People: list with filter, page, create, edit, archive, restore. - Passports from the machine-readable zone with check digits (ICAO 9303 TD3); expiry warnings at 12 and 6 months. - Addresses in Thailand in the order Thai forms use, with the house master and the TM.30 receipt. - Append-only audit log of every view and change, with the names of the changed fields but never their values (PDPA); the Activity page. - Invented demo people (visa seed-demo, refused when login is on). - 40 tests: unit tests, pages with demo data, the forms, the audit log and the whole login against a fake OpenID provider. - CI: gitleaks over the history, fmt, clippy and the tests against PostgreSQL 18; the pre-commit secret scan.
25 lines
999 B
Bash
Executable File
25 lines
999 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# CI: install the given Rust toolchain (with clippy and rustfmt) through
|
|
# rustup and make it the default. Installs rustup and a C compiler first when
|
|
# the job image has none (ring compiles C).
|
|
# bash .gitea/scripts/rust-toolchain.sh 1.98.1
|
|
set -euo pipefail
|
|
tc=${1:?toolchain, e.g. 1.98.1}
|
|
need=()
|
|
command -v cc >/dev/null || need+=(gcc libc6-dev)
|
|
command -v curl >/dev/null || need+=(curl ca-certificates)
|
|
if [ ${#need[@]} -gt 0 ]; then
|
|
SUDO=$(command -v sudo || true)
|
|
$SUDO apt-get update -qq
|
|
$SUDO apt-get install -y -qq "${need[@]}"
|
|
fi
|
|
if ! command -v rustup >/dev/null && [ ! -x "$HOME/.cargo/bin/rustup" ]; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain none
|
|
fi
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
[ -n "${GITHUB_PATH:-}" ] && echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
rustup toolchain install "$tc" --profile minimal -c clippy -c rustfmt
|
|
rustup default "$tc"
|
|
rustc --version
|
|
cargo --version
|