Closed gencer closed 3 years ago
Hm.. I think using something like Dotenv::Railtie.load
from https://github.com/bkeepers/dotenv will suits better in this case instead of statically insert environments into systemd config files, I believe.
Yes, dotenv gem will be good tool to manage envrionment variables for your application.
You need to upload .env
file by your own custom capistrano task or something.
Exactly. Just finished implementing dotenv
and it worked very well (i already upload .env on prod using cap).
Thanks for confirming on this. A second opinion always a value for me!
Issue closed.
P.S> Thank you for this great capistrano plugin.
Hi,
I was using
foreman
and switched tocapistrano-systemd-multiservice
which gives me more fine-control over my configuration files, however, one thing bothers me when I work with environments.With
foreman
we simply have.env
file (dotenv
) and when we export to systemd, this file read then added to the systemd config file. However, with this plugin I see they are hardcoded. As you might know, ENV params may contains sensitive data, therefore, I would like to keep them out of my git repository.What is the best strategy to reflect my
.env
file that resides in production server only when I export to systemd? Is it already implemented? Because, I just couldn't see it. If not what can we do about it?P.S.: One thing that came to my mind is to use ERB-style syntax and read
.env
file in config file but I would like to know your thoughts first.Thanks, Gencer.