Added rudimentary index.html

This commit is contained in:
Philipp Böhm 2014-07-15 01:16:38 +02:00
parent 2c9a38bdc8
commit 6d72f5aaaa
3 changed files with 185 additions and 0 deletions

1
.gitignore vendored
View file

@ -57,3 +57,4 @@ pdns.conf
pdns_backend.py
ddns
dump.rdb
bindata.go

14
ddns.go
View file

@ -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")

170
templates/index.html Normal file
View file

@ -0,0 +1,170 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DDNS</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css">
<!-- Optional theme -->
<style type="text/css" media="all">
/* Space out content a bit */
body {
padding-top: 20px;
padding-bottom: 20px;
}
/* Everything but the jumbotron gets side spacing for mobile first views */
.header,
.marketing,
.footer {
padding-right: 15px;
padding-left: 15px;
}
/* Custom page header */
.header {
border-bottom: 1px solid #e5e5e5;
}
/* Make the masthead heading the same height as the navigation */
.header h3 {
padding-bottom: 19px;
margin-top: 0;
margin-bottom: 0;
line-height: 40px;
}
/* Custom page footer */
.footer {
padding-top: 19px;
color: #777;
border-top: 1px solid #e5e5e5;
}
/* Customize container */
@media (min-width: 768px) {
.container {
max-width: 730px;
}
}
.container-narrow > hr {
margin: 30px 0;
}
/* Main marketing message and sign up button */
.jumbotron {
text-align: center;
border-bottom: 1px solid #e5e5e5;
}
.jumbotron .btn {
padding: 14px 24px;
font-size: 21px;
}
/* Supporting marketing content */
.marketing {
margin: 40px 0;
}
.marketing p + h4 {
margin-top: 28px;
}
/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
/* Remove the padding we set earlier */
.header,
.marketing,
.footer {
padding-right: 0;
padding-left: 0;
}
/* Space out the masthead */
.header {
margin-bottom: 30px;
}
/* Remove the bottom border on the jumbotron for visual effect */
.jumbotron {
border-bottom: 0;
}
}
</style>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="header">
<ul class="nav nav-pills pull-right">
<li class="active"><a href="#">Home</a></li>
<li><a href="https://github.com/pboehm/ddns">
<i class="fa fa-github fa-lg"></i> Code</a></li>
</ul>
<h3 class="text-muted">DDNS</h3>
</div>
<div class="jumbotron">
<h1>Self-Hosted Dynamic DNS</h1>
<p class="lead">DDNS is a project that lets you host a Dynamic
DNS Service, similar to DynDNS/NO-IP, on your own servers.</p>
<hr />
<form class="form-inline" role="form">
<div class="form-group">
<div class="input-group">
<input class="form-control input-lg" type="text" placeholder="my-own-hostname">
<div class="input-group-addon input-lg">.d.pboehm.de</div>
</div>
</div>
</form>
</div>
<div class="row marketing">
<div class="col-lg-6">
<h4>Own Domain with NS delegation</h4>
<p>You have to own a domain where your Registrar allows you
to add NS-Records for Subdomains, as this is handled by
DDNS.</p>
<h4>Running Server</h4>
<p>You should have a server running continously. Go, Redis
and PowerDNS have to be supported by the running OS.</p>
</div>
<div class="col-lg-6">
<h4>Redis</h4>
<p>Redis is used as the data store with features like
automatic expiration of hosts ...</p>
<h4>PowerDNS</h4>
<p>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.</p>
</div>
</div>
<div class="footer">
<p>&copy; Philipp Böhm</p>
</div>
</div> <!-- /container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>