Skip to content

catmullet/envi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envi

Encrypted local environment variable storage

Getting Started

Set your ENVI_RESOURCE_ID environment variable

Import envi into your project

import github.com/catmullet/envi

Install the CLI

go install github.com/catmullet/envi/envi-cli

Running with it

Initialize and edit an envi.yaml within your project.

  • From the root of your project run envi-cli init.
  • To edit the file run envi-cli edit. This will start up either your default editor defined by the EDITOR environment variable or it will default to vim.

Run with your envi.SetEnv(<environment>) function.

package main

import (
	"fmt"
	"github.com/catmullet/envi"
	"os"
)

func main() {
	if err := envi.SetEnv(envi.Developer); err != nil {
		fmt.Println("an error occured grabbing environment variables:", err)
		os.Exit(1)
	}

	for _, v := range os.Environ() {
		fmt.Println(v)
	}
}

Added the environment variable

Run the app and check the results

Viewing envi.yaml

For anyone else without your key it's just encrypted garbage

For you use envi-cli edit or follow Google's documentation to decrypt with gcloud CLI (https://cloud.google.com/kms/docs/creating-keys)

Releases

No releases published

Packages

No packages published

Languages