Skip to content

Commit

Permalink
Add the possibility to pass API token as environment variable for Doc…
Browse files Browse the repository at this point in the history
…ker container
  • Loading branch information
fguillot committed May 12, 2017
1 parent 3cf9484 commit 5e32f55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions app/Api/Middleware/AuthenticationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ private function getApiToken()
return API_AUTHENTICATION_TOKEN;
}

if (getenv('API_AUTHENTICATION_TOKEN')) {
return getenv('API_AUTHENTICATION_TOKEN');
}

return $this->configModel->get('api_token');
}
}
9 changes: 5 additions & 4 deletions doc/en_US/env.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
1 change: 1 addition & 0 deletions docker/php/env.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
env[DATABASE_URL] = $DATABASE_URL
env[DEBUG] = $DEBUG
env[API_AUTHENTICATION_TOKEN] = $API_AUTHENTICATION_TOKEN

0 comments on commit 5e32f55

Please sign in to comment.