Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Commit

Permalink
remove dns ping feature, invalidate reset tokens after use, minor hou…
Browse files Browse the repository at this point in the history
…sekeeping
  • Loading branch information
jedireza committed May 24, 2016
1 parent 3fec99c commit a298a37
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 270 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dev-certs
certs
node_modules
npm-debug.log
spacekit.json
Expand Down
2 changes: 0 additions & 2 deletions lib/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const CreateLogger = require('../create-logger');
const Db = require('../db');
const DynamicDns = require('../dynamic-dns');
const Mailer = require('../mailer');
const Ping = require('./ping');
const Recover = require('./recover');
const Reset = require('./reset');
const SignUp = require('./signup');
Expand Down Expand Up @@ -38,7 +37,6 @@ module.exports = function (config) {
res.json({ message: 'Welcome to the SpaceKit api.' });
});

api.get('/ping', Ping);
api.post('/recover', Recover);
api.post('/reset', Reset);
api.post('/signup', SignUp);
Expand Down
107 changes: 0 additions & 107 deletions lib/api/ping.js

This file was deleted.

9 changes: 8 additions & 1 deletion lib/api/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ module.exports = function Reset (req, res) {
});
}],
updateUser: ['apiKey', function (done, results) {
let query = 'UPDATE users SET api_key = $1 WHERE id = $2';
let query = `
UPDATE users
SET
api_key = $1,
reset_token = NULL,
reset_expires = NULL
WHERE id = $2
`;
let params = [
results.apiKey.hash,
results.userLookup.id
Expand Down
Binary file added lib/www/static/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions lib/www/static/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,42 @@ body {
border-bottom: 2px solid #ccc;
}

/* Overview */
.step {
font-weight: bold;
}
.step label {
display: inline-block;
font-size: 25px;
color: #fff;
background: #000;
text-align: center;
width: 30px;
height: 30px;
border-radius: 33px;
display: inline-block;
vertical-align: middle;
margin-right: 5px;
}
.step-1 {
color: #000;
}
.step-1 label {
background: #000;
}
.step-2 {
color: #4286c5;
}
.step-2 label {
background: #4286c5;
}
.step-3 {
color: #4caf50;
}
.step-3 label {
background: #4caf50;
}

/* Feature matrix*/
.feature-matrix .text-tiny {
font-size: 80%;
Expand Down
127 changes: 55 additions & 72 deletions lib/www/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
<li role="presentation" class="active">
<a href="#">Home</a>
</li>
<li role="overview">
<a href="#overview">Overview</a>
<li role="install">
<a href="#install">Install</a>
</li>
<li role="examples">
<a href="#examples">Examples</a>
</li>
<li role="presentation">
<a href="#features">Features</a>
Expand All @@ -37,71 +40,63 @@ <h3 class="nav-brand">
<div class="row">
<div class="col-lg-12">
<div class="pre-release">
<p><span class="text-highlight">
<strong>Please note:</strong> This is a pre-release experiment.
We're still beta testing.
<p class="lead"><span class="text-highlight">
<strong>Attention:</strong> This is a pre-release experiment.
</span></p>
</div>
</div>
</div>
<div class="jumbotron">
<h1>Secure Connections</h1>
<p class="lead">For your home. For your work. For your devices.</p>
<p class="icons">
<i class="fa fa-home"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fa fa-building"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fa fa-wifi"></i>
</p>
</div>
<ul class="nav nav-tabs nav-forms">
<li role="presentation" class="active">
<a href="#signup" aria-controls="signup" role="tab" data-toggle="tab">Get an API key</a>
</li>
<!-- <li role="presentation"> -->
<!-- <a href="#recover" aria&#45;controls="recover" role="tab" data&#45;toggle="tab">Recover credentials</a> -->
<!-- </li> -->
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="signup">
<form id="signup-form" class="text-center">
<div class="signup-step-1">
<div class="signup-domain">
<span class="relay">home.</span>
<input type="text" name="username" placeholder="username">
<span>.spacekit.io</span>
</div>
<div class="signup-email">
<input type="text" name="email" placeholder="recovery email address">
</div>
<button class="btn btn-lg btn-success">Get API key <i class="fa fa-arrow-right"></i></button>
<div class="row marketing">
<div class="col-lg-4">
<h4 class="step step-1">
<label>1</label> Start a relay
</h4>
<p>First you start a relay on your local network.</p>
</div>
<div class="col-lg-4">
<h4 class="step step-2">
<label>2</label> We update DNS
</h4>
<p>We make sure DNS is pointing correctly.</p>
</div>
<div class="signup-step-2">
<div>
Username: <span class="signup-username"></span>
</div>
<div>
API key: <span class="signup-api-key"></span>
</div>
<div class="col-lg-4">
<h4 class="step step-3">
<label>3</label> Relay is live
</h4>
<p>Within seconds, you can access your app(s) securely.</p>
</div>
</form>
</div>
<a href="routing-diagram.png">
<img class="img-responsive" alt="routing diagram" src="routing-diagram.png" />
</a>
</div>
<div role="tabpanel" class="tab-pane" id="recover">
<form id="recover-form">
</form>
</div>
<div class="row">
<div class="col-lg-12">
<div class="page-header">
<a id="install"></a>
<a href="#" class="pull-right">
<small>top <i class="fa fa-arrow-up"></i></small>
</a>
<h2>Install</h2>
</div>
<div>
<pre>
$ npm install -g spacekit</pre>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="page-header">
<a id="overview"></a>
<a id="examples"></a>
<a href="#" class="pull-right">
<small>top <i class="fa fa-arrow-up"></i></small>
</a>
<h2>Overview</h2>
<h2>Examples</h2>
</div>
<div>
<pre>
$ spacekit laptop 8080</pre>
</div>
<a href="routing-diagram.png">
<img class="img-responsive" alt="routing diagram" src="routing-diagram.png" />
</a>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -163,13 +158,6 @@ <h2>Features</h2>
</td>
<td><i class="fa fa-check"></i></td>
</tr>
<tr>
<td>Dynamic DNS to your IP</td>
<td><i class="fa fa-check"></i></td>
<td><i class="fa fa-times"></i></td>
<td><i class="fa fa-times"></i></td>
<td><i class="fa fa-times"></i></td>
</tr>
<tr>
<td>Open source</td>
<td><i class="fa fa-check"></i></td>
Expand Down Expand Up @@ -198,20 +186,19 @@ <h4>Secure without MITM</h4>
offer SSL but are the "man in the middle" who <em>could</em>
inspect your traffic.</p>
</div>
<div class="col-lg-6">
<h4>Dynamic DNS to your IP</h4>
<p>By using the <code>--noProxy</code> setting, your relay will
ping SpaceKit's servers and we'll keep your domain pointed back to
your IP address.</p>
</div>
</div>
<div class="row marketing">
<div class="col-lg-6">
<h4>Open source</h4>
<p><strong>All of our code</strong> is open and everything is
configurable. You could run your own service and relays. Everything
is up <a href="https://github.com/spacekit">on our GitHub</a>.</p>
</div>
</div>
<div class="row marketing">
<div class="col-lg-6">
<h4>Multiple instances</h4>
<p>Create as many relays as you'd like;
home, work, laptop, etc...</p>
</div>
<div class="col-lg-6">
<h4>Free forever</h4>
<p>Although we may have paid features in the future, our features
Expand All @@ -226,9 +213,5 @@ <h4>Free forever</h4>
<p>&copy; 2016 SpaceKit</p>
</footer>
</div>

<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="index.js"></script>
</body>
</html>
Loading

0 comments on commit a298a37

Please sign in to comment.