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-11 21:36:15 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-11 21:36:15 +0300
commit8166163d39f1f972b2bea2817bdc78cc0777faa3 (patch)
treefa41836f32a4368eaf1b1e8c15c6e029a76ee496 /main.go
parent3732867a8f79171e2d5aefb8ceaa4b887fbbaf72 (diff)
Move most of configuration to appConfig
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.go b/main.go
index 46f1bfb9..d5c4b775 100644
--- a/main.go
+++ b/main.go
@@ -3,11 +3,12 @@ package main
import (
"flag"
"fmt"
- "io/ioutil"
"log"
+ "path/filepath"
+ "io/ioutil"
"net"
"os"
- "path/filepath"
+ "strings"
)
// VERSION stores the information about the semantic version of application
@@ -16,8 +17,6 @@ var VERSION = "dev"
// REVISION stores the information about the git revision of application
var REVISION = "HEAD"
-var pagesDomain = flag.String("pages-domain", "gitlab-example.com", "The domain to serve static pages")
-
func evalSymlinks(directory string) (result string) {
result, err := filepath.EvalSymlinks(directory)
if err != nil {
@@ -58,6 +57,7 @@ func main() {
var redirectHTTP = flag.Bool("redirect-http", true, "Serve the pages under HTTP")
var useHTTP2 = flag.Bool("use-http2", true, "Enable HTTP2 support")
var pagesRoot = flag.String("pages-root", "shared/pages", "The directory where pages are stored")
+ var pagesDomain = flag.String("pages-domain", "gitlab-example.com", "The domain to serve static pages")
fmt.Printf("GitLab Pages Daemon %s (%s)", VERSION, REVISION)
fmt.Printf("URL: https://gitlab.com/gitlab-org/gitlab-pages")
@@ -65,7 +65,7 @@ func main() {
var app theApp
- app.Domain = *pagesDomain
+ app.Domain = strings.ToLower(*pagesDomain)
app.RootDir = evalSymlinks(*pagesRoot)
app.RedirectHTTP = *redirectHTTP
app.HTTP2 = *useHTTP2