Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

Commit

Permalink
fix issue with environment variables with dashes, change Dockerfile e…
Browse files Browse the repository at this point in the history
…nv LISTENER to LISTENERS, bump version
  • Loading branch information
dan-v committed Apr 22, 2020
1 parent f31eaef commit 65443b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV FREQUENCY=
ENV MEMORY=
ENV SSH_USER=
ENV SSH_PORT=2222
ENV LISTENER=
ENV LISTENERS=
ENV DEBUG_PROXY=

WORKDIR /app
Expand Down
3 changes: 3 additions & 0 deletions cmd/awslambdaproxy/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"strings"

"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -39,9 +40,11 @@ func initConfig() {
viper.SetConfigFile(cfgFile)
}

var replacer = strings.NewReplacer("-", "_", ".", "_")
viper.SetConfigName(".awslambdaproxy") // name of config file (without extension)
viper.AddConfigPath("$HOME") // adding home directory as first search path
viper.AutomaticEnv() // read in environment variables that match
viper.SetEnvKeyReplacer(replacer)

// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
Expand Down
3 changes: 3 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
// ServerInit is the main entrypoint for the server portion of awslambdaproxy
func ServerInit(sshUser string, sshPort string, regions []string, memory int64, frequency time.Duration,
listeners []string, timeout int64, debugProxy bool) {
log.Printf("sshUser=%v, sshPort=%v regions=%v memory=%v frequency=%v listeners=%v timeout=%v debugProxy=%v\n",
sshUser, sshPort, regions, memory, frequency, listeners, timeout, debugProxy)

publicIP, err := getPublicIP()
if err != nil {
log.Fatal("Error getting public IP address", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package awslambdaproxy

import "strings"

const version = "0.0.10"
const version = "0.0.11"

// LambdaVersion is version of awslambdaproxy
func LambdaVersion() string {
Expand Down

0 comments on commit 65443b2

Please sign in to comment.