-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
[request] Custom Redis client settings using environment variables #225
Comments
I think I'll start implementing support for JSON-based configurations as files. This way it's better to configure nested values 🤔 (https://github.com/soketi/soketi/projects/1#card-64718909) |
I think that environment variables wouldn't be a great choice for complex configurations. I don't really know why I started doing that in the first place, but having a JSON file that can be configured would be easier. {
"database.redis.tls": { ... }
} soketi start --config=/path/to/config.json |
Honestly having it makes setting up a server really quick and easy... so I like having the JSON option but would not call the env variables bad honestly. Also for the TLS option, it just needs to be an empty object so there is not much to configure unless you also want to implement reading files from disk. |
Still going to work on this to make env variables for this a thing 🤔 |
Any update on allowing env variables for this? |
Is there any way of doing this with environment variables ? |
No it is not, but it's very easy to do with the JSON (in addition to your environment variables). Create a file called {
"database.redis.tls": {}
} Instead of running just |
I had to postpone this issue. For now, the config should work perfectly fine. |
I'm using the docker image inside of my helm chart. How can I pass this command? It looks like the command automatically runs when the container starts. I tried this but it didn't work
|
Have you injected the file in the pod? |
Yes, I created a custom configmap with:
and mounted it to /etc/configws/config.json I also exec into the pod and confirmed the file was there. I tried to also exec into the pod and run node server.js start --config=/etc/configws/config.json. When i did that, the pod just terminates and crashes |
@mackensiealvarezz I FIGURED YOUR ISSUE OUT
is an incorrect way of specifying the command block for a docker-compose config. Instead, you need to separate your last line!!!!!
This worked for me! Quite literally one of the worst experiences troubleshooting Docker I have ever had. (sorry unrelated to issue at hand, but will prevent someone from troubleshooting Docker + Soketi for a few hours) |
Is there any update on allowing to configure TLS using an environment variable? ☝️ |
We are using a managed database by Digital Ocean and they require an SSL connection. AWS ElastiCache and many other managed solutions have the same requirement.
This is "easy" to enable by adding a
tls: {}
to the options passed tonew Redis({...})
. However I have a hard time figuring out how to do this nicely so we can have aDB_REDIS_TLS=true
and it doingtls: {}
ortls: undefined
(which is the default) based on that value. Any help would be appreciated :)I also noticed that when Redis has a connection problem it spins out of control (consuming ~1 core of CPU time) in an infinite loop barfing this when in debug mode:
Maybe we should have a little more conservatie retry strategy.
The text was updated successfully, but these errors were encountered: