How To Pass Environment variables in Compose ( docker compose )

There are multiple parts of Compose that deal with environment variables in one sense or another. So how do I pass Environment variables in Compose ( docker-compose ) According to the documentation If you have multiple environment variables, you can substitute them by adding them to a default environment variable file named .env or by… Read More How To Pass Environment variables in Compose ( docker compose )

How to access variables from .env file in React app using Firebase?

Hopefully, I did put my .env file in the right place, I wanna access variables in firebase.js file for authentication to keep my API secure. .env file:- Here is my firebase.js file:- import { initializeApp } from "firebase/app"; import { getAuth } from "firebase/auth"; // Your web app’s Firebase configuration const firebaseConfig = { apiKey:… Read More How to access variables from .env file in React app using Firebase?

Having issues with fetching an environment variable

In the root of my React project, I have this .env file containing the following. DS_API_URL=[http://url.com](http:url.com/) In another file of the project, an axios call utilizes this to return some stuff. const url = ‘http://url.com/graph/tech-stack-by-role’ will return what I need. const url = `${DS_API_URL}/graph/tech-stack-by-role`; returns an error. How do I fetch the link from the… Read More Having issues with fetching an environment variable

How can i put a json body in a environnement variable

I try to create a environnement variable containing this: { "type":"1234", "project_id": "1234", "private_key_id": "1234", "private_key": "1234564789", "client_email": "iam.gserviceaccount.com", "client_id": "1072", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadatam" } I don’t want to create the env variable "auth_url", "token_url" etc… I would like to create a variable that would contain all these elements. I… Read More How can i put a json body in a environnement variable

How to pass multiple variables as input in shell script in non-interactive way

I am trying to make this interactive script take inputs in a non-interactive way by declaring $username and $password variables in bash env and pass them as inputs to the script. By running ./input.sh <<< "$username" #!bin/bash read username read password echo "The Current User Name is $username" echo " The Password is $password" is… Read More How to pass multiple variables as input in shell script in non-interactive way

How do I replace a value in "appsettings.json" with a value that I pass in via a docker environment variable

I have an MVC C# app that has a appsettings.json file that looks like this: { "Logging": { "LogLevel": { "Default": "Warning" } }, "AllowedHosts": "*", "ConnectionStrings": { "db": "Server=postgresql_MENTIONvlt_bg;Database=amaranth_vaultvid_tests;User Id=amaranth_vaultvid_test_user;Password=<PASSWORD HERE>" }, "Kestrel": { "Endpoints": { "Http": { "Url": "http://0.0.0.0:5000&quot; }, "Https": { "Url": "https://0.0.0.0:5001&quot; } }, "EndpointDefaults": { "Url": "https://0.0.0.0:5001&quot;, "Protocols": "Http1" }… Read More How do I replace a value in "appsettings.json" with a value that I pass in via a docker environment variable

Typescript class does not recognize constants in .env file, but recognizes them in a React component

I am using .env file and reading from it. I use it like this: process.env.BASE_URL in both the class and the react component. Why would it work in the component and in the class it is undefined? This is the class and here the value of process.env.BASE_URL is undefined: export default class HttpClient { async… Read More Typescript class does not recognize constants in .env file, but recognizes them in a React component

Make the function accept as an argument a file path or object from the environment [R]

Let’s say this is my function: library(dplyr) library(vroom) #input table <- /path/to/file myfunction <- function(input_table){ #load data my_table <- vroom::vroom(input_table,col_select=c(readname, transcript_start, qc_tag),show_col_types = FALSE) #do something output <- dplyr::filter(my_table, qc_tag=="PASS") return(output) } Currently, it accepts path to the input file. I would like it to accept an argument passed either as a path to file… Read More Make the function accept as an argument a file path or object from the environment [R]

Running EXE file with environment variable in path (PowerShell)

I want to run some executable on Windows using PowerShell. Path to this executable should be resolved with environment variable. For example running command C:\Windows\system32\cmd.exe as $Env:SystemRoot\system32\cmd.exe I have tried this option and it raises following exception At line:1 char:16 + $Env:SystemRoot\system32\cmd.exe + ~~~~~~~~~~~~~~~~~ Unexpected token ‘\system32\cmd.exe’ in expression or statement. + CategoryInfo : ParserError:… Read More Running EXE file with environment variable in path (PowerShell)