luci-ddns writes incorrect service_name when "--custom--" service is chosen
See original GitHub issueluci-ddns write incorrect service into /etc/config/ddns when “–custom–” service is chosen
option service_name '-'
where this line should be deleted or commented ( https://openwrt.org/docs/guide-user/services/ddns/client#custom_service1 )
This would result in “No update_url found/defined or no update_script found/defined! - TERMINATE” error when it try to update
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:5 (1 by maintainers)
Top Results From Across the Web
[OpenWrt Wiki] DDNS client
This guide will help you configure your DDNS service, so that your router ... A possible solution for this option is to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was having a look at the code and I think your solution above is not ideal. From what I can understand, we need to suppress the
service_name='-'
ONLY when saving the configuration file.So, that is when we call the
uci.set
command onservice_name
Here
As it is already done in other parts of the code, we need to check if it is a custom script and then IGNORE the uci.set command for the service_name.
We can do that with
Was quite the pain to test this in a running OpenWRT router. Browser cache also interfering.
Also, this is done when you select the service type and click
CREATE SERVICE
(pre-creation)Patching existing install
(EDIT) Because I had to do the same thing in other routers, I made this one-liner that uses
sed
to patch it. Should be safe, because if anything in the long pattern changes, it will do nothing. Use it at your own risk tho.This is what the sed command does:
File:
/www/luci-static/resources/view/ddns/overview.js
Original:
Changed:
Reload uhttp
Your browser may be stubborn about the Javascript cache though. Try in another browser to be sure (or inspect the source).
I think this is a simple working solution. I probably won’t be able to make a PR any time soon.
Cheers!
Gus
The problem is this line. https://github.com/openwrt/luci/blob/master/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js#L517 Please change this line from
service_name.value('-',"-- " + _("custom") + " --");
toservice_name.value('',"-- " + _("custom") + " --");
Please report back if this solve the issue.
Maybe we also need an
service_name.rmempty = true;
there?