Commit graph

34 commits

Author SHA1 Message Date
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
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
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
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
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
f8ad3fe807 docs: update multi-server docker port mapping instructions to 51820-51830/udp 2026-03-08 11:18:05 +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
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
xtcnet
faa4938256 Auto-detect IP, show detailed progress, and verify installation results 2026-03-07 21:14:08 +07:00
xtcnet
bf6df7d99c Enhance install.sh with system dependency checks and uninstallation 2026-03-07 21:11:09 +07:00
xtcnet
df60cfd270 Update install.sh to use Cloud Build image from GHCR 2026-03-07 21:08:39 +07:00
xtcnet
6b1177ddee Improve install.sh with usage info and robust argument handling 2026-03-07 21:03:59 +07:00
xtcnet
e90253ca72 Fix integer expected bash syntax limit in $# 2026-03-07 21:00:56 +07:00
xtcnet
6c2d4a6a13 Fix syntax error in script arguments parsing 2026-03-07 20:59:07 +07:00
xtcnet
0397a67ae8 Initial commit for D3V-NPMWG 2026-03-07 20:49:44 +07:00