diff --git a/README.md b/README.md index 4ffa293..9b06040 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -59,9 +59,9 @@ docker run -d \ Create a `.env` file: ```bash -USERNAME= +IBKRUSER= # wrap password in single quotes if $, /, or \ are present -PASSWORD='' +IBKRPASS='' ``` `compose.yml`: @@ -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 # @@ -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) | | diff --git a/image-files/start.sh b/image-files/start.sh index a725dc4..a38ea68 100644 --- a/image-files/start.sh +++ b/image-files/start.sh @@ -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:-}" diff --git a/latest/image-files/start.sh b/latest/image-files/start.sh index a725dc4..a38ea68 100644 --- a/latest/image-files/start.sh +++ b/latest/image-files/start.sh @@ -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:-}" diff --git a/stable/image-files/start.sh b/stable/image-files/start.sh index a725dc4..a38ea68 100644 --- a/stable/image-files/start.sh +++ b/stable/image-files/start.sh @@ -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:-}"