Commit 8ba5a676 authored by dmorley's avatar dmorley

Updates fall 2019

parent a15d0544
......@@ -9,6 +9,20 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
### Fixed
### Security
## [2.6.2] - 2019-11-24
### Added
- Total rows count o loading screen as that is growing
- Status page timeout value is user set in config.php
### Changed
- Update backup meta if backup is a success
### Deprecated
### Removed
### Fixed
- Updated json pull for mastodon not having the full nodeinfo data
- Fix geoip if IP is not real
### Security
- Updated packages
## [2.6.1] - 2019-06-30
### Added
### Changed
......
......@@ -35,6 +35,9 @@ return [
//DNS server for dnssec testing. 1.1.1.1 tests the best
'dnsserver' => '',
//Number of minutes to report on status.php that the run is still green
'status_green' => '',
//CA for curl to use - full file path
'cafullpath' => '',
......
......@@ -233,16 +233,16 @@ a {
}
.signal {
border: 6px solid #ffffff;
border: 4px solid #ffffff;
border-radius: 50px;
height: 40px;
left: 5%;
left: 520px;
margin: -20px 0 0 -20px;
opacity: 0;
position: absolute;
top: 24%;
top: 197px;
width: 40px;
animation: pulsate 2s ease-in-out;
animation: pulsate 5s ease-out;
animation-iteration-count: infinite;
}
......
......@@ -26,6 +26,11 @@ system(sprintf(
c('pgdb'),
$backup_file
), $exit_code);
if ($exit_code === 0) {
updateMeta('backup');
}
debug(" %s\n", $exit_code === 0 ? 'Success!' : 'Failed.');
$dirh = dir(c('backup_dir'));
......@@ -48,5 +53,3 @@ while ($entry = $dirh->read()) {
unlink($file) ? 'Success!' : 'Failed.'
);
}
updateMeta('backup');
......@@ -25,15 +25,15 @@ foreach ($softwares as $software => $details) {
$cjson = curl('https://' . $details['gitsite'] . '/repos/' . $details['repo'] . '/commits/' . $details['devbranch']);
$commitjson = json_decode($cjson['body'] ?: '');
}
if ($masterversion = $releasejson->tag_name ? str_replace('v', '', $releasejson->tag_name) : '') {
if (isset($releasejson->tag_name) && $masterversion = $releasejson->tag_name ? str_replace('v', '', $releasejson->tag_name) : '') {
try {
$m = R::dispense('masterversions');
$m['software'] = $software;
$m['version'] = $masterversion;
if ($releasedate = $releasejson ? $releasejson->published_at : '') {
if (isset($releasejson->published_at) && $releasedate = $releasejson ? $releasejson->published_at : '') {
$m['releasedate'] = $releasedate;
}
if ($devlastcommit = $commitjson ? $commitjson->commit->author->date : '') {
if (isset($commitjson->commit->author->date) && $devlastcommit = $commitjson ? $commitjson->commit->author->date : '') {
$m['devlastcommit'] = $devlastcommit;
}
R::store($m);
......@@ -48,15 +48,15 @@ foreach ($softwares as $software => $details) {
$cjson = curl('https://' . $details['gitsite'] . '/api/v4/projects/' . $details['repo'] . '/repository/commits/' . $details['devbranch']);
$commitjson = json_decode($cjson['body'] ?: '');
}
if ($masterversion = $releasejson[0]->name ? str_replace('v', '', $releasejson[0]->name) : '') {
if (isset($releasejson[0]->name) && $masterversion = $releasejson[0]->name ? str_replace('v', '', $releasejson[0]->name) : '') {
try {
$m = R::dispense('masterversions');
$m['software'] = $software;
$m['version'] = $masterversion;
if ($releasedate = $releasejson[0] ? $releasejson[0]->commit->created_at : '') {
if (isset($releasejson[0]->commit->created_at) && $releasedate = $releasejson[0] ? $releasejson[0]->commit->created_at : '') {
$m['releasedate'] = $releasedate;
}
if ($devlastcommit = $commitjson ? $commitjson->created_at : '') {
if (isset($commitjson->created_at) && $devlastcommit = $commitjson ? $commitjson->created_at : '') {
$m['devlastcommit'] = $devlastcommit;
}
R::store($m);
......
......@@ -338,7 +338,11 @@ foreach ($pods as $pod) {
// todo: Temporary workaround (see https://github.com/akalongman/php-ip-tools/issues/8)
if (Ip::isValid($ip) && Ip::isRemote($ip) && $ip != '0.0.0.0') {
$geo = $reader->city($ip);
try {
$geo = $reader->city($ip);
} catch (\GeoIp2\Exception\AddressNotFoundException $e) {
} catch (\MaxMind\Db\Reader\InvalidDatabaseException $e) {
}
$countryname = ($geo->country->name ?? null) ?: null;
$country = ($geo->country->isoCode ?? null) ?: null;
$city = ($geo->city->name ?? null) ?: null;
......
......@@ -63,9 +63,9 @@ $(document).ready(function () {
columns[8] = '';
}
$('table').trigger('search', [columns]);
$('.pagerhidden').delay(300).show(800);
$('.pagerhidden').delay(30).show(800);
$('[data-toggle="tooltip"]').tooltip();
$('.loadingtable').delay(300).hide(300);
$('.loadingtable').delay(30).hide(300);
});
$('#colSelect1').prop('checked', false);
});
......@@ -19,6 +19,7 @@ try {
SELECT count(domain)
FROM pods
WHERE status < ?
AND score > 0
", [PodStatus::RECHECK]);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
......@@ -73,7 +74,7 @@ try {
<div class="table-responsive">
<div class="loadingtable">
<div class="loadingmessage">Loading <?php echo $pods[0]['count']; ?> lines of data to the table, this takes under 30 seconds</div>
<div class="loadingmessage">Loading <span id="podcountdown"><?php echo $pods[0]['count']; ?></span> lines of data to the table, this takes under 30 seconds</div>
<div class="signal"></div>
</div>
<table class="table table-bordered table-sm tablesorter table-hover tfont">
......
......@@ -8,7 +8,7 @@ use Carbon\Carbon;
$pods_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('pods_updated', 'date_created'))->diffInMinutes();
echo "<small>";
if ($pods_updated_stats < 200) {
if ($pods_updated_stats < c('status_green')) {
echo "System status is Green<br>";
} else {
echo "System status is Red<br>";
......
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