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-12 16:17:01 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-12 16:17:01 +0300
commit25c9a0571b011674192032ac829120133914dca3 (patch)
tree13b77000b66f4cdcf7e3f99dea176de327734ea9 /main.go
parentbbb533e354b00fdc86ace6901dfddd5d8801a8ba (diff)
Make verify happy
Diffstat (limited to 'main.go')
-rw-r--r--main.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/main.go b/main.go
index 623d2538..d0d6d1c4 100644
--- a/main.go
+++ b/main.go
@@ -2,7 +2,6 @@ package main
import (
"flag"
- "fmt"
"log"
"net"
"os"
@@ -15,9 +14,7 @@ var VERSION = "dev"
// REVISION stores the information about the git revision of application
var REVISION = "HEAD"
-func main() {
- daemonMain()
-
+func appMain() {
var listenHTTP = flag.String("listen-http", ":80", "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")
@@ -29,8 +26,8 @@ func main() {
var pagesDomain = flag.String("pages-domain", "gitlab-example.com", "The domain to serve static pages")
var pagesUser = flag.String("pages-user", "", "Drop privileges to this user")
- fmt.Printf("GitLab Pages Daemon %s (%s)\n", VERSION, REVISION)
- fmt.Printf("URL: https://gitlab.com/gitlab-org/gitlab-pages\n")
+ log.Printf("GitLab Pages Daemon %s (%s)", VERSION, REVISION)
+ log.Printf("URL: https://gitlab.com/gitlab-org/gitlab-pages\n")
flag.Parse()
err := os.Chdir(*pagesRoot)
@@ -71,7 +68,15 @@ func main() {
if *pagesUser != "" {
daemonize(config, *pagesUser)
- } else {
- runApp(config)
+ return
}
+
+ runApp(config)
+}
+
+func main() {
+ log.SetOutput(os.Stderr)
+
+ daemonMain()
+ appMain()
}