Skip to content

Commit

Permalink
Update latest to 10.26.1k (#62)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
github-actions[bot] and github-actions authored Jan 10, 2024
1 parent 840ffe7 commit 66b6df5
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ It includes:

| Channel | IB Gateway Version | IBC Version | Docker Tags |
| -------- | ------------------ | ----------- | --------------------------- |
| `latest` | `10.26.1j` | `3.18.0` | `latest` `10.26` `10.26.1j` |
| `latest` | `10.26.1k` | `3.18.0` | `latest` `10.26` `10.26.1k` |
| `stable` | `10.19.2h` | `3.18.0` | `stable` `10.19` `10.19.2h` |

All [tags](https://github.com/gnzsnz/ib-gateway-docker/pkgs/container/ib-gateway/) are available in the container repository. IB Gateway and TWS share the same version numers and tags, TWS tags are available on it's [container repository](https://github.com/gnzsnz/ib-gateway-docker/pkgs/container/tws-rdesktop).
Expand Down Expand Up @@ -102,7 +102,7 @@ All environment variables are common between ibgateway and TWS image, unless spe
| `TWS_SETTINGS_PATH` | Settings path used by IBC's parameter `--tws_settings_path`. Use with a volume to preserve settings in the volume. | |
| `CUSTOM_CONFIG` | If set to `yes`, then `run.sh` will not generate config files using env variables. You should mount config files. Use with care and only if you know what you are doing. | NO |
| `JAVA_HEAP_SIZE` | Set Java heap, default 768MB, TWS might need more. Proposed value 1024. Enter just the number, don't enter units, ex mb. See [Increase Memory Size for TWS](https://ibkrguides.com/tws/usersguidebook/priceriskanalytics/custommemory.htm) | **not defined** |
| `SSH_TUNNEL` | If set to `yes` then `socat` won't start, instead a remote ssh tunnel is started. SSH keys should be provided to container through ~/.ssh volume. | **not defined** |
| `SSH_TUNNEL` | If set to `yes` then `socat` won't start, instead a remote ssh tunnel is started. if set to `both` then `socat` and remote ssh tunnel are started. SSH keys should be provided to container through ~/.ssh volume. | **not defined** |
| `SSH_OPTIONS` | additional options for [ssh](https://manpages.ubuntu.com/manpages/jammy/en/man1/ssh.1.html) client | **not defined** |
| `SSH_ALIVE_INTERVAL` | [ssh](https://manpages.ubuntu.com/manpages/jammy/en/man1/ssh.1.html) `ServerAliveInterval` setting. Don't set it in `SSH_OPTIONS` as this behavior is undefined. | 20 |
| `SSH_ALIVE_COUNT` | [ssh](https://manpages.ubuntu.com/manpages/jammy/en/man1/ssh.1.html) `ServerAliveCountMax` setting. Don't set it in `SSH_OPTIONS` as this behavior is undefined. | 3 |
Expand Down
4 changes: 2 additions & 2 deletions latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

FROM ubuntu:22.04 as setup

ENV IB_GATEWAY_VERSION=10.26.1j
ENV IB_GATEWAY_VERSION=10.26.1k
ENV IB_GATEWAY_RELEASE_CHANNEL=latest
ENV IBC_VERSION=3.18.0

Expand Down Expand Up @@ -48,7 +48,7 @@ COPY ./scripts /root/scripts

FROM ubuntu:22.04

ENV IB_GATEWAY_VERSION=10.26.1j
ENV IB_GATEWAY_VERSION=10.26.1k
# IB Gateway user constants
ARG USER_ID="${USER_ID:-1000}"
ARG USER_GID="${USER_GID:-1000}"
Expand Down
5 changes: 3 additions & 2 deletions latest/Dockerfile.tws
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This is a dedicated stage used as source for needed files.
#
##############################################################################
ARG IB_VERSION=10.26.1j
ARG IB_VERSION=10.26.1k
FROM ghcr.io/gnzsnz/ib-gateway:${IB_VERSION} as setup

WORKDIR /
Expand All @@ -15,7 +15,7 @@ WORKDIR /

FROM lscr.io/linuxserver/rdesktop:ubuntu-xfce

ENV IB_GATEWAY_VERSION=10.26.1j
ENV IB_GATEWAY_VERSION=10.26.1k
ENV IB_GATEWAY_RELEASE_CHANNEL=latest
ENV IBC_VERSION=3.18.0

Expand All @@ -28,6 +28,7 @@ ENV IBC_PATH=/opt/ibc
ENV IBC_INI=${IBC_PATH}/config.ini
ENV SCRIPT_PATH=/defaults
ENV GATEWAY_OR_TWS=tws
ENV NO_AT_BRIDGE=1

ARG DEBIAN_FRONTEND=noninteractive

Expand Down
2 changes: 1 addition & 1 deletion latest/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup_ssh() {
# setup SSH Tunnel
if [ "$SSH_TUNNEL" = "yes" ]; then
if [ "$SSH_TUNNEL" = "yes" ] || [ "$SSH_TUNNEL" = "both" ]; then
echo ".> Setting SSH tunnel"

_SSH_OPTIONS="-o ServerAliveInterval=${SSH_ALIVE_INTERVAL:-20}"
Expand Down
31 changes: 21 additions & 10 deletions latest/scripts/port_forwarding.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
#!/bin/bash

# validate API port
if [ -z "${API_PORT}" ]; then
echo ".> API_PORT not set, port: ${API_PORT}"
exit 1
fi

if [ "$SSH_TUNNEL" = "yes" ]; then

start_ssh() {
if [ -n "$(pgrep -x ssh)" ]; then
# if this script is already running don't start it
echo ".> SSH tunnel already active. Not starting a new one"
Expand All @@ -34,12 +27,18 @@ if [ "$SSH_TUNNEL" = "yes" ]; then
echo ".> SSH_RDP_TUNNEL set to :${SSH_SCREEN}"
fi

if [ "$SSH_TUNNEL" = "both" ]; then
start_socat
fi

while true; do
echo ".> Starting ssh tunnel with ssh sock: $SSH_AUTH_SOCK"
bash -c "ssh ${SSH_ALL_OPTIONS} -TNR 127.0.0.1:${API_PORT}:localhost:${SSH_REMOTE_PORT} ${SSH_SCREEN:-} ${SSH_USER_TUNNEL}"
sleep "${SSH_RESTART:-5}"
done
else
}

start_socat() {
if [ -z "${SOCAT_PORT}" ]; then
echo ".> SOCAT_PORT not set, port: ${SOCAT_PORT}"
exit 1
Expand All @@ -56,5 +55,17 @@ else
#
printf "Forking :::%d onto 0.0.0.0:%d > trading mode %s \n" \
"${API_PORT}" "${SOCAT_PORT}" "${TRADING_MODE}"
socat TCP-LISTEN:"${SOCAT_PORT}",fork TCP:127.0.0.1:"${API_PORT}"
socat TCP-LISTEN:"${SOCAT_PORT}",fork TCP:127.0.0.1:"${API_PORT}" &
}

# validate API port
if [ -z "${API_PORT}" ]; then
echo ".> API_PORT not set, port: ${API_PORT}"
exit 1
fi

if [ "$SSH_TUNNEL" = "yes" ] || [ "$SSH_TUNNEL" = "both" ]; then
start_ssh
else
start_socat
fi
2 changes: 1 addition & 1 deletion latest/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ set_ports
# Java heap size
set_java_heap

# forward ports, socat or ssh
# forward ports, socat/ssh
"${SCRIPT_PATH}/port_forwarding.sh" &

echo ".> Starting IBC with params:"
Expand Down
11 changes: 10 additions & 1 deletion latest/tws-scripts/run_tws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ disable_agents() {
fi
}

disable_compositing() {
# disable compositing
# https://github.com/gnzsnz/ib-gateway-docker/issues/55
echo ".> Disabling xfce compositing"
xfconf-query --channel=xfwm4 --property=/general/use_compositing --type=bool --set=false --create
}

# set display
export DISPLAY=:10

Expand All @@ -34,6 +41,8 @@ id

# disable agents
disable_agents
# disable compositing
disable_compositing
# SSH
setup_ssh
# set ports
Expand All @@ -44,7 +53,7 @@ apply_settings
# Java heap size
set_java_heap

# forward ports, socat or ssh
# forward ports, socat/ssh
"${SCRIPT_PATH}/port_forwarding.sh" &

# start IBC
Expand Down

0 comments on commit 66b6df5

Please sign in to comment.