Comments (8)
I wonder if this problem isn't already addressed with existing concepts:
- for security insensitive configuration settings, store them in package.json,
- for security sensitive configuration settings, use
git azure blob
to store them in Blob Storage, and if you need to reference a particular blob (e.g. a password or connection string), put the blob name in the package.json file.
This is exactly the approach I am taking with X.509 certificates and associated private keys.
from git-azure.
Blob storage sounds good, I forgot you already had a storage account available to use. What do you think of something like:
- creating a blob (
appname.yml
) when scaffolding an app (git azure blob --put appname.yml --content "node_env: production"
) - write a very simple config module (maybe a fork of this https://github.com/rjyo/yaml-config-node using blobs instead of fs) and include it as part of the scaffolded app
- have a way to restart apps (
git azure app --restart hello
) so that configuration is reloaded - setup the env var AUZRE_STORAGE_ACCOUNT and KEY so that it works locally for dev
Regarding env vars, what I like about using them is that it is the universal config system in every cloud platform.
from git-azure.
Env Vars are the default nodejs configuration strategy, although I'd love to have a runtime ability like
jitsu set env VARIABLE value
or
heroku config:add VARIABLE=value
I'm working on a new approach. On start_worker
if exists I'll call SetEnvVars.cmd
which will live on the root of the repo (as package.json) hence it can be changed without repackaging (which has been trouble for me).
I'm working on this right now on my branch, and I'll submit a pull-request afterwards.
Thoughts?
from git-azure.
Just to keep the same patterns, file will be called set_env_vars.cmd
😄
from git-azure.
The set_env_vars.cmd will set the same set of environment variables for all applications, and changing them will require bringing down arr.js (which can be done with git azure reset --hard
and takes ~2 minutes). If the variables are not security sensitive, perhaps a better approach would be have a section for them in the package.json
of individual apps. arr.js can read that section and create appropriate environment block before starting a node.exe
to handle a particular application. Moreover, this mechanism composes very well with the existing post-receive hook based mechanism of updating applications: you push changes to environment variables into package.json, and arr.js picks it up just like any other change in the application configuration or code.
from git-azure.
I like your idea, a little bit better 😄, I'm playing with
set_env_vars.cmd
. I think it's enough for now (not having to recreate the
cspkg, it's huge). However, I'll like yours better.
How would you set the env variables from nodejs?
On Tue, Jun 26, 2012 at 1:40 PM, Tomasz Janczuk <
[email protected]
wrote:
The set_env_vars.cmd will set the same set of environment variables for
all applications, and changing them will require bringing down arr.js
(which can be done withgit azure reset --hard
and takes ~2 minutes).
If the variables are not security sensitive, perhaps a better approach
would be have a section for them in thepackage.json
of individual
apps. arr.js can read that section and create appropriate environment block
before starting anode.exe
to handle a particular application.
Moreover, this mechanism composes very well with the existing post-receive
hook based mechanism of updating applications: you push changes to
environment variables into package.json, and arr.js picks it up just like
any other change in the application configuration or code.
Reply to this email directly or view it on GitHub:
#39 (comment)
from git-azure.
You need to massage the environment block passed to the new process here: https://github.com/tjanczuk/git-azure/blob/master/src/runtime/arr.js#L715. A good place to do this would be in the getEnv function: https://github.com/tjanczuk/git-azure/blob/master/src/runtime/arr.js#L645-654.
From: johnny.halife [[email protected]]
Sent: Tuesday, June 26, 2012 11:06 AM
To: Tomasz Janczuk
Subject: Re: [git-azure] support configuration & env vars (#39)
I like your idea, a little bit better 😄, I'm playing with
set_env_vars.cmd
. I think it's enough for now (not having to recreate the
cspkg, it's huge). However, I'll like yours better.
How would you set the env variables from nodejs?
On Tue, Jun 26, 2012 at 1:40 PM, Tomasz Janczuk <
[email protected]
wrote:
The set_env_vars.cmd will set the same set of environment variables for
all applications, and changing them will require bringing down arr.js
(which can be done withgit azure reset --hard
and takes ~2 minutes).
If the variables are not security sensitive, perhaps a better approach
would be have a section for them in thepackage.json
of individual
apps. arr.js can read that section and create appropriate environment block
before starting anode.exe
to handle a particular application.
Moreover, this mechanism composes very well with the existing post-receive
hook based mechanism of updating applications: you push changes to
environment variables into package.json, and arr.js picks it up just like
any other change in the application configuration or code.
Reply to this email directly or view it on GitHub:
#39 (comment)
Reply to this email directly or view it on GitHub:
#39 (comment)
from git-azure.
Will do then, I like that better. I'm using the CMD and works fair enough, using the package.json will be even better =)
from git-azure.
Related Issues (20)
- allow setting the azure instance size
- multi-instance support HOT 3
- [node.js] Deploy with no node_modules installs dev dependencies HOT 1
- Cannot use libxmljs HOT 1
- null ref in arr.js
- add support for npm install HOT 11
- better docs on how to contribute and test HOT 2
- move arr.js to v0.8 of node HOT 1
- consider a friendly error when no matching node.js engine found
- restart when on an unhandled exception HOT 3
- update readme.md with instructions for hooking up private repos HOT 3
- Support for https://github.com/c9/azure-packager-node HOT 2
- Add support for Azure Affinity Groups
- Cannot initialize service due to parsing error HOT 3
- Getting a "The location constraint is not valid" error when creating service HOT 1
- Deploy never completes HOT 1
- Hangs after "Choosing subscription name" on OSX 10.8.4 HOT 2
- Error on init when trying to parse the certificate HOT 1
- Set-AzureRmResource returns " The pipeline has been stopped." When trying to add tags in hashtable HOT 2
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 git-azure.