Skip to content
Back to search

uwas

Unified Web Application Server — Apache+Nginx+Varnish+Caddy in a single Go binary. Auto HTTPS, built-in caching, PHP/FastCGI, reverse proxy, load balancing, WAF, web dashboard, and MCP server.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/uwaserver/uwas with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/uwaserver/uwas'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/uwaserver--uwas/badge.svg)](/listings/uwaserver--uwas)

HTML

<a href="/listings/uwaserver--uwas"><img src="/api/listings/uwaserver--uwas/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

# One-line install (Linux / macOS)
curl -fsSL https://raw.githubusercontent.com/uwaserver/uwas/main/install.sh | sh

Update

# One-line update (detects current version, downloads latest, restarts service)
curl -fsSL https://raw.githubusercontent.com/uwaserver/uwas/main/update.sh | sh

Or download from [GitHub Releases](https://github.com/uwaserver/uwas/releases).

> **Upgrading?** Releases that change runtime behavior are documented in > [UPGRADING.md](UPGRADING.md). v0.8.7 (security release) tightens several > defaults — review it before upgrading multi-user or docker-compose deployments.

Build from Source

git clone https://github.com/uwaserver/uwas.git && cd uwas
make build        # Production binary → bin/uwas
make linux        # Cross-compile for Linux amd64

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 692 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # UWAS
  2. **Unified Web Application Server**
  3. One binary to serve them all.
  4. Apache + Nginx + Varnish + Caddy + cPanel → UWAS
  5. ---
  6. <p align="center">
  7. <img src="assets/banner.jpeg" alt="UWAS Logo" width="100%">
  8. </p>
  9. > **Note:** UWAS is intended for production use; verify it against your own deployment, traffic, and security requirements.
  10. [![Go](https://img.shields.io/badge/Go-1.26+-00ADD8?logo=go&logoColor=white)](https://go.dev)
  11. [![License](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](LICENSE)
  12. ## What is UWAS?
  13. UWAS replaces your entire web server stack and hosting control panel with a single Go binary. Auto HTTPS, built-in caching, PHP support, .htaccess compatibility, reverse proxy, WebSocket forwarding, WAF, multi-user access control, and a 42-page React dashboard backed by 254 explicit admin API route registrations.
  14. One binary. Zero hassle.
  15. ## Current Snapshot (v0.11.41)
  16. - **Dashboard pages:** 42 (`web/dashboard/src/pages`; `settingsSections.tsx` lives there too but is section definitions, not a page)
  17. - **Admin API routes:** 254+ explicit route registrations in `internal/admin/routes.go` under `/api/v1` plus dashboard/static handlers
  18. - **Go packages:** 71 (`go list ./...`) — 63 under `internal/`, 2 under `pkg/`; 57 carry tests
  19. - **CLI commands:** 19
  20. - **Test status:** all gates pass — `go build`, `go vet`, `staticcheck`, `go test`, `go test -race`, dashboard npm build; CI runs additional `govulncheck`, shellcheck, installer tests, Docker Compose validation, and docs/site builds
  21. - **Security/stability fixes:** v0.11.29 hardens against request floods (async logging, rate-limited redirects, cache bypass fix) and moves to Go 1.26.9 for HTTP/2 DoS fixes
  22. - **Security posture:** risk score 2.1/10 (Low) per July 2026 reassessment
  23. **v0.11.41 highlights (security release, evidence-audit rounds 196–198):**
  24. - Access-control bypasses closed: a trailing `/` (`/private/a.txt/`, `//`, `/./`) no longer skips `$`-anchored regex locations such as `basic_auth`; `/wp-config.old/.`, `/dump.sql/.` and `/img/a.jpg/.` no longer bypass the wp-config copy guard, WAF file-probe rules or hotlink guard
  25. - Clone/migrate: a failed DB clone no longer leaves the target `wp-config.php` on the production database, failed rsync/copy stops the migration, partial copies are discarded
  26. - Backups and cleanup: a failing `mysqldump` no longer lets a files-only backup prune the older backup holding the database; domain delete with `cleanup=true` reports cron/SFTP cleanup failures; `wordpress.Harden` re-checks the `mu-plugins` symlink
  27. - Dashboard: password fields reset when the form moves to another row; release builds report `build.Date`
  28. **v0.11.40 highlights (security release, evidence-audit rounds 174–195):**
  29. - Tenant isolation: PHP workers (php-cgi) and wp-cli no longer run as root, root-owned writes and chowns on tenant paths refuse symlinks (backup restore, WordPress install/update, image optimizer, clone/migrate), bootstrap rejects DNS-rebinding hosts
  30. - Availability: a NUL byte in a WordPress install request no longer crashes the server, `domains.d` and `include:` domains no longer produce a duplicate host that blocks restart, a second instance no longer clobbers the PID file, `uwas stop` waits for graceful shutdown
  31. - Disclosure: PHP variant sources (`.phtml` and friends), Composer `vendor/`, `node_modules/` and lock files are no longer served, cache no longer leaks template headers, config export redacts secrets
  32. - Destructive actions: DB import and API-key regeneration require PIN / current password; many API status codes, null lists and dashboard load-error states fixed
  33. - Cache and DoS hardening: bounded `Accept-Encoding` cache keys, no cache entries for unmatched hosts, bounded reads, image-conversion and `systemctl` deadlines, oversized app logs rotated at start, deploy output cap
  34. **v0.11.39 highlights:**
  35. - 2FA fixes: the per-request gate no longer rejects the second admin request in a 30 s window, the web terminal and SSE stats work with 2FA, the dashboard recovers from an expired code and sends it on every call
  36. - PHP sites no longer cache dynamic output by URL extension (`/index.php/app.js`, front-controller `/invoice/123.pdf`)
  37. - Bot guard no longer treats proxied requests from the same host as local; IPv6 login lockout by /64
  38. - Cache hits honour `Range`/`If-Modified-Since`; PIN required for package removal and software restore/backup delete; curl 8.23 floor in PHP images (CVE-2026-92392)
  39. **v0.11.38 highlights:**
  40. - Evidence-audit rounds 164–170: WordPress install no longer deletes a document root named `wordpress`, rewrite/redirect/htaccess fixes, alert e-mail headers and SMTPS, MX priority for Hetzner/Route 53/Cloudflare, audit log coverage for mutating routes, HTTP/3 `Alt-Svc` only when the UDP listener bound, second shutdown signal terminates, `[]` instead of `null` in API lists, dashboard load-error and stale-state fixes
  41. **v0.11.37 highlights:**
  42. - Evidence-audit rounds 156–163: clone endpoint no longer hangs the panel, config-write failures reported as 500 across domain/cloudflare/PHP/cert flows, circuit-breaker probe leak, own-password change requires the current password
  43. **v0.11.36 highlights:**
  44. - Evidence-audit rounds 152–155: PHP uninstall/keyring hardening, `${VAR:-x}` empty fallback, proxy `TE: trailers`, `Retry-After` rounding, SFTP/backup/ACME/logging fixes
  45. **v0.11.34 highlights:**
  46. - PHP update / uninstall from the dashboard, API and CLI; vulnerable versions get an "Update now" action
  47. - Evidence-audit rounds 147–151: child-process env secrets filter, monitor proxy SSRF, firewall/deploy/autoblock ownership fixes
  48. **v0.11.33 highlights:**
  49. - PHP php2shell RCE (CVE-2026-109618/109619): Docker images on PHP 8.3.36; dashboard flags vulnerable and EOL PHP; PHP 8.2+ only
  50. **v0.11.29 highlights:**
  51. - Go 1.26.9 + x/net v0.60.0: HTTP/2 DoS vulnerabilities fixed
  52. - Logging never blocks requests (flood no longer ends in an OOM kill)
  53. - Canonical redirects and global 429s feed rate limiting / autoblock
  54. - Cache: client no-cache ignored, origin max-age honoured, alias purge, rule cache_control on proxies
  55. **v0.11.28 highlights:**
  56. - Published binaries for the v0.11.27 product changes (that tag failed lint)
  57. - Image conversions publish atomically under concurrency
  58. - Domain backup fails closed if the database dump fails
  59. - Dashboard tests drop `any` so release `npm run lint` stays green
  60. **v0.11.27 highlights:**
  61. - WAF blocks scanner probes (`phpinfo.php`, `secrets.json`, `.bak`) when WAF is on
  62. - Alert titles spell out 5xx spikes instead of `error_spike`
  63. - (tag only — binaries in v0.11.28)
  64. **v0.11.26 highlights:**
  65. - Round-robin uses configured backend weights; circuit probes recover
  66. - SQL explorer refuses `EXPLAIN ANALYZE`; Docker short flags stay off the allowlist
  67. - DNS record ids are escaped; nested zones match the longest name
  68. **v0.11.25 highlights:**
  69. - Published binaries for the v0.11.24 changes; dashboard lockfile clears
  70. high `brace-expansion` and `undici` advisories
  71. **v0.11.24 highlights:**
  72. - File Manager: page through every file (50 per page); new uploads/saves
  73. are mode 0600
  74. - Cache keys are length-prefixed (one miss cycle); FastCGI responses cap
  75. at 64 MiB
  76. **v0.11.23 highlights:**
  77. - Deploy: listen probe 45s (was 3s) — stops false rollbacks on slow Node boots;
  78. Telegram notifications append `hostname · IP`
  79. **v0.11.22 highlights:**
  80. - Apps: Environment vars keep operator save order; full-width env editor;
  81. deploy modal auto-closes on success
  82. **v0.11.21 highlights:**
  83. - Deploy: clear stale `.git/*.lock`, live SSE deploy logs, 5m UI timeout;
  84. auto-build runs install/build as separate steps (no `&&`)
  85. **v0.11.20 highlights:**
  86. - Firewall: hide `# uwas-autoblock` rows from the rules table; enable opens
  87. 443/udp for HTTP/3 (QUIC)
  88. **v0.11.19 highlights:**
  89. - Firewall: heal missing IPv4 default DENY (v6-only orphan no longer blocks restore)
  90. **v0.11.18 highlights:**
  91. - Firewall: ↑↓ move no longer drops the bottom DENY; empty protocol shows as
  92. `any`; panel/API reject blank port+source allow/deny
  93. **v0.11.17 highlights:**
  94. - Firewall: visible rule count matches the table (IPv6 hidden noted); empty port
  95. = any; enable places a numbered default DENY at the bottom; re-enable no
  96. longer duplicates rules
  97. **v0.11.16 highlights:**
  98. - WAF body scanning covers `application/json` and `multipart/form-data`
  99. - Firewall source IP/CIDR, allow-above-deny insert, arrow reorder
  100. - Database user Drop; remote MySQL firewall prompt for 3306
  101. - Deploy-key Generate on app Edit
  102. **v0.5.0 highlights (refactor + perf + observability sweep, 43 commits):**
  103. - TLS handshake allowlist is now lock-free (atomic pointer instead of mutex + linear scan)
  104. - IPACL / GeoIP / CORS / WAF middleware run as predicates on the hot path (no per-request wrapper allocation)
  105. - API-key authentication is O(1) (secondary hash index alongside the username map)
  106. - Cache LRU promotion debounced; per-host mutex on access-log writes; ACME renewal split from cert-map iteration
  107. - New `internal/respond` package centralizes JSON responses with operator-visible 5xx logging
  108. - Per-handler latency histogram (`uwas_handler_duration_seconds{handler,quantile}`)
  109. - **Behavioural change:** plaintext `api_key` fallback is now opt-in (`global.users.allow_legacy_plaintext_api_key`, default `false`). Operators upgrading from v0.4.x with a plaintext key must set the flag or migrate to hashed credentials.
  110. ## Features
  111. ### Web Server
  112. - **Auto HTTPS** — Let's Encrypt certificates with zero configuration
  113. - **HTTP/3 (QUIC)** — Via quic-go with Alt-Svc header advertisement
  114. - **Built-in Cache** — Varnish-level caching with grace mode, tag-based purge, ESI (Edge Side Includes)
  115. - **PHP Ready** — FastCGI with connection pooling and .htaccess support
  116. - **Per-domain PHP** — Multiple PHP versions per domain with auto-port assignment, crash auto-restart
  117. - **Load Balancer** — 6 algorithms (round-robin, least-conn, ip-hash, uri-hash, random, sticky), health checks, circuit breaker, canary routing
  118. - **WebSocket Proxy** — Transparent TCP tunnel with hijack + bidirectional pipe
  119. - **URL Rewrite** — Apache mod_rewrite compatible engine
  120. - **Brotli + Gzip** — Dual compression with Accept-Encoding negotiation
  121. - **Image Optimization** — On-the-fly WebP/AVIF conversion
  122. ### Hosting Control Panel
  123. - **42-page Dashboard** — React 19 admin panel with dark/light theme
  124. - **Applications** — Deploy and supervise Node.js, Python, Ruby, Go, custom, and Docker apps
  125. - **Web Terminal** — Browser-based shell via WebSocket-to-PTY bridge
  126. - **Multi-user Auth** — Admin, reseller, user roles with TOTP 2FA
  127. - **WordPress Management** — One-click install, plugin updates, debug mode, error log viewer
  128. - **DNS Zone Editor** — Full CRUD for Cloudflare, Hetzner, DigitalOcean, Route53
  129. - **File Manager** — Browse, edit, upload, delete files via dashboard
  130. - **SFTP Server** — Built-in pure Go SFTP with chroot per domain + SSH key management
  131. - **Database Management** — MySQL/MariaDB + Docker containers (MariaDB/MySQL/PostgreSQL)
  132. - **Site Migration** — SSH wizard: rsync files + dump/import database
  133. - **Clone/Staging** — One-click domain clone with DB duplication
  134. - **Backup/Restore** — Local, S3, SFTP providers with scheduling + webhook notifications
  135. - **Cron Jobs** — Per-domain cron management with execution monitoring and failure alerts
  136. ### Security & Monitoring
  137. - **WAF** — SQL injection, XSS, shell, RCE detection
  138. - **Per-domain Rate Limiting** — Sharded token bucket per domain
  139. - **Bandwidth Limits** — Monthly/daily caps with throttle or block action
  140. - **Webhook Events** — 12 event types plus a `test` event, HMAC-SHA256 signed, with retry
  141. - **Uptime Monitoring** — Per-domain health checks with alerting
  142. - **Analytics** — Per-domain traffic, referrer tracking, user agent breakdown
  143. - **Prometheus Metrics** — p50/p95/p99 latency percentiles
  144. - **Audit Logging** — Track all admin actions with timestamps and IPs
  145. - **IP Access Control** — Per-domain whitelist/blacklist
  146. - **Resource Limits** — Per-domain CPU/memory/PID limits via Linux cgroups v2
  147. ### DevOps
  148. - **Git Deploy** — Git clone/pull + build + health check + restart with concurrent protection, env persistence, and cancellation support
  149. - **AI-Native** — MCP server for LLM-driven management
  150. - **Nginx/Apache Migration** — CLI config converter
  151. - **Hot-Reload** — All per-domain chains rebuild on SIGHUP (zero downtime)
  152. - **Self-Update** — Binary auto-update from GitHub releases
  153. - **CI/CD** — GitHub Actions for build, test, release automation (manual or on `v*` release tags, not on every push — see [CONTRIBUTING.md](CONTRIBUTING.md#ci))
  154. - **Single Binary** — ~16MB, no runtime dependencies, just download and run
  155. ## Install
  156. ```bash
  157. # One-line install (Linux / macOS)
  158. curl -fsSL https://raw.githubusercontent.com/uwaserver/uwas/main/install.sh | sh
  159. ```
  160. ### Update
  161. ```bash
  162. # One-line update (detects current version, downloads latest, restarts service)
  163. curl -fsSL https://raw.githubusercontent.com/uwaserver/uwas/main/update.sh | sh
  164. ```
  165. Or download from [GitHub Releases](https://github.com/uwaserver/uwas/releases).
  166. > **Upgrading?** Releases that change runtime behavior are documented in
  167. > [UPGRADING.md](UPGRADING.md). v0.8.7 (security release) tightens several
  168. > defaults — review it before upgrading multi-user or docker-compose deployments.
  169. ### Build from Source
  170. ```bash
  171. git clone https://github.com/uwaserver/uwas.git && cd uwas
  172. make build # Production binary → bin/uwas
  173. make linux # Cross-compile for Linux amd64
  174. ```
  175. ## Quick Start
  176. ```bash
  177. # Start server (auto-creates config on first run)
  178. uwas
  179. # Or with a specific config
  180. uwas serve -c uwas.yaml
  181. # Install as systemd service (auto-start on boot)
  182. sudo uwas install
  183. sudo systemctl start uwas
  184. # Dashboard
  185. # http://127.0.0.1:9443/_uwas/dashboard/
  186. # CLI commands (API key auto-loaded from ~/.uwas/.env)
  187. uwas status
  188. uwas php list
  189. uwas domain list
  190. uwas doctor
  191. ```
  192. ## Configuration
  193. UWAS uses a single YAML file. See [`uwas.example.yaml`](uwas.example.yaml) for a full reference.
  194. ### Static Site
  195. ```yaml
  196. global:
  197. http_listen: ":80"
  198. https_listen: ":443"
  199. acme:
  200. email: you@example.com
  201. domains:
  202. - host: example.com
  203. root: /var/www/html
  204. type: static
  205. ssl:
  206. mode: auto
  207. ```
  208. ### WordPress / PHP
  209. ```yaml
  210. domains:
  211. - host: blog.example.com
  212. root: /var/www/wordpress
  213. type: php
  214. ssl:
  215. mode: auto
  216. php:
  217. fpm_address: "unix:/var/run/php/php8.3-fpm.sock"
  218. htaccess:
  219. mode: import
  220. cache:
  221. enabled: true
  222. ttl: 1800
  223. ```
  224. ### Standalone App + Domain Route
  225. Apps live outside the main domain YAML. Create them from the dashboard
  226. Applications page or as files under `/etc/uwas/apps.d/`; then route a
  227. domain to the app by using `apps://<name>` as a proxy upstream.
  228. ```yaml
  229. # /etc/uwas/apps.d/my-api.yaml
  230. name: my-api
  231. runtime: node
  232. work_dir: /var/lib/uwas/apps/my-api
  233. port: 0
  234. env:
  235. NODE_ENV: production
  236. # uwas.yaml or domains.d/api.example.com.yaml
  237. domains:
  238. - host: api.example.com
  239. type: proxy
  240. ssl:
  241. mode: auto
  242. proxy:
  243. upstreams:
  244. - address: "apps://my-api"
  245. ```
  246. Native runtimes with an empty workdir get a small demo file on create
  247. (`index.js`, `app.py`, `app.rb`, or `main.go`) so the app has something
  248. runnable immediately. Existing files are never overwritten.
  249. ### Git Deploy + Private Repos + Webhooks
  250. Applications can be deployed from a Git repo from the dashboard or by
  251. persisting deploy settings in the app YAML. Private repositories can use
  252. either a HTTPS token or an SSH deploy key. If `build_cmd` is empty, UWAS
  253. auto-detects the build step from `package.json`, `requirements.txt`,
  254. `Gemfile`, or `go.mod`; set `build_cmd: none` to skip builds. Set
  255. `health_path` when deploys should require a 2xx/3xx HTTP response after
  256. the process starts.
  257. ```yaml
  258. # /etc/uwas/apps.d/my-api.yaml
  259. name: my-api
  260. runtime: node
  261. work_dir: /var/lib/uwas/apps/my-api
  262. port: 0
  263. env:
  264. NODE_ENV: production
  265. deploy:
  266. git_url: https://github.com/acme/private-api.git
  267. git_branch: main
  268. health_path: /health
  269. git_token: ghp_xxx
  270. webhook_secret: a-long-random-secret
  271. branch_filter: main
  272. ```
  273. For SSH repositories:
  274. ```yaml
  275. deploy:
  276. git_url: git@github.com:acme/private-api.git
  277. git_branch: main
  278. ssh_key_path: /home/uwas/.ssh/private-api-deploy-key
  279. webhook_secret: a-long-random-secret
  280. ```
  281. Add a GitHub webhook pointing at:
  282. ```text
  283. https://your-admin-host/api/v1/apps/my-api/webhook
  284. ```
  285. Use `application/json` and the same webhook secret. GitLab can use the
  286. same URL with `X-Gitlab-Token`. Accepted webhook pushes run clone/fetch,
  287. auto build if needed, restart the app, verify that it is listening, and
  288. check `health_path` when configured. If build, restart, or health
  289. verification fails after an existing repo moved to a new commit, UWAS
  290. resets the workdir to the previous commit and restarts the previous
  291. version.
  292. ### Reverse Proxy with WebSocket
  293. ```yaml
  294. domains:
  295. - host: api.example.com
  296. type: proxy
  297. ssl:
  298. mode: auto
  299. proxy:
  300. upstreams:
  301. - address: "http://127.0.0.1:3000"
  302. weight: 3
  303. - address: "http://127.0.0.1:3001"
  304. weight: 1
  305. algorithm: least_conn
  306. websocket: true
  307. health_check:
  308. path: /health
  309. interval: 10s
  310. ```
  311. ### Bandwidth Limits + Rate Limiting
  312. ```yaml
  313. domains:
  314. - host: example.com
  315. root: /var/www/html
  316. type: static
  317. bandwidth:
  318. enabled: true
  319. monthly_limit: 100GB
  320. daily_limit: 5GB
  321. action: throttle # or "block"
  322. security:
  323. rate_limit:
  324. requests: 100
  325. window: 1m
  326. ```
  327. ## Requirements
  328. | Component | Minimum | Recommended | Notes |
  329. |-----------|---------|-------------|-------|
  330. | Go | 1.26.10+ | 1.26.10+ | For building from source (1.26.10 carries the `crypto/x509` GO-2026-6809 fix) |
  331. | PHP | 8.2+ (8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 or newer) | 8.4+ / 8.5+ | Only needed for PHP sites. 8.1 and older are end-of-life and unsupported; older patch releases are vulnerable to CVE-2026-109618/109619 |
  332. | Docker | 20.10+ | 24+ | Only for Docker apps and database containers |
  333. **No PHP needed** for static sites, reverse proxy, or redirect domains.
  334. ## CLI
  335. ```
  336. uwas Start server (auto-setup if no config)
  337. uwas serve -c uwas.yaml Start with specific config
  338. uwas serve -d Start as background daemon
  339. uwas version Print version info
  340. uwas config validate Validate config file
  341. uwas domain list List domains
  342. uwas cache stats Cache statistics
  343. uwas cache purge Purge cache
  344. uwas status Server status via admin API
  345. uwas reload Hot-reload configuration
  346. uwas stop Stop running server
  347. uwas restart Restart running server
  348. uwas migrate nginx <file> Convert Nginx config to UWAS
  349. uwas migrate apache <file> Convert Apache config to UWAS
  350. uwas backup Create config backup
  351. uwas restore Restore from backup
  352. uwas php list List detected PHP versions
  353. uwas php start <ver> Start PHP-FPM for version
  354. uwas install Install as systemd service
  355. uwas uninstall Remove systemd service
  356. uwas user list List admin users
  357. uwas cert list List certificates + expiry
  358. uwas doctor System diagnostics + auto-fix
  359. uwas help Show help
  360. ```
  361. ## Architecture
  362. ```
  363. Request Flow:
  364. TCP → TLS (SNI routing)
  365. → HTTP Parse
  366. → Global Middleware Chain:
  367. Recovery → Request ID → Real IP → Security Headers → Compress
  368. → Rate Limit → Security Guard (blocked paths) → Bot Guard
  369. → Access Log
  370. → Virtual Host Lookup
  371. → Per-domain (inline in handleRequest, not middleware):
  372. IP ACL → GeoIP → BasicAuth → CORS → Header Transform → WAF
  373. → Bandwidth Check (throttle/block)
  374. → Rewrite Engine (mod_rewrite compatible)
  375. → Cache Lookup (L1 memory + L2 disk)
  376. → Handler:
  377. ├── Static File (ETag, Range, pre-compressed, SPA)
  378. ├── FastCGI/PHP (connection pool, CGI env)
  379. ├── Reverse Proxy (6 LB algorithms, sticky, circuit breaker, gRPC)
  380. ├── WebSocket (TCP tunnel, bidirectional pipe)
  381. └── Redirect (301/302/307/308)
  382. → Cache Store
  383. → Bandwidth Record
  384. → Response
  385. ```
  386. ## Project Layout
  387. ```
  388. cmd/uwas/ → CLI entry point (19 commands)
  389. internal/
  390. admin/ → REST API (253 route registrations) + dashboard embed + TOTP auth
  391. apps/ authmw/ backup/ cloudflare/ database/ deploy/ domain/ files/
  392. php/ settings/ wordpress/ → handler sub-packages (see docs/admin-subpackaging.md)
  393. alerting/ → Alert thresholds + webhook/Slack/Telegram/email notifications
  394. analytics/ → Per-domain traffic analytics
  395. apps/ → Standalone Node/Python/Ruby/Go/custom/Docker app supervision
  396. auth/ → Multi-user RBAC (admin/reseller/user) + session + TOTP 2FA
  397. backup/ → Local/S3/SFTP backup + restore + scheduling
  398. bandwidth/ → Per-domain bandwidth limits (throttle/block)
  399. build/ → Build metadata (version, commit, date) via ldflags
  400. cache/ → L1 memory (256-shard LRU) + L2 disk cache + ESI
  401. cli/ → CLI framework and commands
  402. cloudflare/ → Cloudflare Tunnel API + local cloudflared process
  403. config/ → YAML parser, validation, defaults, ByteSize/Duration types
  404. cronjob/ → Cron job management + execution monitoring
  405. database/ → MySQL/MariaDB management + Docker container support
  406. deploy/ → Git clone/pull + Docker-based application deployment
  407. dnsmanager/ → Cloudflare, Route53, Hetzner, DigitalOcean DNS CRUD
  408. dnschecker/ → DNS record verification (A/MX/NS/TXT)
  409. doctor/ → System diagnostics + auto-fix
  410. domainroot/ → Filesystem root resolution for a domain (apps:// aware)
  411. domainutil/ → Pure hostname helpers shared by admin and admin/domain
  412. filemanager/ → Web file manager (browse/edit/upload/delete)
  413. firewall/ → UFW management via API
  414. handler/
  415. fastcgi/ → PHP handler, CGI environment builder
  416. proxy/ → Reverse proxy, load balancing, WebSocket, circuit breaker
  417. static/ → Static files, MIME, ETag, pre-compressed, SPA
  418. install/ → System package installer task queue
  419. logger/ → Structured logger (slog wrapper)
  420. mcp/ → MCP server for AI management
  421. metrics/ → Prometheus-compatible metrics
  422. middleware/ → Chain, recovery, rate limit, gzip, CORS, WAF, bot guard
  423. migrate/ → Nginx/Apache converter + SSH site migration + clone
  424. monitor/ → Uptime monitoring per domain
  425. notify/ → Webhook, Slack, Telegram, Email (SMTP) channels
  426. pathsafe/ → Path traversal guard (symlink-resolving containment check)
  427. phpmanager/ → PHP detect, install, start/stop, per-domain assign
  428. respond/ → Centralized JSON response helpers (status + hardening headers + 5xx logging)
  429. rewrite/ → URL rewrite engine (Apache mod_rewrite compatible)
  430. rlimit/ → Per-domain resource limits via Linux cgroups v2
  431. router/ → Virtual host routing, request context
  432. selfupdate/ → Binary self-update from GitHub releases
  433. server/ → HTTP/HTTPS/HTTP3 server + request dispatch + log rotation
  434. serverip/ → Server IP detection (interfaces + public IP)
  435. services/ → systemd service management (start/stop/restart)
  436. sftpserver/ → Built-in SFTP server (pure Go, chroot per domain)
  437. siteuser/ → SFTP user management (chroot jail + SSH keys)
  438. terminal/ → WebSocket-to-PTY bridge for browser-based shell
  439. tls/ → TLS manager, ACME client, auto-renewal, cert expiry alerts
  440. acme/ → RFC 8555 ACME protocol, JWS signing
  441. webhook/ → Event-driven webhook delivery (12 events + test, HMAC, retry)
  442. wordpress/ → WordPress install, manage, debug, permissions
  443. pkg/
  444. fastcgi/ → FastCGI binary protocol, connection pool
  445. htaccess/ → .htaccess parser and converter
  446. web/dashboard/ → React 19 SPA (42 pages, Vite + TypeScript + Tailwind)
  447. ```
  448. ## Dashboard
  449. UWAS includes a 42-page React 19 dashboard at `/_uwas/dashboard/` with dark/light theme:
  450. **Sites:** Dashboard, Domains, Domain Detail, Topology, Certificates, DNS Zone Editor, Cloudflare, WordPress, Clone/Staging, Migration, File Manager
  451. **Server:** PHP, PHP Config, Applications, Software Library, Database, DB Explorer, SFTP Users, Cron Jobs, Services, Packages, IP Management, Email Guide
  452. **Performance:** Cache, Metrics, Analytics, Logs
  453. **Security:** Security, Firewall, Unknown Domains, Audit Log, Admin Users
  454. **System:** Setup Wizard, Config Editor, Webhooks, Backups, Terminal, Updates, Doctor, Settings, About
  455. **Not in the sidebar:** Domain Detail, Login
  456. **Auth:** Login (with 2FA/TOTP support)
  457. ## Comparison
  458. | Feature | UWAS | Nginx | Caddy | Apache | cPanel |
  459. |---------|------|-------|-------|--------|--------|
  460. | Single binary | Yes | No | Yes | No | No |
  461. | Auto HTTPS | Yes | No | Yes | No | Yes |
  462. | Built-in cache | Yes | No | No | No | No |
  463. | PHP FastCGI | Yes | Yes | Yes | Yes | Yes |
  464. | .htaccess support | Yes | No | No | Yes | Yes |
  465. | Load balancer | Yes | Yes | No | No | No |
  466. | WebSocket proxy | Yes | Yes | No | No | No |
  467. | WAF | Yes | No | No | Mod | Yes |
  468. | Control panel | Yes (built-in) | No | No | No | Yes |
  469. | Multi-user auth | Yes | No | No | No | Yes |
  470. | Webhook events | Yes | No | No | No | No |
  471. | DNS management | 4 providers | No | No | No | Yes |
  472. | MCP / AI-native | Yes | No | No | No | No |
  473. | Open source | AGPL-3.0 | BSD | Apache 2.0 | Apache 2.0 | Proprietary |
  474. ## Performance
  475. Tested with [hey](https://github.com/rakyll/hey) on AMD Ryzen 9 9950X3D:
  476. | Scenario | Requests/sec | Avg Latency |
  477. |----------|-------------|-------------|
  478. | Small static file (14B) | **7,000** | 7.1ms |
  479. | 4KB static file | **7,100** | 7.0ms |
  480. | 100K requests @ 200 concurrent | **7,254** | 27ms |
  481. | 404 error page | **22,000** | 2.2ms |
  482. | Cache L1 lookup (bench) | **75,000,000** | 31ns |
  483. | VHost routing (bench) | **70,000,000** | 35ns |
  484. ## Deployment
  485. ### Systemd
  486. ```bash
  487. sudo cp init/uwas.service /etc/systemd/system/
  488. sudo systemctl enable uwas
  489. sudo systemctl start uwas
  490. # Live config reload (zero downtime)
  491. sudo systemctl reload uwas
  492. ```
  493. ### Docker
  494. The image runs as a non-root `uwas` user (with `CAP_NET_BIND_SERVICE` for ports
  495. 80/443), includes a healthcheck, and ships a baked default config that the
  496. entrypoint seeds into a writable volume on first boot — so domain additions and
  497. config edits made from the dashboard persist across restarts.
  498. **docker compose (recommended):** includes MariaDB + PHP-FPM sidecars.
  499. ```bash
  500. cp .env.example .env # set UWAS_ADMIN_KEY (required for the dashboard)
  501. docker compose up -d
  502. ```
  503. The admin API binds `:9443` inside the container but Compose publishes it only
  504. on host loopback (`127.0.0.1:9443`) because the default admin listener is HTTP.
  505. For remote access, use `ssh -L 9443:127.0.0.1:9443 user@server` and open
  506. `http://127.0.0.1:9443/_uwas/dashboard/`. Set `UWAS_ADMIN_KEY` in `.env`
  507. (generate one with `openssl rand -hex 24`). The config lives in a named volume
  508. (`uwas_config`); edit it from the dashboard or drop a custom
  509. `docker/uwas.yaml` before the first boot.
  510. **docker run (standalone):**
  511. ```bash
  512. docker build -t uwas .
  513. docker run -d -p 80:80 -p 443:443 -p 127.0.0.1:9443:9443 \
  514. -e UWAS_ADMIN_KEY=your-admin-key \
  515. -v uwas_config:/etc/uwas \
  516. uwas
  517. ```
  518. See [`docker-compose.yml`](docker-compose.yml) and [`docker/uwas.yaml`](docker/uwas.yaml) for the full reference.
  519. ## Migration from Nginx/Apache
  520. ```bash
  521. # Convert existing Nginx config
  522. uwas migrate nginx /etc/nginx/sites-enabled/example.conf > uwas.yaml
  523. # Convert Apache config
  524. uwas migrate apache /etc/apache2/sites-enabled/example.conf > uwas.yaml
  525. # Or use the dashboard Migration wizard for full site transfer (files + database)
  526. ```
  527. ## Development
  528. ```bash
  529. make dev # Build development binary
  530. make dashboard # Build the React dashboard (required before go:embed)
  531. make build # Production binary (includes dashboard build)
  532. make test # Run all Go tests
  533. make lint # Run go vet + staticcheck
  534. make check # Pre-push gate: lint + tsc + tests
  535. make clean # Clean build artifacts
  536. ```
  537. > **Dashboard changes** require `npm install` in `web/dashboard/`, then
  538. > `make dashboard` to rebuild before the Go binary picks them up.
  539. ## Monitoring (Prometheus + Grafana)
  540. UWAS exposes a Prometheus-compatible metrics endpoint at `/api/v1/metrics`.
  541. Scrape it with Prometheus:
  542. ```yaml
  543. scrape_configs:
  544. - job_name: uwas
  545. static_configs:
  546. - targets: ["localhost:9443"]
  547. bearer_token: "your-admin-key"
  548. ```
  549. A ready-made Grafana dashboard is included at
  550. [`docs/grafana/uwas-overview.json`](docs/grafana/uwas-overview.json) — import
  551. it via Dashboards → Import → Upload JSON. It covers request rate, cache hit
  552. ratio, latency (p50/p95/p99), handler distribution, bandwidth, and more.
  553. ## License
  554. UWAS is dual-licensed:
  555. - **AGPL-3.0** for open-source and community use — [full text](LICENSE)
  556. - **Commercial license** for enterprise and proprietary use — [uwaserver.com/enterprise](https://uwaserver.com/enterprise)
  557. ## Contributing
  558. 1. Open an issue first to discuss
  559. 2. One feature/fix per PR
  560. 3. Tests required
  561. 4. `go vet` must pass

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.