alectrocute / UnboundBL

🛑 DNSBL (adblock) on OPNsense with UnboundBL & Unbound DNS
62 stars 12 forks source link

Blocklist and whitelist fields empty #15

Open Madj42 opened 4 years ago

Madj42 commented 4 years ago

Running into an issue with the two fields above where they show up blank on page load. They are definitely there but look to be hidden in the page load. Has anyone else ran into this issue or have a fix? I'm assuming this plugin is abandoned?

marcelloinfoweb commented 4 years ago

The same problem here, is the project really abandoned?

Keltere commented 4 years ago

@alectrocute sorry to bother but could you at least resolve this problem? In the meantime ill check if i can do something about but i'm not a developer and my knowledge is limited. Thanks for your work.

Keltere commented 4 years ago

Strangely the fields have all the links listed but they disappear after showing the count of the entries

Before: Screenshot (43)

After: Screenshot (44)

You can see it on the right

I think it's just a javascript problem and this is the script that must be fixed

function numberWithCommas(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function getStats(){ajaxCall(url="/api/unboundbl/service/stats",sendData={},callback=function(e,n){$("#statsInner").text(numberWithCommas(e.message))})}$(document).ready(function(){var e={frm_general_settings:"/api/unboundbl/general/get"};mapDataToFormUI(e).done(function(e){formatTokenizersUI(),$(".selectpicker").selectpicker("refresh")}),getStats(),$("#responseMsg").addClass("hidden"),$("#console-dnsbl").addClass("hidden"),mapDataToFormUI(e).done(function(e){}),$("#saveAct").click(function(){$("#saveAct").prop('disabled',true),saveFormToEndpoint(url="/api/unboundbl/general/set",formid="frm_general_settings",callback_ok=function(){$("#saveAct_progress").addClass("fa fa-spinner fa-pulse"),$("#console-dnsbl").removeClass("hidden"),$("#responseMsgInner").text("Working..."),ajaxCall(url="/api/unboundbl/service/reload",sendData={},callback_ok=function(){ajaxCall(url="/api/unboundbl/service/refresh",sendData={},callback=function(e,n){$("#responseMsg").removeClass("hidden"),$("#saveAct").prop('disabled',false),$("#responseMsg").text("Settings changed! Please restart your DNS resolver."),$("#responseMsgInner").text(e.message),getStats(),$("#saveAct_progress").removeClass("fa fa-spinner fa-pulse")})})})})});const copyToClipboard=e=>{const n=document.createElement("textarea");n.value="include:/var/unbound/dnsbl.conf",n.setAttribute("readonly",""),n.style.position="absolute",n.style.left="-9999px",document.body.appendChild(n);const t=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);n.select(),document.execCommand("copy"),document.body.removeChild(n),t&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(t))};

Keltere commented 4 years ago

@Madj42 @marcelloinfoweb on /usr/local/opnsense/mvc/app/views/OPNsense/Unboundbl/general.volt replace it with this after removing the .txt extension general.volt.txt

For this workaround i just removed mapDataToFormUI(e).done(function (e) {}) from the script You won't be able to copy the url but it's a decent workaround for now.

kevin88252 commented 4 years ago

@Keltere thank you for this, can you please create a pull request so it can be fixed in the future?

Keltere commented 4 years ago

@Keltere thank you for this, can you please create a pull request so it can be fixed in the future?

It isn't a fix, just a workaround so i will not make a pull request, sorry. Anyway even with this fix if a great number of entries is added unbound will just stop working. Don't know how many or what is causing this (maybe multiple entries of the same host). I really suggest to just pick a raspberry pi and use pihole if you need dns block or move to bind

kevin88252 commented 4 years ago

maybe you are right, it is sad to see that there is no more developing...

does bind work on opnsense?

Keltere commented 4 years ago

maybe you are right, it is sad to see that there is no more developing...

does bind work on opnsense?

Of course some uses unbound and bind together but i didn't look into yet. Good luck.

alectrocute commented 4 years ago

I've been meaning to get back to this project, but full-time work has taken priority as of late. :(

Keltere commented 4 years ago

I've been meaning to get back to this project, but full-time work has taken priority as of late. :(

By my test Unbound itself crashes with a lot of entries. If unbound can't handle the load there is no point in continuing this project and in that case don't worry at all. Anyway thanks for at least have tried to do something for the community, hope you stay safe this days.

fireheadman commented 4 years ago

+1 for me also... I am not seeing my working block and white lists as I add them. They simply disappear on each service restart.

Would be helpful to know where the whitelist entries are stored off to.. image

...EDIT: Think I found it. Will just have to remember to hand edit this and restart unboundDNS each time since UI is currently a blackhole. cat /usr/local/etc/Unboundbl/UnboundBL.conf image