summaryrefslogtreecommitdiff
path: root/app/ServiceProvider
diff options
context:
space:
mode:
authorMiodrag Tokić <miki@denimo.io>2018-06-04 14:50:17 +0200
committerFrédéric Guillot <fred@miniflux.net>2018-06-04 09:59:55 -0700
commit5dae1e2e8397e6a374b16ff391719e1767ba4250 (patch)
tree07e0f4bd69903916c88bb268e660e5adaec4c1a6 /app/ServiceProvider
parent87a94201aa1c48394798b4780a7ab8a03d303f8c (diff)
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.
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r--app/ServiceProvider/AuthenticationProvider.php1
-rw-r--r--app/ServiceProvider/RouteProvider.php3
2 files changed, 4 insertions, 0 deletions
diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php
index 9cb437ac..40a62971 100644
--- a/app/ServiceProvider/AuthenticationProvider.php
+++ b/app/ServiceProvider/AuthenticationProvider.php
@@ -143,6 +143,7 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->add('FeedController', '*', Role::APP_PUBLIC);
$acl->add('AvatarFileController', array('show', 'image'), Role::APP_PUBLIC);
$acl->add('UserInviteController', array('signup', 'register'), Role::APP_PUBLIC);
+ $acl->add('CronjobController', array('run'), Role::APP_PUBLIC);
$acl->add('ConfigController', '*', Role::APP_ADMIN);
$acl->add('TagController', '*', Role::APP_ADMIN);
diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php
index 5b9eca98..66942188 100644
--- a/app/ServiceProvider/RouteProvider.php
+++ b/app/ServiceProvider/RouteProvider.php
@@ -180,6 +180,9 @@ class RouteProvider implements ServiceProviderInterface
// PasswordReset
$container['route']->addRoute('forgot-password', 'PasswordResetController', 'create');
$container['route']->addRoute('forgot-password/change/:token', 'PasswordResetController', 'change');
+
+ // Cronjob
+ $container['route']->addRoute('cronjob', 'CronjobController', 'run');
}
return $container;