Commit graph

1 commit

Author SHA1 Message Date
Gustavo Iñiguez Goia
149e0f61b8
tasks: added downloader task
Added a new task to schedule files downloads.

Whenever the task is loaded, the files will be downloaded. From that on,
files will be downloaded according to the duration specified in the
"interval" field.
The format of the interval field is time.Duration:
https://pkg.go.dev/time#Duration

configuration example:

/etc/opensnitchd/tasks/tasks.json:
{
    "tasks":[
        {
            "enabled": false,
            "name": "downloader",
            "configfile": "/etc/opensnitchd/tasks/downloader/downloader.json"
        }
    ]
}

/etc/opensnitchd/downloader/downloader.json:
{
  "name": "downloader",
  "parent": "downloader",
  "description": "",
  "data": {
      "interval": "6h",
      "timeout": "5s",
      "urls": [
          {
              "name": "adaway",
              "enabled": true,
              "remote": "https://adaway.org/hosts.txt",
              "localfile": "/tmp/bl3/ads-adaway-hosts.txt"
          }
      ],
      "notify": {
          "enabled": true
      }
}
2025-09-12 00:24:59 +02:00