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

Docker: Blink won't initialize if OIDC provider is still starting up. #757

Closed
WillowMist opened this issue Oct 14, 2022 · 1 comment
Closed

Comments

@WillowMist
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

If running through Docker and also running KeyCloak on docker, Blink tries to connect to the OIDC service before KeyCloak is up and running. It then fails to start the container.

Describe the solution you'd like
A clear and concise description of what you want to happen.

It would be nice if there could be a config option that would let it retry connection to OIDC until it succeeds, rather than fail to start entirely. With luck, the service would still be able to serve already created URLs while it tries.

I've tried to make it depend on keycloak in the docker-compose, but it still starts up before keycloak is responding to requests.

I'm not super-fluent with Node, but I can try to help, if the request makes sense :)

@JaneJeon
Copy link
Owner

Well, Blink expects everything to be "up" by the time it's connected. Connect/retry of OIDC really shouldn't be part of the application, and I suggest putting a short little script (e.g. wait-on, wait-for, wait-for-it) listening to the keycloak endpoint to make sure it is up BEFORE you start Blink.

Making sure "X" is started before "Y" and making sure it satisfies $condition_Z and the like starts to encroach on the boundaries of "orchestration" (e.g. with docker swarm or kubernetes), which is out of scope for this project.

Do look into the "waiting scripts" I pointed out above. They are the standard way ("best practices") of solving this problem, not just across link shorteners, but across cloud-native applications in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants