Commit graph

73 commits

Author SHA1 Message Date
xtcnet
23f197aeb1 feat: auto-tune swap and Node.js memory based on VPS RAM
Some checks failed
Docker Cloud Build / Build & Publish Image (push) Failing after 36m19s
install.sh: detect RAM at runner install time and create swap only when
needed (<2GB → 2G swap, 2-4GB → 1G swap, >4GB → no swap).

workflow: detect RAM at build time and set NODE_OPTIONS accordingly
(<2GB → 768MB, 2-4GB → 1536MB, >4GB → 3072MB).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:30:17 +07:00
xtcnet
89c9ed842f fix: support 1GB RAM VPS for Docker image builds
Some checks failed
Docker Cloud Build / Build & Publish Image (push) Has been cancelled
- workflow: limit Node.js to 768MB (NODE_OPTIONS --max-old-space-size)
  and remove GitHub Actions cache (not supported on Forgejo Actions)
- install: auto-create 2GB swapfile when installing Forgejo Runner so
  the build process does not OOM on low-RAM machines

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:24:53 +07:00
xtcnet
2345f10b21 fix(install): use env vars for act_runner auto-registration
gitea/act_runner entrypoint auto-registers on first start using
GITEA_INSTANCE_URL and GITEA_RUNNER_REGISTRATION_TOKEN env vars,
then starts the daemon. Remove the separate register step entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:21:35 +07:00
xtcnet
376d27367c fix(install): remove duplicate act_runner prefix in runner commands
gitea/act_runner sets act_runner as the container entrypoint, so the
register and daemon subcommands must be passed directly without the
binary name prefix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:20:05 +07:00
xtcnet
9536c8a75a fix(install): switch Forgejo Runner to gitea/act_runner from Docker Hub
code.forgejo.org/forgejo/runner does not have usable version tags.
Use gitea/act_runner:latest from Docker Hub which is fully compatible
with Forgejo Actions. Update register/daemon commands accordingly
(act_runner instead of forgejo-runner, --instance instead of --url).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:18:22 +07:00
xtcnet
4ec63f0fe8 feat(install): auto-update install.sh on every run at startup
Move self-update logic from do_update() to a self_update() helper called
at the entry point before showing the menu or running any command.
The script now checks for a newer version on every execution, re-execs
with the original arguments if an update is found, and is a no-op if
unreachable or already up to date.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:16:50 +07:00
xtcnet
c8801b97c6 fix(install): use versioned tag for Forgejo Runner image
code.forgejo.org/forgejo/runner does not publish a 'latest' tag.
Switch to stable major version tag ':3'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:15:14 +07:00
xtcnet
71f5477db3 docs: update README for Forgejo migration and new features
- Update install script URL to src.d3v.ac
- Update Docker image reference to src.d3v.ac/xtcnet/d3v-server:latest
- Update git clone URL to Forgejo
- Add Forgejo integration section (optional Git server + CI/CD)
- Add encrypted file storage and client isolation to feature list
- Update menu options to reflect current install.sh (8 options + Forgejo submenu)
- Update CI/CD section to describe Forgejo Actions workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:13:01 +07:00
xtcnet
b8d64b150c feat: switch Docker registry from ghcr.io to Forgejo (src.d3v.ac)
Some checks failed
Docker Cloud Build / Build & Publish Image (push) Has been cancelled
- Update workflow REGISTRY to src.d3v.ac and use FORGEJO_TOKEN for auth
- Update IMAGE_NAME in install.sh to src.d3v.ac/xtcnet/d3v-server:latest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:07:41 +07:00
xtcnet
4c0d3952cb chore: update install.sh references from GitHub to Forgejo
- Update header comment URL to src.d3v.ac/xtcnet/D3V-Server
- Update self-update URL in do_update to fetch install.sh from Forgejo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:06:47 +07:00
xtcnet
91e493d81f feat(install): add Forgejo Runner install/uninstall to Forgejo submenu
- Add FORGEJO_RUNNER_DIR, FORGEJO_RUNNER_CONTAINER, FORGEJO_RUNNER_IMAGE constants
- do_forgejo_runner_install: prompts for Forgejo URL and token, registers
  runner with ubuntu-latest/ubuntu-22.04 Docker labels, starts daemon
- do_forgejo_runner_uninstall: stops/removes container and data directory
- Extend Forgejo submenu to 6 options (added Install/Uninstall Runner)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:05:15 +07:00
xtcnet
649d252a0f feat(install): unblock ports 3000 and 2222 when Forgejo is uninstalled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:45:25 +07:00
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