[control] Clippy clean for the T4 code; CLAUDE.md: the deploy folders and the Linux test command in Docker; the Docker smoke turns off Git Bash's path rewriting and removes its volume
This commit is contained in:
@@ -14,10 +14,13 @@ tests/diff same requests against Ianitor and Caddy, responses compared.
|
|||||||
tests/support shared test fixtures (test CA, upstreams, mock Authelia, clients); test-only.
|
tests/support shared test fixtures (test CA, upstreams, mock Authelia, clients); test-only.
|
||||||
tests/fuzz cargo-fuzz targets.
|
tests/fuzz cargo-fuzz targets.
|
||||||
deploy/nixos NixOS module + VM tests.
|
deploy/nixos NixOS module + VM tests.
|
||||||
|
deploy/docker the image (edge + control), compose file, the Linux CI image (target ci). deploy/linux: installer,
|
||||||
|
systemd units. deploy/windows: Windows Server installer (Caddy mode). docs/deploy/anywhere.md.
|
||||||
scripts the release's version check. Releases (notes, screenshots): docs/release.md.
|
scripts the release's version check. Releases (notes, screenshots): docs/release.md.
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
cargo test --workspace # quote test counts per crate; an exit code alone is not green
|
cargo test --workspace # quote test counts per crate; an exit code alone is not green
|
||||||
|
docker build --load -f deploy/docker/Dockerfile --target ci -t ianitor-ci . && docker run --rm --memory 6g ianitor-ci cargo test --workspace --locked -j 2 # Linux, all suites
|
||||||
cargo run -p ianitor-control -- --dev
|
cargo run -p ianitor-control -- --dev
|
||||||
pnpm --filter web dev # 127.0.0.1 only, never --host
|
pnpm --filter web dev # 127.0.0.1 only, never --host
|
||||||
node apps/web/scripts/shots.mjs # the release's screenshots (demo data, headless Edge) -> target/aula (docs/release.md)
|
node apps/web/scripts/shots.mjs # the release's screenshots (demo data, headless Edge) -> target/aula (docs/release.md)
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ use crate::util::{
|
|||||||
write_json,
|
write_json,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// What a user asked for.
|
/// What a user asked for. Built once per request; boxing the host body buys nothing.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
#[allow(clippy::large_enum_variant)]
|
||||||
pub enum Change {
|
pub enum Change {
|
||||||
Put { spec: HostSpec, create: bool },
|
Put { spec: HostSpec, create: bool },
|
||||||
ShareLinks { hostname: String, on: bool },
|
ShareLinks { hostname: String, on: bool },
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
//! (a preview token is hostile: it must not be able to publish this machine's admin ports),
|
//! (a preview token is hostile: it must not be able to publish this machine's admin ports),
|
||||||
//! and the sweeper that closes expired previews.
|
//! and the sweeper that closes expired previews.
|
||||||
|
|
||||||
|
// A refusal is built once per failed request; boxing it buys nothing (as in `engine`).
|
||||||
|
#![allow(clippy::result_large_err)]
|
||||||
|
|
||||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
@@ -95,7 +98,10 @@ fn parse_entry(e: &str) -> Option<Allowed> {
|
|||||||
ports,
|
ports,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
plain(&name).then(|| Allowed {
|
if !plain(&name) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(Allowed {
|
||||||
target: Target::Name(name),
|
target: Target::Name(name),
|
||||||
ports,
|
ports,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ use serde_json::{Value, json};
|
|||||||
const DOMAIN: &str = "pv.example.test";
|
const DOMAIN: &str = "pv.example.test";
|
||||||
|
|
||||||
struct Ctl {
|
struct Ctl {
|
||||||
dir: TempDir,
|
_dir: TempDir,
|
||||||
api: SocketAddr,
|
api: SocketAddr,
|
||||||
admin: String,
|
admin: String,
|
||||||
preview: String,
|
preview: String,
|
||||||
@@ -112,7 +112,7 @@ sweep_secs = 1
|
|||||||
"control did not listen"
|
"control did not listen"
|
||||||
);
|
);
|
||||||
Ctl {
|
Ctl {
|
||||||
dir,
|
_dir: dir,
|
||||||
api,
|
api,
|
||||||
admin,
|
admin,
|
||||||
preview,
|
preview,
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
#
|
#
|
||||||
# scripts/smoke-docker.sh <image> <ianitor-control binary for the offline root> <work dir>
|
# scripts/smoke-docker.sh <image> <ianitor-control binary for the offline root> <work dir>
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
# Git Bash on Windows rewrites /paths in arguments and the environment of Windows programs
|
||||||
|
# (docker.exe); the paths here are the container's.
|
||||||
|
export MSYS_NO_PATHCONV=1 MSYS2_ENV_CONV_EXCL='*'
|
||||||
|
|
||||||
IMAGE=$1 CTL=$2 WORK=$3
|
IMAGE=$1 CTL=$2 WORK=$3
|
||||||
REPO=$(cd "$(dirname "$0")/.." && pwd)
|
REPO=$(cd "$(dirname "$0")/.." && pwd)
|
||||||
@@ -24,6 +27,7 @@ fail() { echo "FAILED: $*" >&2; exit 1; }
|
|||||||
cleanup() {
|
cleanup() {
|
||||||
"${DC[@]}" down -v --remove-orphans >/dev/null 2>&1 || true
|
"${DC[@]}" down -v --remove-orphans >/dev/null 2>&1 || true
|
||||||
docker rm -f $P-app >/dev/null 2>&1 || true
|
docker rm -f $P-app >/dev/null 2>&1 || true
|
||||||
|
docker volume rm ${P}_state >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
[ ! -e "$WORK" ] || fail "$WORK exists; give a new folder"
|
[ ! -e "$WORK" ] || fail "$WORK exists; give a new folder"
|
||||||
|
|||||||
Reference in New Issue
Block a user