Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
182 views

Run Docker in production with environment variables that are secret and cannot be seen on the server

I need to send environment variables to my application running in a container but I understand that it is bad practice that the ".env" file is on the server since the "root" user ...
Juan Ignacio Portilla Kitroser's user avatar
4 votes
1 answer
3k views

How do I add environment variables to a AWS Lightsail Node.js instance?

The Problem I'm dipping my toes into AWS by deploying a simple API built with NestJS. This will be the first app I've deployed to a cloud service. I've already cloned my repository on an AWS Lightsail ...
rolias4031's user avatar
0 votes
0 answers
100 views

Node JS loading secrets on a "pre" task and updating the environment variables for the main task

I have many services written in Node and loading secrets on startup has always been a problem for me. I believe that when a service starts up, it should have every piece of configuration/secret ready ...
johni's user avatar
  • 5,578
2 votes
1 answer
11k views

How can I unset all environment variables at once?

I am trying to unset environment variables in my code in a teardown block. Is there a command to unset all variables at once? For example I am setting the following environment variables: export ...
Krishna's user avatar
  • 206
0 votes
2 answers
450 views

Can't connect to a MongoDB server

I'm trying to deploy this Fullstack app to a DigitalOcean droplet: https://github.com/maismin/stock-portfolio-app-demo I installed MongoDB like how to documentation said and then I started it and didn'...
Carter McKay's user avatar
0 votes
2 answers
3k views

Linux Environment variables in NodeJs .env file

I am currently using the dotenv library in my nodejs project, and reactjs project. I have a .env file that works perfectly when I have values like the following PORT=80 API_URL=https://api.com:8080 ...
Conor Thompson's user avatar
4 votes
4 answers
6k views

Running an .env file and access them from Node

This feels a bit embarrassing since I've been a Linux user for 10+ years. However, I've ran into a problem which I can't understand. Lets assume I want to expose an environment variable, SECRET, that ...
petur's user avatar
  • 1,396
0 votes
1 answer
183 views

How can I export the execution of a command to an upstart script

I have an upstart script that runs a nodejs-app, but Node.js is installed with nvm. I source some variables to upstart from another file, and my script section looks like this: script . /etc/default/...
robe007's user avatar
  • 3,967
0 votes
1 answer
99 views

Changing environment variables of terminal from node.js

I'm working on a simple node.js CLI that provides functionality for (MF) authentication for AWS. This requires on-calling the AWS CLI and updating environment variables in the current terminal (in ...
Hubris's user avatar
  • 2,022
0 votes
1 answer
48 views

How does this example of passing environment variables in linux to node work?

I read and verified that I can pass environment variables to node by doing something like: MY_ENV_VAR1=/tmp MY_ENV_VAR2=/data node index.js How on earth does that work? I've only seen arguments to a ...
user1471465's user avatar
8 votes
1 answer
9k views

Is the equals sign character "=" allowed in the value of an environment value in Linux?

For example, I would like to use the following environment variable name and value in a Linux environment myDN=OU=MY_OU,DC=MYDC,DC=local Is the above allowed in a Linux environment?
TinMan's user avatar
  • 125
0 votes
0 answers
1k views

Can't access environment variable from node.js in Ubuntu

I created an Ubuntu micro instance on AWS, installed node and everything. I have some API credentials in my node.js app, that I'd like to store in environment variables. I'm not Linux savy, so I ...
kecman's user avatar
  • 863
1 vote
1 answer
875 views

Is there a way to figure out what environment variables are needed/used by an executable?

I've got a C++ program that will run certain very specific commands as root. The reason this is needed is because another program running under Node.js needs to do things like set system time, set ...
Brian's user avatar
  • 3,334