From 5dae1e2e8397e6a374b16ff391719e1767ba4250 Mon Sep 17 00:00:00 2001 From: Miodrag Tokić Date: Mon, 4 Jun 2018 14:50:17 +0200 Subject: Run cron jobs via URL Kanboard supports running cron jobs via CLI. There are hosting services that don't offer CLI access, but they do offer calling a URL periodically. This feature is often used as a CLI cron job replacement. This commit adds a CronjobController called by "/cronjob" URL that will execute cron jobs as they were executed via CLI. The URL has public access, but is protected using the webhook token. The "/cronjob" URL should be called via HTTPS. --- app/Controller/CronjobController.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 app/Controller/CronjobController.php (limited to 'app/Controller/CronjobController.php') diff --git a/app/Controller/CronjobController.php b/app/Controller/CronjobController.php new file mode 100644 index 00000000..082fadfa --- /dev/null +++ b/app/Controller/CronjobController.php @@ -0,0 +1,32 @@ +checkWebhookToken(); + + $input = new ArrayInput(array( + 'command' => 'cronjob', + )); + $output = new NullOutput(); + + $this->cli->setAutoExit(false); + $this->cli->run($input, $output); + + $this->response->html('Cronjob executed'); + } +} -- cgit v1.2.3