From 2c6cf786c151118232533a6cfbc769ce1514aa9e Mon Sep 17 00:00:00 2001 From: Dan Rostovtsev Date: Mon, 16 Mar 2026 16:02:54 -0400 Subject: Simple bash script deployment of client portal gateway. --- NOTES | 5 +++++ README | 4 ++++ resources/clientportal.gw.zip | Bin 0 -> 10542956 bytes resources/custom.yaml | 28 ++++++++++++++++++++++++++++ scripts/deploy.bash | 19 +++++++++++++++++++ scripts/keepalive.bash | 7 +++++++ scripts/tickle.py | 5 +++++ 7 files changed, 68 insertions(+) create mode 100644 NOTES create mode 100644 README create mode 100644 resources/clientportal.gw.zip create mode 100644 resources/custom.yaml create mode 100755 scripts/deploy.bash create mode 100755 scripts/keepalive.bash create mode 100755 scripts/tickle.py diff --git a/NOTES b/NOTES new file mode 100644 index 0000000..bc8094e --- /dev/null +++ b/NOTES @@ -0,0 +1,5 @@ +TLS is not necessary for local host, can turn it off and remove +warnings. The proxy connection SHOULD be encrypted. + +You can use the "procyon" Java decompiler to read the source for the +gateway. The source is straightforward. diff --git a/README b/README new file mode 100644 index 0000000..0a0ebd7 --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +Interactive Brokers Client Portal Gateway +(ibkr-cpgw) + +A tool for configuring and installing the IBKR gateway. diff --git a/resources/clientportal.gw.zip b/resources/clientportal.gw.zip new file mode 100644 index 0000000..91586c5 Binary files /dev/null and b/resources/clientportal.gw.zip differ diff --git a/resources/custom.yaml b/resources/custom.yaml new file mode 100644 index 0000000..302fe5b --- /dev/null +++ b/resources/custom.yaml @@ -0,0 +1,28 @@ + ip2loc: "US" + proxyRemoteSsl: true + proxyRemoteHost: "https://api.ibkr.com" + listenPort: 5000 + listenSsl: false + ccp: false + svcEnvironment: "v1" + authDelay: 3000 + portalBaseURL: "" + serverOptions: + blockedThreadCheckInterval: 1000000 + eventLoopPoolSize: 20 + workerPoolSize: 20 + maxWorkerExecuteTime: 100 + internalBlockingPoolSize: 20 + cors: + origin.allowed: "*" + allowCredentials: false + webApps: + - name: "demo" + index: "index.html" + ips: + allow: + - 192.* + - 131.216.* + - 127.0.0.1 + deny: + - 212.90.324.10 diff --git a/scripts/deploy.bash b/scripts/deploy.bash new file mode 100755 index 0000000..0fd8193 --- /dev/null +++ b/scripts/deploy.bash @@ -0,0 +1,19 @@ +#!/usr/bin/bash + +set -e + +# create env +TMP=`mktemp -t -d ibkr-cpgw.XXXXXX` +mkdir -p $TMP +cp resources/clientportal.gw.zip $TMP +cp resources/custom.yaml $TMP + +# build env +cd $TMP +unzip clientportal.gw.zip +cp custom.yaml ./root/custom.yaml + +# run gateway +./bin/run.sh ./root/custom.yaml + +rm -rf $TMP diff --git a/scripts/keepalive.bash b/scripts/keepalive.bash new file mode 100755 index 0000000..3b2a1ae --- /dev/null +++ b/scripts/keepalive.bash @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +while [ 0 ]; do + ./scripts/tickle.py + echo teehee + sleep 60 +done diff --git a/scripts/tickle.py b/scripts/tickle.py new file mode 100755 index 0000000..59902d0 --- /dev/null +++ b/scripts/tickle.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 + +import requests + +requests.get("http://localhost:5000/v1/api/tickle") -- cgit v1.3