Giter VIP home page Giter VIP logo

Comments (13)

rennokki avatar rennokki commented on May 14, 2024 3

Still going to work on this to make env variables for this a thing 🤔

from soketi.

stayallive avatar stayallive commented on May 14, 2024 2

No it is not, but it's very easy to do with the JSON (in addition to your environment variables).

Create a file called config.json on your server which should be accessible by the user running Soketi with the following contents:

{
    "database.redis.tls": {}
}

Instead of running just soketi start, change it to soketi start --config=/home/soketi/config.json (change the path to the config.json to where you placed it) and then you can use a Redis host using TLS (like a Digital Ocean managed Redis instance).

from soketi.

winfamy avatar winfamy commented on May 14, 2024 1

@mackensiealvarezz I FIGURED YOUR ISSUE OUT
I've been going through this myself trying to figure out how to do this (TLS on Redis)

        - name: soketi
          image: quay.io/soketi/soketi:0.32.2-16-alpine
          command:
            - node
            - /app/bin/server.js
            - start --config=/etc/configws/config.json

is an incorrect way of specifying the command block for a docker-compose config. Instead, you need to separate your last line!!!!!

        - name: soketi
          image: quay.io/soketi/soketi:0.32.2-16-alpine
          command:
            - node
            - /app/bin/server.js
            - start 
            - --config=/etc/configws/config.json

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)

from soketi.

limadelrey avatar limadelrey commented on May 14, 2024 1

Is there any update on allowing to configure TLS using an environment variable? ☝️

from soketi.

rennokki avatar rennokki commented on May 14, 2024

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)

from soketi.

rennokki avatar rennokki commented on May 14, 2024

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

from soketi.

stayallive avatar stayallive commented on May 14, 2024

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.

from soketi.

ajnozari avatar ajnozari commented on May 14, 2024

Any update on allowing env variables for this?

from soketi.

mackensiealvarezz avatar mackensiealvarezz commented on May 14, 2024

Is there any way of doing this with environment variables ?

from soketi.

rennokki avatar rennokki commented on May 14, 2024

I had to postpone this issue. For now, the config should work perfectly fine.

from soketi.

mackensiealvarezz avatar mackensiealvarezz commented on May 14, 2024

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

        - name: soketi
          image: quay.io/soketi/soketi:0.32.2-16-alpine
          command:
            - node
            - /app/bin/server.js
            - start --config=/etc/configws/config.json

from soketi.

rennokki avatar rennokki commented on May 14, 2024

Have you injected the file in the pod?

from soketi.

mackensiealvarezz avatar mackensiealvarezz commented on May 14, 2024

Yes, I created a custom configmap with:

{
    "database.redis.tls": {}
}

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

from soketi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.