Repository navigation
Conversation
Add the upstream-shaped luci-app-v2raya tree under contrib/upstream, install v2raya-detect from the service package for the LuCI overview, and record the open openwrt/packages#31203 and openwrt/luci#9220 pull requests. Also make the overview persist enabled=1 when the Start button is used, skip false core warnings when the detection helper is absent, and check both /usr/share/v2ray and /usr/share/v2raya for rule data. Signed-off-by: Amr Fateem <amr.fateem@yahoo.com>
| }; | ||
| o.description = _('The web interface listens on this address. Use 127.0.0.1:2017 to keep it off the LAN.'); | ||
|
|
||
| o = s.taboption('general', form.Value, 'baseurl', _('Base URL')); |
There was a problem hiding this comment.
Frontend-only with no backend consumer: the v2raya package currently in packages (2.2.7.5, +xray-core) only exports the options in start_service at v2raya.init:46-57. baseurl, core_startup_timeout, redirect_respect_bound_device, v2ray_assetsdir, gomemlimit, gomaxprocs, gogc and nofile are ignored, and the "v2raya_core only" texts are wrong for the xray-core based package. Is this meant to wait for openwrt/packages#31203? If so, the PR description should say these settings depend on it, not only the detection helper.
Generated by Claude Code
| return m.render(); | ||
| }, | ||
|
|
||
| handleSaveApply: function (ev, mode) { |
There was a problem hiding this comment.
The comment's premise is wrong. The default handleSaveApply never restarts the service. It calls ui.changes.apply(), and this override loses that call's apply modal, page reload, and the unchecked-apply mode. Drop the override.
Generated by Claude Code
| uci.set('v2raya', 'config', 'enabled', '1'); | ||
|
|
||
| return L.resolveDefault(uci.save(), null).then(function () { | ||
| return runAction('start', button); |
There was a problem hiding this comment.
uci.save() only stages enabled=1 in the session delta, so the init script still sees enabled=0 and returns early at v2raya.init:37. Start does nothing on a disabled service until the later uci.apply() fires the reload trigger. Run uci.apply() before runAction('start'), or skip the explicit start.
Generated by Claude Code
| "description": "Grant access to the v2rayA service and configuration", | ||
| "read": { | ||
| "file": { | ||
| "/etc/init.d/v2raya": [ "exec" ], |
There was a problem hiding this comment.
Putting init-script exec in the read section lets read-only users stop and restart the service. Keep it only under write, and list the allowed commands as other apps do, e.g. luci-app-adblock's ACL:`` "/etc/init.d/v2raya start", `"... stop"`, `"... restart"`.
| "/etc/init.d/v2raya": [ "exec" ], |
Generated by Claude Code
| return E('div', { class: 'cbi-map' }, [ | ||
| E('h2', {}, _('v2rayA')), | ||
| E('div', { class: 'cbi-map-descr' }, [ | ||
| _('A web client for its own Xray-based core, with transparent proxy support.'), |
There was a problem hiding this comment.
nit: "Xray-based core" contradicts line 170 and the settings page, which say Xray-core is never used as the v2rayA backend.
Generated by Claude Code
| E('h2', {}, _('v2rayA log')), | ||
| E('div', { class: 'cbi-map-descr' }, | ||
| _('Showing the last %d lines of %s. Refreshes every %d seconds.') | ||
| .format(MAX_LINES, LOG_PATH, L.env.pollinterval || 5)), |
There was a problem hiding this comment.
nit: poll.add(refresh, 5) hardcodes 5 s, so showing L.env.pollinterval can state the wrong interval.
| .format(MAX_LINES, LOG_PATH, L.env.pollinterval || 5)), | |
| .format(MAX_LINES, LOG_PATH, 5)), |
Generated by Claude Code
23bccf5 to
8ff1690
Compare
Replace the single settings form with three pages: an overview with the service state, versions, detected cores and start/stop controls; a tabbed settings form for the options the 2.5.x init script supports; and a log viewer with refresh and clear. The overview reads /usr/libexec/v2raya-detect, which the v2raya package installs, to report the installed core and any other proxy service. Detection is skipped cleanly when the helper is absent. The extra settings are consumed by the 2.5.x init script; older releases store but ignore them. Signed-off-by: Amr Fateem <amr.fateem@yahoo.com>
8ff1690 to
bac74fb
Compare
|
Addressed in bac74fb:
|
Record that openwrt/luci#9220 is a draft until openwrt/packages#31203 lands, and that it needs to be marked ready after the merge. Signed-off-by: Amr Fateem <amr.fateem@yahoo.com>
Pull request details
Description
This replaces the minimal v2rayA configuration form with three pages:
address, web UI link, and start/stop/restart buttons.
advanced options that the OpenWrt init script supports (base URL, core
startup timeout, hooks, Go memory/scheduler limits, descriptor limit).
The overview uses /usr/libexec/v2raya-detect from the v2raya package to
show installed cores and to warn about a second transparent-proxy stack.
When that helper is missing (v2raya 2.2.x), the overview skips detection
instead of reporting false results.
The menu and ACL use the existing admin/services/v2raya paths and the ACL
adds only the exec/read permissions the pages need. The existing po/
translations are untouched; new strings fall back to English until
Weblate regenerates them.
Screenshot or video of changes (if applicable)
Not included; the pages use the standard LuCI form, table and pre
elements and have no custom styling.
Maintainer (preferred)
@cnsztl, @amrfateem
Checklist
v2raya: update to 2.5.13 packages#31203. Without it the overview degrades cleanly.
I built the app from the luci feed in the 25.12.6 ipq40xx SDK; the
modules pass the LuCI minifier and the same views are deployed on an
OpenWrt 25.12 ipq40xx router running v2raya 2.5.13.
I used an AI assistant to help draft the code and this description; I
reviewed every line and take responsibility for it.
This app targets v2rayA 2.5.13 from openwrt/packages#31203. The extra
settings and the core detection depend on the 2.5.x init script and the
detection helper; with the 2.2.x package currently in the feed they are
stored but ignored, and detection is skipped. The PR is a draft until
#31203 merges.