Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1
    Untanglit
    Join Date
    Sep 2011
    Posts
    18

    Default Import Ad Block lists

    Hi,

    I'm new to Untangle and I found this post by WebFooL:


    WebFooL posted:


    Just do a loop and take the value form each line and print out
    "
    {"string":"$Value","javaClass":"com.untangle.uvm.n ode.StringRule","live":true}
    "


    I would like to do this but unfortunately I'm really bad at coding and I don't really know where to begin.

    Is there anyone who could help me?

    Thanks in advance!

  2. #2
    Untangle Ninja
    WebFooL's Avatar
    Join Date
    Jan 2009
    Location
    Sweden (Eskilstuna)
    Posts
    5,245

    Default

    Hi su_root and welcome to the forum,
    What is it that you are trying to do?

    I have some "prof of concept" things at http://untangle.nu/gen/


    What format do you have on the Ad list?

  3. #3
    Untangle Ninja
    WebFooL's Avatar
    Join Date
    Jan 2009
    Location
    Sweden (Eskilstuna)
    Posts
    5,245

    Default

    i did some modifications and now there is a "CSV" import method.

    http://untangle.nu/gen/ (click "AD blocker")

    Then you can just add ".1100i.com/,*site.com/*,.test.com" etc.
    And it will generate a json file that you can import.

    my site will generate up to 50 strings for free.

  4. #4
    Untanglit
    Join Date
    Sep 2011
    Posts
    18

    Default

    Amazing fast reply, thanks!

    It's a Ad Block plus format (1.1) and the list is found here (ah, I can't post any links here because I'm still a forum noob):

    But if You search on google for easylist.txt or wiltteri.txt, You'll find the lists there.

    Thank You Sir once again for Your fast reply!

  5. #5
    Untanglit
    Join Date
    Sep 2011
    Posts
    18

    Default

    Quote Originally Posted by WebFooL View Post
    i did some modifications and now there is a "CSV" import method.


    Then you can just add ".1100i.com/,*site.com/*,.test.com" etc.
    And it will generate a json file that you can import.

    my site will generate up to 50 strings for free.
    Amazing! I'll give it a try, thank You once again!

  6. #6
    Untangle Ninja
    WebFooL's Avatar
    Join Date
    Jan 2009
    Location
    Sweden (Eskilstuna)
    Posts
    5,245

    Default

    I did a test with converting the hole file.

    but i am getting error on importing it.

    I don't know if Untangle can cope with &@| etc.

    here is the list in json format
    http://untangle.nu/upl/KJH84QN/easylist.json

    A dev might take a look at it and see what i did wrong

  7. #7
    Untangle Ninja
    WebFooL's Avatar
    Join Date
    Jan 2009
    Location
    Sweden (Eskilstuna)
    Posts
    5,245

    Default

    nothing wrong the file is just to big.

    Do any dev know the limit?

  8. #8
    Untanglit
    Join Date
    Sep 2011
    Posts
    18

    Default

    Thanks alot for Your help/work!

    If/when this get's sorted out, I'll guess it would be quite easy to get a bash script to update Ad Block list ~once a week?

    EDIT: BTW, why does this have to be in the file {"string":"$Value","javaClass":"com.untangle.uv m.n ode.StringRule","live":true}?

    Why can't {"string":"","javaClass":"com.untangle.uv m.n ode.StringRule","live":true} be hard coded and only $Value called from a database?
    Last edited by su_root; 09-24-2011 at 11:50 AM.

  9. #9
    Untangle Ninja
    WebFooL's Avatar
    Join Date
    Jan 2009
    Location
    Sweden (Eskilstuna)
    Posts
    5,245

    Default

    the .json format is the way they import/export.

    The information is stored in a postgresql.
    So if you just find the sql table you can import it directly with normal sql queries.

    The test i did was to just import 2200 and that works but when i did a test with about 5500 id did not.

  10. #10
    Untangle Junkie dmorris's Avatar
    Join Date
    Nov 2006
    Location
    San Carlos, CA
    Posts
    17,747

    Default

    I wouldn't bother with any postgres hacks. Settings will be stored in files in JSON format in the future.

    I don't know any size limit. Try with firebug loaded and the console open - do you see any errors?
    Last edited by dmorris; 09-25-2011 at 09:31 AM.
    Attention: Support and help on the Untangle Forums is provided by volunteers and community members like yourself.
    If you need Untangle support please call or email support@untangle.com

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2