Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-ttyd: interface option is too restrictive #7466

Open
1 task done
anonhostpi opened this issue Dec 12, 2024 · 5 comments
Open
1 task done

luci-app-ttyd: interface option is too restrictive #7466

anonhostpi opened this issue Dec 12, 2024 · 5 comments

Comments

@anonhostpi
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

screenshots or captures

No response

Actual behaviour

Luci's ttyd app only allows you to specify interfaces and devices for the interface option. This causes problems when the interface has multiple IP addresses. See:

tsl0922/ttyd#1411

Expected behaviour

The -i flag that this option wraps also accepts an IP address, so Luci's ttyd implementation should also allow IPs on top of interfaces and devices

For comparison, the uci command supports setting the IP address directly:

uci set ttyd.@ttyd[0].interface='x.x.x.x'
uci commit
service ttyd stop
service ttyd start

Steps to reproduce

  1. go to Services -> Terminal -> Config, then try to specify an IP address for an interface. It won't let you.

Additional Information

NAME="OpenWrt"
VERSION="23.05.5"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 23.05.5"
VERSION_ID="23.05.5"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r24106-10cc5fcd00"
OPENWRT_BOARD="x86/64"
OPENWRT_ARCH="x86_64"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 23.05.5 r24106-10cc5fcd00"

What browsers do you see the problem on?

No response

Relevant log output

No response

@anonhostpi
Copy link
Author

anonhostpi commented Dec 12, 2024

To be clear, despite ttyd's issue with interfaces/devices, I still think that Luci should add the ability to set IPs as the interface (instead of replacing the dropdown altogether) to be consistent with uci (unless ttyd removes the ability to set the interface by device name)

@systemcrash
Copy link
Contributor

Then that's a ttyd problem, and not a luci problem. What happens when you specify multiple IPs?

https://github.com/tsl0922/ttyd/blob/main/man/ttyd.man.md

@anonhostpi
Copy link
Author

anonhostpi commented Dec 12, 2024

You misunderstood the problem. The problem is that LuCi doesn't allow you to specify IPs to use the workaround for the ttyd issue

LuCi is limited to devices and interfaces. It doesn't allow you to specify IP (which is inconsistent with uci). uci allows you to do all 3.

LuCi should allow all values acceptable by uci (and the ttyd -i command), not just a subset

@anonhostpi
Copy link
Author

anonhostpi commented Dec 12, 2024

Another way to phrase it:

Both uci and LuCI add OpenWRT interfaces as an option in addition to devices (ttyd calls these interfaces - -i).

ttyd -i also allows you to directly the specify the bind address using the same parameter. uci supports this behavior, but LuCI does not.

@anonhostpi
Copy link
Author

anonhostpi commented Dec 12, 2024

Another way to phrase it:

LuCI can't do this:

# ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

# NOTICE that this is an IP address, NOT an interface/device:
uci set ttyd.@ttyd[0].interface='192.168.1.1' # used as `ttyd -i <ttyd.@ttyd[0].interface>` by init.d

# ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

uci commit
service ttyd stop
service ttyd start

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

No branches or pull requests

2 participants