v0.0.23: ETH display everywhere, local build, web UX fixes

Version: 0.0.22 → 0.0.23, SW cache wz-v3 → wz-v4

TUI:
- Own messages show ETH address (0x...) instead of fingerprint
- Received messages: async ETH cache lookup (resolve on first sight)
- /info shows Identity + Fingerprint
- Welcome message shows ETH address

Web:
- Header shows only ETH address (single element, click to copy)
- Own messages show ETH format
- Received messages resolve sender ETH via /v1/resolve/
- /peer 0x... resolves via /v1/resolve/ endpoint
- Click messages area → focuses text input

Client:
- register_bundle sends eth_address to server
- ETH↔fingerprint mapping stored on registration

Build:
- --local: build on current machine (auto-detect apt/dnf/pacman/brew)
- --local-ship: build locally + deploy to all servers
- --local-clean: build + clean cargo cache

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-29 08:50:31 +04:00
parent 2aa58a4319
commit ea04405199
9 changed files with 226 additions and 55 deletions

View File

@@ -384,6 +384,108 @@ do_logs() {
ssh "$host" "journalctl -u $PROD_SERVICE -f --no-pager"
}
# ---------------------------------------------------------------------------
# --local: Build locally on this machine (auto-detect package manager)
# ---------------------------------------------------------------------------
detect_pkg_manager() {
if command -v apt-get &>/dev/null; then echo "apt"
elif command -v dnf &>/dev/null; then echo "dnf"
elif command -v pacman &>/dev/null; then echo "pacman"
elif command -v brew &>/dev/null; then echo "brew"
else echo "unknown"; fi
}
do_local_deps() {
local pm
pm=$(detect_pkg_manager)
echo "[1/4] Installing dependencies ($pm)..."
case "$pm" in
apt)
sudo apt-get update -qq
sudo apt-get install -y -qq build-essential pkg-config libssl-dev curl >/dev/null 2>&1
;;
dnf)
sudo dnf install -y gcc gcc-c++ make pkg-config openssl-devel curl >/dev/null 2>&1
;;
pacman)
sudo pacman -Sy --noconfirm base-devel pkg-config openssl curl >/dev/null 2>&1
;;
brew)
brew install openssl pkg-config 2>/dev/null || true
;;
*)
echo "WARNING: Unknown package manager. Ensure build-essential, pkg-config, libssl-dev are installed."
;;
esac
# Ensure Rust is installed
if ! command -v cargo &>/dev/null; then
echo " Installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
source "$HOME/.cargo/env"
fi
# Ensure wasm-pack is installed
if ! command -v wasm-pack &>/dev/null; then
echo " Installing wasm-pack..."
cargo install wasm-pack 2>/dev/null || true
fi
# Ensure wasm target
rustup target add wasm32-unknown-unknown 2>/dev/null || true
}
do_local_build() {
local arch
arch=$(uname -m)
local os
os=$(uname -s | tr '[:upper:]' '[:lower:]')
local out_dir="target/${os}-${arch}"
echo "=== Local Build (${os}-${arch}) ==="
do_local_deps
echo "[2/4] Building WASM..."
wasm-pack build crates/warzone-wasm --target web --out-dir ../../wasm-pkg 2>&1 | tail -3
echo "[3/4] Building release binaries..."
cargo build --release --bin warzone-server --bin warzone-client 2>&1
echo "[4/4] Copying to ${out_dir}..."
mkdir -p "$out_dir"
cp target/release/warzone-server target/release/warzone-client "$out_dir/"
cp federation.example.json "$out_dir/" 2>/dev/null || true
# Clean cargo cache if requested
if [ "${CLEAN_CACHE:-}" = "1" ]; then
echo " Cleaning build cache..."
cargo clean 2>/dev/null || true
fi
echo ""
echo "=== Local Build Complete ==="
ls -lh "$out_dir"/warzone-*
echo ""
echo "Run:"
echo " $out_dir/warzone-server --bind 0.0.0.0:7700"
echo " $out_dir/warzone-client tui --server http://localhost:7700"
}
do_local_ship() {
do_local_build
echo ""
do_update_all
echo ""
do_status
echo ""
echo "========================================"
echo " LOCAL SHIP COMPLETE"
echo "========================================"
}
# ---------------------------------------------------------------------------
# --ship: Build + deploy to all servers + destroy VM (full pipeline)
# ---------------------------------------------------------------------------
@@ -453,18 +555,30 @@ case "${1:-}" in
--ship)
do_ship
;;
--local)
do_local_build
;;
--local-ship)
do_local_ship
;;
--local-clean)
CLEAN_CACHE=1 do_local_build
;;
--upload)
do_upload
;;
*)
echo "Usage: $0 <command> [args]"
echo ""
echo "One command:"
echo " --ship Build + deploy to all servers + destroy VM"
echo "Local build:"
echo " --local Build locally (auto-detect OS, install deps)"
echo " --local-ship Build locally + deploy to all servers"
echo " --local-clean Build locally + clean cargo cache after"
echo ""
echo "Build (Hetzner VM):"
echo "Remote build (Hetzner VM):"
echo " --ship Build on VM + deploy + destroy VM"
echo " --prepare Create VM, install deps, upload source"
echo " --build Build release binaries"
echo " --build Build release binaries on VM"
echo " --transfer Download binaries to $OUTPUT_DIR"
echo " --destroy Delete the build VM"
echo " --all prepare + build + transfer (VM persists)"