summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-10-16 17:43:28 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-10-16 17:43:28 +0200
commitf73e6f38581d9cdfb10e3fb6409ea1894e18b39b (patch)
tree01b595c07b35fdc368ff8b774988df1292f8f9c0
parent0d1de95de5bd31de756f7b764e63baad2b6e928c (diff)
Cleanup
-rw-r--r--config.go6
-rw-r--r--livewatch.go18
-rw-r--r--main.go8
-rw-r--r--prometheus.go1
-rw-r--r--static.go4
5 files changed, 6 insertions, 31 deletions
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"))