Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 tg-dashboard (1.0-1) unstable; urgency=medium
 .
   * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>
Author: root <root@unknown>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2021-02-27

--- /dev/null
+++ tg-dashboard-1.0/dashboard/dashboard.wsgi
@@ -0,0 +1,4 @@
+#!/usr/bin/python3
+import sys
+sys.path.insert(0,"/var/www/dashboard/")
+from dashboard import app as application
--- /dev/null
+++ tg-dashboard-1.0/dashboard/static/common.js
@@ -0,0 +1,2 @@
+$(function() {
+});
--- /dev/null
+++ tg-dashboard-1.0/dashboard/static/style.css
@@ -0,0 +1,70 @@
+body { overflow-y: auto; overflow-x: hidden }
+.nav-left { height: 100vh }
+.container { overflow: auto }
+.ov-auto { overflow: auto !important }
+.navbar, .card { box-shadow: 0px 0px 60px -40px rgba(0,0,0,0.75) }
+.col-3 { display: none !important }
+table, .whsnowrap { white-space: nowrap !important }
+#auth-el-1, #auth-el-2 { margin-top: 30px }
+
+#data-el-1, #data-el-2, #data-el-3, #data-el-4, #data-el-5, #user-el-1, #user-el-2, #user-el-3, #auth-el-1, #auth-el-2 { width: 100% !important }
+
+@media only screen and (min-width: 769px) {
+  body { overflow: hidden }
+  .container { height: 100vh }
+  .nav-mob { display: none !important }
+  .col-3 { display: block !important }
+  .n-l-1 { font-size: 1.9vw; white-space: nowrap; margin-left: 20% }
+  .n-l { font-size: 1.1vw; margin-left: 10px }
+  .card { border-radius: 0px }
+  .card::-webkit-scrollbar { -webkit-appearance: none }
+  /*.ov-auto::-webkit-scrollbar { -webkit-appearance: none }*/
+  .card-log { overflow: auto; height: 92vh; margin-right: 20px; margin-top: 35px }
+  table, .whsnowrap { white-space: nowrap !important }
+
+  #data-el-1, #auth-el-1, #auth-el-2 { width: 47% !important }
+  #data-el-2 { width: 47% !important; margin-left: 20px }
+  #data-el-5, #data-el-4, #data-el-3 { width: calc(94% + 20px) !important }
+
+  #user-el-1 { width: 20% !important }
+  #user-el-2 { width: 74% !important; margin-left: 30px }
+  #user-el-3 { width: calc(94% + 30px) !important }
+
+  #login-el-2, #auth-el-2 { margin-left: 30px }
+}
+
+dd, .os {margin-left: 30px; margin-top: 5px; margin-bottom: 5px;}
+.scroll-x {
+  height: 45px;
+  background-color: #e9ecef;
+  overflow-x: scroll;
+  overflow-y: hidden;
+  white-space: nowrap;
+}
+
+.tgr-col {
+  font-size: 1.25rem;
+}
+.tgr-button {
+  display       : inline-block;
+  border-radius : 5%;          /* 角丸       */
+  font-size     : 8pt;        /* 文字サイズ */
+  text-align    : center;      /* 文字位置   */
+  cursor        : pointer;     /* カーソル   */
+  padding       : 6px 5px;   /* 余白       */
+  background    : #999999;     /* 背景色     */
+  color         : #000000;     /* 文字色     */
+  line-height   : 1em;         /* 1行の高さ  */
+  opacity       : 1;           /* 透明度     */
+  transition    : .3s;         /* なめらか変化 */
+}
+
+.tgr-button:hover {
+  opacity       : 0.8;         /* カーソル時透明度 */
+}
+
+.chkbox {
+  transform: scale(1.5);
+  position: relative;
+  top: 8px;
+}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/admin.html
@@ -0,0 +1,97 @@
+{% extends "layout.html" %}
+{% block container %}
+          {% if auth_type_2 == 'dmk' %}
+          <div class="card" style="width: 97%; margin-top: 30px">
+            <div class="card-body ov-auto">
+              <h5 class="card-title">Change DMK</h5>
+              <form action="/admin/dmk" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="Current DMK" id="dmk" name="dmk"></div>
+                </div>
+                <div class="row" style="margin-top: 10px">
+                  <div class="col"><input class="form-control" type="password" placeholder="New DMK" id="newdmk" name="newdmk"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="Repeat new DMK" id="rnewdmk" name="rnewdmk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ dmk_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Change DMK">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+          {% if auth_type_2 == 'smk' %}
+          <div class="card" style="width: 97%; margin-top: 30px">
+            <div class="card-body ov-auto">
+              <h5 class="card-title">Add Data Admin</h5>
+              <form action="/admin/adddataadmin" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="DataAdmin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="SMK" id="smk" name="smk"></div>
+                </div>
+                <div class="row" style="margin-top: 10px">
+                  <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="Repeat DMK" id="dmk2" name="dmk2"></div>
+                </div>
+                <div class="row" style="margin-top: 10px">
+                  <div class="col"><input class="form-control" type="text" placeholder="First Name" id="fname" name="fname"></div>
+                  <div class="col"><input class="form-control" type="text" placeholder="Last Name" id="lname" name="lname"></div>
+                </div>
+                <div class="row" style="margin-top: 10px">
+                  <div class="col"><input class="form-control" type="text" placeholder="E-mail" id="email" name="email"></div>
+                  <div class="col"><input class="form-control" type="text" placeholder="Phone number" id="phone" name="phone"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ da_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Add Data Admin">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+          {% if auth_type_2 == 'smk' %}
+          <div class="card" style="width: 97%; margin-top: 30px">
+            <div class="card-body ov-auto">
+              <h5 class="card-title">Delete Data Admin</h5>
+              <form action="/admin/deletedataadmin" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="DataAdmin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="SMK" id="smk" name="smk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ da_del_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Delete Data Admin">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+          {% if auth_type_2 == 'smk' %}
+          <div class="card" style="width: 97%; margin-top: 30px">
+            <div class="card-body ov-auto">
+              <h5 class="card-title">Delete Current Data Admin & Reassign Responsibility</h5>
+              <form action="/admin/reassigndataadmin" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Current DataAdmin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="text" placeholder="New DataAdmin-ID" id="dida" name="dida"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="SMK" id="smk" name="smk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ da_assign_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Delete Data Admin">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          <br>
+          {% endif %}
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/audit.html
@@ -0,0 +1,25 @@
+{% extends "layout.html" %}
+{% block container %}
+          <div class="card card-log">
+            <div class="card-body">
+            <table class="table table-striped table-borderless">
+              <thead>
+                <tr>
+                  <th scope="col">Date</th>
+                  <th scope="col">User</th>
+                  <th scope="col">Event</th>
+                </tr>
+              </thead>
+              <tbody>
+                {% for entry in entries %}
+                <tr>
+                  <td>{{ entry['Date'] }}</td>
+                  <td>{{ entry['User'] }}</td>
+                  <td>{{ entry['Event'] }}</td>
+                </tr>
+                {% endfor %}
+              <tbody>
+            </table>
+            </div>
+          </div>
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/bucket.html
@@ -0,0 +1,152 @@
+{% extends "layout.html" %}
+{% block container %}
+          {% if auth_type_2 == 'dmk' %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+		    <h5 class="card-title">Bucket JSON Credential File ({{ sg_status['bucket_creds']|safe }})</h5>
+              <form action="/bucket/upload" method="post" enctype="multipart/form-data">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="file" placeholder="Bucket Credencial File" id="bucket-creds" name="bucket-creds"></div>
+		</div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ upload_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Upload file">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Bucket Name ({{ sg_status['bucket']|safe }})</h5>
+              <form action="/bucket/save_name" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Bucket name" id="bucket_name" name="bucket_name"></div>
+		</div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ save_name_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Save">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% if sg_status['bucket_name'] != 'Not configured' %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+              <h5 class="card-title">Bucket Space Utilization</h5>
+                <div class="row" style="margin: 10px">
+			Bucket URL: <div id="bucket_url"> {{ bucket_path|safe }} </div>
+		</div>
+                <div class="row" style="margin: 10px">
+			Bucket Usage: <div id="bucket_usage"> NaN </div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" readonly>
+                  <div class="input-group-append">
+		    <button id='calculate_bksize' class="btn btn-dark text-white">Calculate</button>
+                  </div>
+                </div>
+            </div>
+          </div>
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+              <h5 class="card-title">Check Bucket Health</h5>
+          {% if bucket_health != False %}
+                <div class="row" style="margin: 10px">
+			Measurement time: <div id="measurement_time"> {{ bucket_health['sysinfo']['gmt_timestamp'] }}</div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Bucket URI: <div id="bucket_uri"> {{ bucket_health['bucket_uri'] }} </div>
+		</div>
+                <div class="row" style="margin: 10px">
+			gsutil Version: <div id="gsutil_version"> {{ bucket_health['gsutil_version'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			boto Version: <div id="boto_version"> {{ bucket_health['boto_version'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Running on GCE: <div id="running_on_gce"> {{ bucket_health['sysinfo']['on_gce'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Bucket location: <div id="bucket_location"> {{ bucket_health['sysinfo']['bucket_location'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Bucket storage class: <div id="bucket_storage_class"> {{ bucket_health['sysinfo']['bucket_storageClass'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			CPU Count: <div id="cpu_count"> {{ bucket_health['sysinfo']['cpu_count'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			CPU Load Average: <div id="bucket_location"> {{ bucket_health['sysinfo']['load_avg'][0] }}, {{ bucket_health['sysinfo']['load_avg'][1] }}, {{ bucket_health['sysinfo']['load_avg'][2] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Total Memory: <div id="total_memory"> {{ bucket_health['sysinfo']['meminfo']['mem_total'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Free Memory: <div id="free_memory"> {{ bucket_health['sysinfo']['meminfo']['mem_free'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Boto HTTPS Enabled: <div id="boto_https_enabled"> {{ bucket_health['sysinfo']['boto_https_enabled'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Requested routed through proxy: <div id="using_proxy"> {{ bucket_health['sysinfo']['using_proxy'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Latency of the DNS lookup for Google Storage server (ms): <div id="dns_latency"> {{ bucket_health['sysinfo']['google_host_dns_latency'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Latencies connecting to Google Storage server IPs (ms): <div id="connect_latency"> {{ bucket_health['sysinfo']['google_host_connect_latencies'] }} </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Write throughput: <div id="write_throughput"> {{ bucket_health['write_throughput']['bytes_per_second'] }}/s </div>
+                </div>
+                <div class="row" style="margin: 10px">
+			Read throughput: <div id="patallelism_strategy"> {{ bucket_health['read_throughput']['bytes_per_second'] }}/s </div>
+                </div>
+          {% endif %}
+                <div class="input-group" style="margin-top: 10px">
+                  <input id='check_results' type="text" class="form-control" readonly>
+                  <div class="input-group-append">
+		    <button id='reload_bucket_health' class="btn btn-dark text-white">Reload</button>
+		    <button id='check_bucket_health' class="btn btn-dark text-white">Check</button>
+                  </div>
+                </div>
+            </div>
+          </div>
+	  <script>
+		$(function() {
+			$('#reload_bucket_health').hide();
+
+			$('#calculate_bksize').click(function(){
+				$('#bucket_usage').html('Calculating...');
+				$.getJSON('/bucket/usage', function(data) {
+					$('#bucket_usage').html(data['usage'] + ' ' + data['unit']);
+					// $('#bucket_url').html(data['url']);
+				});
+			});
+			$('#check_bucket_health').click(function(){
+				$.getJSON('/bucket/health?method=check', function(data) {
+					$('#check_results').val(data['message']);
+					$('#check_bucket_health').hide();
+					$('#reload_bucket_health').show();
+				});
+			});
+			$('#reload_bucket_health').click(function(){
+				$('#check_results').val('Reloading...');
+				$.getJSON('/bucket/health?method=reload', function(data) {
+					$('#check_results').val(data['message']);
+					if (data['result'] == 'Reload') {
+						setTimeout(function(){
+							location.reload();
+						}, "3000");
+					}
+				});
+			});
+		});
+          </script>
+          {% endif %}
+          {% endif %}
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/data.html
@@ -0,0 +1,48 @@
+{% extends "layout.html" %}
+{% block container %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Data Vault Management ({{ sg_status['vault']|safe }})</h5>
+              <form action="/data/vault-status" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ command_status['vault_status'] }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Show status">
+                    <input type="submit" class="btn btn-secondary text-white" value="Open Vault" formaction="/data/open-vault">
+                    <input type="submit" class="btn btn-dark text-white" value="Close Vault" formaction="/data/close-vault">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% if sg_status['tg_type'] == 'TGR' %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+              <h5 class="card-title">SMB Windows File Sharing Service ({{ sg_status['smb']|safe }})</h5>
+	      {% if 'Installed' in sg_status['smb'] %}
+              <h5 class="card-title">PATH: {{ sg_status['smb_path']|safe }}</h5>
+	      {% endif %}
+              <form id="smb_form" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ command_status['smb_status'] }}" readonly>
+                  <div class="input-group-append">
+                    {% if 'Not installed' in sg_status['smb'] %}
+                    <input type="button" class="btn btn-dark text-white" value="Install SMB Service" onClick="$('#smb_form').attr('action', '/data/install-smb'); mirror_confirm('smb_form')">
+		    {% else %}
+                    <input type="submit" class="btn btn-dark text-white" value="Uninstall SMB Service" formaction="/data/uninstall-smb">
+		    {% endif %}
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/datasource.html
@@ -0,0 +1,60 @@
+{% extends "layout.html" %}
+{% block container %}
+{% if auth_type_2 == 'dmk' %}
+<div class="card" id="data-el-3" style="margin-top: 30px">
+	<div class="card-body ov-auto">
+		<h5 class="card-title">Mount NFS Source ({{ sg_status['mount_nfs']|safe }})</h5>
+		<form action="/datasource/mount-nfs" method="post">
+		{% if not 'Configured' in sg_status['mount_nfs'] %}
+			<div class="row" style="margin-top: 25px">
+				<div class="col"><input class="form-control" type="text" placeholder="NFS Server IP Address" id="nfs_server_ip" name="nfs_server_ip"></div>
+				<div class="col"><input class="form-control" type="text" placeholder="NFS Share Path" id="nfs_share_path" name="nfs_share_path"></div>
+			</div>
+			<div class="row" style="margin-top: 10px">
+				<div class="col"><input class="form-control" type="text" placeholder="Advanced Mount Parameters(Ex. user=admin,password=adminpass)" id="nfs_mount_option" name="nfs_mount_option"></div>
+			</div>
+			<div class="input-group" style="margin-top: 10px">
+				<input type="text" class="form-control" placeholder="{{ command_status['mount_nfs'] }}" readonly>
+				<div class="input-group-append">
+					<input type="submit" class="btn btn-dark text-white" value="Mount">
+				</div>
+			</div>
+		{% else %}
+			<div class="input-group" style="margin-top: 10px">
+				<input type="text" class="form-control" placeholder="{{ command_status['mount_nfs'] }}" readonly>
+				<div class="input-group-append">
+					<input type="submit" class="btn btn-dark text-white" value="UnMount" formaction='/datasource/umount-nfs'>
+				</div>
+			</div>
+		{% endif %}
+		</form>
+	</div>
+	<div class="card-body ov-auto">
+		<h5 class="card-title">Mount SMB(Windows Share) Source ({{ sg_status['mount_smb']|safe }})</h5>
+		<form action="/datasource/mount-smb" method="post">
+		{% if not 'Configured' in sg_status['mount_smb'] %}
+			<div class="row" style="margin-top: 25px">
+				<div class="col"><input class="form-control" type="text" placeholder="SMB Share Path (ex \\192.168.x.x\share)" id="smb_share_path" name="smb_share_path"></div>
+			</div>
+			<div class="row" style="margin-top: 10px">
+				<div class="col"><input class="form-control" type="text" placeholder="Advanced Mount Parameters(Ex. user=admin,password=adminpass)" id="smb_mount_option" name="smb_mount_option"></div>
+			</div>
+			<div class="input-group" style="margin-top: 10px">
+				<input type="text" class="form-control" placeholder="{{ command_status['mount_smb'] }}" readonly>
+				<div class="input-group-append">
+					<input type="submit" class="btn btn-dark text-white" value="Mount">
+				</div>
+			</div>
+		{% else %}
+			<div class="input-group" style="margin-top: 10px">
+				<input type="text" class="form-control" placeholder="{{ command_status['mount_smb'] }}" readonly>
+				<div class="input-group-append">
+					<input type="submit" class="btn btn-dark text-white" value="UnMount" formaction='/datasource/umount-smb'>
+				</div>
+			</div>
+		{% endif %}
+		</form>
+	</div>
+</div>
+{% endif %}
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/index.html
@@ -0,0 +1,286 @@
+{% extends "layout.html" %}
+{% block container %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+	    {% if not 'Not defined' in sg_status['did'] %}
+            <div class="card-body">
+              <h4 class="card-title">Status</h4>
+	      <ul>
+		      <li> License: {{ sg_status['license']|safe }}
+                      {% if sg_status['tg_type'] == 'TG' %}
+		      <li> Security Officer: {{ sg_status['sid']|safe }}
+		      {% endif %}
+		      <li> Data Admin: {{ sg_status['did']|safe }}
+		      <li> Data Vault Status: {{ sg_status['vault']|safe }}
+                      {% if sg_status['tg_type'] == 'TG' %}
+		      <li> NFS Data Source Status: {{ sg_status['mount_nfs']|safe }}
+		      <li> SMB(Windows Share) Data Source Status: {{ sg_status['mount_smb']|safe }}
+		      {% endif %}
+		      <li> Bucket Credentials: {{ sg_status['bucket_creds']|safe }}
+		      <li> Bucket Status: {{ sg_status['bucket']|safe }}
+	      </ul>
+	      <ul>
+		      <li> Dashboard Version: {{ sg_status['dashboard-version'] }}
+		      <li> Server General Version: {{ sg_status['sg-version'] }}
+		      <li> ISO Version: {{ sg_status['iso-version'] }}
+	      </ul>
+	    </div>
+	  </div>
+	  {% endif %}
+	      {% with messages = get_flashed_messages() %}
+	        {% if messages %}
+		   <div class=flashes>
+		   {% for message in messages %}
+		   <span style="color: green">{{ message }}</span><br />
+		   {% endfor %}
+		   </div>
+		{% endif %}
+              {% endwith %}
+          {% if sg_status['license_agree'] != True %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h4 class="card-title">Welcome To Transfer General</h4>
+	      <h5 class="card-title">License Agreement</h5>
+              <form action="/admin/agree_license" method="post">
+                <div class="row" style="margin-top: 25px">
+			<div class="col"><textarea rows="20" class="form-control" id="license" name="license">{{ sg_status['agreement_text'] }}</textarea></div>
+                </div>
+                <div class="row" style="margin-top: 25px">
+		    <div class="col">
+                    <label>Do you agree? </label>
+                    <input type="submit" value="Yes">
+                    <input type="submit" value="No" formaction="/exit">
+                    </div>
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% elif 'Not activated' in sg_status['license'] and session['check_connectivity'] != True %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Checking connectivity...</h5>
+              <form action="/" method="get">
+                <div class="row" style="margin-top: 25px">
+			<div class="col">
+				<dl>
+				<dt></dt>
+					<dd id="cklic" class="os"> Pinging the licensing server ... </dd>
+					<dd id="ckkey" class="os"> Pinging the key locker ... </dd>
+					<dd id="cklog" class="os"> Pinging the logging server ... </dd>
+				</dl>
+			</div>
+                </div>
+<script>
+$(function(){
+	$.getJSON('/admin/check_connectivity', function(data) {
+		 for (key in data) {
+			 result = data[key] ? '<span style="color: green">Passed</span>' : '<span style="color: red">Failed</span>';
+			 text = $('#' + key).text();
+			 $('#' + key).html(text + result);
+		 }
+		 
+	});
+});
+</script>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x"></div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Proceed">
+                    <input type="submit" class="btn btn-dark text-white" style="margin-left: 3px" value="Abort" formaction="/exit">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% elif 'Not activated' in sg_status['license'] %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">License Activation</h5>
+              <form action="/admin/activate" method="post">
+                <div class="row" style="margin-top: 25px">
+			<div class="col"><textarea class="form-control" id="license" name="license" placeholder="Enter the license string or contact admin@servergeneral.com to get one"></textarea></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">{{ command_status['activate'] }}</div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Activate">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% elif sg_status['tg_type'] == False %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Welcome To Transfer General</h5>
+              <form action="/admin/set_tg_type" method="post">
+                <div class="row" style="margin-top: 25px">
+			<div class="col">
+				<p>Are you configuring this machine as: </p>
+			<div class="col">
+				<input type="radio" name="tg-type" value="TG" checked>Transfer General Main
+			</div>
+			<div class="col">
+				<input type="radio" name="tg-type" value="TGR">Transfer General Remote
+			</div>
+				<p>Note: You will not be able to change the machine type later.</p>
+			</div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">{{ command_status['set_tg_type'] }}</div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Enter">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% elif sg_status['tg_type'] == 'TGR' %}
+          {% if sg_status['tg_pub'] == False and session['opening_screen'] != True %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Transfer General Remote (TGR) works in conjunction with Transfer General Main (TGM). Here are the requirements to set up the TGR:</h5>
+              <form action="/admin/os_proceed" method="post">
+                <div class="row" style="margin-top: 25px">
+			<div class="col">
+				<dl>
+				<dt>The Transfer General Main (must be already installed)</dt>
+					<dd class="os"> A fully functional TGM </dd>
+					<dd class="os"> Data Admin User-id </dd>
+					<dd class="os"> Data Admin’s DMK </dd>
+					<dd class="os"> Public key for the “sgadmin” user on TGM </dd>
+				</dl>
+				<dl>
+				<dt>The Remote Transfer General (the one you are currently installing)</dt>
+					<dd class="os"> An open port to accept “ssh” connections from TGM </dd>
+					<dd class="os"> Unrestricted *outbound* access to the Internet (run test)</dd>
+					<dd class="os"> A valid license
+				</dl>
+			</div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x"></div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Proceed">
+                    <input type="submit" class="btn btn-dark text-white" style="margin-left: 3px" value="Abort" formaction="/exit">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% elif sg_status['tg_pub'] == False %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Enter the public key for the “sgadmin” user on the TGM</h5>
+              <form action="/admin/set_tg_pub" method="post">
+                <div class="row" style="margin-top: 25px">
+			<div class="col"><textarea class="form-control" style="height:350px" id="tg-pub" name="tg-pub"></textarea></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">{{ command_status['set_tg_pub'] }}</div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Proceed">
+                    <input type="submit" class="btn btn-dark text-white" style="margin-left: 3px" value="Abort" formaction="/exit">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% elif 'Not defined' in sg_status['did'] %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Please contact the TGM admin now.</h5>
+              <form action="/admin/remove_tg_pub" method="post">
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">Waiting for the TGM admini.</div>
+                  <div class="input-group-append">
+			<input type="button" class="btn btn-dark text-white" style="width:215px" onclick="location.href='/';" value="Check configuration status">
+		  </div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">Public key is configured.</div>
+                  <div class="input-group-append">
+                 	<input type="submit" class="btn btn-dark text-white" style="width:215px" value="Re-configure public key">
+		  </div>
+                </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+          {% elif sg_status['tg_type'] == 'TG' %}
+	  {% if 'Not defined' in sg_status['sid'] %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Configure Security Officer's Passphrase (SMK)</h5>
+              <form action="/admin/create_smk" method="post">
+                <div class="row" style="margin-top: 25px">
+		  <div class="col"><input class="form-control" placeholder="Alpha-numeric string at-least 16 characters long" type='password' id="smk" name="smk"></div>
+		  <div class="col"><input class="form-control" placeholder="Re-type passphrase" type='password' id="smk2" name="smk2"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">{{ command_status['smk'] }}</div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Submit">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% elif 'Not defined' in sg_status['did'] %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Configure Data Administrator's Passphrase (DMK)</h5>
+              <form action="/admin/create_dmk" method="post">
+                <div class="row" style="margin-top: 25px">
+		  <div class="col"><input class="form-control" placeholder="Alpha-numeric string at-least 16 characters long" type='password' id="dmk" name="dmk"></div>
+		  <div class="col"><input class="form-control" placeholder="Re-type passphrase" type='password' id="dmk2" name="dmk2"></div>
+                </div>
+                <div class="row" style="margin-top: 25px">
+		  <div class="col"><input class="form-control" placeholder="Enter Security Oficer's passphrase" type='password' id="smk" name="smk"></div>
+		</div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">{{ command_status['dmk'] }}</div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Submit">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+	  {% elif 'Not uploaded' in sg_status['bucket_creds'] %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+		    <h5 class="card-title">Bucket JSON Credential File</h5>
+              <form action="/bucket/upload?p=index&menu=dmk" method="post" enctype="multipart/form-data">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="file" placeholder="Bucket Credencial File" id="bucket-creds" name="bucket-creds"></div>
+		</div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">{{ command_status['bucket-creds'] }}</div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Upload file">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+	  {% elif 'Not configured' in sg_status['bucket'] %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Bucket Name</h5>
+              <form action="/bucket/save_name?p=index&menu=dmk" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Bucket name" id="bucket_name" name="bucket_name"></div>
+		</div>
+                <div class="input-group" style="margin-top: 10px">
+	  	  <div class="form-control scroll-x">{{ command_status['bucket'] }}</div>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Save">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+	  {% endif %} <!-- END IF FOR TGTYPE -->
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/ingest-data.html
@@ -0,0 +1,94 @@
+{% extends "layout.html" %}
+{% block container %}
+          {% if sg_status['tg_type'] == 'TG' %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Load Data From NFS Data Source ({{ sg_status['mount_nfs']|safe }})</h5>
+              <form action="/data/load-data-nfs" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+		<select name="transfer-mode">
+			<option value="normal">Normal</option>
+			<option value="mirror">Mirror</option>
+		</select>
+                  <input type="text" class="form-control" placeholder="{{ command_status['load_data_nfs'] }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Load Data">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+          {% if sg_status['tg_type'] == 'TG' %}
+          <div class="card" id="data-el-3" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Load Data From SMB(Windows Share) Data Source ({{ sg_status['mount_smb']|safe }})</h5>
+              <form action="/data/load-data-smb" method="post">
+                <div class="row" style="margin-top: 25px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                  <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+		<select name="transfer-mode">
+			<option value="normal">Normal</option>
+			<option value="mirror">Mirror</option>
+		</select>
+                  <input type="text" class="form-control" placeholder="{{ command_status['load_data_smb'] }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Load Data">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+          <div class="card" id="data-el-4" style="height: 25vh; margin-bottom: 30px; margin-top: 30px">
+	    <h5 class="card-title" style="margin-top: 25px; margin-left:25px;">Transfer Results</h5>
+            <div class="card-body ov-auto">
+              <div class="row" style="margin-top: 5px">
+                <ul class="list-group list-group-flush">
+                  {% for i in rsync_results %}
+                  <li class="list-group-item">{{ i }}</li>
+                  {% endfor %}
+                </ul>
+              </div>
+            </div>
+          </div>
+	  <script>
+	     function mirror_confirm(method) {
+		if (method == "upload_form") {
+			message = "Caution: This option will copy all data from the encrypted TG repository to the bucket and delete all other data in the bucket that is not in the repository. Please exercise caution: It's possible to delete large amounts of data accidentally from your bucket.";
+		} else if (method == 'download_form') {
+			message = "Caution: This option will copy all data from the bucket to the TG repository and delete all other data in the TG repository that is not in the bucket. Please exercise caution: It's possible to delete large amounts of data accidentally that has been previously downloaded.";
+		} else if (method == 'smb_form') {
+			message = "Security Warning: The SMB protocol is not a secure protocol. Hence you should select the install option only when your TGR is installed behind your firewall.";
+		}
+		if ($('#' + method + ' select').val() == 'mirror' || method == 'smb_form') {
+			bootbox.confirm({
+			    message: message,
+			    buttons: {
+				confirm: {
+				    label: 'Yes',
+				    className: 'btn-success'
+				},
+				cancel: {
+				    label: 'No',
+				    className: 'btn-danger'
+																    }
+			    },
+			    callback: function (result) {
+				if (result == true) {
+					$('#' + method).submit();
+				}
+			    }
+			});
+		} else {
+		  $('#' + method).submit();
+		}
+	     }
+	  </script>
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/layout.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
+    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
+    <link rel="stylesheet" href="/static/style.css"/>
+    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/5.4.1/bootbox.min.js" integrity="sha512-eoo3vw71DUo5NRvDXP/26LFXjSFE1n5GQ+jZJhHz+oOTR4Bwt7QBCjsgGvuVMQUMMMqeEvKrQrNEI4xQMXp3uA==" crossorigin="anonymous"></script>
+    <script src="/static/common.js"></script>
+    {% if sg_status['tg_type'] == 'TG' %}
+    <title>{{title}} - Transfer General Main</title>
+    {% elif sg_status['tg_type'] == 'TGR' %}
+    <title>{{title}} - Transfer General Remote</title>
+    {% else %}
+    <title>{{title}} - Transfer General</title>
+    {% endif %}
+  </head>
+  <body>
+    <nav class="navbar navbar-dark bg-dark nav-mob">
+      <a class="navbar-brand" href="/">TG</a>
+      {% if not 'Not defined' in sg_status['did']: %}
+      <h4 class="text-white">DA menuu</h4>
+      <a class="nav-link text-white n-l" href="/data?menu=dmk"><i class="fa fa-folder-open"></i></a>
+      {% if sg_status['tg_type'] == 'TG' %}
+      <a class="nav-link text-white n-l" href="/admin?menu=dmk"><i class="fa fa-lock"></i></a>
+      <a class="nav-link text-white n-l" href="/audit?menu=dmk"><i class="fa fa-clipboard"></i></a>
+      <a class="nav-link text-white n-l" href="/bucket?menu=dmk"><i class="fa fa-key"></i></a>
+      {% endif %}
+      {% endif %}
+      {% if not 'Not defined' in sg_status['sid']: %}
+      <h4 class="text-white">SO menu</h4>
+      <a class="nav-link text-white n-l" href="/admin?menu=smk"><i class="fa fa-lock"></i></a>
+      <a class="nav-link text-white n-l" href="/audit?menu=smk"><i class="fa fa-clipboard"></i></a>
+      <a class="nav-link text-white n-l" href="#"><i class="fa fa-user"></i></a>
+      {% endif %}
+      <a href="/exit" class="btn btn-sm btn-light">Logout</a>
+    </nav>
+    <div class="row">
+      <div class="col-3">
+        <nav class="navbar bg-dark" style="padding-left: 8px; padding-right: 8px;">
+          <ul class="nav nav-left navbar-nav">
+            <li class="nav-item">
+              {% if sg_status['tg_type'] == 'TG' %}
+	      <span class="text-white">Transfer General Main</span>
+              {% elif sg_status['tg_type'] == 'TGR' %}
+	      <span class="text-white">Transfer General Remote</span>
+	      {% else %}
+	      <span class="text-white">Transfer General</span>
+	      {% endif %}
+            </li>
+	    {% if not 'Not defined' in sg_status['did']: %}
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/"><i class="fa fa-dashboard"></i>Dashboard</a>
+            </li>
+	    {% else %}
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/"><i class="fa fa-dashboard"></i>One-time Configuration</a>
+            </li>
+	    {% endif %}
+	    {% if not 'Not defined' in sg_status['did']: %}
+	    <h4 class="text-white">DA menu</h4>
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/data"><i class="fa fa-folder-open"></i>Data Management</a>
+              {% if sg_status['tg_type'] == 'TG' %}
+	      <ul>
+		      <li class="nav-item"><a class="text-white n-l" href="/data?menu=transfer">Transfer Data</a></li>
+		      <li class="nav-item"><a class="text-white n-l" href="/data?menu=ingest">Ingest Data</a></li>
+	      </ul>
+              {% endif %}
+            </li>
+	    {% if sg_status['tg_type'] == 'TG' %}
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/admin?menu=dmk"><i class="fa fa-lock"></i> Rotate Encryption Key</a>
+            </li>
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/audit?menu=dmk"><i class="fa fa-clipboard"></i> Audit Reports</a>
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/datasource?menu=dmk"><i class="fa fa-clipboard"></i> Manage Data Source</a>
+            </li>
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/bucket?menu=dmk"><i class="fa fa-clipboard"></i> Manage Bucket</a>
+            </li>
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/tgr?menu=dmk"><i class="fa fa-clipboard"></i> Manage TGR</a>
+            </li>
+            {% endif %}
+            {% endif %}
+	    {% if not 'Not defined' in sg_status['sid']: %}
+            <h4 class="text-white">SO menu</h4>
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/admin?menu=smk"><i class="fa fa-lock"></i> Admin<span> Management</span></a>
+            </li>
+            <li class="nav-item">
+              <a class="nav-link text-white n-l" href="/user?menu=smk"><i class="fa fa-key"></i> Rotate Data Encryption Key</a>
+            </li>
+            {% endif %}
+            <br><br><p class="text-white n-l host">{{ sg_status['hostname'] }}</p>
+            <p class="text-white n-l host">{{ sg_status['ip_address'] }}</p>
+            <a class="btn btn-sm btn-light" href="/exit">Logout</a>
+          </ul>
+        </nav>
+      </div>
+      <div class="col">
+        <div class="container">
+	  {% block container %}
+	  {% endblock %}
+        </div>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/login.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
+    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
+    <title>Transfer General</title>
+    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"/>
+  </head>
+  <body>
+    <nav class="navbar navbar-dark bg-dark nav-mob">
+      <a class="navbar-brand" href="/">TG</a>
+    </nav>
+    <div class="row">
+      <div class="col-3">
+        <nav class="navbar bg-dark">
+          <ul class="nav nav-left navbar-nav">
+            <li class="nav-item">
+              <a class="nav-link text-white n-l-1" href="/">Transfer General</a>
+            </li>
+            <br><br><p class="text-white n-l host">{{ vm_hostname }}</p>
+            <p class="text-white n-l host">{{ ip_address }}</p>
+          </ul>
+        </nav>
+      </div>
+      <div class="col">
+        <div class="container">
+          <div class="card" id="auth-el-1">
+            <div class="card-body">
+              <h4 class="card-title">Authorization</h4>
+              <form action="/login" method="post">
+                <div class="row" style="margin-top: 10px">
+                    <div class="col"><input class="form-control" type="text" placeholder="Login-ID" id="sgid" name="sgid"></div>
+                    <div class="col"><input type="password" class="form-control" placeholder="Password" id="sgpass" name="sgpass"></div>
+                </div>
+                <input type="submit" class="btn btn-dark btn-block text-white" style="margin-top: 10px" value="Authorize">
+              </form>
+	      <div>
+	      {% with messages = get_flashed_messages() %}
+	        {% if messages %}
+	          <ul class=flashes>
+	          {% for message in messages %}
+	            <li>{{ message }}</li>
+	          {% endfor %}
+	          </ul>
+	        {% endif %}
+              {% endwith %}
+	      </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/tgr.html
@@ -0,0 +1,205 @@
+{% extends "layout.html" %}
+{% block container %}
+          {% if auth_type_2 == 'dmk' %}
+          <div class="card" id="data-el-4" style="margin-top: 30px">
+            <div id="tgr-list" class="card-body ov-auto">
+		    <h5 class="card-title">Available TGR's</h5>
+	      {% for tgr_name, tgr_ip in sg_status['tgr'].items() %}
+              <div class="row" style="margin-top: 2px; margin-left: 15px">
+		      <input name="tgr_name" class="chkbox" type="checkbox" value="{{tgr_name}}">
+		      <span class="tgr-col" style="margin-left: 5px; width: 200px;"> {{tgr_name}}</span>
+		      <span class="tgr-col">{{tgr_ip}} (<span id="{{tgr_name}}_status">Checking...</span>)</span>
+              </div>
+	      {% endfor %}
+              <div class="row" style="margin-top: 25px">
+                <div class="col"><input id="tgr-did" class="form-control" type="text" placeholder="Data Admin-ID"></div>
+                <div class="col"><input id="tgr-dmk" class="form-control" type="password" placeholder="DMK"</div>
+              </div>
+              <div class="input-group" style="margin-top: 10px">
+                <input type="text" class="form-control" readonly>
+                <div class="input-group-append">
+			      <button id="status" class="btn btn-dark text-white" data-name="{{tgr_name}}">Status</button>
+			      <button id="open" class="btn btn-secondary text-white">Open Vault</button>
+			      <button id="close" class="btn btn-dark text-white">Close Vault</button>
+			      <button id="push" class="btn btn-secondary text-white">Push Data</button>
+                </div>
+              </div>
+              <div class="input-group" style="margin-top: 10px">
+		<div id="tgr_list_status" class="form-control scroll-x"></div>
+	      </div>
+	    </div>
+          </div>
+          <div class="card" id="data-el-4" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Add New TGR</h5>
+              <form id="upload_form" action="/tgr/add" method="post">
+              <div class="row" style="margin-top: 25px">
+                <div class="col"><input class="form-control" type="text" placeholder="Name" id="tgr_name" name="tgr_name"></div>
+                <div class="col"><input class="form-control" type="text" placeholder="IP Address" id="tgr_ip" name="tgr_ip"></div>
+              </div>
+              <div class="row" style="margin-top: 25px">
+                <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+              </div>
+              <div class="input-group" style="margin-top: 10px">
+                <input type="text" class="form-control" placeholder="{{ command_status['add_tgr_status'] }}" readonly>
+                <div class="input-group-append">
+                  <input type="submit" class="btn btn-dark text-white" value="Configure">
+                </div>
+              </div>
+	      </form>
+	    </div>
+          </div>
+          <div class="card" id="data-el-4" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Delete TGR</h5>
+              <form id="upload_form" action="/tgr/delete" method="post">
+              <div class="row" style="margin-top: 25px">
+                <div class="col"><input class="form-control" type="text" placeholder="Name" id="tgr_name" name="tgr_name"></div>
+                <div class="col"><input class="form-control" type="text" placeholder="IP Address" id="tgr_ip" name="tgr_ip"></div>
+              </div>
+              <div class="row" style="margin-top: 25px">
+                <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+              </div>
+              <div class="input-group" style="margin-top: 10px">
+                <input type="text" class="form-control" placeholder="{{ command_status['delete_tgr_status'] }}" readonly>
+                <div class="input-group-append">
+                  <input type="submit" class="btn btn-dark text-white" value="Delete">
+                </div>
+              </div>
+	      </form>
+	    </div>
+          </div>
+          <div class="card" id="data-el-4" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Public key</h5>
+              <form id="form">
+              <div class="row" style="margin-top: 25px">
+		      <div class="col"><textarea rows="10" class="form-control" readonly>{{ sg_status['public_key'] }}</textarea>
+              </div>
+	      </form>
+	    </div>
+          </div>
+          {% endif %}
+<script>
+$(function(){
+	var auth = {};
+	$('input:checkbox[name="tgr_name"]').each(function() {
+		check_status($(this).val());
+	});
+
+	function check_dmk() {
+		auth = { did: $('#tgr-did').val(), dmk: $('#tgr-dmk').val() };
+		$('#tgr-did').val('');
+		$('#tgr-dmk').val('');
+		var res = {};
+		$.ajax({
+			url: "/tgr/check_dmk",
+			type: "POST",
+			data: JSON.stringify(auth),
+			contentType: "application/json",
+			success: function(result) {
+				res = result;
+			},
+			async: false
+		});
+		return res;
+	}
+
+	function manage_vault(tgr_name, command) {
+		data = {
+			did: auth['did'],
+			dmk: auth['dmk'],
+	       		tgr_name: tgr_name,
+			command: command
+		};
+		if (command == 'push') {
+			url = '/tgr/remote-download-from-bucket';
+		} else {
+			url = '/tgr/manage_vault';
+		}
+		$.ajax({
+			url: url,
+			type: "POST",
+			data: JSON.stringify(data),
+			contentType: "application/json",
+			success: function(data) {
+				check_status(tgr_name);
+			}
+		});
+	}
+
+	function check_status(tgr_name) {
+		$('#' + tgr_name + '_status').text('Checking...');
+		$.getJSON('/tgr/status?name=' + tgr_name, function(data) {
+			$('#' + tgr_name + '_status').html(data['status_html']);
+			if (data['status'] == 'open') {
+			} else {
+			}
+		});
+	}
+	$('#status').click(function(){
+		$('input:checkbox[name="tgr_name"]:checked').each(function() {
+			check_status($(this).val());
+		});
+	});
+	$('#open').click(function(){
+		$('#tgr_list_status').text('Authenticating...');
+		res = check_dmk();
+		if (res['result'] == 'OK') {
+			$('#tgr_list_status').text('Authenticating...Done.');
+			data = { did: auth['did'], dmk: auth['dmk'] };
+			$('input:checkbox[name="tgr_name"]:checked').each(function() {
+				tgr_name = $(this).val();
+				$('#' + tgr_name + '_status').text('Opening vault...');
+				data['tgr_name'] = tgr_name;
+				manage_vault(tgr_name, 'open');
+			});
+		} else {
+			$('#tgr_list_status').text('Authenticating...Failed.');
+		}
+	});
+	$('#close').click(function(){
+		$('#tgr_list_status').text('Authenticating...');
+		res = check_dmk();
+		if (res['result'] == 'OK') {
+			$('#tgr_list_status').text('Authenticating...Done.');
+			data = { did: auth['did'], dmk: auth['dmk'] };
+			$('input:checkbox[name="tgr_name"]:checked').each(function() {
+				tgr_name = $(this).val();
+				$('#' + tgr_name + '_status').text('Closing vault...');
+				data['tgr_name'] = tgr_name;
+				manage_vault(tgr_name, 'close');
+			});
+		} else {
+			$('#tgr_list_status').text('Authenticating...Failed.');
+		}
+	});
+	$('#push').click(function(){
+		$('#tgr_list_status').text('Authenticating...');
+		res = check_dmk();
+		$('#tgr_list_status').text(res['message']);
+		if (res['result'] == 'OK') {
+			$('#tgr_list_status').text('Authenticating...Done.');
+			data = { did: auth['did'], dmk: auth['dmk'] };
+			count = 0;
+			$('input:checkbox[name="tgr_name"]:checked').each(function() {
+				tgr_name = $(this).val();
+				$('#' + tgr_name + '_status').text('Pushing data...');
+				data['tgr_name'] = tgr_name;
+				manage_vault(tgr_name, 'push');
+				count = count + 1;
+			});
+			if (count == 0) {
+				$('#tgr_list_status').text('No TGR selected!');
+			} else {
+				$('#tgr_list_status').text('Pushed data for ' + count + ' TGR(s)');
+			}
+		} else {
+			$('#tgr_list_status').text('Authenticating...Failed.');
+		}
+	});
+});
+</script>
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/transfer-data.html
@@ -0,0 +1,92 @@
+{% extends "layout.html" %}
+{% block container %}
+          {% if sg_status['tg_type'] == 'TG' %}
+          <div class="card" id="data-el-4" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Transfer Into Bucket ({{ sg_status['bucket_path']|safe }})</h5>
+              <form id="upload_form" action="/data/upload-into-bucket" method="post">
+              <div class="row" style="margin-top: 25px">
+                <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+              </div>
+              <div class="input-group" style="margin-top: 10px">
+		<select name="transfer-mode">
+			<option value="normal">Normal</option>
+			<option value="mirror">Mirror</option>
+		</select>
+                <input type="text" class="form-control" placeholder="{{ command_status['upload_status'] }}" readonly>
+                <div class="input-group-append">
+                  <input type="button" class="btn btn-dark text-white" value="Transfer" onClick="mirror_confirm('upload_form')">
+                </div>
+              </div>
+	      </form>
+	    </div>
+          </div>
+          {% endif %}
+          <div class="card" id="data-el-4" style="margin-top: 30px">
+            <div class="card-body ov-auto">
+	      <h5 class="card-title">Download From Bucket ({{ sg_status['bucket_path']|safe }})</h5>
+              <form id='download_form' action="/data/download-from-bucket" method="post">
+              <div class="row" style="margin-top: 25px">
+                <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                <div class="col"><input class="form-control" type="password" placeholder="DMK" id="dmk" name="dmk"></div>
+              </div>
+              <div class="input-group" style="margin-top: 10px">
+		<select name="transfer-mode">
+			<option value="normal">Normal</option>
+			<option value="mirror">Mirror</option>
+		</select>
+                <input type="text" class="form-control" placeholder="{{ command_status['download_status'] }}" readonly>
+                <div class="input-group-append">
+                  <input type="button" class="btn btn-dark text-white" value="Download" onClick="mirror_confirm('download_form')">
+                </div>
+              </div>
+	      </form>
+	    </div>
+          </div>
+          <div class="card" id="data-el-4" style="height: 25vh; margin-bottom: 30px; margin-top: 30px">
+	    <h5 class="card-title" style="margin-top: 25px; margin-left:25px;">Transfer Results</h5>
+            <div class="card-body ov-auto">
+              <div class="row" style="margin-top: 5px">
+                <ul class="list-group list-group-flush">
+                  {% for i in rsync_results %}
+                  <li class="list-group-item">{{ i }}</li>
+                  {% endfor %}
+                </ul>
+              </div>
+            </div>
+          </div>
+	  <script>
+	     function mirror_confirm(method) {
+		if (method == "upload_form") {
+			message = "Caution: This option will copy all data from the encrypted TG repository to the bucket and delete all other data in the bucket that is not in the repository. Please exercise caution: It's possible to delete large amounts of data accidentally from your bucket.";
+		} else if (method == 'download_form') {
+			message = "Caution: This option will copy all data from the bucket to the TG repository and delete all other data in the TG repository that is not in the bucket. Please exercise caution: It's possible to delete large amounts of data accidentally that has been previously downloaded.";
+		} else if (method == 'smb_form') {
+			message = "Security Warning: The SMB protocol is not a secure protocol. Hence you should select the install option only when your TGR is installed behind your firewall.";
+		}
+		if ($('#' + method + ' select').val() == 'mirror' || method == 'smb_form') {
+			bootbox.confirm({
+			    message: message,
+			    buttons: {
+				confirm: {
+				    label: 'Yes',
+				    className: 'btn-success'
+				},
+				cancel: {
+				    label: 'No',
+				    className: 'btn-danger'
+																    }
+			    },
+			    callback: function (result) {
+				if (result == true) {
+					$('#' + method).submit();
+				}
+			    }
+			});
+		} else {
+		  $('#' + method).submit();
+		}
+	     }
+	  </script>
+{% endblock %}
--- /dev/null
+++ tg-dashboard-1.0/dashboard/templates/user.html
@@ -0,0 +1,85 @@
+{% extends "layout.html" %}
+{% block container %}
+        {% if auth_type_2 == 'smk' %}
+        <div class="card" style="width: 97%; margin-top: 30px">
+          <div class="card-body ov-auto">
+            <h5 class="card-title">Change SMK</h5>
+            <form action="/admin/smk" method="post">
+              <input class="form-control" type="password" placeholder="Current SMK" id="smk" name="smk" style="margin-top: 25px">
+              <div class="row" style="margin-top: 10px">
+                <div class="col"><input class="form-control" type="password" placeholder="New SMK" id="newsmk" name="newsmk"></div>
+                <div class="col"><input class="form-control" type="password" placeholder="Repeat new SMK" id="rnewsmk" name="rnewsmk"></div>
+              </div>
+              <div class="input-group" style="margin-top: 10px">
+                <input type="text" class="form-control" placeholder="{{ smk_status }}" readonly>
+                <div class="input-group-append">
+                  <input type="submit" class="btn btn-dark text-white" value="Change SMK">
+                </div>
+              </div>
+            </form>
+          </div>
+        </div>
+        {% endif %}
+        <div class="d-flex flex-row flex-wrap">
+          {% if auth_type_2 == 'dmk' %}
+          <div class="card" id="user-el-1" style="margin-top: 30px; max-height: 55vh">
+            <div class="card-body ov-auto" style="white-space: nowrap; height: 100%; overflow: auto">
+              <h5 class="card-title">Configured users</h5>
+              <ul class="list-group list-group-flush">
+                {% for i in configured_users %}
+                <li class="list-group-item">{{ i }}</li>
+                {% endfor %}
+              </ul>
+            </div>
+          </div>
+          {% endif %}
+          {% if auth_type_2 == 'dmk' %}
+          <div class="card ov-auto" id="user-el-2" style="margin-top: 30px">
+            <div class="card-body">
+              <h5 class="card-title">Add SFTP user</h5>
+              <form action="/user/add" method="post">
+                <input type="text" class="form-control" placeholder="Username (lowercase user-id)" style="margin-top: 25px" id="user" name="user">
+                <div class="row" style="margin-top: 10px">
+                  <div class="col"><input type="password" class="form-control" placeholder="Password" id="pass" name="pass"></div>
+                  <div class="col"><input type="text" class="form-control" placeholder="SSH key" id="key" name="key"></div>
+                </div>
+                <p class="text-grey font-italic" style="margin-top: 4px">Hint: You can choose to use only one authentication method.</p>
+                <div class="row" style="margin-top: 20px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                  <div class="col"><input type="password" class="form-control" placeholder="DMK" id="dmk" name="dmk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ add_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Add user">
+                  </div> 
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+          </div>
+          {% if auth_type_2 == 'dmk' %}
+          <div class="card" id="user-el-3" style="margin-top: 30px">
+            <div class="card-body">
+              <h5 class="card-title">Delete SFTP user</h5>
+              <form action="/user/delete" method="post">
+                <div class="row" style="margin-top: 10px">
+		  <div class="col"><input type="text" class="form-control" placeholder="Username (lowercase user-id)" style="margin-top: 25px" id="user" name="user"></div>
+		  <div class="col"><input type="text" class="form-control" placeholder="Keep data [Y/N]" style="margin-top: 25px" id="keepdata" name="keepdata"></div>
+                </div>
+                <div class="row" style="margin-top: 10px">
+                  <div class="col"><input class="form-control" type="text" placeholder="Data Admin-ID" id="did" name="did"></div>
+                  <div class="col"><input type="password" class="form-control" placeholder="DMK" id="dmk" name="dmk"></div>
+                </div>
+                <div class="input-group" style="margin-top: 10px">
+                  <input type="text" class="form-control" placeholder="{{ delete_status }}" readonly>
+                  <div class="input-group-append">
+                    <input type="submit" class="btn btn-dark text-white" value="Delete user">
+                  </div>
+                </div>
+              </form>
+            </div>
+          </div>
+          {% endif %}
+{% endblock %}
