Questions tagged [environment-variables]

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.

Environment variables are a set of dynamic-named values that can affect the way running processes will behave on a computer. They can be said in some sense to create the operating environment in which a process runs. For example, an environment variable with a standard name can store the location that a particular computer system uses to store temporary files—this may vary from one computer system to another. A process which invokes the environment variable by (standard) name can be sure that it is storing temporary information in a directory that exists and is expected to have sufficient space.

https://en.wikipedia.org/wiki/Environment_variable

13704 questions
6
votes
1 answer

Concatenate AWS Secrets in aws-cdk for ECS container

how do you go about making a postgres URI connection string from a Credentials.fromGeneratedSecret() call without writing the secrets out using toString()? I think I read somewhere making a lambda that does that, but man that seems kinda…
6
votes
1 answer

Running flask app with gunicorn and environment variables

For local development I simply set .env file that contain necessarily variables and just run the app with: Flask run Everything seems fine, all the environment variables are being read and set correctly in the app. However when I run the app with…
Alex T
  • 3,529
  • 12
  • 56
  • 105
6
votes
1 answer

GitHub Action to build environment variables from each other

In GitHub Action, how to build environment variables one after another: name: workflow-level-custom-environment-variables on: [push] # Here the environment variable is declared in workflow level env: PART1: var1 PART2: ${PART1}var2 …
xpt
  • 20,363
  • 37
  • 127
  • 216
6
votes
1 answer

GitHub Actions to use variables set from shell

Goal: In GitHub Actions, to define my commit message dynamically from shell: - name: Commit changes uses: EndBug/add-and-commit@v7 with: message: "added on $(date -I)" However, it seems that I have to define a…
xpt
  • 20,363
  • 37
  • 127
  • 216
6
votes
2 answers

Is using multiple .env files bad practice?

I need to run tests in different environments : DEV, STAGING, PRODUCTION. And needless to say, the environment variables/secrets for the above environments would obviously be different. I quick solution would be to have an env file for each…
6
votes
2 answers

Should environment variables that contain a executable-path with spaces also contain the necessary quotes?

When defining an environment variable (on Windows for me, maybe there is a more general guideline) set MY_TOOL=C:\DevTools\bin\mytool.exe if the tool is located on a path with spaces set MY_TOOL=C:\Program Files (x86)\Foobar\bin\mytool.exe should…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
6
votes
4 answers

How to recognize env variables in typescript when using vite?

export const EnvironmentProvider: React.FC = ({ children }) => ( { children } …
6
votes
2 answers

How do I set environment variables in Google Colab?

On my local computer, I can simply go into "System Properties -> Environment Variables" and add a new variable with its value in user variables. Then, I can retrieve this value by using this in Python: import os os.environ["VAR_NAME"] However, I…
Frying Pan
  • 167
  • 2
  • 8
6
votes
6 answers

Use data from .env file in main.ts - NestJS

NestJS allows us to read .env file through ConfigModule and I can do that easily in my modules with code like following @Module({ imports: [ConfigModule.forRoot()], providers: [ NVFullNameSearchService, NVPartialNameSearchService, …
Krishnan Sriram
  • 5,037
  • 5
  • 21
  • 31
6
votes
1 answer

How to use perf with ld_preload?

I tried to use perf stat with LD_PRELOAD as prefix for executable such as: perf stat LD_PRELOAD=$PWD/../user/preload.so ./write 1 It seems not work for perf, are there any way to achieve it?
Steven
  • 811
  • 4
  • 23
6
votes
1 answer

How to dynamically import package.json dependencies based on environment variables?

How could I add a script to my package.json file that would allow me to dynamically use a local file instead of a package version based on an environment variable? "dependencies": { "dynamic-dependency": "$(process.env.NODE_ENV !== 'dev' ?…
6
votes
1 answer

How to properly manage .env files in a microservices architecture

I have been working for some time on a project with a microservices architecture where each service has its own environment variables which are handled with a .env file for each service/repository. A great part of these variables are related to…
reymon359
  • 1,240
  • 2
  • 11
  • 34
6
votes
2 answers

where is process.env located

I'm learning React and React-Redux and I'm trying to edit an existing project I found. Inside the reducers folder there is a file that has this line of code: const { data } = await client(`${process.env.REACT_APP_BE}/videos`); But there was no…
Commando
  • 358
  • 3
  • 16
6
votes
1 answer

How to comment multiple lines in env file

I wanted to know if there is any way to comment a block or multiple lines in .env file. I know that by using # we can comment a single line but I want to comment multiple lines at once. Currently I am using visual studio code in ubuntu and working…
Yogi Katba
  • 189
  • 1
  • 2
  • 6
6
votes
4 answers

#! /usr/bin/env and process names: portability at a price?

There are lots of good reasons to use #! /usr/bin/env. Bottom line: It makes your code more portable. Well, sorta. Check this out.... I have two nearly identical scripts, bintest.py #! /usr/bin/python import time time.sleep(5*60) and envtest.py #!…
BrianTheLion
  • 2,618
  • 2
  • 29
  • 46