telebit.js/lib/admin/index.html

236 lines
9.1 KiB
HTML
Raw Permalink Normal View History

2018-10-16 02:37:07 +00:00
<!DOCTYPE html>
<html>
<head>
2018-10-18 07:11:37 +00:00
<title>Telebit Setup</title>
2018-10-16 02:37:07 +00:00
</head>
<body>
<script>document.body.hidden = true;</script>
2018-10-16 02:37:07 +00:00
<div class="v-app">
2018-10-23 04:36:46 +00:00
<h1>Telebit (Remote) Setup v{{ config.version }}</h1>
2018-10-16 02:37:07 +00:00
<section v-if="views.flash.error">
{{ views.flash.error }}
</section>
<section v-if="views.section.loading">
Loading...
</section>
2018-10-21 05:25:14 +00:00
<section v-if="views.section.setup">
2018-10-18 07:11:37 +00:00
<h2>Create Account</h2>
2018-10-16 02:37:07 +00:00
<form v-on:submit.stop.prevent="initialize">
<label for="-email">Email:</label>
2018-10-18 07:11:37 +00:00
<input id="-email" v-model="init.email" type="text" placeholder="john@example.com" required>
2018-10-16 02:37:07 +00:00
<br>
2018-10-18 07:11:37 +00:00
<label for="-teletos"><input id="-teletos" v-model="init.teletos" type="checkbox" required>
2018-10-16 02:37:07 +00:00
Accept Telebit Terms of Service</label>
<br>
2018-10-18 07:11:37 +00:00
<label for="-letos"><input id="-letos" v-model="init.letos" type="checkbox" required>
2018-10-16 02:37:07 +00:00
Accept Let's Encrypt Terms of Service</label>
<br>
2018-10-18 07:11:37 +00:00
<label for="-notifications">Notification Preferences</label>
<select id="-notifications" v-model="init.notifications">
<option value="newsletter">Occassional Newsletter</option>
<option value="important" default><strong>Important Messages Only</strong></option>
<option value="required">Required Only</option>
</select>
<small>
<p v-if="'newsletter' == init.notifications">
You'll receive a friendly note now and then in addition to the important updates.
</p>
<p v-if="'important' == init.notifications">
You'll only receive updates that we believe will be of the most value to you, and the required updates.
</p>
<p v-if="'required' == init.notifications">
You'll only receive security updates, transactional and account-related messages, and legal notices.
</p>
</small>
2018-10-21 01:11:16 +00:00
<details><summary><small>Advanced</small></summary>
2018-10-21 05:25:14 +00:00
<label for="-relay">Relay:</label>
<input id="-relay" v-model="init.relay" type="text" placeholder="telebit.cloud">
2018-10-18 07:11:37 +00:00
<br>
<button type="button" v-on:click="defaultRelay">Use Default</button>
<button type="button" v-on:click="betaRelay">Use Beta</button>
<br>
2018-10-21 01:11:16 +00:00
<br>
2018-10-21 05:25:14 +00:00
<label for="-acme-server">ACME (Let's Encrypt) Server:</label>
<input id="-acme-server" v-model="init.acmeServer" type="text" placeholder="https://acme-v02.api.letsencrypt.org/directory">
<br>
<button type="button" v-on:click="productionAcme">Use Production</button>
<button type="button" v-on:click="stagingAcme">Use Staging</button>
<br>
<br>
2018-10-21 01:11:16 +00:00
</details>
2018-10-18 07:11:37 +00:00
<button type="submit">Accept &amp; Continue</button>
2018-10-16 02:37:07 +00:00
</form>
<pre><code>{{ init }}</code></pre>
</section>
2018-10-18 07:11:37 +00:00
<section v-if="views.section.advanced">
2018-10-21 05:25:14 +00:00
<h2>Advanced Setup for {{ init.relay }}</h2>
<form v-on:submit.stop.prevent="advance">
2018-10-16 02:37:07 +00:00
2018-10-21 05:25:14 +00:00
<strong><label for="-secret">Relay Shared Secret:</label></strong>
2018-10-18 07:11:37 +00:00
<input id="-secret" v-model="init.secret" type="text" placeholder="ex: xxxxxxxxxxxx">
<br>
2018-10-21 05:25:14 +00:00
<strong><label for="-domains">Domains:</label></strong>
<br>
<small>(comma separated list of domains to use for http, tls, https, etc)</small>
<br>
<input id="-domains" v-model="init.domains" type="text" placeholder="ex: whatever.com, example.com">
2018-10-18 07:11:37 +00:00
<br>
2018-10-16 02:37:07 +00:00
2018-10-21 05:25:14 +00:00
<strong><label for="-ports">TCP Ports:</label></strong>
<br>
<small>(comman separated list of ports, excluding 80 and 443, typically port over 1024)</small>
<br>
<input id="-ports" v-model="init.ports" type="text" placeholder="ex: 5050, 3000, 8080">
2018-10-18 07:11:37 +00:00
<br>
2018-10-21 05:25:14 +00:00
<label for="-telemetry"><input id="-telemetry" v-model="init.telemetry" type="checkbox">
Contribute to Telebit by sharing telemetry</label>
<br>
<button type="submit">Finish</button>
2018-10-18 07:11:37 +00:00
</form>
<pre><code>{{ init }}</code></pre>
2018-10-16 02:37:07 +00:00
</section>
<section v-if="views.section.otp">
<pre><code><h2>{{ init.otp }}</h2></code></pre>
</section>
<section v-if="views.section.status">
2018-10-23 04:36:46 +00:00
http://localhost:{{ status.port }}
2018-10-23 06:44:59 +00:00
<br>
<br>
2018-11-01 08:19:07 +00:00
<section v-if="views.section.status_chooser">
<button v-on:click.prevent.stop="changeState('status/share')">Share Files &amp; Folders</button>
<button v-on:click.prevent.stop="changeState('status/host')">Host a Website or Webapp</button>
<button v-on:click.prevent.stop="changeState('status/access')">Remote Access via SSH</button>
</section>
<section v-if="views.section.status_access">
SSH:
<span v-if="status.ssh">{{ status.ssh }}
<button v-on:click="ssh(-1)">Disable SSH</button></span>
<span v-if="!status.ssh"><input type="text" v-model="state.ssh" placeholder="22">
<button v-on:click="ssh(state.ssh)">Enable SSH</button></span>
<br>
<br>
<div v-if="state.ssh_active">SSH is currently running</div>
<div v-if="!state.ssh_active">SSH is not currently running</div>
<br>
<div v-if="state.ssh_insecure">Password Authentication is NOT disabled.
Please consider updating your <code>sshd_config</code> and restarting ssh.
<pre><code>{{ status }}</code></pre>
</div>
<div v-if="!state.ssh_insecure">Key-Only Authentication is enabled :)</div>
<br>
2018-11-01 09:49:36 +00:00
<div class="alert alert-info">
<strong>Important:</strong> Accessing this device with other SSH clients:
<br>
In order to use your other ssh clients with telebit you will need to put them into
<strong>ssh+https mode</strong>.
We recommend downloading <code><a href="https://telebit.cloud/sclient/" target="_blank">sclient</a></code>
to do so, because it makes it as simple as adding <code>-o ProxyCommand="sclient %h"</code> to your
ssh command to enable ssh+https:
<pre><code>ssh -o ProxyCommand="sclient %h" {{ newHttp.name }}</code></pre>
<br>
However, most clients can also use <code>openssl s_client</code>, which does the same thing, but is
more difficult to remember:
<pre><code>proxy_cmd='openssl s_client -connect %h:443 -servername %h -quiet'
ssh -o ProxyCommand="$proxy_cmd" hot-skunk-45.telebit.io</code></pre>
</div>
2018-11-01 08:19:07 +00:00
</section>
<section v-if="views.section.status_share">
Path Hosting:
<ul>
<li v-for="domain in status.pathHosting">
2018-11-01 09:18:42 +00:00
<form v-on:submit.prevent.stop="changePathHost(domain, domain.path)">
2018-11-01 08:19:07 +00:00
{{ domain.name }}
<input type="text" v-model="domain.path" v-bind:placeholder="domain.handler">
2018-11-01 09:18:42 +00:00
<button type="submit"
v-if="domain.handler == domain.path">Save</button>
<button type="button" v-on:click="deletePathHost(domain)">X</button>
</form>
2018-11-01 08:19:07 +00:00
</li>
</ul>
2018-11-01 09:11:47 +00:00
<form v-on:submit.prevent.stop="createShare(newHttp.sub, newHttp.name, newHttp.handler)">
<input v-model="newHttp.sub" type="text" placeholder="subdomain (ex: pub)">
2018-11-01 08:19:07 +00:00
<select v-model="newHttp.name">
<option v-for="w in status.wildDomains" v-bind:value="w.name">{{ w.name }}</option>
</select>
<input v-model="newHttp.handler" type="text" placeholder="path (ex: ~/Public)" required>
<button>Add</button>
</form>
<br>
</section>
<section v-if="views.section.status_host">
Port Forwarding:
<ul>
<li v-for="domain in status.portForwards">
2018-11-01 09:18:42 +00:00
<form v-on:submit.prevent.stop="changePortForward(domain, domain._port)">
2018-11-01 08:19:07 +00:00
{{ domain.name }}
<input type="text" v-model="domain._port" v-bind:placeholder="domain.handler">
2018-11-01 09:18:42 +00:00
<button type="submit"
v-if="domain.handler == domain._port">Save</button>
<button type="button" v-on:click="deletePortForward(domain)">X</button>
</form>
2018-11-01 08:19:07 +00:00
</li>
</ul>
2018-11-01 09:11:47 +00:00
<form v-on:submit="createHost(newHttp.sub, newHttp.name, newHttp.handler)">
2018-11-01 08:19:07 +00:00
<input v-model="newHttp.sub" type="text" placeholder="subdomain (ex: api)">
<select v-model="newHttp.name">
<option v-for="w in status.wildDomains" v-bind:value="w.name">{{ w.name }}</option>
</select>
<input v-model="newHttp.handler" type="number" placeholder="port (ex: 3000)" required>
<button>Add</button>
</form>
</section>
2018-10-23 06:44:59 +00:00
2018-10-23 04:36:46 +00:00
<br>
Uptime: {{ statusUptime }}
<br>
Runtime: {{ statusRuntime }}
<br>
Reconnects: {{ status.reconnects }}
2018-11-01 08:19:07 +00:00
<details><summary><small>Advanced</small></summary>
<button v-if="!status.enabled" v-on:click="enable">Enable Traffic</button>
<button v-if="status.enabled" v-on:click="disable">Disable Traffic</button>
2018-10-23 04:36:46 +00:00
<br>
2018-11-01 08:19:07 +00:00
<br>
<pre><code>{{ status }}</code></pre>
2018-11-01 08:19:07 +00:00
</details>
</section>
2018-10-16 02:37:07 +00:00
</div>
2018-10-18 07:11:37 +00:00
<script src="/js/vue.js"></script>
<script src="/js/bluecrypt-acme.js"></script>
2018-10-18 07:52:30 +00:00
<script src="/js/telebit.js"></script>
<script src="/js/telebit-token.js"></script>
2018-10-18 07:11:37 +00:00
<script src="/js/app.js"></script>
2018-10-16 02:37:07 +00:00
</body>
</html>