From 6d72f5aaaa822dd43ff9f823d78081937fb450b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20B=C3=B6hm?= Date: Tue, 15 Jul 2014 01:16:38 +0200 Subject: [PATCH] Added rudimentary index.html --- .gitignore | 1 + ddns.go | 14 ++++ templates/index.html | 170 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 templates/index.html diff --git a/.gitignore b/.gitignore index cfc3dc3..9538768 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ pdns.conf pdns_backend.py ddns dump.rdb +bindata.go diff --git a/ddns.go b/ddns.go index 44e4713..e33fffc 100644 --- a/ddns.go +++ b/ddns.go @@ -8,6 +8,7 @@ import ( "log" "net" "net/http" + "html/template" "os" "strings" ) @@ -63,6 +64,19 @@ func RunWebService() { defer conn.Close() r := gin.Default() + + // Add index template from bindata + index_content, err := Asset("templates/index.html") + HandleErr(err) + + html, err := template.New("index.html").Parse(string(index_content)) + HandleErr(err) + r.HTMLTemplates = html + + r.GET("/", func (g *gin.Context) { + g.HTML(200, "index.html", nil) + }) + r.GET("/new/:hostname", func(c *gin.Context) { hostname := c.Params.ByName("hostname") diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..9d9e2a0 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,170 @@ + + + + + + + DDNS + + + + + + + + + + + + + +
+
+ +

DDNS

+
+ +
+

Self-Hosted Dynamic DNS

+ +

DDNS is a project that lets you host a Dynamic + DNS Service, similar to DynDNS/NO-IP, on your own servers.

+ +
+ +
+
+
+ +
.d.pboehm.de
+
+
+
+
+ +
+ +
+

Own Domain with NS delegation

+

You have to own a domain where your Registrar allows you + to add NS-Records for Subdomains, as this is handled by + DDNS.

+ +

Running Server

+

You should have a server running continously. Go, Redis + and PowerDNS have to be supported by the running OS.

+
+ +
+

Redis

+

Redis is used as the data store with features like + automatic expiration of hosts ...

+ +

PowerDNS

+

PowerDNS is the DNS server software used by DDNS to handle + the DNS requests for your subdomain. DDNS provides a suitable + backend software for PowerDNS.

+
+
+ + + +
+ + + + + + + +