Skip to content

Commit 446174b

Browse files
committed
Document containerized CLI configuration
1 parent 4e610dc commit 446174b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ There are two ways to authenticate:
7575

7676
*_Warning_*: An API token can act as the account that created it, with no restrictions. Use a separate machine account to limit the token's access.
7777

78+
### Authentication in Dockerized cli (compose)
79+
80+
To prevent malicious attackers from serving the browser login page [1], the page is served on the local loopback address (`127.0.0.1`), and not on `localhost`. This does mean that if you containerize the cli using docker (compose), you won't be able to use the web browser login method. Because the browser login is the default authentication method, users will still be asked to go to the local address even though it won't be accessible from outside the container.
81+
82+
To use API tokens [2] as default authentication and to ask for an api token instead of a browser login, you can add an environment variable to configure this: `{application.env_prefix}APPLICATION_LOGIN_METHOD`. by default, the `env_prefix` is set to `PLATFORMSH_CLI_`, so this would result in the following environment variable in your docker file:
83+
84+
```dockerfile
85+
ENV PLATFORMSH_CLI_APPLICATION_LOGIN_METHOD api-token
86+
```
87+
88+
or the following environment variable in compose.yaml when using docker compose:
89+
90+
```yaml
91+
environment:
92+
PLATFORMSH_CLI_APPLICATION_LOGIN_METHOD: api-token
93+
```
94+
7895
## Customization
7996
8097
You can configure the CLI via the user configuration file `~/.platformsh/config.yaml`.

0 commit comments

Comments
 (0)