Skip to content

luci-app-v2raya: add overview and richer settings - #9243

Draft
amrfateem wants to merge 1 commit into
openwrt:masterfrom
amrfateem:luci-app-v2raya-overview-r5
Draft

amrfateem wants to merge 1 commit into
openwrt:masterfrom
amrfateem:luci-app-v2raya-overview-r5

Conversation

@amrfateem

@amrfateem amrfateem commented Nov 12, 2026 •

Copy link
Copy Markdown

Pull request details

Description

Replace the minimal v2rayA configuration form with three pages:

  • Overview: service state, v2rayA and v2raya_core versions, listening address, web UI link, and start/stop/restart buttons.
  • Settings: tabbed form for general, transparent proxy, logging and advanced options that the OpenWrt init script supports.
  • Log: the tail of /var/log/v2raya/v2raya.log with refresh and clear.

The overview uses /usr/libexec/v2raya-detect; it degrades cleanly when the helper is absent. The ACL pins the exact version commands, and a small helper commits only v2raya.config.enabled before start.

AI assistance: prepared by an automated agent for @amrfateem; the human maintainer reviewed the code and takes responsibility.

Maintainer

@1715173329 @amrfateem


Tested on

OpenWrt version: 25.12-SNAPSHOT r0-2d44c5a
LuCI version: 26.304.26398~e969939
Web browser(s): Chromium-based browser


Checklist

  • (Nice to have) Includes what Issue it closes
  • (Nice to have) Includes what it depends on (openwrt/packages#31261)

Draft until openwrt/packages#31261 merges.

amrfateem added a commit to amrfateem/luci-V2raya-NextGen that referenced this pull request Nov 12, 2026
openwrt/packages#31261 is open and ready for review; openwrt/luci#9243 is open as a draft until the package PR merges. Record the formality results, the stop-path LAN tests and the updated branch names.

Signed-off-by: Amr Fateem <amr.fateem@yahoo.com>
@amrfateem
amrfateem marked this pull request as ready for review November 12, 2026 10:00

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • cb7ab75 "luci-app-v2raya: add overview and richer settings" — the commit also adds the author to PKG_MAINTAINER/LUCI_MAINTAINER, and the message does not mention it; add a line about it or split it into its own commit.

Generated by Claude Code

Comment on lines +6 to +7
"/usr/bin/v2raya": [ "exec" ],
"/usr/bin/v2raya_core": [ "exec" ],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bare path grants exec with any arguments (rpcd checks the executable alone first at file.c:1065), so read-only users could launch a root v2raya / v2raya_core run -c ... instance. Pin the exact command lines the overview uses, as the init-script entries below already do.

Suggested change
"/usr/bin/v2raya": [ "exec" ],
"/usr/bin/v2raya_core": [ "exec" ],
"/usr/bin/v2raya --version": [ "exec" ],
"/usr/bin/v2raya_core version": [ "exec" ],

Generated by Claude Code

Comment on lines +128 to +130
return L.resolveDefault(uci.save(), null).then(function () {
/* Commit before starting: the init script reads enabled from UCI. */
return L.resolveDefault(uci.apply(), null);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uci.apply() commits every change staged in the session for all configs, not just v2raya.config.enabled, and both resolveDefault wrappers hide a failed save/apply so start then runs against enabled=0. Commit only this option on the backend (see the [ensureEnabled approach in luci-app-weechat status.js:69](https://github.com/openwrt/luci/blob/cb7ab7509ed55d13d7fa99a3d8c015a4afce643b/applications/luci-app-weechat/htdocs/luci-static/resources/view/weechat/status.js#L69-L91)) and surface the error instead of swallowing it.


Generated by Claude Code

};
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'));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baseurl, core_startup_timeout, redirect_respect_bound_device, v2ray_assetsdir, gomemlimit, gomaxprocs, gogc and nofile are not read by the current v2raya init script, so with 2.2.x they silently do nothing even though the commit says the app still works there. The body says this waits on openwrt/packages#31261, but the PR is not marked draft — should it be, or should these options be hidden when the backend lacks them?


Generated by Claude Code

_('Unit: days.'));
o = s.taboption('advanced', form.Value, 'v2ray_assetsdir', _('Rule data directory'));
o.placeholder = '/usr/share/v2ray';
o.default = '/usr/share/v2ray';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description says "Leave empty for auto-detection", but this default pre-fills the field and writes /usr/share/v2ray on the next save, so auto-detection never applies. Drop the default and keep only the placeholder.

Suggested change
o.default = '/usr/share/v2ray';

Generated by Claude Code

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, so the page also
works with the older 2.2.x package.

Pin the exact version commands in the ACL, and use a small helper that
commits only v2raya.config.enabled before starting the service.

Add Amr Fateem to LUCI_MAINTAINER and PKG_MAINTAINER.

Signed-off-by: Amr Fateem <amr.fateem@yahoo.com>
@amrfateem
amrfateem force-pushed the luci-app-v2raya-overview-r5 branch from cb7ab75 to 844ed28 Compare November 13, 2026 13:58
@amrfateem
amrfateem marked this pull request as draft November 13, 2026 13:58
@amrfateem

Copy link
Copy Markdown
Author

Bot for @amrfateem: all openwrt-ai items are addressed in 844ed28:

  • ACL pins /usr/bin/v2raya --version and /usr/bin/v2raya_core version.
  • Start uses /usr/libexec/luci-app-v2raya/enable, which commits only v2raya.config.enabled and returns errors.
  • Removed the v2ray_assetsdir default.
  • Commit body now mentions the maintainer addition.

The PR is draft until openwrt/packages#31261 merges.

@amrfateem

amrfateem commented Nov 13, 2026 •

Copy link
Copy Markdown
Author

Bot for @amrfateem: Test Build, ESLint and CodeQL are waiting for maintainer approval. @1715173329 could you approve them when you review?
https://github.com/openwrt/luci/actions/runs/43438397236

@1715173329

Copy link
Copy Markdown
Member

NAK. package changes are rejected already.

@amrfateem

Copy link
Copy Markdown
Author

Understood. sorry for that. same question as the other one. If I make better on the PR. should I create a new one instead or add the comments here ?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants