From b35b36ea6a21c44aa53371b3da375853d992b3a6 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 6 Oct 2020 17:45:12 -0400 Subject: [PATCH 1/2] fix: use better error for invalid process name --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 39e8870..a29e407 100644 --- a/main.go +++ b/main.go @@ -144,6 +144,8 @@ func writeProcfile(path string, delimiter string, entries []procfileEntry) error func parseProcfile(path string, delimiter string) ([]procfileEntry, error) { var entries []procfileEntry reCmd, _ := regexp.Compile(`^([a-z0-9]([-a-z0-9]*[a-z0-9])?)` + delimiter + `\s*(.+)$`) + reOldCmd, _ := regexp.Compile(`^([A-Za-z0-9_-]+)` + delimiter + `\s*(.+)$`) + reComment, _ := regexp.Compile(`^(.*)\s#.+$`) text, err := getProcfile(path) @@ -163,14 +165,20 @@ func parseProcfile(path string, delimiter string) ([]procfileEntry, error) { continue } + oldParams := reOldCmd.FindStringSubmatch(line) params := reCmd.FindStringSubmatch(line) isCommand := len(params) == 4 + isOldCommand := len(oldParams) == 3 isComment := strings.HasPrefix(line, "#") if isComment { continue } if !isCommand { + if isOldCommand { + return entries, fmt.Errorf("process name contains invalid characters, line %d", lineNumber) + } + return entries, fmt.Errorf("invalid line in procfile, line %d", lineNumber) } From 8976e32dc8b562632bdc5bddc12462bc351b142d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 6 Oct 2020 17:46:08 -0400 Subject: [PATCH 2/2] Release 0.9.1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fc20608..9df3ee3 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ MAINTAINER_NAME = Jose Diaz-Gonzalez REPOSITORY = go-procfile-util HARDWARE = $(shell uname -m) SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]') -BASE_VERSION ?= 0.9.0 +BASE_VERSION ?= 0.9.1 IMAGE_NAME ?= $(MAINTAINER)/$(REPOSITORY) PACKAGECLOUD_REPOSITORY ?= dokku/dokku-betafish