Commit graph

61 commits

Author SHA1 Message Date
xtcnet
4369b1a3e4 feat(install): block port 2222, auto-save iptables rules on reboot
- Block port 2222 (Forgejo SSH) alongside 3000 after install since
  git operations use HTTPS via NPM proxy only
- Add save_iptables_rules helper: uses netfilter-persistent if present,
  otherwise writes /etc/iptables/rules.v4 and installs iptables-persistent
  so DROP rules survive reboots
- Call save_iptables_rules after Forgejo port block and toggle-port-81

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:44:36 +07:00
xtcnet
50dff1712e feat(install): block port 3000 after Forgejo install, English instructions
- Automatically add iptables DOCKER-USER DROP rule for port 3000 so
  Forgejo is only reachable via NPM proxy, not directly from the internet
- Rewrite post-install instructions in English with all 6 NPM setup steps
  including SSL config and correct ROOT_URL / SSH Port values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:43:37 +07:00
xtcnet
6ef729eb45 fix(install): use versioned Forgejo image tag instead of latest
Codeberg container registry does not publish a 'latest' tag for Forgejo.
Switch to the stable major version tag 'codeberg.org/forgejo/forgejo:9'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:35:47 +07:00
xtcnet
2e9ed07708 fix(install): skip d3v-net in compose when Forgejo is not installed
generate_docker_compose now only adds the d3v-net network section if the
network actually exists on the host. Servers without Forgejo no longer
fail with "network declared as external, but could not be found".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:31:13 +07:00
xtcnet
04a22dcc7d ci: skip Docker build when only non-image files change
Add paths filter so the build only triggers on changes to backend/,
frontend/, docker/, or the workflow file itself. Edits to install.sh,
CLAUDE.md, etc. no longer cause unnecessary image rebuilds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:28:35 +07:00
xtcnet
ce0d4f7611 feat(install): add Forgejo submenu with install/uninstall/update
- Add Forgejo as option 8 in main menu with submenu (install/uninstall/update)
- do_forgejo_install: creates /opt/forgejo with SQLite, ports 3000/2222,
  joins d3v-net network so NPM can proxy to it
- ensure_docker_network: creates d3v-net external network if missing
- On Forgejo install, regenerate D3V-NPMWG compose to include d3v-net
  and connect running container immediately (no restart required)
- Success output includes step-by-step NPM Proxy Host setup guide
- DOCKER_NETWORK constant (d3v-net) shared across both stacks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:25:48 +07:00
xtcnet
6c3122d03d feat(wg-public): add file manager UI with upload, rename, delete
- Add File Manager card above REST API Documentation on /wg-public page
  with table showing name, size, modified date and action buttons
- Upload: file picker button, enforces storage quota
- Rename: inline editable row (Enter to confirm, Escape to cancel)
- Delete: with confirmation dialog
- Download: opens decrypted file in new tab
- Add renameFile() method to wireguard-fs.js (fs.rename, no re-encryption)
- Add PATCH /api/wg-public/files/:filename endpoint for rename
- Fix bug: saveEncryptedFile -> uploadFile in wg_public.js
- Fix bug: getDecryptedFileStream + pipe -> downloadFile in wg_public.js
- Add Rename curl example to REST API Documentation section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 21:57:49 +07:00
xtcnet
dd525adaef feat(login): show xGat3 button only when accessed via IP address
Hide the Open xGat3 button when the page is accessed via a domain name.
Only show it when the hostname is a raw IP (e.g. 10.0.0.1 over WireGuard).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 21:44:02 +07:00
xtcnet
1b97b8b0ad fix(login): update xGat3 button link to /wg-public
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 21:43:11 +07:00
xtcnet
b49bcf90cb feat(login): add Open xGat3 button on login page
Adds a button below the login card that opens the xGat3 reverse
proxy interface (port 80) in a new tab when accessed via WireGuard VPN.
The link is built dynamically from the current hostname so it works
regardless of which IP the client uses to reach the server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 21:42:00 +07:00
xtcnet
5d65eafc65 fix: allow client-to-client traffic when isolation is disabled
The wg+ wildcard in the server isolation DROP rule was also matching
same-interface traffic (wg0->wg0), blocking clients from pinging each
other even with Client Isolation turned off.

Fix: always insert an explicit same-interface ACCEPT (or REJECT if
isolated) rule AFTER the wg+ DROP, so it lands at position 1 in the
chain and is evaluated before the DROP.

Also update syncIptablesRules to apply the ACCEPT rule (not just remove
the REJECT) when isolation is toggled off at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 20:14:33 +07:00
xtcnet
fd8baf878c fix: apply client isolation iptables rules immediately on config save
wg syncconf does not execute PostUp/PostDown, so toggling isolate_clients
had no effect until container restart. Add syncIptablesRules() to directly
apply/remove the REJECT rule after every syncconf call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 20:02:53 +07:00
xtcnet
08ce4b8390 fix: sửa lỗi và cải thiện tính năng Reset Admin Password
- Sửa lỗi db.js export getInstance() thay vì knex instance trực tiếp
- Tìm admin theo user đầu tiên trong DB thay vì hard-code id=1
- Chỉ hỏi mật khẩu mới, hiển thị email sau khi update thành công

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 19:51:09 +07:00
xtcnet
335490ac06 Fix: Resolve React Error #31 and missing date rendering in WireGuard Client Logs Modal 2026-03-10 19:12:24 +07:00
xtcnet
090894021a Refactor: Standardize units to GB/MB, fix Dashboard live traffic aggregation, and optimize WireGuard client layout with expanded actions. 2026-03-10 19:02:44 +07:00
xtcnet
b77da8e6de feat(wireguard): massive scale extensions for Quotas, Web Dashboards, Connection Logs, and Zero-Auth Public VPN file portals 2026-03-10 13:09:51 +07:00
xtcnet
66dc95bc6b fix(wireguard): resolve 500 parse failure on encrypted file upload stream memory buffers 2026-03-10 11:53:20 +07:00
xtcnet
787e3bb243 fix(wireguard): resolve empty auth token on client file upload 2026-03-10 11:45:12 +07:00
xtcnet
bd04298843 feat(wireguard): add isolated encrypted file manager per wg client, drop sql editor 2026-03-10 11:40:19 +07:00
xtcnet
e057aee8ba feat(wireguard): harden security constraints and fix db manager UI 2026-03-10 11:25:40 +07:00
xtcnet
b99b623355 feat(database): add native SQLite database manager and fix wireguard admin visibility 2026-03-10 10:58:08 +07:00
xtcnet
3f0d529d14 fix(wireguard): isolate user data by owner_user_id 2026-03-10 10:39:46 +07:00
xtcnet
d67081492d fix: map interfaceId to WireGuard client response 2026-03-08 20:55:47 +07:00
xtcnet
497482aef3 fix: WireGuard client filter, feat: system monitor storage and total ram 2026-03-08 20:49:00 +07:00
xtcnet
e48fef3154 feat: real-time system monitor in footer 2026-03-08 20:35:06 +07:00
xtcnet
34020bc562 feat: custom Stream port manager UI and WireGuard config Zip download API 2026-03-08 15:50:25 +07:00
xtcnet
7bf175da41 fix: revert from host to bridge network mode to bypass external firewalls automatically 2026-03-08 15:13:32 +07:00
xtcnet
2cbaab23c5 fix: remove sysctls from host network container and apply them to host OS 2026-03-08 15:01:48 +07:00
xtcnet
9eeb3f7c7d feat: centralize compose generation and add self-update to install script 2026-03-08 14:58:47 +07:00
xtcnet
a0edaccfc4 feat: script auto-migrates old docker-compose ports to host network mode on update 2026-03-08 14:53:19 +07:00
xtcnet
af5cfbea84 feat: switch default docker compose template to network_mode host 2026-03-08 14:42:57 +07:00
xtcnet
f5323ce8fa fix: translation variables and WireGuard client filtering 2026-03-08 14:30:22 +07:00
xtcnet
8c91886de6 fix: remove unused variables causing TypeScript build failure 2026-03-08 14:21:34 +07:00
xtcnet
ec55362d15 feat: fix audit log display, add dashboard counts, restructure WireGuard page, add translations 2026-03-08 14:17:18 +07:00
xtcnet
f8ad3fe807 docs: update multi-server docker port mapping instructions to 51820-51830/udp 2026-03-08 11:18:05 +07:00
xtcnet
f9d687c131 fix: resolve multi-server iptables bridging and hook audit logging 2026-03-08 10:58:19 +07:00
xtcnet
dd8dd605f1 fix: resolve 500 error on server creation due to ipv6_cidr schema violation 2026-03-08 10:45:19 +07:00
xtcnet
3960d6025f fix: resolve 404 on server creation and 500 on client creation and reposition buttons to tables 2026-03-08 10:39:17 +07:00
xtcnet
5f4acb755e fix: resolve cancel and close buttons not working on server modals 2026-03-08 10:29:37 +07:00
xtcnet
36acc3ea65 fix: resolve WireGuard server tab crash and enforce client creation server prerequisite 2026-03-08 09:47:20 +07:00
xtcnet
54d1623551 feat: implement wireguard multi-server UI and backend logic 2026-03-08 09:33:24 +07:00
xtcnet
5119f84558 Feat: add toggle for port 81 and fix WireGuard translation 2026-03-07 22:49:56 +07:00
xtcnet
bec35a38a2 Fix: add iproute2 package for wg-quick ip command 2026-03-07 22:03:15 +07:00
xtcnet
9f29032a07 Fix CRLF: add .gitattributes + fix s6 permissions in Dockerfile 2026-03-07 21:50:09 +07:00
xtcnet
ca0ef7c270 Fix: chmod +x install-s6 before execution in Docker build 2026-03-07 21:35:19 +07:00
xtcnet
51443b6ee3 Fix workflow: correct steps.meta reference and update action versions 2026-03-07 21:30:47 +07:00
xtcnet
0563f2c67a Add GitHub Actions Docker build workflow 2026-03-07 21:29:23 +07:00
xtcnet
5cb9760782 Fix: restart Docker daemon explicitly and remove obsolete compose version 2026-03-07 21:24:58 +07:00
xtcnet
1b400ee8bd Fix Docker startup race condition and remove legacy docker-compose 2026-03-07 21:21:47 +07:00
xtcnet
55f44e0a29 Rewrite install.sh from scratch - clean, robust, with detailed progress 2026-03-07 21:19:13 +07:00