What's new

Feature request: Launch user scripts from WebUi

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Juglar

Occasional Visitor
Hi:

This is my first post to this forum, after hours looking for previous talks about this subject.

I miss one feature that I am convinced that would significantly enhance the Merlin FW and make the great power of its user scripts quickly accessible: the ability to associate user scripts to WebUi buttons so that pressing one of these buttons would launch the associated user script (maybe even with some optional argument, to fill just before pressing the button). This would allow the normal user to access some functions, maybe implemented by more advanced users, and even these advanced users to access those functions with minimum key presses (specially important from small android mobiles).

The buttons could be accessible through just one menu option level (which could be named "User Scripts") and should appear in the main menu when the "Enable JFFS custom scripts and configs" option were enabled. Subject to the "Web Interface" configuration conditions, when someone from the Internet accessed the WEB UI, but (for example) with the URL ending in "/UserScripts", after the corresponding authentication, he should be directed to this web page. In it, he should see the number of configured buttons, with their configured name and a text box to optionally enter arguments. For configuration of this page, there might be a pencil icon to the rightmost of each (added) button, which would allow the more advanced (or patient) user to fill-in the button name, the associated script (maybe with full file path) and maybe the optional argument default value (Or in other similar way, homogeneous to the rest of the webui interface).

I think this feature would complete the effort devoted to make Merlin offer the power of user scripts, by making them really accessible to the user, for the many possible cases when it is not appropiate to launch them from the "official" launching places (init, wan up, etc).

I understand the reluctance to modify the WebUi, but I think this modification could be very separated from the rest and would add very little risk to cause harm to the rest.

Now, my longer explanation of my need (issuing parental control tickets), but the feature requested would be of much wider and more general utility:

I've come back from Tomato to this Merlin FW because I couldn't make the triple VLAN work fast enough there, while here, with Merlin, I keep the HW NAT and IPTV works like a charm from 2 decos, including via the WIFI.

In Merlin, I have initially missed the Parental Control flexibility of Tomato. But, after some days learning, I think I'm ready to "develop" here, with user scripts based on IPSET, even much better Parental Control than in Tomato (when I finish, I'll try to contribute my results here).

I need to manually launch some user scripts from the WAN from my android mobile (for parental control "tickets", when my sons ask me and I am outside home). I might be in a meeting and I need to respond quickly and with MINIMUM KEY PRESSES. I will prepare some TicketUserScript's. I know I could try to connect from my android in the internet through telnet or SSH, but it would need quite a lot of key presses and each of them are a pain in the android keyboard. However, if the feature requested were available, I would just have a direct URL access shortcut in my mobile browser that would directly place me in the User Script page in my home; then, I would enter the required authentication and press one of the configured buttons.

So, how do you see the possibility of implementing this? (maybe it is already in the TO DO list) I think many users would benefit and thank it.

In any case, thank you for reading.

Juglar
 
Last edited:
Another alternative would be to use a ssh client that allows you to pass a string after you login ( such as Juicessh).

I have a menu option in Juicessh that automatically logs me in and starts the absolution ad blocker which is a script. This also has the added advantage of not exposing the web gui to the WAN. I'm pretty sure that would result in even less keystrokes than navigating through the web gui on a small screen.

Sent from my LG-V940n using Tapatalk
 
Not going to happen, at one time Merlin FW had a command window like Tomato IIRC, but it was removed, impossible to secure. You can do anything you want with ssh root command line access.
 
I don't wanna mention other firmware in snbforums but,,,

install xiaobao firmware.

Thanks for the tip. I had no idea about it. I've followed some google results, like this one:

http://114.55.26.126/thread-2745-1-1.html

But they seem to be in another strange characters language (japanese?).

The questions are:
1.- Will it easily support multi station IPTV, like Merlin FW does with Movistar TV in Spain?
2.- Does it keep the hardware NAT offered by Asus AC68? (the one I use)?
3.- Do you know any link to an english site where I can find out more?

Maybe my objective (user script launching with minimum keypress from android) is better covered by the Juicessh solution replied by crandy2, but I would like to have a look on the xiaobao you propose.

Thank you.
 
Another alternative would be to use a ssh client that allows you to pass a string after you login ( such as Juicessh).

I have a menu option in Juicessh that automatically logs me in and starts the absolution ad blocker which is a script. This also has the added advantage of not exposing the web gui to the WAN. I'm pretty sure that would result in even less keystrokes than navigating through the web gui on a small screen.

Sent from my LG-V940n using Tapatalk

Sure I'm going to try your solution, which seems very promising and seems to offer the advantage of less key presses.

Anyway, I keep on thinking that the user scripts launching from the webui would be quite convenient (I could use any browser, without having to install another app).

Thank you very much.
 
Not going to happen, at one time Merlin FW had a command window like Tomato IIRC, but it was removed, impossible to secure. You can do anything you want with ssh root command line access.

I count on beeing able to use ssh from the internet (up to now just checked from the LAN), but I'm not so sure of it needing fewer keypresses and, definitely, it wouldn't be as universally available as from any browser from any terminal. At this moment, I think the Juicessh solution proposed by crandy2 is most promising for my present needs.

But, in relation to security, I don't think that some user scripts launcher buttons would present increased vulnerability over the already available WebUi internet access. Do you consider the current WebUi internet access to be unsafe? In the worst case, Merlin could forbid just the buttons configuration from the internet, but not their clicking.

About removing the Merlin's old command window, I would prefer a warning to the user about its risk and that the user would be left the decision to enable or disable it.

Thank you, anyway, for the info about that old command window and the clarification of the reason of its removal.
 
Last edited:
I don't see this being added and for fairly good reason. Such a feature would require the script to be run as root which is a huge vulnerability and attack vector which is why the old console was removed. If you are worried about fewer clicks, add auto-login with a SSH client like Xshell, I personally have mine setup with a pubkey which is much faster then logging in via browser
 
If you are worried about fewer clicks, add auto-login with a SSH client like Xshell, I personally have mine setup with a pubkey which is much faster then logging in via browser

No doubt we all do but the original post states:

"I need to manually launch some user scripts from the WAN from my android mobile (for parental control "tickets", when my sons ask me and I am outside home)."
 
I thank the suggestions to use an automateable SSH clients, for I hadn't yet looked for any (by the way, the free JuiceSSH doesn't let me automate the after-login shell command. I don't know if I should complement it with any extension or I would need to buy the pro version. Probably I'll try also and compare with the Xshell before). This could be the best solution for my personal need.

But my first feature request I think would be of benefit for many very unadvanced users. I keep on thinking that the security could be kept by restricting it, for example, to https and, maybe, by not letting the remote user modify the buttons configuration (just clicking).
 
Juglar, since you are new around perhaps you do not know what this project (Merlin Firmware) is all about.

RMerlin said:
The primary goals of this project are to fix bugs, add a few basic features and tweaks to the original firmware. This firmware will try to remain as close as possible to the original firmware. If you are looking for a slew of advanced features, then this project is not for you. Look at TomatoUSB or DD-WRT, two excellent products that might suit your needs better.
 
Juglar, since you are new around perhaps you do not know what this project (Merlin Firmware) is all about.

Thanks, KevTech, for the info. I already read it before installing Merlin. Actually, as I explained before, I went to Tomato when I saw that the flexibility of parental control I was looking for was not available. But when, after days of trying with tutorials, I finally achieved to make it view IPTV in just one station, it failed with some HD TV channels and the download speed was clearly lower than with Merlin. So, I decided to revert to Merlin.

Now, here in Merlin, I want to implement some improved parental controls. For that, I'm going to use User Scripts, that I understand are acknowledged by the developers as the way to allow more advanced features. What I intend to use is not new to Merlin: iptables and ipSets. So, up to now, I'm not requesting Merlin to get more distanced from the main line.

What I request, based on that User Script support has already been decided and included, is that they be made available to the unadvanced user through configurable WebUi buttons. The inconvenients to that that I've read up to now are:

1.- Security. Do you think that those buttons increase the vulnerability over the already available (by https, for example) internet WebUi access?

2.- Risk of damaging other features. Do you think that they cannot be implemented as a new main menu option, very separated from the rest of the options?

3.- Distancing from the main Merlin's intention of keeping it close to the stock firmware. Do you think that adding buttons to make the already offered User Scripts available through the WebUi significantly distances it over the current User Scripts availability through SSH?

I understand that, at first thought, it may seem dangerous, specially when it may remind of the eliminated and feared command console, but, if you think more carefully, I think that it is quite different.

However, I'm afraid that, with all this "popular" (hope not "populist") oposition, it won't actually be implemented, which will be a pity for the firmware. It sounds to me like having developed a marvelous and useful cruise control in a car model but, then, not having made it available to the drivers but through a complicated selection procedure, deep in the driving menus.
 
Last edited:

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top