Skip to content

bochkov/tasks

Repository files navigation

Tasks

Tasks is a java app which do some jobs. These jobs started by schedule. Also jobs more complicated than bash scripts.

In this time we support these things:

Daily Press

Download and send by email e-version of popular (nope) russian magazines and papers. At this time we support:

Torrent update

Periodic check torrents on popular (nope) trackers and download it if they changed. At this time we support trackers:

Requirements

  1. Java 8
  2. MongoDB
  3. SMTP server (optional)
  4. Telegram bot (optional)

How to run

  1. Clone this repo on your machine
  2. In the project dir run ./gradlew build or gradlew.bat build prefers to your OS.
  3. Find in build/libs dir tasks-all.jar and copy it to desired location.
  4. Place with jar properties file (see below)
  5. Run java -jar tasks-all.jar
  6. At this time we not support add task from admin web page. Honestly we doesnt have admin page. So you must create your tasks manully. To do this you must create record in mongodb.

Sample property file

# port of http server
http.port = 8080

# connection params to mongodb
mongo.host = 127.0.0.1
mongo.port = 27017
mongo.db   = tasks
mongo.user =
mongo.pass =

# mail send params
mail.user = 
mail.pass = 
mail.host = 
mail.port = 
mail.from = 

system.tmpdir = /opt/tmp

# curl extra params, e.g. socks proxy
curl.extra-opts = --socks5 user:pass@server:port

Sample record to daily-press

{
    "job" : "sb.tasks.jobs.DailyPress", 
    "params" : {
        "mail_to" : ["recipient1", "recipient2"], 
        "subject" : "< Mail subject >", 
        "text" : "< Mail text >", 
        "url" : "http://www.sport-express.ru/"
    }, 
    "schedule" : [
        "0 0 0/2 * * ?", 
        "0 10/10 4,6 * * ?"
    ]
}

Sample record to torrent update

for rutracker.org params section must contains num field

{
    "job" : "sb.tasks.jobs.trupd.Trupd", 
    "params" : {
        "num" : "< torrent num on rutracker.org >", 
        "mail_to" : ["recipient1", "recipient2"], 
        "admin_telegram" : "< chatId for notification >"
    },
    "schedule" : [
        "0 0 * * * ?"
    ]
}

for others - url field

{
    "job" : "sb.tasks.jobs.trupd.Trupd", 
    "params" : {
        "url" : "https://www.lostfilm.tv/series/Riverdale/", 
        "download_dir" : "/opt/torrents", 
        "mail_to" : "< notification mail address >", 
        "telegram" : "< notification telegram chatId >"
    },
    "schedule" : [
        "0 0 * * * ?"
    ]
}

Telegram

Tasks doesnt provide a telegram bot. To start using telegram notification you must create own telegram bot and set webhook for it in you host. More on Telegram Bot API

Supported telegram commands:

1. /start Start using telegram bot. In answer you receive a chatId
2. /admin Register new user with admin privileges
2. /task Add torrent update tasks
3. /ls List all tasks
4. /info Info about task
5. /rm Delete task

How to contribute?

Just fork the repo and send me a pull request.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages