196 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			196 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html>
 | 
						|
<head>
 | 
						|
  <title>Telebit Setup</title>
 | 
						|
</head>
 | 
						|
<body>
 | 
						|
  <script>document.body.hidden = true;</script>
 | 
						|
 | 
						|
  <div class="v-app">
 | 
						|
    <h1>Telebit (Remote) Setup v{{ config.version }}</h1>
 | 
						|
 | 
						|
    <section v-if="views.flash.error">
 | 
						|
      {{ views.flash.error }}
 | 
						|
    </section>
 | 
						|
 | 
						|
    <section v-if="views.section.loading">
 | 
						|
      Loading...
 | 
						|
    </section>
 | 
						|
 | 
						|
    <section v-if="views.section.setup">
 | 
						|
      <h2>Create Account</h2>
 | 
						|
      <form v-on:submit.stop.prevent="initialize">
 | 
						|
 | 
						|
        <label for="-email">Email:</label>
 | 
						|
        <input id="-email" v-model="init.email" type="text" placeholder="john@example.com" required>
 | 
						|
        <br>
 | 
						|
 | 
						|
        <label for="-teletos"><input id="-teletos" v-model="init.teletos" type="checkbox" required>
 | 
						|
          Accept Telebit Terms of Service</label>
 | 
						|
        <br>
 | 
						|
 | 
						|
        <label for="-letos"><input id="-letos" v-model="init.letos" type="checkbox" required>
 | 
						|
          Accept Let's Encrypt Terms of Service</label>
 | 
						|
        <br>
 | 
						|
 | 
						|
        <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>
 | 
						|
 | 
						|
        <details><summary><small>Advanced</small></summary>
 | 
						|
 | 
						|
        <label for="-relay">Relay:</label>
 | 
						|
          <input id="-relay" v-model="init.relay" type="text" placeholder="telebit.cloud">
 | 
						|
        <br>
 | 
						|
        <button type="button" v-on:click="defaultRelay">Use Default</button>
 | 
						|
        <button type="button" v-on:click="betaRelay">Use Beta</button>
 | 
						|
        <br>
 | 
						|
        <br>
 | 
						|
 | 
						|
        <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>
 | 
						|
 | 
						|
        </details>
 | 
						|
 | 
						|
        <button type="submit">Accept & Continue</button>
 | 
						|
 | 
						|
      </form>
 | 
						|
      <pre><code>{{ init }}</code></pre>
 | 
						|
    </section>
 | 
						|
 | 
						|
    <section v-if="views.section.advanced">
 | 
						|
      <h2>Advanced Setup for {{ init.relay }}</h2>
 | 
						|
      <form v-on:submit.stop.prevent="advance">
 | 
						|
 | 
						|
        <strong><label for="-secret">Relay Shared Secret:</label></strong>
 | 
						|
        <input id="-secret" v-model="init.secret" type="text" placeholder="ex: xxxxxxxxxxxx">
 | 
						|
        <br>
 | 
						|
 | 
						|
        <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">
 | 
						|
        <br>
 | 
						|
 | 
						|
        <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">
 | 
						|
        <br>
 | 
						|
 | 
						|
        <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>
 | 
						|
 | 
						|
      </form>
 | 
						|
      <pre><code>{{ init }}</code></pre>
 | 
						|
    </section>
 | 
						|
 | 
						|
    <section v-if="views.section.otp">
 | 
						|
      <pre><code><h2>{{ init.otp }}</h2></code></pre>
 | 
						|
    </section>
 | 
						|
 | 
						|
    <section v-if="views.section.status">
 | 
						|
      <button v-if="!status.enabled" v-on:click="enable">Enable Traffic</button>
 | 
						|
      <button v-if="status.enabled" v-on:click="disable">Disable Traffic</button>
 | 
						|
      <br>
 | 
						|
      <br>
 | 
						|
 | 
						|
      http://localhost:{{ status.port }}
 | 
						|
      <br>
 | 
						|
      <br>
 | 
						|
 | 
						|
      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>
 | 
						|
 | 
						|
      Path Hosting:
 | 
						|
      <ul>
 | 
						|
        <li v-for="domain in status.pathHosting">
 | 
						|
          {{ domain.name }}
 | 
						|
          <input type="text" v-model="domain.path" v-bind:placeholder="domain.handler">
 | 
						|
          <button
 | 
						|
            v-if="domain.handler == domain.path"
 | 
						|
            v-on:click="changePathHost(domain, domain.path)">Save</button>
 | 
						|
          <button v-on:click="deletePathHost(domain)">X</button>
 | 
						|
        </li>
 | 
						|
      </ul>
 | 
						|
      <form v-on:submit="createHttp(newHttp.name, newHttp.handler)">
 | 
						|
        <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="text" placeholder="path (ex: ~/Public)" required>
 | 
						|
        <button>Add</button>
 | 
						|
      </form>
 | 
						|
      <br>
 | 
						|
 | 
						|
      Port Forwarding:
 | 
						|
      <ul>
 | 
						|
        <li v-for="domain in status.portForwards">
 | 
						|
          {{ domain.name }}
 | 
						|
          <input type="text" v-model="domain._port" v-bind:placeholder="domain.handler">
 | 
						|
          <button
 | 
						|
            v-if="domain.handler == domain._port"
 | 
						|
            v-on:click="changePortForward(domain, domain._port)">Save</button>
 | 
						|
          <button v-on:click="deletePortForward(domain)">X</button>
 | 
						|
        </li>
 | 
						|
      </ul>
 | 
						|
      <form v-on:submit="createHttp(newHttp.name, newHttp.handler)">
 | 
						|
        <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>
 | 
						|
 | 
						|
      <br>
 | 
						|
      Proctime: {{ statusProctime }}
 | 
						|
      <br>
 | 
						|
      Uptime: {{ statusUptime }}
 | 
						|
      <br>
 | 
						|
      Runtime: {{ statusRuntime }}
 | 
						|
      <br>
 | 
						|
      Reconnects: {{ status.reconnects }}
 | 
						|
      <br>
 | 
						|
      <pre><code>{{ status }}</code></pre>
 | 
						|
    </section>
 | 
						|
 | 
						|
  </div>
 | 
						|
 | 
						|
  <script src="/js/vue.js"></script>
 | 
						|
  <script src="/js/telebit.js"></script>
 | 
						|
  <script src="/js/telebit-token.js"></script>
 | 
						|
  <script src="/js/app.js"></script>
 | 
						|
</body>
 | 
						|
</html>
 |