Commit graph

122 commits

Author SHA1 Message Date
Andrevich
aefb1043bd Add bypass_cn and bypass_ir routing modes
Introduce refactored and new routing modes (bypass_cn, bypass_ir) and adapt the UI/logic accordingly.
2026-06-23 23:54:22 +04:00
Andrevich
a4f1c41fab Add Zapret (nfqws2) anti-DPI support
Introduce Zapret (nfqws2) integration across UI, init, firewall and RPC. Adds UI controls to enable/install Zapret, a strategy preset picker, strategy tester, and a Discord-voice opt-in; plumbing in client.js and node.js to install/manage and test strategies. Add zapret_test.sh to run isolated strategy tests against several sites. Enable runtime nfqws2 instance via init script (procd) and ensure HomeProxy runs its own nfqws2 with admin-specified strategy. Update nft rules and firewall_post.ut to mark and queue zapret flows (including both TCP and UDP/QUIC handling) and to respect zapret marks; generate_client.uc emits zapret outbound, optional voice-port routing, adds sniff action for QUIC routing, and tweaks default uTLS fingerprint to 'edge'. Add RPC handlers (zapret_status, zapret_prepare_install, zapret_install_pkg, zapret_remove, zapret_strategy_test) to support detection, installation and testing from the web UI. Minor: register 'zapret-out' as a routing option and wire it into rule generation.
2026-06-21 21:51:16 +04:00
Andrevich
ca4209ae28 Add DNS choices, xhttp padding fix, cron & UI tweaks
Several small but important updates:

- UI (htdocs/luci-static/resources/view/homeproxy/client.js): add Cloudflare (1.1.1.1) and Google (8.8.8.8) DNS presets; restrict the "Same as main node" (main-out) option to non-custom routing modes and only when a main_node exists; always expose ByeDPI outbound when enabled; rename "Proxy filter mode" to "Proxy mode for devices" and add explanatory hints for gaming/global proxy IP options.
- Node UI (htdocs/luci-static/resources/view/homeproxy/node.js): fix closure variable (i -> k) to avoid iteration bug and shorten the probe hint text.
- Generator (root/etc/homeproxy/scripts/generate_client.uc): add xhttp_padding() to coerce disabled xhttp padding values ('0', '0-0' or empty) to the safe default '100-1000' and apply it when emitting sing-box/hiddify xhttp fields to prevent fatal core errors.
- Init script (root/etc/init.d/homeproxy): restore subscription auto-update cron entry on start when enabled (adds daily run at configured hour and restarts cron), reintroducing behavior lost during a prior init rewrite.
- Translations (po/ru/homeproxy.po): add and update Russian translations for the new/changed UI strings.

These changes prevent runtime failures for certain provider configs, restore missing auto-update behavior, improve UI clarity, and fix a node probing bug.
2026-06-16 16:25:18 +04:00
Andrevich
6505ece16d Add connectivity tests, BYEDPI UI updates & fixes
Introduce a Connectivity diagnostics section (connection checks, exit IP / active node info) with new RPCs and live polling; move connection-check UI out of status into diagnostics and add translations. Add active URLTest node display and several routing/DNS UI tweaks for 'proxy_banned_ru' mode (russia-dns, secure-dns, main-out, byedpi-out). Rework ByeDPI presets: group presets by letter, add community presets, improve "Test all" flow with ordered execution, a Stop button, clearer progress/messages and updated translations. Fix template/comment text (replace crude QUIC comment), and harden client config generation by recognizing built-in DNS tags and skipping empty/dangling routing node outbounds to avoid crashes. Minor README_ru wording update and assorted i18n strings added.
2026-06-16 10:44:47 +04:00
Andrevich
e07082d002 Rebrand to Re:HomeProxy and installer improvements
Rename project and packages to Re:HomeProxy (luci-app-re-homeproxy), update package metadata and build scripts, and adjust UI labels and menus accordingly. Improve core install flow: add RAM detection, overlay-compression heuristics, automatic selection between full and compact (UPX) builds, stricter storage/RAM checks, and a variant argument for prepare_install; fetch sing-box-extended releases more robustly. Fix runtime behavior: init.d restores a default config when missing, add packaged homeproxy.default, prefer user-preferred core in ucode, and suppress top-level TLS for Shadowsocks in generated client configs. UI tweaks include better install/remove UX, gating "Same as main node" for custom routing, and updated diagnostics/status strings. Update translations (po files) and rpcd/menu/acl renames to match the rebrand.
2026-06-14 21:32:23 +04:00
Andrevich
758e52ed95 Add ByeDPI: loop fix, per-list node, secure-DNS, diagnostics
- Fix conntrack loop: run ciadpi as root+gid 8181, exclude egress via meta skgid
- ByeDPI as main node and per-list RU-rules node (generate_client.uc + client.js)
- ByeDPI preset selector + strategy tester fixes (node.js)
- Diagnostics: ByeDPI status/ports in Core section and report; pidof detection
- Harden firewall gen against CRLF (tr -d '\r') + .gitattributes LF enforcement
- Fix strToInt crash in byedpi_strategy_test
2026-06-13 23:39:34 +04:00
Andrevich
dac137feca Move ByeDPI UI to node page and add installer
Move ByeDPI configuration and testing UI from the Client tab to the Node Settings page and add an integrated installer/prepare flow. client.js: add fs/ui requires, new RPC declarations and core_mgmt download helper, change ByeDPI flag to auto-install on first enable with a modal-driven install flow and requirement checks; remove the large in-page ByeDPI settings block (now on Node page). node.js: add a full ByeDPI tab (presets, command options, strategy tester, test-all runner, UDP-over-TCP and QUIC-block flags) with RPC-based testing and curl detection. status.js: disable package removal when ByeDPI is selected as the main node and pass a flag to the card builder. Update po and pot translation strings and adjust several UI texts and warnings. Also update init/scripts/ucode files related to ByeDPI packaging and management.
2026-06-13 19:10:24 +04:00
Andrevich
923ba106e6 Add ByeDPI (ciadpi) support and UI
Introduce local ByeDPI (ciadpi) integration: add a ByeDPI tab in Client settings (presets, cmd options, tester, UDP-over-TCP and QUIC-blocking), a ByeDPI card on the Status page with install/remove/update actions and live status, and route support (byedpi-out) in generated client configs. Add RPC handlers for byedpi status, prepare/install/remove, strategy test and custom core detection; update ucode to detect custom core paths and expose core info. Init script now launches ciadpi when enabled and can add an nft rule to block QUIC; generate_client handles byedpi outbound fallback. Also update menu ordering and add translation strings for new core descriptions.
2026-06-13 15:25:17 +04:00
Andrevich
b916dc2d99 Move core management to core_mgmt script
Add a new /usr/share/homeproxy/scripts/core_mgmt.uc to handle core info, remote checks, install and remove operations (apk/opkg, GitHub API, package downloads). Update LuCI frontend to call the new script (fs.exec_direct) instead of in-process rpc methods, adjust core descriptions and translations, and conditionally hide China/GFW list version fields when routing_mode is proxy_banned_ru. In generate_client.uc prefer direct-out for ruleset downloads if the main node (or urltest nodes) use WireGuard/AmneziaWG. Also ensure RUN_DIR exists earlier in the init script and remove the old core_* rpc handlers from luci.homeproxy.
2026-06-12 10:38:52 +04:00
Andrevich
846cd03c29 Polish UI, DoH defaults and RU routing rules
Add small UI enhancements and adjust DNS/routing defaults for the Russia (proxy_banned_ru) mode. Changes include:

- UI: add icons and clearer labels in htdocs/.../client.js (main node, secure/russia DNS labels, flags, source/node labels, Separate URLTest). Reorder and rename some DNS options.
- DNS: switch default secure DNS to Cloudflare DoH (https://cloudflare-dns.com/dns-query) and update DoH/DoT option entries and default.
- Routing: change default config (root/etc/config/homeproxy) to routing_mode=proxy_banned_ru, routing_port=all, disable ipv6_support, enable proxy_calls and no_proxy_torrents by default.
- generate_client.uc: use new secure DNS default, add comment about Cloudflare DoH via proxy, add early resolve rule, and reorder/modify torrent and VoIP proxy rules so torrent bypass has priority and port/protocol mappings are corrected.
- init script: include proxy_banned_ru in dnsmasq configuration branch.
- Localization: update template and translations (fa_IR, ru, zh_Hans) to reflect new strings.

These changes aim to improve UX, prefer Cloudflare DoH for encrypted DNS by default, prevent DNS leaks, and refine routing behavior for the RU-specific proxy mode.
2026-06-11 21:45:53 +04:00
Andrevich
e8ca7ccc8f Add preferred core selection/detection
Expose and persist a preferred core option across UI and runtime. UI: show a 'Preferred core' dropdown in routing when multiple cores are available and populate it with auto/hiddify/singbox (htdocs/luci-static/.../client.js). Translations: add msgid for 'Preferred core' to POT and update fa_IR, ru, zh_Hans PO files. Init script: read config preferred_core, try the preferred core first and fall back to any installed core, keeping previous error behavior if none found (root/etc/init.d/homeproxy). Backend: rpcd ucode now reports available_cores by checking /usr/bin/hiddify-core and /usr/bin/sing-box (root/usr/share/rpcd/ucode/luci.homeproxy).
2026-06-11 12:52:16 +04:00
Andrevich
9fc25e4849 Add core detection, MTProxy inbound and bug fixes
Detect and expose core type/version reliably and add MTProxy inbound

- LuCI: fall back to /var/run/homeproxy/core.info when RPC lacks core info; load features before rendering status view.
- init: write core_type and version to /var/run/homeproxy/core.info on start.
- rpcd ucode: improve kernel module detection (use /sys/module), normalize access checks and parse core version/tags more robustly.
- UI: remove ip-full from Tun prerequisite message; only show direct/proxy IP checks for hiddify cores.
- Server view: add MTProxy server options (secrets, domain fronting, timeouts, concurrency) and expose MTProxy type when using singbox core.
- Client generator: emit MTProxy fields (secrets -> users, domain fronting, timeouts, concurrency) and propagate xhttp x_padding_bytes when using singbox.
- Node parsing: handle amnezia last_config JSON, fix labels and host/port resolution, and extract xhttp fields (path/host/mode/padding).
2026-06-10 20:18:30 +04:00
Andrevich
2d259e19dc Add multi-core detection and conditional core handling
Detect active core (hiddify-core vs sing-box) and update UI and runtime generation to handle both.

- htdocs/*: Update client/server status rendering to show detected core name/version or a "no core installed" message; adjust UI descriptions to "multi-core" wording; rename runtime log label to "core client".
- root/etc/homeproxy/scripts/generate_client.uc: Detect active core and set is_hiddify/is_singbox flags; make sniff/sniff_override/set_system_proxy fields conditional for hiddify; add sing-box-specific sniff route entry while keeping other route entries intact.
- root/etc/init.d/homeproxy: Select appropriate run command (srun for hiddify, run for sing-box) and use it when launching the core.

These changes enable support for both hiddify-core and sing-box, avoiding inappropriate configuration options for the inactive core and providing clearer UI feedback about which core is installed.
2026-06-10 16:36:24 +04:00
Andrevich
dbdde24846 Add AmneziaWG support and sing-box detection
Support for AmneziaWG (vpn://) links and sing-box core was added across UI, backend and init scripts. UI: parseVpnLink() handles AmneziaVPN vpn:// payloads; node editor adds amneziawg type and numerous Amnezia-specific fields; share import now accepts vpn:// links, deduplicates inputs and imports vpn + URI configs. View changes: renderStatus shows detected core name (hiddify-core or sing-box). Backend: generate_client treats amneziawg as a wireguard endpoint with extra amnezia parameters and includes amneziawg nodes in endpoint/outbound selection. Init script: start logic now prefers hiddify-core or sing-box and logs the actual binary started. RPCD: feature detection updated to probe for sing-box and parse its version/tags.
2026-06-10 16:12:15 +04:00
Andrevich
6e5b8e3da3 Check PROG executable in start_service
Add a pre-start check in start_service to verify $PROG exists and is executable. If the binary is missing, log an error advising to install hiddify-core and return status 1 to avoid continuing with an invalid runtime state.
2026-05-14 20:44:37 +04:00
Andrevich
900ac53717 Support custom_json, XHTTP, Naïve and parsing fixes
Adds a new 'custom_json' routing mode that can use a user-provided client config; UI changes in client.js to expose custom_json options and trigger subscription updates via RPC. node.js: require rpc, add NaïveProxy node type and XHTTP transport with UI fields (xhttp_mode, xhttp_headers), and adjust field dependencies. generate_client.uc: add TLS fragment support, normalize TLS ALPN to an array, handle xhttp mode/headers, rename log/output filenames, add default_mark and use it in routing, and write out hiddify-c.json. update_subscriptions.uc: import urldecode_params and extend URI parsing (naive, ssh, enhanced trojan parsing including xhttp and hiddify extras), add WireGuard parsing, and make base64 node decoding more robust. init.d: support custom_json by copying user-supplied config or generating config as appropriate and include custom_json in DNSMasq routing cases. Add an RPC method (subscription_update) in luci.homeproxy to run the subscription updater.
2026-05-14 00:22:45 +04:00
Andrevich
4f3511fdaf Switch sing-box to hiddify-core
Migrate the project from sing-box to hiddify-core across packaging, init scripts, UI and runtime helpers. Removed sing-box package dependency from build/IPK/Makefile and updated GitHub Actions usages (checkout/upload-artifact pinned to v4). UI and status/log viewers now reference hiddify-c/hiddify-core and log filenames were renamed. init.d was rewritten to use /usr/bin/hiddify-core, load client config from /etc/homeproxy/hiddify-c.json, simplify routing/tproxy setup, adjust dnsmasq handling, and run hiddify-c via procd; log cleaner and ACL/ucode RPC checks were updated accordingly. Overall this change migrates runtime/service names, config paths and version parsing to hiddify-core.
2026-05-12 23:47:25 +04:00
saldry
fccc558ab9 chore(init): simplify fetching sing-box version 2025-08-19 13:30:22 +08:00
Tianling Shen
5484b194a0
fix(init): disable quic-go gso on kernel 6.6
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-08-18 17:09:16 +08:00
Tianling Shen
b50f882484
chore: refine
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-08-04 16:26:36 +08:00
Tianling Shen
22455b9b6b
fix(init): avoid flush user-defined cron jobs
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-07-24 17:13:45 +08:00
Tianling Shen
cf3ea08b20
fix(init): fix cleanup forward/input fw rules when stop
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-05-05 00:27:13 +08:00
Tianling Shen
9e20aae986
feat(fw4/pre): split rules to avoid race condition
Fixes: #216
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-04-28 18:30:45 +08:00
Tianling Shen
1d33efd85b
fix(init): fix adding duplicate cron jobs
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-01-08 15:19:02 +08:00
Tianling Shen
28bd24fbe3
chore(init): suppress error message
Fixes: #264
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-01-07 18:33:04 +08:00
Tianling Shen
d6a06c6513
fix(init): fix typo error
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-01-06 14:51:29 +08:00
Tianling Shen
9a8066846a
chore(init): refine
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-01-06 13:06:48 +08:00
Tianling Shen
51e49d99ca
fix(init): fix permission for cache.db
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-01-06 13:02:12 +08:00
Tianling Shen
e7e22cef81
refactor(client): remove chinadns-ng
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-01-05 17:44:32 +08:00
Tianling Shen
1d815e111e
fix(init): fix mount tls certs
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-04 16:34:36 +08:00
IAN_K
539c03f083
fix(init): fix remove cron command 2024-11-29 12:57:49 +08:00
Tianling Shen
8d79f403a1
feat(init): adapt dnsmasq conf-dir update
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-29 23:19:04 +08:00
Tianling Shen
30c42935d4
fix(init): fix filter non-china v6addr with new chinadns-ng 2024-07-23 15:44:35 +08:00
Tianling Shen
74403eb1a9
feat(init): enable verdict-cache for chinadns-ng v2 2024-04-02 15:32:20 +08:00
Tianling Shen
0d2f0d86ad
feat: prepare chinadns-ng v2 support 2024-04-02 14:42:34 +08:00
Tianling Shen
2580ef75c2
feat(init): use multi-threaded chinadns-ng
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-02 13:52:51 +08:00
Anya Lin
7538a9c1e9
fix(init.d): fix startup failure in tun mode 2024-03-14 21:36:42 +08:00
Tianling Shen
f387ede773
feat(init): append chnlist to chinadns-ng
Closes: #77
2024-02-20 21:51:03 +08:00
Tianling Shen
faa1526c7b
chore(init): optimize create ruleset dir
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-01-22 15:43:58 +08:00
Anya Lin
8c98045638 chore(init.d): Create ruleset dir during initial boot in custom routing mode 2024-01-16 19:24:44 +08:00
Tianling Shen
d545826cca
fix(init): fix proxy list condition 2023-07-12 23:02:53 +08:00
Tianling Shen
65e8718bd9
feat(init): only reload servcie for wan network 2023-07-10 18:50:22 +08:00
Tianling Shen
f89b176f86
feat(init): reload service for network change 2023-07-08 21:22:14 +08:00
Tianling Shen
c78278d449
feat(init): mount timezone file 2023-06-08 13:37:07 +08:00
Tianling Shen
1996a23b03
chore: style
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-06-03 17:45:53 +08:00
Tianling Shen
a54efb6244
fix(init): make cert path readable 2023-06-03 15:06:28 +08:00
Tianling Shen
1e3e7b1e47
feat(server): split configuration/process from client
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-06-02 16:23:01 +08:00
Tianling Shen
2b47a9724a
chore(init): refine ujail rules 2023-04-16 05:52:50 +08:00
Tianling Shen
6d318d5bd7
chore(init): use root for tun interface 2023-04-14 23:53:39 +08:00
Tianling Shen
1bd3c8f4c7
fix(init): use privileged mode for tun/wg 2023-04-14 23:45:45 +08:00