heshiming / ibga

IB Gateway in a headless docker container.
GNU General Public License v3.0
23 stars 3 forks source link

Optional specification of installer file location #5

Closed blades closed 2 years ago

blades commented 2 years ago

used to specify file download location to an alternative location e.g. for using a specific approved version of the gateway rather than only the latest currently available

heshiming commented 2 years ago

@blades Thank you for the pull request. Putting the download URL as a configurable variable does make sense. I'll take care of this in the coming days.

However, I'm sorry that I'm currently not prepared to accept outside contributions. If I did, I wouldn't be able to relicense the product commercially. Thanks for the idea though.

blades commented 2 years ago

No worries - I needed it for my particular use case scenario (i.e. only using a trusted, tested version), so I implemented it and thought you might want to use it. Feel free to implement any way you like.

heshiming commented 2 years ago

Hi @blades . How did you get the URL of alternative versions of IBG? I'd like to implement version choices but the official site seemed to offer the latest version only. Even the stable version link can only be googled. It seems to me they are phasing out everything keeping just the latest.

blades commented 2 years ago

Short answer is that you don't - you have to self-host a version that you've downloaded somewhere and reference that when you do a build. I've also embedded that version in the docker image as well now so that my built image has a simple way to ensure it's the same every time and doesn't need to do the download every time I fire up a new container.

Another thing I've done is to add a healthcheck endpoint if you'd be interested in a PR for that?

Regards, Allan

On Thu, 28 Jul 2022, 05:17 He Shiming, @.***> wrote:

Hi @blades https://github.com/blades . How did you get the URL of alternative versions of IBG? I'd like to implement version choices but the official site seemed to offer the latest version only. Even the stable version link can only be googled. It seems to me they are phasing out everything keeping just the latest.

— Reply to this email directly, view it on GitHub https://github.com/heshiming/ibga/pull/5#issuecomment-1197638498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADUCXPWVXRMUISTSJBBY4DVWICVBANCNFSM5Y3VNV3A . You are receiving this because you were mentioned.Message ID: @.***>

heshiming commented 2 years ago

Oh, dear. Then a historical version wouldn't be easily reproducible.

I still can't accept a pull request. But I'll probably implement my version of health checks a bit later. If I understand you correctly, you wanted to programmatically see the green/yellow/red status of IBG servers right?

blades commented 2 years ago

Yes, hence why it has to be self-hosted :)

And as for health checks, I've got a simply python script that uses ib's api code to attempt a connection, with a wrapper so I can time the attempt out. I've also got a lightweight python script that acts as an http server so I can access the result external to the container. In the dockerfile, I use the script to report the health of the container.

If there's a way to report on the status of the gateway externally, that would be awesome, though!

On Thu, 28 Jul 2022, 11:21 He Shiming, @.***> wrote:

Oh, dear. Then a historical version wouldn't be easily reproducible.

I still can't accept a pull request. But I'll probably implement my version of health checks a bit later. If I understand you correctly, you wanted to programmatically see the green/yellow/red status of IBG servers right?

— Reply to this email directly, view it on GitHub https://github.com/heshiming/ibga/pull/5#issuecomment-1197953318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADUCXOFFOP6NKL6TMEN5FTVWJNLDANCNFSM5Y3VNV3A . You are receiving this because you were mentioned.Message ID: @.***>

heshiming commented 2 years ago

Yeah, thanks for the idea.

Although I'm really trying to avoid the inevitable path of bloating. Including an additional HTTP server just for status reports sounds like overkill, given VNC is already using one. Eventually, people would like additional APIs to facilitate control over dialog settings and stuff, which splits from the original intention of automating IBG and forgetting about its existence.

If I try hard enough, I can probably reuse the VNC HTTP server for this purpose, by just writing a status file on the file system.

heshiming commented 2 years ago

Hi, sorry for the long wait. I've implemented my own version of custom URL. With the latest update, you can use an environment variable to provide a custom URL in docker-compose configuration:

environment:
  - IBG_DOWNLOAD_URL=https://download2.interactivebrokers.com/installers/ibgateway/stable-standalone/ibgateway-stable-standalone-linux-x64.sh

The default value is assigned in _env.sh.