What's new

Adding APIs to httpd

  • 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!

black-raison-detre

Occasional Visitor
I am trying to add api to merlin's firmware, currently testing it on GT-AC2900. I want to create an appCentre for future addons using Vuejs because the current add-on method is too limiting. I actually have figured out how to change nvram values, trigger rc_service script using js fetch though the httpd appGet.cgi and applyapp.cgi. I haven't upload it to GitHub yet because it is far from complete. But writing custom_settings in /jffs/custom_settings is somewhat restrictive
get is alright, I have test it on browser
JavaScript:
fetch('appGet.cgi?hook=get_custom_settings()', { credentials: 'same-origin' }).then(resp => console.log(resp.json()))
this will readout the whole custom_settings.txt into a json object.
writing it you have to write the whole thing though applyapp.cgi. not like nvram values you can get individual value and set individual value.

So I try to create an customAction.cgi to function like nvram write. and support multiple configuration file as well
My work here
But I running into some segmentation fault that I am unable to locate. So maybe someone here can solve it?? Or maybe I should try something simpler.

The httpd source code is really a pain in the ***. I really don't know how those guys in Asus still working on this crap.
 
Btw, If anyone want to know about how to use js api call to change settings, feel free to ask. I think I have figured out most of it
 
Friend, you may be posting in the wrong subforum of this website: there is a subforum dedicated to https://www.snbforums.com/forums/asuswrt-merlin-addons.60/
There was a person who wrote and maintained a whole bunch of the addons users talk about, but they're not particularly active anymore and the underlying firmware continues to evolve; perhaps you might be inclined to review the situation and add your perspectives and possibly expertise to our machines?
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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