Comments (2)
Hi @bayeslearner ,
I can think of several ways to provide a solution to the problem of dynamic environment variables or runtime. One of them would be using the method you describe. Another would be generating the .env file before executing the docker-compose command, taking advantage that our entry point is the Makefile would not be complicated. And, the last one, using a wrapper similar to the one that you comment and described in the following gist https://gist.github.com/mikeclarke/7620336.
About trying to hide the passwords and not show them in plain text, that should not be a problem. Why? Because this is running on a server, which should be secured and accessible only by the server administrator. Even if we avoid having passwords in plain text, this would not be a sufficient mechanism to ensure that, even if someone compromised our server, they would not obtain confidential information. Being able to access the .env.sh file would already be a way to obtain passwords or sensitive details.
Anyway, the possibility of adding dynamic information seems to me a good idea. If you feel like contributing, go ahead, as any contribution will be welcome 🚀
Thanks @bayeslearner !
from mars-server.
so I settled on making just one change in your common.mk:
ifeq ($(wildcard $(ROOT_DIR)/docker-compose.sh),)
DOCKER_COMPOSE := docker-compose
else
DOCKER_COMPOSE := bash docker-compose.sh
endif
For each individual service, they are free to implement a wrapper however it sees fit.
For example, I have a mssql service, there I added 2 files one is docker-compose.sh, the other .env.dynamic.
#!/bin/bash
set -a
[ -f ".env.dynamic" ] && source <(cat .env.dynamic | sed -e '/^#/d;/^\s*$/d')
set +a
docker-compose "$@"
The password is saved in a gpg encrypted store, without the passphrase to the secret-store, having access to .env.dynamic is still useless.
#An encrypted password test
MSSQL_ROOT_PASSWORD=$(pass docker-compose/services/mssql)
I'm not sure I understand how exec could be used. According to docker-compose documentation, I have to use the environment variables of the shell to influence how it works, and not merely variables of the parent process. So I have to export those variables into the shell, no matter what. Am I missing something?
from mars-server.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mars-server.