Skip to content

Commit

Permalink
Merge pull request #43 from funbox/develop
Browse files Browse the repository at this point in the history
Version 0.18.0
  • Loading branch information
andyone authored Feb 21, 2018
2 parents 368cdf3 + f5d9a0f commit 09472e0
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ sudo: false
language: go

go:
- 1.7.x
- 1.8.x
- 1.9.x
- 1.10.x
- tip

branches:
Expand Down
5 changes: 3 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// +build !windows

package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down Expand Up @@ -31,7 +32,7 @@ import (
// App props
const (
APP = "init-exporter"
VER = "0.17.0"
VER = "0.18.0"
DESC = "Utility for exporting services described by Procfile to init system"
)

Expand Down
7 changes: 5 additions & 2 deletions common/init-exporter.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

Summary: Utility for exporting services described by Procfile to init system
Name: init-exporter
Version: 0.17.0
Version: 0.18.0
Release: 0%{?dist}
Group: Development/Tools
License: MIT
Expand All @@ -52,7 +52,7 @@ Source0: %{name}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: golang >= 1.8
BuildRequires: golang >= 1.9

Provides: upstart-exporter = %{version}-%{release}
Provides: systemd-exporter = %{version}-%{release}
Expand Down Expand Up @@ -111,6 +111,9 @@ rm -rf %{buildroot}
################################################################################

%changelog
* Wed Feb 21 2018 Anton Novojilov <[email protected]> - 0.18.0-0
- Removed validation for environment variables' values

* Wed Nov 08 2017 Anton Novojilov <[email protected]> - 0.17.0-0
- Reloading units after application installation and uninstallation

Expand Down
2 changes: 1 addition & 1 deletion export/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package export

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion export/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package export

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion export/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package export

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion export/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package export

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion export/upstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package export

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion init-exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
34 changes: 10 additions & 24 deletions procfile/procfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package procfile

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand All @@ -23,10 +23,10 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

const (
REGEXP_V1_LINE = `^([A-z\d_]+):\s*(.+)`
REGEXP_V2_VERSION = `(?m)^\s*version:\s*2\s*$`
REGEXP_PATH_CHECK = `\A[A-Za-z0-9_\-./]+\z`
REGEXP_VALUE_CHECK = `\A[A-Za-z0-9_\-.,+/:;${}"' =\*]+\z`
REGEXP_V1_LINE = `^([A-z\d_]+):\s*(.+)`
REGEXP_V2_VERSION = `(?m)^\s*version:\s*2\s*$`
REGEXP_PATH_CHECK = `\A[A-Za-z0-9_\-./]+\z`
REGEXP_NAME_CHECK = `\A[A-Za-z0-9_\-]+\z`
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -146,7 +146,10 @@ func (a *Application) Validate() []error {
func (s *Service) Validate() []error {
errs := errutil.NewErrors()

errs.Add(checkValue(s.Name))
if !regexp.MustCompile(REGEXP_NAME_CHECK).MatchString(s.Name) {
errs.Add(fmt.Errorf("Service name %s is misformatted and can't be accepted", s.Name))
}

errs.Add(s.Options.Validate()...)

return errs.All()
Expand Down Expand Up @@ -508,27 +511,10 @@ func checkEnv(name, value string) error {
}
}

if !regexp.MustCompile(REGEXP_VALUE_CHECK).MatchString(name) {
if !regexp.MustCompile(REGEXP_NAME_CHECK).MatchString(name) {
return fmt.Errorf("Environment variable name %s is misformatted and can't be accepted", name)
}

if !regexp.MustCompile(REGEXP_VALUE_CHECK).MatchString(value) {
return fmt.Errorf("Environment variable value %s is misformatted and can't be accepted", value)
}

return nil
}

// checkValue check any value and return error if value is insecure
func checkValue(value string) error {
if value == "" {
return nil
}

if !regexp.MustCompile(REGEXP_VALUE_CHECK).MatchString(value) {
return fmt.Errorf("Value %s is insecure and can't be accepted", value)
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion procfile/procfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package procfile

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion procfile/procfile_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package procfile

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion procfile/procfile_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package procfile

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2006-2017 FB GROUP LLC //
// Copyright (c) 2006-2018 FB GROUP LLC //
// //
// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down

0 comments on commit 09472e0

Please sign in to comment.