aboutsummaryrefslogtreecommitdiff
path: root/_site/admin/status
diff options
context:
space:
mode:
Diffstat (limited to '_site/admin/status')
-rw-r--r--_site/admin/status/index.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/_site/admin/status/index.php b/_site/admin/status/index.php
new file mode 100644
index 0000000..6d46f34
--- /dev/null
+++ b/_site/admin/status/index.php
@@ -0,0 +1,40 @@
+<?php $__ADMIN = true; $_TITLE = "Data Sync Status - Blogchain Administration"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/header.php"; ?>
+
+<div class="container" style="margin-top:30px;text-align: center;">
+ <h2>Data Sync Status</h2>
+ <p>Check if everything is good!</p>
+</div>
+
+<div class="container">
+ <ul>
+ <?php
+
+ $commit = json_decode(gh_api("repos/Minteck/Blogchain-Content/commits"), true)[0];
+ if (!isset($commit["commit"]["verification"]) || !isset($commit["commit"]["verification"]["verified"]) || !$commit["commit"]["verification"]["verified"]) {
+ echo("<li class='list-admin-warning'>This version is <b>not</b> digitally signed, its content may have been compromised.</li>");
+ }
+
+ ?>
+ <li><b>Upstream version:</b> <?php
+
+ echo(substr($commit["sha"], 0, 7) . " « " . $commit["commit"]["message"] . " » · commited by " . $commit["commit"]["author"]["name"]);
+
+ ?></li>
+ <li><b>Downstream version:</b> <?php
+
+ echo(substr(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/../_posts/.git/refs/heads/master"), 0, 7));
+
+ ?></li>
+ <li><?php
+
+ if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/../_posts/.git/refs/heads/master")) === trim($commit["sha"])) {
+ echo("Downstream is up to date");
+ } else {
+ echo("Downstream <b>rebase needed</b>");
+ }
+
+ ?></li>
+ </ul>
+</div>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/footer.php"; ?> \ No newline at end of file