Unverified Commit 29bcb735 authored by David Morley's avatar David Morley Committed by GitHub

develop branch cleanup (#173)

* develop branch cleanup

* develop branch cleanup

* develop branch cleanup

* move to new lightbox that is responsive

* move to new lightbox that is responsive

* Adminunused (#175)

* remove adminrating

* remove adminrating

* remove echo

* Dbtableclean - remove hidden and secure (#176)

* remove hidden and secure from db

* remove hidden and secure from db

* remove hidden and secure from db

* This syntax (ES6) can make defining complex object literals much cleaner.

* fix weird blank pages on reloads

* remove unused line

* lat and long

* Just some alignment stuff, only visual code, no functionality.

* Refactor away unnecessary 'else' statements.

* Prevent duplicate PHP code execution for pie chart generation using passed data.

* Various little fixes, like spacing, better date output, removing unused code.

* Recursive call to stringify subarray items for API.

* Small fixes thanks to Codacy, some simple code cleanup.

* More spacing and alignment fixes, purely visual.

* Fix domain cookie check.

* There is no more slider...

* few last cleanups
parent 9b0f7215
# 2x+
# 2.3.0
## Podmins
* Can no longer access db/pull.php to test their pod, they can however get to a debug screen from the edit pod area
* Language is detected based on your homepage, edit your homepage to non-en if that is what you use
* Edit will send to email on file and be less delay, runner of site does not really have anyway to verify email address
## DB
* Add development and release dates to masterversions table https://github.com/diasporg/Poduptime/issues/143
* Store full country name, store days monitored each pod
* Store detectedlanguage
* Store full country name, store days monitored each pod https://github.com/diasporg/Poduptime/issues/150
* Store detectedlanguage https://github.com/diasporg/Poduptime/issues/144
* DB migrations see db/version.md
* rename table rating_comments to ratingcomments for redbean support
* rename table rating_comments to ratingcomments for redbean support https://github.com/diasporg/Poduptime/issues/146
* Default new pods to UP to be checked
* Remove unused hidden and secure columns https://github.com/diasporg/Poduptime/issues/141 https://github.com/diasporg/Poduptime/issues/140
## Cleanup
* Use the git API for release versions, check development releases on pods https://github.com/diasporg/Poduptime/issues/143
* Forbid access to files that should be cli only https://github.com/diasporg/Poduptime/issues/152
* Move from bower to yarn for packages
* NOTE config.php.examples change to full paths for 2 items!
* Move from bower to yarn for packages https://bower.io/blog/2017/how-to-migrate-away-from-bower/
* Move to PHP 7.2 with declare(strict_types=1);
* Move to Eslint compliance https://eslint.org/docs/rules/
* Move to PSR-2 compliance https://www.php-fig.org/psr/psr-2/
* NOTE config.php.example change to full paths for 2 items!
## End Users
* Show version and update in full view cleaner https://github.com/diasporg/Poduptime/issues/143
* Edit will send to email on file and be less delay, runner of site does not really have anyway to verify email address
* Filter and search on the columns of data
* Paginate the results so they fit per page
* Show time as human readable everywhere
* Filter and search on the columns of data https://github.com/diasporg/Poduptime/issues/147
* Paginate the results so they fit per page https://github.com/diasporg/Poduptime/issues/147
* Show time as human readable everywhere https://github.com/diasporg/Poduptime/issues/150
# 2.2.0
......
# Poduptime
Poduptime is software to get live stats and data on listed Diaspora Pods.
Poduptime is software to get live stats and data on listed Diaspora and other Pods that support nodeinfo output.
Dependencies:
# To Install:
Environmental items you need (debian based system assumed):
OS Dependencies:
```
php7.2 php7.2-curl php7.2-pgsql php-geoip php7.2-cli php7.2-common php7.2-json php7.2-readline php7.2-mbstring php7.2-xml php-cgi git curl postgresql postgresql-contrib wget dnsutils bind9 npm nodejs nodejs-legacy composer yarn
php7.2 php7.2-curl php7.2-pgsql php-geoip php7.2-cli php7.2-common php7.2-bcmath php7.2-json php7.2-readline php7.2-mbstring php7.2-xml php-cgi git curl postgresql postgresql-contrib dnsutils bind9 npm nodejs composer
```
GeoIP needs setup normally with a dat file
Yarn is a separate install: https://yarnpkg.com
To Install:
Clone and setup:
```
git clone https://github.com/diasporg/Poduptime.git
cd Poduptime
yarn install
composer install
cp config.php.example config.php
cp config.php.example config.php (all fields required)
```
If you need to setup your Postgresql/DB:
......@@ -27,30 +35,41 @@ sudo -u postgres bash -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE podupdb TO
sudo nano /etc/postgresql/vx.x/main/pg_hba.conf
# restart postgresql
```
# import database structure
Import database schema
```
psql -U podupuser podupdb < db/tables.sql
```
Edit `config.php` to add your DB and file settings.
touch add.log in location you configured in config.php
start your first run with `db/pull.sh init`
1. Edit `config.php` to add your DB and file settings
2. Touch add.log in location you configured in config.php
3. Create your backup folder
4. Add a pod and run `db/pull.sh init`
# To Use:
run `db/pull.sh` manually or with cron to update your data
run `db/pull.sh debug` to debug output
run `db/pull.sh sqldebug` to debug sql
run `db/pull.sh develop` to run without email alerts to end users
run `db/pull.sh Check_System_Deleted` to re-check system deleted pods as needed
run `db/pull.sh` manually or with cron to update your data
run `db/pull.sh debug` to debug output
run `db/pull.sh sqldebug` to debug sql
run `db/pull.sh develop` to run without email alerts to end users
run `db/pull.sh Check_System_Deleted` to re-check system deleted pods as needed
To Upgrade:
# To Upgrade:
```
cd Poduptime
git pull
bower install
yarn install
composer install
psql -U podupuser podupdb < db/migrationXXX.sql (see db/version.md for proper migration versions)
```
# To Contribute
Something here or a link to the wiki on how to....
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0515afa78df64b6385088246ee84acde)](https://www.codacy.com/app/diasporg/Poduptime?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=diasporg/Poduptime&amp;utm_campaign=Badge_Grade)
============================
Source for Diaspora Pod Uptime
......
......@@ -47,7 +47,7 @@ EOF;
foreach ($pods as $pod) {
$summary = sprintf(
'This pod %1$s has been watched for %2$s months and its average ping time is %3$s with uptime of %4$s%% this month and was last checked on %5$s. On a score of 100 this pod is a %6$s right now',
htmlentities($pod['name'], ENT_QUOTES),
htmlentities($pod['name'] ?? '', ENT_QUOTES),
$pod['monthsmonitored'],
$pod['responsetimelast7'],
$pod['uptimelast7'],
......@@ -128,14 +128,12 @@ function allToString(array $arr)
$ret = $arr;
foreach ($ret as &$item) {
if (is_array($item)) {
/** @var array $item */
foreach ($item as &$field) {
$field !== null && $field = (string) $field;
}
} else {
$item !== null && $item = (string) $item;
$item = allToString($item);
continue;
}
unset($field, $item);
$item !== null && $item = (string) $item;
unset($item);
}
return $ret;
......
{
"name": "poduptime",
"homepage": "https://github.com/diasporg/Poduptime",
"authors": [
"David Morley <support@diasp.org>"
],
"description": "Diaspora pod checking site",
"main": "",
"keywords": [
"diaspora"
],
"license": "AGPL",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"facebox": "*"
}
}
......@@ -11,9 +11,9 @@
"commerceguys/enum": "^1.0",
"noplanman/xec": "0.1.0",
"jaybizzle/crawler-detect": "1.*",
"twbs/bootstrap": "^4.1.0",
"patrickschur/language-detection": "^3.3",
"geoip2/geoip2": "^2.9"
"geoip2/geoip2": "^2.9",
"maxmind-db/reader": "~1.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.3"
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "1cd7c802d1459c30d044708a4ecc98b0",
"content-hash": "0817bebabc4fd710e4682f1ebaff3f95",
"packages": [
{
"name": "commerceguys/enum",
......@@ -346,16 +346,16 @@
},
{
"name": "nesbot/carbon",
"version": "1.31.1",
"version": "1.32.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "385780c8ca2dbfd25452666e3f55e8dc1df58c41"
"reference": "64563e2b9f69e4db1b82a60e81efa327a30ff343"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/385780c8ca2dbfd25452666e3f55e8dc1df58c41",
"reference": "385780c8ca2dbfd25452666e3f55e8dc1df58c41",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/64563e2b9f69e4db1b82a60e81efa327a30ff343",
"reference": "64563e2b9f69e4db1b82a60e81efa327a30ff343",
"shasum": ""
},
"require": {
......@@ -397,7 +397,7 @@
"datetime",
"time"
],
"time": "2018-06-25T13:15:16+00:00"
"time": "2018-07-05T06:59:26+00:00"
},
{
"name": "noplanman/xec",
......@@ -624,57 +624,6 @@
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2018-06-22T08:59:39+00:00"
},
{
"name": "twbs/bootstrap",
"version": "v4.1.1",
"source": {
"type": "git",
"url": "https://github.com/twbs/bootstrap.git",
"reference": "779ad9f174ea5ab7e755f6df0ec9e5912d67dd16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/779ad9f174ea5ab7e755f6df0ec9e5912d67dd16",
"reference": "779ad9f174ea5ab7e755f6df0ec9e5912d67dd16",
"shasum": ""
},
"replace": {
"twitter/bootstrap": "self.version"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jacob Thornton",
"email": "jacobthornton@gmail.com"
},
{
"name": "Mark Otto",
"email": "markdotto@gmail.com"
}
],
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
"homepage": "https://getbootstrap.com/",
"keywords": [
"JS",
"css",
"framework",
"front-end",
"mobile-first",
"responsive",
"sass",
"web"
],
"time": "2018-04-30T16:04:33+00:00"
}
],
"packages-dev": [
......
<?php
/**
* Config for Poduptime.
*/
declare(strict_types=1);
//backup directory - full dir path
$backup_dir = __DIR__ . '/backup';
......@@ -39,4 +38,4 @@ $cafullpath = '';
$mapboxkey = '';
//Geolite2-city database file in mmdb format - full file path (pull.sh will update this monthly)
$geoip2db = '';
\ No newline at end of file
$geoip2db = '';
.sub-header {
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}
.sidebar {
background-color: #fff;
border-right: 1px solid #eee;
display: block;
overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
padding: 10px;
position: fixed;
top: 56px;
}
.sidebar .nav {
margin-bottom: 20px;
}
.sidebar .nav .nav-link {
padding: .3em .7em;
}
.main {
padding: 20px;
}
......@@ -44,10 +20,6 @@
display: inline-block;
}
.rating {
font-size: 9px;
}
.tfont {
font-size: 12px;
}
......@@ -94,7 +66,7 @@
background-color: blue;
text-align: left;
font-size: 17px;
background: url('/bower_components/leaflet/dist/images/marker-icon-2x.png') repeat-y right bottom;
background: url('/node_modules/leaflet/dist/images/marker-icon-2x.png') repeat-y right bottom;
background-size: 25px 37px;
}
......@@ -102,18 +74,6 @@
color: red;
}
table {
empty-cells: show;
}
#facebox {
z-index: 1000 !important;
}
#facebox .content {
width: 800px !important;
}
.tablesorter-pager .btn-group-sm .btn {
font-size: 1.2em; /* make pager arrows more visible */
}
......@@ -178,7 +138,7 @@ table {
display: inline-block;
color: black;
float: left;
padding: 8px 16px;
padding: 2px 8px;
margin: 0 4px;
text-decoration: none;
transition: background-color .3s;
......@@ -194,7 +154,7 @@ table {
display: inline-block;
color: black;
float: left;
padding: 8px 16px !important;
padding: 2px 8px !important;
margin: 0 4px;
text-decoration: none;
transition: background-color .3s;
......@@ -206,6 +166,33 @@ table {
background-size: 10px 15px !important;
}
.modal-xlg {
max-width: 92%;
.loadingtable {
visibility: hidden;
width: 100%;
height: 100%;
}
.featherlight-close-icon {
font-size: 30px;
}
.featherlight-loading .featherlight-content {
-webkit-animation: featherlightLoader 1s infinite linear;
animation: featherlightLoader 1s infinite linear;
background: transparent;
border: 8px solid #8f8f8f;
border-left-color: #fff;
border-radius: 80px;
width: 80px;
height: 80px;
min-width: 0;
}
.featherlight-loading .featherlight-content > * {
display: none !important;
}
.featherlight-loading .featherlight-close,
.featherlight-loading .featherlight-inner {
display: none;
}
......@@ -12,10 +12,17 @@ use RedBeanPHP\R;
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../config.php';
define('PODUPTIME', microtime(true));
if (PHP_SAPI === 'cli' || PHP_SAPI === 'cgi-fcgi') {
define('PODUPTIME', microtime(true));
// Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
}
$log = new Logging();
$log->lfile( $log_dir . '/add.log');
$log->lfile($log_dir . '/add.log');
if (!($_domain = $_GET['domain'] ?? null)) {
$log->lwrite('no domain given');
die('no pod domain given');
......@@ -31,11 +38,6 @@ if (!filter_var(gethostbyname($_domain), FILTER_VALIDATE_IP)) {
die('Could not validate the domain name, be sure to enter it as "domain.com" (no caps, no slashes, no extras)');
}
// Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
try {
$pods = R::getAll('
SELECT id, domain, publickey, email
......@@ -53,23 +55,28 @@ foreach ($pods as $pod) {
}
$digtxt = exec(escapeshellcmd('dig ' . $_domain . ' TXT +short'));
if (strpos($digtxt, $pod['publickey']) !== false) {
echo 'domain validated, you can now add details ';
$uuid = md5(uniqid($_domain, true));
$expire = time() + 2700;
try {
$p = R::load('pods', $pod['id']);
$p['token'] = $uuid;
$p['tokenexpire'] = date('Y-m-d H:i:s', $expire);
R::store($p);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
echo <<<EOF
<form action="/?edit" method="get">
if (strpos($digtxt, $pod['publickey']) === false) {
$log->lwrite('domain already exists and can be registered' . $_domain);
die('domain already exists, you can claim the domain by adding a DNS TXT record that states<br><b> ' . $_domain . ' IN TXT "' . $pod['publickey'] . '"</b>');
}
echo 'domain validated, you can now add details ';
$uuid = md5(uniqid($_domain, true));
$expire = time() + 2700;
try {
$p = R::load('pods', $pod['id']);
$p['token'] = $uuid;
$p['tokenexpire'] = date('Y-m-d H:i:s', $expire);
R::store($p);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
echo <<<EOF
<form method="get">
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="{$_domain}">
<input type="hidden" name="token" value="{$uuid}">
<label>Email <input type="text" size="20" name="email"></label><br>
......@@ -79,18 +86,14 @@ foreach ($pods as $pod) {
</form>
EOF;
die;
} else {
$log->lwrite('domain already exists and can be registered' . $_domain);
die('domain already exists, you can claim the domain by adding a DNS TXT record that states<br><b> ' . $_domain . ' IN TXT "' . $pod['publickey'] . '"</b>');
}
die;
}
}
if ($infos = json_decode(file_get_contents('https://' . $_domain . '/.well-known/nodeinfo'), true)) {
$link = max($infos['links'])['href'];
} else {
$link = 'https://' . $_domain . '/.well-known/nodeinfo';
$link = 'https://' . $_domain . '/nodeinfo/1.0';
if ($infos = file_get_contents('https://' . $_domain . '/.well-known/nodeinfo')) {
$info = json_decode($infos, true);
$link = max($info['links'])['href'];
}
$chss = curl_init();
......@@ -103,7 +106,7 @@ curl_setopt($chss, CURLOPT_NOBODY, 0);
$outputssl = curl_exec($chss);
curl_close($chss);
if (stristr($outputssl, 'openRegistrations')) {
if (stripos($outputssl, 'openRegistrations') !== false) {
$log->lwrite('Your pod has ssl and is valid ' . $_domain);
echo 'Your pod has ssl and is valid<br>';
......
......@@ -21,9 +21,9 @@ echo "pg backup of $pgdb made";
$dirh = dir($backup_dir);
while ($entry = $dirh->read()) {
$old_file_time = (date('U') - $keep);
$file_created = filectime( "$backup_dir/$entry");
$file_created = filectime("$backup_dir/$entry");
if ($file_created < $old_file_time && !is_dir($entry)) {
if (unlink( "$backup_dir/$entry")) {
if (unlink("$backup_dir/$entry")) {
echo 'Cleaned up old backups';
}
}
......
......@@ -6,6 +6,7 @@
declare(strict_types=1);
use Carbon\Carbon;
use Poduptime\PodStatus;
use RedBeanPHP\R;
......@@ -94,54 +95,36 @@ if ('save' === $_action) {
// Forms.
?>
Authorized to edit <b><?php echo $_domain; ?></b> until <?php echo $pod['tokenexpire']; ?><br>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<label>Email <input type="text" size="40" name="email" value="<?php echo $pod['email']; ?>"></label><br>
<label>Podmin Statement (You can use HTML to include links to your terms and policies and information about your pod you wish to share with users.) <br><textarea cols="150" rows="10" name="podmin_statement"><?php echo $pod['podmin_statement']; ?></textarea></label><br>
<label>Weight <input type="text" size="2" name="weight" value="<?php echo $pod['weight']; ?>"> This lets you weight your pod lower on the list if you have too much traffic coming in, 10 is the norm use lower to move down the list.</label><br>
<label>Notify if pod falls to hidden status? <input type="checkbox" name="podmin_notify" <?php echo $pod['podmin_notify'] ? 'checked' : ''; ?> ></label><br>
<input type="submit" name="action" value="save">
</form>
<br>
<br>Your pod status is currently: <?php echo PodStatus::getKey((int) $pod['status']); ?>
<br>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<input type="submit" name="action" value="delete">
</form>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<input type="submit" name="action" value="pause">
</form>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<input type="submit" name="action" value="unpause">
</form>
<button type="button" class="openBtn" value="<?php echo $_domain; ?>">Do a debug test pull of your pod</button>
<!-- Modal -->
<div class="modal fade" id="podpull" role="dialog">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Pod debug data</h4>
</div>
<div class="modal-body">
Loading.....
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
Authorized to edit <b><?php echo $_domain; ?></b> for <?php echo (new Carbon($pod['tokenexpire']))->diffForHumans(null, true); ?><br>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<label>Email <input type="text" size="40" name="email" value="<?php echo $pod['email']; ?>"></label><br>
<label>Podmin Statement (You can use HTML to include links to your terms and policies and information about your pod you wish to share with users.) <br><textarea cols="150" rows="10" name="podmin_statement"><?php echo $pod['podmin_statement']; ?></textarea></label><br>
<label>Weight <input type="text" size="2" name="weight" value="<?php echo $pod['weight']; ?>"> This lets you weight your pod lower on the list if you have too much traffic coming in, 10 is the norm use lower to move down the list.</label><br>
<label>Notify if pod falls off the list? <input type="checkbox" name="podmin_notify" <?php echo $pod['podmin_notify'] ? 'checked' : ''; ?> ></label><br>
<input type="submit" name="action" value="save">
</form>
<br>
<br>Your pod status is currently: <?php echo PodStatus::getKey((int) $pod['status']); ?>
<br>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<input type="submit" name="action" value="delete">
</form>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<input type="submit" name="action" value="pause">
</form>
<form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>">
<input type="submit" name="action" value="unpause">
</form>
<button type="button" data-featherlight="/db/pull.php?debug=1&nowrite=1&domain=<?php echo $_domain; ?>">Do a debug test pull of your pod</button>
......@@ -9,21 +9,14 @@ declare(strict_types=1);
use RedBeanPHP\R;
// Required parameters.
($_domain = $_POST['domain'] ?? null) || die('no pod domain given');
($_domain = $_GET['domain'] ?? null) || die('no pod domain given');
// Other parameters.
$_email = $_POST['email'] ?? '';
$_email = $_GET['email'] ?? '';
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../config.php';
define('PODUPTIME', microtime(true));
// Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
try {
$pod = R::findOne('pods', 'domain = ?', [$_domain]);
$pod || die('domain not found');
......
ALTER TABLE masterversions ADD devlastcommit timestamp;
ALTER TABLE masterversions ADD releasedate timestamp;
ALTER TABLE pods ADD daysmonitored int, ADD countryname text;
ALTER TABLE masterversions ADD devlastcommit timestamp, ADD releasedate timestamp;
ALTER TABLE pods ADD daysmonitored int, ADD countryname text, ADD detectedlanguage text;
ALTER TABLE pods DROP COLUMN adminrating, DROP COLUMN hidden, DROP COLUMN secure;
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 pods ADD detectedlanguage text;
......@@ -58,5 +58,6 @@ if ($pods = json_decode(file_get_contents('https://diasp.org/pods.json'), true))
$results = array_diff($foundpods, $existingpods);
foreach ($results as $result) {
echo $result . ' ';
echo exec("php-cgi add.php domain={$result}") . "\r\n";
}
......@@ -20,7 +20,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;
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;
......
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 ] || [ "$@" = '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 ] || [ "$@" = '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
......
......@@ -13,10 +13,7 @@ use RedBeanPHP\R;
//($_userurl = $_POST['userurl'] ?? null) || die('no userurl given');//lets not annoy people on this for now
($_domain = $_POST['domain'] ?? null) || die('no pod domain given');