From f73e6f38581d9cdfb10e3fb6409ea1894e18b39b Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 16 Oct 2016 17:43:28 +0200 Subject: Cleanup --- config.go | 6 ++---- livewatch.go | 18 ------------------ main.go | 8 ++------ prometheus.go | 1 + static.go | 4 +--- 5 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 livewatch.go diff --git a/config.go b/config.go index c89f79a..5361d6e 100644 --- a/config.go +++ b/config.go @@ -1,14 +1,12 @@ package main -import ( - "golang.org/x/tools/blog" -) +import "golang.org/x/tools/blog" const hostname = "www.dim13.org" // default hostname for blog server var config = blog.Config{ Hostname: hostname, - BaseURL: "//" + hostname, + BaseURL: "https://" + hostname, HomeArticles: 5, // articles to display on the home page FeedArticles: 10, // articles to include in Atom and JSON feeds FeedTitle: "dim13", diff --git a/livewatch.go b/livewatch.go deleted file mode 100644 index 7a6c02c..0000000 --- a/livewatch.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "io" - "net/http" -) - -func init() { - http.HandleFunc("/livewatch", liveWatch) -} - -func liveWatch(w http.ResponseWriter, r *http.Request) { - key := r.FormValue("key") - if len(key) != 32 { - key = "Ok" - } - io.WriteString(w, key) -} diff --git a/main.go b/main.go index d69648a..b66a674 100644 --- a/main.go +++ b/main.go @@ -7,18 +7,14 @@ import ( "log" "net/http" "net/http/fcgi" - _ "net/http/pprof" "golang.org/x/tools/blog" ) -var reload = flag.Bool("reload", false, "reload content on each page load") - -func init() { +func main() { + reload := flag.Bool("reload", false, "reload content on each page load") flag.Parse() -} -func main() { l, err := dropPrivAndListen("www", "run/blog.sock") if err != nil { log.Fatal(err) diff --git a/prometheus.go b/prometheus.go index c9ac835..333a9fd 100644 --- a/prometheus.go +++ b/prometheus.go @@ -2,6 +2,7 @@ package main import ( "net/http" + _ "net/http/pprof" "github.com/prometheus/client_golang/prometheus" ) diff --git a/static.go b/static.go index 2323400..0b16307 100644 --- a/static.go +++ b/static.go @@ -2,9 +2,7 @@ package main -import ( - "net/http" -) +import "net/http" func init() { fs := http.FileServer(http.Dir("htdocs/static")) -- cgit v1.2.3