Unverified Commit 533802e7 authored by David Morley's avatar David Morley Committed by GitHub

Pullissues (#184)

* Pull some things after curl is a success rather than for all

* fix ip pull if ip

* fix loading spinner css

* allow php-cgi

* allow php-cgi

* == not ===

* more cli

* tricky pods have node info but no home page so users can not even access the pod

* implode and make them a version that conforms

* less nice to dash

* dont barf on bad pods

* space

* fix ratings

* less jumping on table

* view items

* shortversion is not really ok for dev, hack to make it decent for now

* store version in checks

* fix div

* make charts responsive for mobile

* Catch invalid GeoIP database.

* Small code simplification and remove unnecessary else statement.

* Minor code changes, purely visual.
parent bc88dfbc
......@@ -29,7 +29,7 @@
height: 16px;
background: url('/images/smlogo.png') 0 0;
display: inline-block;
margin: 0 2px;
margin: 0;
}
.smlogo-twitter {
......@@ -63,10 +63,9 @@
.mycluster {
width: 35px;
height: 35px;
background-color: blue;
text-align: left;
font-size: 17px;
background: url('/node_modules/leaflet/dist/images/marker-icon-2x.png') repeat-y right bottom;
background: blue url('/node_modules/leaflet/dist/images/marker-icon-2x.png') repeat-y right bottom;
background-size: 25px 37px;
}
......@@ -172,6 +171,30 @@
height: 100%;
}
@-webkit-keyframes featherlightLoader {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes featherlightLoader {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.featherlight-close-icon {
font-size: 30px;
}
......
......@@ -106,7 +106,7 @@ curl_setopt($chss, CURLOPT_NOBODY, 0);
$outputssl = curl_exec($chss);
curl_close($chss);
if (stripos($outputssl, 'openRegistrations') !== false) {
if ($outputssl && stripos($outputssl, 'openRegistrations') !== false) {
$log->lwrite('Your pod has ssl and is valid ' . $_domain);
echo 'Your pod has ssl and is valid<br>';
......
......@@ -5,3 +5,4 @@ UPDATE pods SET status=1 WHERE status IS NULL;
ALTER TABLE pods ALTER status SET DEFAULT 1;
ALTER TABLE rating_comments DROP COLUMN admin;
ALTER TABLE rating_comments RENAME TO ratingcomments;
ALTER TABLE checks ADD version text;
DROP TABLE pods_apiv1;
CREATE TABLE pods_apiv1 AS SELECT * FROM pods;
ALTER TABLE pods_apiv1 ADD Hgitdate text, ADD Hgitref text, ADD Hruntime text, ADD Hencoding text, ADD longversion text, ADD ptr text, ADD whois text, ADD postalcode text, ADD connection text, ADD pingdomlast text, ADD adminrating decimal, ADD hidden boolean, ADD secure boolean;
ALTER TABLE pods_apiv1 RENAME COLUMN stats_apikey TO pingdomurl;
ALTER TABLE pods_apiv1 RENAME COLUMN service_xmpp TO xmpp;
......@@ -20,8 +21,7 @@ ALTER TABLE pods_apiv1 ALTER COLUMN secure TYPE text USING secure::text;
ALTER TABLE pods_apiv1 ALTER COLUMN signup TYPE text USING signup::text;
ALTER TABLE pods_apiv1 ALTER COLUMN responsetimelast7 TYPE text USING responsetimelast7::smallint;
ALTER TABLE pods_apiv1 ADD Hgitdate text, ADD Hgitref text, ADD Hruntime text, ADD Hencoding text, ADD longversion text, ADD ptr text, ADD whois text, ADD postalcode text, ADD connection text, ADD pingdomlast text, ADD adminrating decimal, ADD hidden boolean, ADD secure boolean;
ALTER TABLE pods_apiv1 DROP podmin_statement, DROP sslexpire, DROP dnssec, DROP publickey, DROP podmin_notify;
UPDATE pods_apiv1 SET hgitdate = 'unsupported';
......@@ -30,7 +30,7 @@ $softwares = [
'pleroma' => ['repo' => 'pleroma%2fpleroma', 'gitsite' => 'git.pleroma.social', 'gittype' => 'gitlab', 'devbranch' => 'develop'],
'socialhome' => ['repo' => 'jaywink/socialhome', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
'social-relay' => ['repo' => 'jaywink/social-relay', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
'ganggo' => ['repo' => 'ganggo/ganggo', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
'ganggo' => ['repo' => 'ganggo%2fganggo', 'gitsite' => 'git.feneas.org', 'gittype' => 'gitlab', 'devbranch' => ''],
];
$opts = [
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ if ! wget -q --spider --tries=2 --timeout=15 https://www.google.com; then
fi
echo "$HAPPY"
if [ "$HOUR" = 23 ] || [ "$@" = 'init' ]; then
if [ "$HOUR" = 23 ] || [ "$1" = 'init' ]; then
printf "%s" "Pulling in master versions..."
if php pull-masterversions.php; then
echo "$HAPPY"
......@@ -44,7 +44,7 @@ if [ "$HOUR" = 23 ] || [ "$@" = 'init' ]; then
else
echo "$SAD"
fi
if [ "$DAY" = 23 ] || [ "$@" = 'init' ]; then
if [ "$DAY" = 23 ] || [ "$1" = 'init' ]; then
printf "%s" "Updating CA..."
CACERT_FILE="$(php -r "include __DIR__ . '/../config.php'; echo \$cafullpath;")"
if curl -Lss https://curl.haxx.se/ca/cacert.pem -o "$CACERT_FILE"; then
......
......@@ -86,6 +86,7 @@ CREATE TABLE checks (
local_posts int,
comment_counts int,
shortversion text,
version text,
date_checked timestamp DEFAULT current_timestamp
);
......
......@@ -25,8 +25,8 @@ R::usePartialBeans(true);
<script>
$(document).ready(function () {
$('#addrating').click(function () {
$('.ratings').hide('fast');
$('#commentform').show('slow');
$('.ratings').hide('slow');
});
$('#submitrating').click(function () {
var domain = '<?php echo $_domain; ?>';
......@@ -49,6 +49,16 @@ R::usePartialBeans(true);
</script>
</head>
<body>
<div id="commentform" class="container" style="display:none">
Would you like to add a comment?<br>
<label>Your Name:<br><input id="username" name="username"></label><br>
<label>Comment:<br><textarea id="comment" name="comment"></textarea></label><br>
<label>Rating (1-10 scale, 10 high):<br><input id="rating" name="rating" type="number" min="1" max="10" step="1"></label><br>
<input class="btn primary" id="submitrating" type="submit" value="Submit your Rating">
<div class="alert-message warning" id="error" style="display:none">
<span id="errortext">Some Error</span>
</div>
</div>
<div>
<?php
......@@ -58,27 +68,17 @@ R::usePartialBeans(true);
die('Error in SQL query: ' . $e->getMessage());
}
echo '<div class="container ratings"><div class="row"><div class="col col-10"><h3>Podupti.me ratings for ' . $_domain . ' pod</h3></div></div>';
echo '<div class="container ratings"><div class="row"><div class="col col-10"><b>Ratings for ' . $_domain . '</b></div></div>';
if (empty($ratings)) {
echo '<b>This pod has no rating yet!</b>';
} else {
foreach ($ratings as $rating) {
echo '<div class="m-1 rounded bg-light"><div class="row"><div class="col-10">Comment from: <b>' . $rating['username'] . '</b></div> <div class="col">Rating: ' . $rating['rating'] . '</div></div>';
echo '<div class="row"><div class="col-10"><i>' . $rating['comment'] . '</i></div><div="col" title="id: ' . $rating['id'] . '">' . date('Y-m-d', strtotime($rating['date_created'])) . '</div></div>';
echo '<div class="m-1 rounded"><div class="row bg-secondary"><div class="col-10">Comment from: <b>' . $rating['username'] . '</b></div> <div class="col text-right">Rating: ' . $rating['rating'] . '</div></div>';
echo '<div class="row"><div class="col-10"><i>' . $rating['comment'] . '</i></div><div class="col text-muted text-right" title="id: ' . $rating['id'] . '">' . date('Y-m-d', strtotime($rating['date_created'])) . '</div></div></div>';
}
}
?>
<input id="addrating" class="btn primary" type="submit" value="Add a Rating">
</div>
<div id="commentform" style="display:none">
Would you like to add a comment?<br>
<label>Your Name:<br><input id="username" name="username"></label><br>
<label>Comment:<br><textarea id="comment" name="comment"></textarea></label><br>
<label>Rating (1-10 scale, 10 high):<br><input id="rating" name="rating" type="number" min="1" max="10" step="1"></label><br>
<input class="btn primary" id="submitrating" type="submit" value="Submit your Rating">
<div class="alert-message warning" id="error" style="display:none">
<span id="errortext">Some Error</span>
</div>
</div>
</body>
</html>
......@@ -47,11 +47,11 @@ try {
$humanmonitored = Carbon::now()->subDays($pod['daysmonitored'])->diffForHumans(null, true);
$tip = "This {$pod['softwarename']} pod's uptime is {$pod['uptime_alltime']}% over {$humanmonitored}.";
if (($_COOKIE['domain'] ?? null) === $pod['domain']) {
echo '<tr><td class="bg-success"><div title="This is the last pod you visited from this site. ' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="text-body url" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></div></td>';
echo '<tr><td class="bg-secondary"><div title="This is the last pod you visited from this site. ' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="text-warning url" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></div></td>';
} else {
echo '<tr><td><div title="' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="text-success url" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></div></td>';
}
echo '<td><a href="#" data-featherlight="podstat-uptime.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
echo '<td><a href="#" data-featherlight-variant="table-responsive" data-featherlight="podstat-uptime.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
if ($pod['active_users_halfyear'] > 0) {
echo '<td data-toggle="tooltip" data-placement="bottom" title="Active users six months: ' . $pod['active_users_halfyear'] . ', Active users one month: ' . $pod['active_users_monthly'] . '">' . $pod['active_users_halfyear'] . '</td>';
} else {
......
......@@ -71,7 +71,7 @@ try {
$tip = "Over the last {$humanmonitored} pod uptime was {$pod['uptime_alltime']}% and response time from Los Angeles was {$pod['latency']}ms, with a SSL cert that expires {$humansslexpire}. This pod was last checked {$humanlastcheck}";
if (($_COOKIE['domain'] ?? null) === $pod['domain']) {
echo '<tr><td class="bg-success"><a title="This is the last pod you visited from this site. ' . $tip . '" class="text-body url" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></td>';
echo '<tr><td class="bg-secondary"><a title="This is the last pod you visited from this site. ' . $tip . '" class="text-warning url" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></td>';
} else {
echo '<tr><td><a title="' . $tip . '" class="text-success url" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></td>';
}
......@@ -96,17 +96,17 @@ try {
echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $pod['shortversion'] . ' master version is: ' . ($pod['masterversion'] ?: 'unknown') . '" data-toggle="tooltip" data-placement="bottom">' . $version . '</div></td>';
echo '<td>' . $pod['softwarename'] . '</td>';
echo '<td><a href="#" data-featherlight="podstat-uptime.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
echo '<td><a href="#" data-featherlight-variant="table-responsive" data-featherlight="podstat-uptime.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
echo '<td>' . ($pod['ipv6'] ? 'Y' : 'N') . '</td>';
echo '<td>' . ($pod['latency'] > 0 ? $pod['latency'] : '') . '</td>';
echo '<td>' . ($pod['signup'] ? 'Y' : 'N') . '</td>';
echo '<td><a href="#" data-featherlight="podstat-counts.php?domain=' . $pod['domain'] . '">' . ($pod['total_users'] > 0 ? $pod['total_users'] : '') . '</a></td>';
echo '<td><a href="#" data-featherlight-variant="table-responsive" data-featherlight="podstat-counts.php?domain=' . $pod['domain'] . '">' . ($pod['total_users'] > 0 ? $pod['total_users'] : '') . '</a></td>';
echo '<td>' . ($pod['active_users_halfyear'] > 0 ? $pod['active_users_halfyear'] : '') . '</td>';
echo '<td>' . ($pod['active_users_monthly'] > 0 ? $pod['active_users_monthly'] : '') . '</td>';
echo '<td>' . ($pod['local_posts'] > 0 ? $pod['local_posts'] : '') . '</td>';
echo '<td>' . ($pod['comment_counts'] > 0 ? $pod['comment_counts'] : '') . '</td>';
echo '<td><div title="This pod has been monitored ' . $humanmonitored . '" data-toggle="tooltip" data-placement="bottom">' . $pod['monthsmonitored'] . '</div></td>';
echo '<td><a href="#" data-featherlight="rate.php?domain=' . $pod['domain'] . '">' . $pod['userrating'] . '</a></td>';
echo '<td><a href="#" data-featherlight-variant="table-responsive" data-featherlight="rate.php?domain=' . $pod['domain'] . '">' . $pod['userrating'] . '</a></td>';
echo '<td><div title="Pod Status is: ' . PodStatus::getKey((int) $pod['status']) . '" data-toggle="tooltip" data-placement="bottom">' . $pod['score'] . '</div></td>';
echo '<td>' . ($pod['dnssec'] ? 'Y' : 'N') . '</td>';
if ($country_code === $pod['country']) {
......@@ -115,7 +115,7 @@ try {
echo '<td data-toggle="tooltip" data-placement="bottom" title="Country: ' . ($pod['countryname'] ?? 'n/a') . ' City: ' . ($pod['city'] ?? 'n/a') . ' State: ' . ($pod['state'] ?? 'n/a') . '">' . $pod['country'] . '</td>';
}
echo '<td>' . ($pod['detectedlanguage'] ?: '') . '</td>';
echo '<td>';
echo '<td class="text-truncate">';
$pod['service_facebook'] && print '<div class="smlogo smlogo-facebook" title="Publish to Facebook"></div>';
$pod['service_twitter'] && print '<div class="smlogo smlogo-twitter" title="Publish to Twitter"></div>';
$pod['service_tumblr'] && print '<div class="smlogo smlogo-tumblr" title="Publish to Tumblr"></div>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment