Security (Desktop Wallet): - Implement BIP39 mnemonic generation with cryptographic RNG - Add Argon2id password-based key derivation (64MB, 3 iterations) - Add ChaCha20-Poly1305 authenticated encryption for seed storage - Add mnemonic auto-clear (60s timeout) and clipboard auto-clear (30s) - Add sanitized error logging to prevent credential leaks - Strengthen CSP with object-src, base-uri, form-action, frame-ancestors - Clear sensitive state on component unmount Explorer (Gas Estimator): - Add Gas Estimation page with from/to/amount/data inputs - Add bech32 address validation (synor1/tsynor1 prefix) - Add BigInt-based amount parsing to avoid floating point errors - Add production guard for mock mode (cannot enable in prod builds) Monitoring (30-day Testnet): - Add Prometheus config with 30-day retention - Add comprehensive alert rules for node health, consensus, network, mempool - Add Alertmanager with severity-based routing and inhibition rules - Add Grafana with auto-provisioned datasource and dashboard - Add Synor testnet dashboard with uptime SLA tracking Docker: - Update docker-compose.testnet.yml with monitoring profile - Fix node-exporter for macOS Docker Desktop compatibility - Change Grafana port to 3001 to avoid conflict
104 lines
2.4 KiB
Docker
104 lines
2.4 KiB
Docker
# Dockerfile for building Synor Desktop Wallet
|
|
# Multi-stage build: Frontend (Node) + Backend (Rust/Tauri)
|
|
|
|
# ==============================================================================
|
|
# Stage 1: Build Frontend
|
|
# ==============================================================================
|
|
FROM node:20-bookworm AS frontend-builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install pnpm
|
|
RUN npm install -g pnpm
|
|
|
|
# Copy package files
|
|
COPY package.json pnpm-lock.yaml* ./
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile || pnpm install
|
|
|
|
# Copy source files
|
|
COPY . .
|
|
|
|
# Build frontend
|
|
RUN pnpm build
|
|
|
|
# ==============================================================================
|
|
# Stage 2: Build Tauri Backend
|
|
# ==============================================================================
|
|
FROM rust:1.85-bookworm AS backend-builder
|
|
|
|
# Install Tauri build dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
build-essential \
|
|
curl \
|
|
wget \
|
|
file \
|
|
libssl-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
cmake \
|
|
clang \
|
|
libclang-dev \
|
|
pkg-config \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy Rust workspace files from root
|
|
COPY --from=frontend-builder /app/dist ./dist
|
|
|
|
# Copy Tauri source
|
|
COPY src-tauri ./src-tauri
|
|
|
|
# Copy monorepo crates (needed for local dependencies)
|
|
# Note: In CI/CD, this would be handled differently
|
|
COPY ../../../crates ./crates 2>/dev/null || true
|
|
|
|
WORKDIR /app/src-tauri
|
|
|
|
# Build release binary
|
|
RUN cargo build --release
|
|
|
|
# ==============================================================================
|
|
# Stage 3: Development environment
|
|
# ==============================================================================
|
|
FROM node:20-bookworm AS development
|
|
|
|
# Install Rust
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
# Install Tauri dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
build-essential \
|
|
curl \
|
|
wget \
|
|
file \
|
|
libssl-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
cmake \
|
|
clang \
|
|
libclang-dev \
|
|
pkg-config \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install pnpm and Tauri CLI
|
|
RUN npm install -g pnpm
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy everything
|
|
COPY . .
|
|
|
|
# Install dependencies
|
|
RUN pnpm install
|
|
|
|
# Install Tauri CLI globally
|
|
RUN cargo install tauri-cli --version "^2.0.0"
|
|
|
|
# Default command for development
|
|
CMD ["pnpm", "tauri", "dev"]
|