Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-16 19:37:10 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-16 19:37:10 +0300
commit9747e5820ce129895e95355b254d110cb39496a4 (patch)
tree15de284bad0b0344738dcfe7fe57596825e2b661
parenta9b41da7fc5a07eae0a72dc7e59f323a73e74a54 (diff)
Fix small bugs
-rw-r--r--app.go4
-rw-r--r--app_config.go12
-rw-r--r--daemon.go2
-rw-r--r--domains.go11
-rw-r--r--main.go4
5 files changed, 18 insertions, 15 deletions
diff --git a/app.go b/app.go
index 4ab6a3e7..4c690845 100644
--- a/app.go
+++ b/app.go
@@ -109,11 +109,11 @@ func (a *theApp) Run() {
}
// Listen for HTTP proxy requests
- if a.listenProxy != 0 {
+ if a.ListenProxy != 0 {
wg.Add(1)
go func() {
defer wg.Done()
- err := listenAndServe(a.listenProxy, a.ServeProxy, a.HTTP2, nil)
+ err := listenAndServe(a.ListenProxy, a.ServeProxy, a.HTTP2, nil)
if err != nil {
log.Fatal(err)
}
diff --git a/app_config.go b/app_config.go
index b7ba56fe..f0f30d8c 100644
--- a/app_config.go
+++ b/app_config.go
@@ -1,15 +1,15 @@
package main
type appConfig struct {
- Domain string
+ Domain string
RootCertificate []byte
RootKey []byte
- ListenHTTP uintptr
- ListenHTTPS uintptr
- listenProxy uintptr
+ ListenHTTP uintptr
+ ListenHTTPS uintptr
+ ListenProxy uintptr
- HTTP2 bool
- RedirectHTTP bool
+ HTTP2 bool
+ RedirectHTTP bool
}
diff --git a/daemon.go b/daemon.go
index 50e57a6c..de6ce4a3 100644
--- a/daemon.go
+++ b/daemon.go
@@ -199,7 +199,7 @@ func daemonize(config appConfig, uid, gid uint) {
// Create a new file and store the FD
daemonUpdateFd(cmd, &config.ListenHTTP)
daemonUpdateFd(cmd, &config.ListenHTTPS)
- daemonUpdateFd(cmd, &config.listenProxy)
+ daemonUpdateFd(cmd, &config.ListenProxy)
// Start the process
if err = cmd.Start(); err != nil {
diff --git a/domains.go b/domains.go
index 6b4849fb..de038f5e 100644
--- a/domains.go
+++ b/domains.go
@@ -125,12 +125,15 @@ func watchDomains(rootDomain string, updater domainsUpdater, interval time.Durat
lastUpdate := []byte("no-update")
for {
+ // Read the update file
update, err := ioutil.ReadFile(".update")
+ if err != nil && !os.IsNotExist(err) {
+ log.Println("Failed to read update timestamp:", err)
+ }
+
+ // If it's the same ignore
if bytes.Equal(lastUpdate, update) {
- if err != nil {
- log.Println("Failed to read update timestamp:", err)
- time.Sleep(interval)
- }
+ time.Sleep(interval)
continue
}
lastUpdate = update
diff --git a/main.go b/main.go
index e5b43a6e..74e208bc 100644
--- a/main.go
+++ b/main.go
@@ -15,7 +15,7 @@ var VERSION = "dev"
var REVISION = "HEAD"
func appMain() {
- var listenHTTP = flag.String("listen-http", ":80", "The address to listen for HTTP requests")
+ var listenHTTP = flag.String("listen-http", "", "The address to listen for HTTP requests")
var listenHTTPS = flag.String("listen-https", "", "The address to listen for HTTPS requests")
var listenProxy = flag.String("listen-proxy", "", "The address to listen for proxy requests")
var pagesRootCert = flag.String("root-cert", "", "The default path to file certificate to serve static pages")
@@ -63,7 +63,7 @@ func appMain() {
if *listenProxy != "" {
var l net.Listener
- l, config.ListenHTTPS = createSocket(*listenProxy)
+ l, config.ListenProxy = createSocket(*listenProxy)
defer l.Close()
}