Set Environment/Config variables

Is there a way to set them up? I'm trying to get a rails app up and running, but I am not sure where to put my environment variables to load my redis url, and other stuff.

Thanks

Comments

  • I got a response via email about this so thought about sharing it here.

    #########################################

    You can set the environment variables in the in ngnix-passenger.conf file accessible from the File manager of your application node.

    Each variable should be added as a new line in the following format:

    passengerenvvar NAME value;

    #########################################


    That being said, I am opening a feature request to be able to add these in an easier way, and for the whole environment, and not per node.

  • ZoltanZoltan Enscale Team

    Hi,


    You can set env variables the usual way :

    Append this to the .bashrc file

    tail -1 .bashrc

    export REDIS_URL=redistes.tt:111

    Restart the ssh session or source the bashrc and you get this :


    $ ruby -e 'p ENV["REDIS_URL"]'

    "redistes.tt:111"

    Not sure if it is better for you..

    Zoltan

  • Thanks Zoltan! It probably is, as this would apply to the whole environment, instead of just ngnix, right?

  • ZoltanZoltan Enscale Team

    Hi,

    Only if you use the clone feature .

    I mean the env variable is useful only on the computing nodes, I dont see why it should be set on a database node for example.

    The environment variable is set for the "active" user, so nginx or apache.

    Perhaps if there would be an option to save on all computing nodes. I have to check this with the developers.


    Zoltan

  • I completely understand that, but, in my other thread which is a feature request I kinda explain.

    Let say you have a node for your web server and another note for a Sidekiq instance. Both will use Redis, so having the redis url available on both nodes is useful.

    Does that make sense?

  • I can't edit my previous post. By your last line, does that mean you are part of Enscale staff?

  • ZoltanZoltan Enscale Team

    I am not directly involved with the development, but yes.

    Also I understand your point and agree that this feature makes sense.

    Theoretically saving this bash profile all over the compute nodes (from file manager) would satisfy this scenario.

    Zoltan

    pmcnano
  • DamienDamien Enscale Team

    We added an 'Enscale Team' badge to make this clearer in future: thanks for the feedback!

Sign In or Register to comment.