diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | app/Api/Middleware/AuthenticationMiddleware.php | 4 | ||||
-rw-r--r-- | doc/en_US/env.markdown | 9 | ||||
-rw-r--r-- | docker/php/env.conf | 1 |
4 files changed, 12 insertions, 4 deletions
@@ -3,6 +3,8 @@ Version 1.0.44 (unreleased) Improvements: +* Update Docker image to Alpine Linux 3.5 +* Add the possibility to pass API token as environment variable for Docker container * Add wildcard search for task reference field * Improve automated action TaskAssignColorOnDueDate to update task only when necessary diff --git a/app/Api/Middleware/AuthenticationMiddleware.php b/app/Api/Middleware/AuthenticationMiddleware.php index 174dc467..d2910589 100644 --- a/app/Api/Middleware/AuthenticationMiddleware.php +++ b/app/Api/Middleware/AuthenticationMiddleware.php @@ -78,6 +78,10 @@ class AuthenticationMiddleware extends Base implements MiddlewareInterface return API_AUTHENTICATION_TOKEN; } + if (getenv('API_AUTHENTICATION_TOKEN')) { + return getenv('API_AUTHENTICATION_TOKEN'); + } + return $this->configModel->get('api_token'); } } diff --git a/doc/en_US/env.markdown b/doc/en_US/env.markdown index 902066d7..6e241f8b 100644 --- a/doc/en_US/env.markdown +++ b/doc/en_US/env.markdown @@ -3,7 +3,8 @@ Environment Variables Environment variables maybe useful when Kanboard is deployed as container (Docker). -| Variable | Description | -|---------------|---------------------------------------------------------------------------------------------------------------------------------| -| DATABASE_URL | `[database type]://[username]:[password]@[host]:[port]/[database name]`, example: `postgres://foo:foo@myserver:5432/kanboard` | -| DEBUG | Enable/Disable debug mode: "true" or "false" | +| Variable | Description | +|--------------------------|---------------------------------------------------------------------------------------------------------------------------------| +| DATABASE_URL | `[database type]://[username]:[password]@[host]:[port]/[database name]`, example: `postgres://foo:foo@myserver:5432/kanboard` | +| DEBUG | Enable/Disable debug mode: "true" or "false" | +| API_AUTHENTICATION_TOKEN | Custom API token | diff --git a/docker/php/env.conf b/docker/php/env.conf index bcf2e37c..23f6ce3d 100644 --- a/docker/php/env.conf +++ b/docker/php/env.conf @@ -1,2 +1,3 @@ env[DATABASE_URL] = $DATABASE_URL env[DEBUG] = $DEBUG +env[API_AUTHENTICATION_TOKEN] = $API_AUTHENTICATION_TOKEN |