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
4 answers

What syntax will check if a variable name containing spaces is defined?

Windows user defined environment variable names can contain any character except =. Special characters can be included by escaping them. A simpler method is to simply enclose the entire SET expression within quotes. For example: set "A weird &…
dbenham
  • 127,446
  • 28
  • 251
  • 390
6
votes
3 answers

Flutter override environment variables in unit tests

In my production code I set environment variables using the --DART-DEFINE flag and then retrieve them by using String.fromEnvironment. How can I override the value returned by String.fromEnvironment in my unit tests, to test how my production code…
Adam Griffiths
  • 680
  • 6
  • 26
  • 60
6
votes
1 answer

Cant access NEXTjs env in kubernetes/terraform

This question has been asked before, ive been trying plenty of examples over the past two days to try and configure with no luck so I am posting my environment for any help. Problem Nextjs environment variables are all undefined after deploying to…
Jason McFarlane
  • 2,048
  • 3
  • 18
  • 30
6
votes
2 answers

How can i get the date of a commit in github actions workflow

I would like to know if there is any way to get the date of a commit through an environment variable or something to be able to use it within github actions.
6
votes
1 answer

Is it secure to expose secret keys to a next.js app via environment variables?

As I take it, environment variables prefixed with NEXT_PUBLIC_ will be substituted by their respective values in the resulting bundle. Is it safe to supply things like API keys, OAuth secrets and the like using NEXT_PUBLIC_* variables or can an end…
D3PSI
  • 154
  • 2
  • 11
6
votes
1 answer

Terminal showing environment variables on startup

Since today my terminal shows all kind of variables on startup. This is my ~/.zshrc file: I don't think something bad will come of it but I'm just wondering how this happened and how I can turn it back off. Thankyou for your help!
6
votes
1 answer

docker-compose Equivalent to Docker Build --secret Argument

We have used the technique detailed here to expose host environment variables to Docker build in a secured fashion. # syntax=docker/dockerfile:1.2 FROM golang:1.18 AS builder # move secrets out of the build process (and docker history) RUN…
6
votes
5 answers

process.env environment variable undefined

I am trying to access an environment variable through process.env in my React/Typescript code, but it's returning undefined. I am able to access NODE_ENV though. console.log(process.env.CURRENT_URL) // prints "undefined" on…
user968437
  • 93
  • 1
  • 1
  • 4
6
votes
2 answers

Change favicon based on environment (dev, stage, or prod) in React

I'm attempting to change favicons based on environments so that users know if they are on dev, stage, or prod. Tutorials such as this one and this one usually show how to change favicons based on button push callbacks, and not by accessing env…
elderlyman
  • 500
  • 8
  • 24
6
votes
2 answers

What's the difference between exposing environment variables in nextjs through the next.config.js vs with the NEXT_PUBLIC prefix?

According to the nextjs documentation, if I want to expose my environment variables to the browser I can just prefix them with NEXT_PUBLIC in my .env.local file, like so: NEXT_PUBLIC_VAR=7 However, it looks like I can also expose my environment…
6
votes
3 answers

Extending a Jenkins/Hudson plugin to set a environment variable pair

I am extending an existing Jenkins/Hudson plugin. I would like it to set a environment variable pair for the running project. What is the easiest way to do that?
datka
  • 860
  • 2
  • 11
  • 15
6
votes
0 answers

Where does Azure store Deployment tokens, such as ${{ secrets.GITHUB_TOKEN }}?

I have a Github Action to deploy my static web app to Azure. On the Build and Deploy step it fails with deployment_token was not provided. Below is my workflow yml file. I've changed secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_scrubbed in the file I…
6
votes
0 answers

Is there a way to set environment variables for all profiles in launchSettings.json?

I have multiple profiles in my launchSettings.json file that each set the same environment variable to the same value. Example of current setup: "profiles": { "IIS Express": { ... "environmentVariables": { …
6
votes
3 answers

How to save Terraform output variable into a Github Action’s environment variable

My project uses Terraform for setting up the infrastructure and Github Actions for CI/CD. After running terraform apply I would like to save the value of a Terraform output variable as Github Action environment variable to be later used by the…
6
votes
2 answers

Adding to the $PATH environment variable in a PHP script

I have a PHP script that is using wget to download some images. However, wget was installed using Homebrew so it's not available to the user running the PHP script. When I run exec('echo $PATH') I don't get the /usr/local/bin directory that contains…
Andrew
  • 227,796
  • 193
  • 515
  • 708