Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User variable IBKRUSER / IBKRPASS for authentication (Issue #111) #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ docker run -d \
-p "127.0.0.1:6080:6080" \
-p "127.0.0.1:8888:8888" \
--ulimit nofile=10000 \
-e USERNAME=your_username \
-e PASSWORD=your_password \
-e IBKRUSER=your_username \
-e IBKRPASS=your_password \
ghcr.io/extrange/ibkr:latest
```

Expand All @@ -59,9 +59,9 @@ docker run -d \
Create a `.env` file:

```bash
USERNAME=<your IBKR username>
IBKRUSER=<your IBKR username>
# wrap password in single quotes if $, /, or \ are present
PASSWORD='<your IBKR password>'
IBKRPASS='<your IBKR password>'
```

`compose.yml`:
Expand All @@ -77,8 +77,8 @@ services:
ulimits:
nofile: 10000 # See FAQ
environment:
USERNAME: ${USERNAME}
PASSWORD: ${PASSWORD}
IBKRUSER: ${IBKRUSER}
IBKRPASS: ${IBKRPASS}
# TWOFA_TIMEOUT_ACTION: restart
# GATEWAY_OR_TWS: tws
#
Expand All @@ -99,8 +99,8 @@ View at [localhost:6080](http://localhost:6080).

| Variable | Description | Default |
|------------------------|------------------------------------------------------------------|------------|
| `USERNAME` | Username | `edemo` |
| `PASSWORD` | Password | `demouser` |
| `IBKRUSER` | Username | `edemo` |
| `IBKRPASS` | Password | `demouser` |
| `GATEWAY_OR_TWS` | What to start, either `tws` or `gateway` | `tws` |
| `TWOFA_TIMEOUT_ACTION` | [2FA timeout action][twofa-timeout]. Either `restart` or `exit`. | `restart` |
| `TWS_SETTINGS_PATH` | (optional) Path to store TWS settings (see FAQ) | |
Expand Down
8 changes: 6 additions & 2 deletions image-files/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ TWS_MAJOR_VERSION=$(ls ~/Jts/ibgateway/.)
# so we need to supply it here. The rest of the arguments can be read from
# the config.ini file.

# if unset, user old variable names
[[ -z "$IBKRUSER" ]] && IBKRUSER=$USERNAME
[[ -z "$IBKRPASS" ]] && IBKRUSER=$PASSWORD

exec /opt/ibc/scripts/ibcstart.sh "${TWS_MAJOR_VERSION}" $command \
"--user=${USERNAME:-}" \
"--pw=${PASSWORD:-}" \
"--user=${IBKRUSER:-}" \
"--pw=${IBKRPASS:-}" \
"--on2fatimeout=${TWOFA_TIMEOUT_ACTION:-restart}" \
"--tws-settings-path=${TWS_SETTINGS_PATH:-}"
8 changes: 6 additions & 2 deletions latest/image-files/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ TWS_MAJOR_VERSION=$(ls ~/Jts/ibgateway/.)
# so we need to supply it here. The rest of the arguments can be read from
# the config.ini file.

# if unset, user old variable names
[[ -z "$IBKRUSER" ]] && IBKRUSER=$USERNAME
[[ -z "$IBKRPASS" ]] && IBKRUSER=$PASSWORD

exec /opt/ibc/scripts/ibcstart.sh "${TWS_MAJOR_VERSION}" $command \
"--user=${USERNAME:-}" \
"--pw=${PASSWORD:-}" \
"--user=${IBKRUSER:-}" \
"--pw=${IBKRPASS:-}" \
"--on2fatimeout=${TWOFA_TIMEOUT_ACTION:-restart}" \
"--tws-settings-path=${TWS_SETTINGS_PATH:-}"
8 changes: 6 additions & 2 deletions stable/image-files/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ TWS_MAJOR_VERSION=$(ls ~/Jts/ibgateway/.)
# so we need to supply it here. The rest of the arguments can be read from
# the config.ini file.

# if unset, user old variable names
[[ -z "$IBKRUSER" ]] && IBKRUSER=$USERNAME
[[ -z "$IBKRPASS" ]] && IBKRUSER=$PASSWORD

exec /opt/ibc/scripts/ibcstart.sh "${TWS_MAJOR_VERSION}" $command \
"--user=${USERNAME:-}" \
"--pw=${PASSWORD:-}" \
"--user=${IBKRUSER:-}" \
"--pw=${IBKRPASS:-}" \
"--on2fatimeout=${TWOFA_TIMEOUT_ACTION:-restart}" \
"--tws-settings-path=${TWS_SETTINGS_PATH:-}"