top | item 31534260

(no title)

tmp538394722 | 3 years ago

> when you run the program, run it with ` MY_SECRET_KEY=myGitHubPersonalToken npm start`

But where does this live? Or do you literally mean that Jane The Sys Admin is supposed to type this into her terminal every time the service restarts in the middle of the night?

What if I need to replace a node? Or scale a service? How do these secrets get there?

discuss

order

capableweb|3 years ago

> But where does this live? Or do you literally mean that Jane The Sys Admin is supposed to type this into her terminal every time the service restarts in the middle of the night?

Depends on how the service is deployed. If you're just running it on a Digital Ocean instance by manually SSHing into the instance and running systemd services, define it in the .service file (it supports defining environment variables).

If you're doing instances via automation (like Terraform), most of them (including Terraform) supports loading things from environment variables. So you run `MY_SECRET_KEY=myGitHubPersonalToken terraform apply` when you create the instance, and use the environment variable in your hcl definitions.