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:27:17 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-11 21:27:17 +0300
commite21aea0827eb6e9635385f9f5d3ad5ad1c952cde (patch)
treebec16453bec01428c324d6a54ab99726934504f1 /main.go
parent3d691bf42432304a3ae6d6465c3f596629891e74 (diff)
Move most of configuration to appConfig
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/main.go b/main.go
index 05d2654d..46f1bfb9 100644
--- a/main.go
+++ b/main.go
@@ -3,10 +3,11 @@ package main
import (
"flag"
"fmt"
- "log"
- "path/filepath"
"io/ioutil"
+ "log"
"net"
+ "os"
+ "path/filepath"
)
// VERSION stores the information about the semantic version of application
@@ -16,7 +17,6 @@ var VERSION = "dev"
var REVISION = "HEAD"
var pagesDomain = flag.String("pages-domain", "gitlab-example.com", "The domain to serve static pages")
-var pagesRoot = flag.String("pages-root", "shared/pages", "The directory where pages are stored")
func evalSymlinks(directory string) (result string) {
result, err := filepath.EvalSymlinks(directory)
@@ -57,6 +57,7 @@ func main() {
var pagesRootKey = flag.String("root-key", "", "The default path to file certificate to serve static pages")
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")
fmt.Printf("GitLab Pages Daemon %s (%s)", VERSION, REVISION)
fmt.Printf("URL: https://gitlab.com/gitlab-org/gitlab-pages")
@@ -69,6 +70,11 @@ func main() {
app.RedirectHTTP = *redirectHTTP
app.HTTP2 = *useHTTP2
+ err := os.Chdir(app.RootDir)
+ if err != nil {
+ log.Fatalln(err)
+ }
+
if *pagesRootCert != "" {
app.RootCertificate = readFile(*pagesRootCert)
}