Skip to content

feat: embedded WireGuard, password protection, remote services & public settings#33

Open
dviejokfs wants to merge 10 commits intomainfrom
feat/embedded-wireguard
Open

feat: embedded WireGuard, password protection, remote services & public settings#33
dviejokfs wants to merge 10 commits intomainfrom
feat/embedded-wireguard

Conversation

@dviejokfs
Copy link
Contributor

@dviejokfs dviejokfs commented Mar 12, 2026

Summary

  • Embedded userspace WireGuard via defguard/boringtun — eliminates external wireguard-tools dependency for relay-mode worker joins
  • Cookie-based password protection for environments — HMAC-signed cookies, argon2 password hashing, HTML password form served by the proxy; configurable via environment settings API with automatic cookie invalidation on password change
  • Public settings endpoint and frontend config — exposes non-sensitive server settings (e.g., demo mode flag) and hides the demo button when disabled
  • Remote managed service support on worker nodes — allows provisioning databases and services on remote worker nodes via the agent HTTP API, with Docker volume management and port mapping

Commits

  • b402a9b docs(changelog): add embedded WireGuard entry
  • b823576 feat(config,web): add public settings endpoint and hide demo button when disabled
  • 9a4eaf2 feat(proxy): add cookie-based password protection for environments
  • 8839641 feat(agent,providers): add remote managed service support on worker nodes

Test plan

  • Verify WireGuard relay join still works with embedded boringtun (no external wg CLI)
  • Test password protection: set password on environment, verify form appears, verify correct password sets cookie, verify cookie persists across requests
  • Test password removal: disable password protection, verify cookie is no longer required
  • Test public settings endpoint returns expected fields without auth
  • Test remote service creation on worker node via agent API
  • Run cargo test --lib -p temps-proxy -p temps-agent -p temps-providers -p temps-environments

Replace shell-out to `wg` and `ip` CLI tools with embedded Rust
implementations:

- Key generation: x25519-dalek (pure Rust, no `wg genkey` needed)
- WireGuard protocol: defguard_wireguard_rs wrapping boringtun
- Interface management: defguard API (create, configure, peer mgmt)
- IP assignment: handled by InterfaceConfiguration.addresses

This eliminates the `wireguard-tools` system package dependency
entirely. The temps binary is now fully self-contained for WireGuard
mesh networking.

Public API unchanged — WireGuardManager, WireGuardPeer, WireGuardKeypair
retain the same signatures. join.rs needed no modifications.

New tests: keypair generation validity, uniqueness, check_available.
…hen disabled

- Add GET /settings/public unauthenticated endpoint returning only
  non-sensitive feature flags (demo_enabled)
- Login page fetches public settings and conditionally renders the
  "Try Demo" section only when demo mode is enabled
Add password wall that intercepts requests at the proxy layer when an
environment has password protection enabled. Visitors see an HTML form,
submit the password, and receive an HMAC-signed cookie (7-day expiry)
that lets subsequent requests pass through. Changing the password
automatically invalidates all existing cookies.

- PasswordProtectionConfig in SecurityConfig (deployment_config)
- Argon2 hashing in environment_service
- password_wall module: HMAC cookie creation/validation, HTML form
- Proxy request_filter interception with POST /_temps/password-verify
- Password protection toggle in environment settings UI
@dviejokfs dviejokfs changed the title feat(wireguard): embed userspace WireGuard via defguard/boringtun feat: embedded WireGuard, password protection, remote services & public settings Mar 12, 2026
…ig on save

- Fix password form not showing error on wrong password by using
  server-side template rendering instead of client-side JS URL check
- Preserve existing password_protection when security config is updated
  to prevent password being wiped on unrelated settings changes
- Redesign password wall with project/environment context badges,
  shield icon, refined dark aesthetic, and proper error alert styling
- Add XSS protection via html_escape for injected project/env names
Rewrite max_tokens → max_completion_tokens for all OpenAI models and
strip unsupported sampling parameters (temperature, top_p,
frequency_penalty, presence_penalty) for o-series reasoning models.
- Increase test prompt max_tokens to 20 and use "Say ok" for reliable completions
- Extract human-readable error.message from upstream JSON responses
- Fix dialog overflow for long error messages with scroll and word-break
…ation and safety

- Add OnDemandWaker trait in temps-core to decouple environments from proxy
- Wake/sleep endpoints now start/stop containers via OnDemandWaker instead of just flipping DB flag
- Add 30s cooldown between state transitions (HTTP 429)
- Use atomic CAS (UPDATE WHERE) in set_sleeping to prevent race conditions
- Track container stop failures during sleep and revert state on partial failure
- Add dedicated EnvironmentSleepStateChangedAudit type
- Harden error responses to not leak database details to clients
- Add too_many_requests error builder and replicas >= 1 validation
- Collapse Environments title into inline tabs on mobile, saving ~100px of chrome
- Hide branch subtitle in env tabs on small screens
- Compact project header (h-12) and hide Deployed badge on mobile
- Reduce padding in Containers/Settings tabs
- Stack deployment row, domain input, and label selectors vertically on mobile
- Use items-start for switch toggle rows to prevent text/switch collision
- Add truncate/overflow handling for variable keys and domain names
- Make action buttons full-width on mobile (Save, Delete, Add Domain)
- Icon-only Add Environment button on small screens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant