Skip to content

Commit

Permalink
Merge pull request #1029 from subutai-io/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Mike Savochkin authored Jun 18, 2020
2 parents 7506d0d + c6c7ea0 commit e7fba5e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions lib/proxy/proxy.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package proxy

import (
"github.com/nightlyone/lockfile"
"time"
"strings"
"github.com/subutai-io/agent/lib/gpg"
"fmt"
"os"
"io/ioutil"
"path/filepath"
"sort"
"github.com/nightlyone/lockfile"
"github.com/pkg/errors"
"github.com/subutai-io/agent/agent/util"
"github.com/subutai-io/agent/config"
"github.com/subutai-io/agent/db"
"github.com/subutai-io/agent/lib/common"
"github.com/subutai-io/agent/lib/net"
"github.com/pkg/errors"
"github.com/subutai-io/agent/lib/exec"
"github.com/subutai-io/agent/lib/fs"
"strconv"
"github.com/subutai-io/agent/lib/gpg"
"github.com/subutai-io/agent/lib/net"
"io/ioutil"
"os"
"path"
"github.com/subutai-io/agent/config"
"github.com/subutai-io/agent/lib/exec"
"github.com/subutai-io/agent/agent/util"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
"time"
)

//todo split this file into types, snippets,
Expand Down Expand Up @@ -66,7 +66,9 @@ server {
{well-known}
return 301 https://$host:{port}$request_uri; # enforce https
location / {
return 301 https://$host:{port}$request_uri; # enforce https
}
}
`
Expand Down Expand Up @@ -200,8 +202,7 @@ func FindProxiedServers(tag, socket string) ([]db.ProxiedServer, error) {
func CreateProxy(protocol, domain, loadBalancing, tag string, port int, redirect80Port, sslBackend bool, certPath string, http2 bool) error {
var err error = nil
var lock lockfile.Lockfile
for lock, err = common.LockFile("port", "proxy");
err != nil; lock, err = common.LockFile("port", "proxy") {
for lock, err = common.LockFile("port", "proxy"); err != nil; lock, err = common.LockFile("port", "proxy") {

time.Sleep(time.Second * 1)
}
Expand Down Expand Up @@ -428,8 +429,7 @@ func AddProxiedServer(tag, socket string) error {

var err error = nil
var lock lockfile.Lockfile
for lock, err = common.LockFile("port", "server");
err != nil; lock, err = common.LockFile("port", "server") {
for lock, err = common.LockFile("port", "server"); err != nil; lock, err = common.LockFile("port", "server") {
time.Sleep(time.Second * 1)
}
defer lock.Unlock()
Expand Down Expand Up @@ -846,7 +846,7 @@ func figureOutDomainFolderName(domain string) (string, error) {
//collect all matching directory names
var res []string
for _, f := range files {
if f.IsDir() && ( validCertDirName.MatchString(f.Name())) {
if f.IsDir() && (validCertDirName.MatchString(f.Name())) {
res = append(res, filepath.Join(f.Name()))
}
}
Expand Down

0 comments on commit e7fba5e

Please sign in to comment.