per-env | Clean up your package.json with per-NODE_ENV npm scripts | Build Tool library
kandi X-RAY | per-env Summary
kandi X-RAY | per-env Summary
Clean up your package.json with per-NODE_ENV npm scripts
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of per-env
per-env Key Features
per-env Examples and Code Snippets
Community Discussions
Trending Discussions on per-env
QUESTION
If I set up my WCF project with an ApplicationInsights.config
file as outlined in this Microsoft documentation, data is logged to Application Insights as expected.
The config file looks like this:
...ANSWER
Answered 2021-Mar-11 at 02:25The correct approach is to use TelemetryConfiguration.CreateDefault() method to load any config from disk, then set/change additional values on the generated configuration.
Once the TelemetryConfiguration instance is created pass it to the constructor of TelemetryClient to create the client and start logging.
QUESTION
Every Terraform guide on the web provides a partial solution that is almost always not the real picture.
I get that, not everyone has the same infrastructure needs, but what worries me that the common scenario with:
- multiple environments (dev, stage)
- remote backend (s3)
- some basic resources (bucket or ec2 instance)
isn't presented anywhere on a real example project.
I'm looking for just that, and in the meantime, I have researched and concluded that apart from those needs I also want:
- to utilize modules
- to NOT use workspaces, but rather a distinct directory-per-environment approach
- to NOT use terragrunt wrapper
My current structure, which does not utilize modules - only root module:
...ANSWER
Answered 2021-Feb-03 at 19:57I work with terraform
5 years. I did a lot of mistakes with in my career with modules and environments.
Below text is just share of my knowledge and experience. They may be bad.
Real example project may is hard to find because terraform
is not used to create opensource projects. It's often unsafe to share terraform
files because you are showing all vulnerabilities from your intrastructure
You should create module that has single purpose, but your module should be generic.
Example moduleYou can create bastion host module
, but better idea is to create a module for generic server
. This module may have some logic dedicated to your business problem like, CW Log group
, some generic security group rules
, etc.
Sometimes it is worth to create more specific module.
Let's say you have application, that requires Lambda
, ECS service
, CloudWatch alarms
, RDS
, EBS
etc. All of that elements are strongly connected.
You have 2 options:
- Create separated modules for each above items - But then your application uses 5 modules.
- Create one big module and then you can deploy your app with single module
- Mix above solutions - I prefer that
Everything depends on details and some circumstances.
But I will show you how I use terraform in my productions in different companies.
Separated definitions for separated resurcesThis is project, where you have environment as directories. For each application, networking, data resoruces you have separated state. I keep mutable data in separated directory(like RDS, EBS, EFS, S3, etc) so all apps, networking, etc can be destroyed and recreated, because they are stateless. No one can destroy statefull items because data can be lost. This is what i was doing for last few years.
QUESTION
Nifi custom properties (per-environment property files) looks to be a perfect way to define an environment specific paths and credentials. The only issue is how to keep sensitive information there? There is Nifi Encrypt-Config Tool described in more details here.
Is Nifi Encrypt-Config Tool capable of encrypting variable files (defined with nifi.variable.registry.properties
) besides nifi.properties
?
As far as I understood, it encrypts only nifi.properties
. It's important, because with Nifi Docker Image I can define only nifi.variable.registry.properties
(NIFI_VARIABLE_REGISTRY_PROPERTIES
env var) without ability to modify nifi.properties
.
ANSWER
Answered 2020-Jul-20 at 22:36The NiFi encrypt-config tool interacts with the following configuration files:
nifi.properties
login-identity-providers.xml
authorizers.xml
bootstrap.conf
flow.xml.gz
It does not handle any linked custom variable definition files, and there is no mechanism for sensitive variables to be properly secured and stored. Variables do not support any sensitive values at all for this reason.
Variables are treated as deprecated in modern versions of NiFi -- still supported but their use is discouraged -- and parameters were introduced in version 1.10.0 as a modern solution. Parameters do support sensitive values and are accessible from every property descriptor at the framework level rather than on a per-field basis depending on the developer's explicit decision to support them. You should prioritize parameters for the storage of sensitive values needed in your flow definitions.
Depending on your threat model, you may have less robust but acceptable alternatives:
- If you accept the security level of environment variables, you can populate these directly and they will be referenced in any properties which support Expression Language, the same as "NiFi variables"
- You can edit the
nifi.properties
file through a custom Docker image, startup scripts, etc. Any modified or added properties in that file can be encrypted by adding their key (property key descriptor, not cryptographic key) as a comma-delimited list tonifi.sensitive.props.additional.keys
in that file. These properties will also be protected by the toolkit and decrypted in memory during NiFi application startup. However,nifi.properties
is meant to hold framework-level configuration values, not component-level properties.
QUESTION
Is there a way "out of the box" to have environment variables in appsettings.json
values expanded automatically?
To take a contrived example:
...ANSWER
Answered 2020-Mar-16 at 22:12To create and use a custom configuration source, two implementations are needed:
It's the IConfigurationSource
implementation that gets added to the IConfigurationBuilder
's sources. This implementation is also responsible for creating its own IConfigurationProvider
, which is reponsible for loading the data from the source.
Here's both a custom implementation of IConfigurationSource
(ExpandJsonConfigurationSource
) and IConfigurationProvider
(ExpandJsonConfigurationProvider
):
QUESTION
What's the correct way of defining secret_key_base
on Rails 6 now that we have per-environment credentials?
My environment has the variable SECRET_KEY_BASE
but Rails is not picking it up. I tried defining secret_key_base
in config\credentials\production.yml.enc
but it has no effect on Rails.application.credentials.secret_key_base
I know config/secrets.yml
with
ANSWER
Answered 2020-Mar-16 at 08:52I've tried to solve that problem few days ago.
And what I learned:
First attempt
I try to use credentials per environment with
QUESTION
I am using replace in my rollup configuration for sapper and sapper-environment to pass environment variables to the client side in sapper - is this secure? Is there a better/safer way to approach this?
Using this config below:
...ANSWER
Answered 2020-Mar-07 at 14:57There are two questions here — a) is it secure, and b) why are the values undefined
?
The answer to the first question is 'no'. Any time you include credentials in JavaScript that gets served to the client (or in session data), you're making those credentials available to anyone who knows how to look for them. If you need to avoid that, you'll need your server (or another server) to make requests on behalf of authenticated clients.
As for the second part, it's very hard to tell without a reproduction unfortunately!
QUESTION
Let's say I have connection string for Development environment specified in appsettings.Development.json
and connection string for the Staging environment specified in appsettings.Staging.json
All I need to do to switch between Development and Staging is to navigate to Visual Studio Debug tab in project properties and change the value for ASPNETCORE_ENVIRONMENT
environment variable.
Now, of course I don't want to have connection string in appsettings.*.json
for security reasons. So I move it to User Secrets.
Problem is - it seems there is just one secrets.json
file that is used by all the environments. There are no secrets.Development.json
or secrets.Staging.json
. This means after I switch from Development to Staging environment via Visual Studio Debug tab I then also need to change connection strings manually in secrets.json
which kind of defeats the purpose of having built-in support for the environments.
Is this correct that User Secrets are not supported on per-environment basis? If so - is there another approach that would avoid having to modify Secret connection string manually when switching environments?
...ANSWER
Answered 2020-Feb-27 at 16:38The Secret Manager (https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1) is designed strictly for development, not any other stage (environment), since it is inherently insecure (local dev secrets are not encrypted). See the warning on the page linked. So there is no need to have per environment secrets storage vis-a-vis that tool. For other environments (staging, prod, etc), Microsoft would likely steer you toward their secure secrets storage service -- Key Vault. You can use the Secret Manager for dev secrets and then store the other environments in Key Vault. I have done this in many Asp.Net Core apps and it works well. For Key Vault info, see this: https://docs.microsoft.com/en-us/aspnet/core/security/key-vault-configuration?view=aspnetcore-3.1
QUESTION
I tried to implement dynamic configuration as can be seen in this post.
Everything works in JiT compiler, but I get
...ANSWER
Answered 2019-Oct-29 at 22:28Don't. Seriously, stay away from those two files (environment.ts
and environment.prod.ts
). Those are NOT about the DevOps meaning of the word "environment", they are about debug constants.
If you need to know if you're running a debug build, import isDevMode:
QUESTION
I am quite new in Azure and i have a task to update a json file's values at deployment time. I have 3 deployment slots in Azure release pipeline Dev, Stage and Prod.
I have following Json file which need to update.
...ANSWER
Answered 2019-Aug-20 at 05:52Please help me out how can i change/update the values of above keys at deployment time based on slots?
If the Json file is not generated during building. We still could use the task Replace Tokens to update the key's values.
As test, change the definition of the key's values:
QUESTION
I have a non-critical Docker Compose project where the Traefik rules vary acceptably between dev and production (I need Lets Encrypt on prod, but not on dev). I am using the [file]
config provider.
Currently I am creating separate builds for dev and prod, thus:
...ANSWER
Answered 2019-Aug-12 at 08:45I didn't find a way to modify the Traefik config file path using environment variables. However, I hit on a volume-based solution that seems to be quite self-contained.
I set up another image called
shell
in my Docker Compose file:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install per-env
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page