Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26
  1. #21
    Untangle Ninja mrunkel's Avatar
    Join Date
    Jul 2008
    Posts
    3,040

    Default

    Quote Originally Posted by su_root View Post
    I'll take a look at the SQL Ad Block tables when I have time. I'll try to convert Ad Block plus list to .csv and then hopefully a bash script that can import the .csv rules.
    Don't waste your time. There is no guarantee that the SQL tables will stay there and/or stay the same. There is ALREADY a method for loading external data into the rules. It's called JSON.

    You'd be better off writing a script to format your ad blocker list into proper JSON.
    m.


    Big Frickin Disclaimer:
    While I'm pretty sure, I can't guarantee that I know what I'm doing. There might be a better way to do this, and this way might actually suck. Make sure you understand the implications of what you're doing before trying to follow these directions.

    It often helps troubleshooting if you have a good network map. Look here if you want my advice on how to draw one.
    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

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

    Default

    i can add so it checks for " in the string and replace it with \" before generating the json output.
    Will look at it during the weekend if time allows.

  3. #23
    Untanglit
    Join Date
    Sep 2011
    Posts
    18

    Default

    Quote Originally Posted by mrunkel View Post
    There is no "Untangle JSON" format. It's just JSON.

    You can't have quotes in there without escaping them. The ] isn't the issue, it's the ".

    {"string":"a-kiltojenliitto.fi##TABLE[align=\"center\"]","javaClass":"com.untangle.uvm.node.StringRule","live":true}

    Should work.
    Yes, I know it isn't just the ] that is causing problems but when putting ] and " together (or " and ] and ") when it doesn't compute.

    Thank You for the tip!

  4. #24
    Untanglit
    Join Date
    Sep 2011
    Posts
    18

    Default

    Quote Originally Posted by mrunkel View Post
    Don't waste your time. There is no guarantee that the SQL tables will stay there and/or stay the same. There is ALREADY a method for loading external data into the rules. It's called JSON.

    You'd be better off writing a script to format your ad blocker list into proper JSON.
    I waste my time every day when I go to work. Untangle uses Ad Block plus rules, correct? If that is the case, I think it should make more sense to adept to Ad Block rules than the other way around.

    No offence but I really don't like the way the Ad Block rules is updated right now. First of all I can't upload the rules as is and secondly update is done manually. I would like to wget the list of choice and convert it to .csv (there is probably a better solution but I'm no coder so I don't know/have the experience) and then import the .csv to the database table.

    Also, it would be nice if the Untangle upgrade process would be modular. Let's say I have made changes to the Ad Block module (or OpenVPN) and want to use that in the future so I choose not to update Ad Block module.

    I understand that module A can rely on module B and thus this "dream" can be.. just a dream.

    Don't get me wrong, I really like Untangle but there is no such thing as a perfect product.

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

    Default

    csv to json
    http://www.cparker15.com/utilities/csv-to-json/

    you just need to have the csv formatted correctly (you need the header row to be right)

  6. #26
    Untanglit
    Join Date
    Sep 2011
    Posts
    18

    Default

    Quote Originally Posted by WebFooL View Post
    csv to json
    http://www.cparker15.com/utilities/csv-to-json/

    you just need to have the csv formatted correctly (you need the header row to be right)
    Thanks, again! Will try it out (soon).

Page 3 of 3 FirstFirst 123

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