Verified Commit 97358212 authored by dmorley's avatar dmorley

Merge branch 'develop'

parents 39b28467 4fe717ba
# 2.2.0
## Podmins
* Can now pause/unpause or delete from podmin area
## End Users
* go.php auto select picks a more stable pod than before
* Graph on user growth on the network
* Make map prettier
* Use lines on tables to make them more readable
## Cleanup
* Don't delete dead pods, keep them and data for history hide them for users
* Put daily tasks in the pull.sh and run each day
* Fix ipv6
## DB
* Add monthly stats table
* Update status to 1-5 rather than text
* Two migrations for this version update see db/version.md
...@@ -4,16 +4,7 @@ Poduptime is software to get live stats and data on listed Diaspora Pods. ...@@ -4,16 +4,7 @@ Poduptime is software to get live stats and data on listed Diaspora Pods.
Dependencies: Dependencies:
``` ```
php7.0 php7.0-curl php7.0-pgsql php-geoip php7.0-cli php7.0-common php7.0-json php7.0-readline php-cgi php7.2 php7.2-curl php7.2-pgsql php-geoip php7.2-cli php7.2-common php7.2-json php7.2-readline php-cgi git curl postgresql postgresql-contrib wget dnsutils bind9 npm nodejs nodejs-legacy composer
git
curl
postgresql postgresql-contrib
wget
dnsutils
bind9
npm
nodejs nodejs-legacy
composer
``` ```
To Install: To Install:
...@@ -39,13 +30,16 @@ sudo nano /etc/postgresql/vx.x/main/pg_hba.conf ...@@ -39,13 +30,16 @@ sudo nano /etc/postgresql/vx.x/main/pg_hba.conf
# restart postgresql # restart postgresql
# import database structure # import database structure
psql -u podupuser podupdb < db/tables.sql psql -U podupuser podupdb < db/tables.sql
``` ```
Edit `config.php` to add your DB and file settings. Edit `config.php` to add your DB and file settings.
touch add.log in location you configured in config.php touch add.log in location you configured in config.php
run db/pull.sh manually or with cron to update your data run `db/pull.sh` manually or with cron to update your data
run `db/pull.sh debug` to debug output
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:
``` ```
...@@ -53,7 +47,7 @@ cd Poduptime ...@@ -53,7 +47,7 @@ cd Poduptime
git pull git pull
bower install bower install
composer install composer install
psql -u podupuser podupdb < db/migrationx.sql (see db/version.md for proper migration version) psql -U podupuser podupdb < db/migrationXXX.sql (see db/version.md for proper migration versions)
``` ```
============================ ============================
......
...@@ -18,6 +18,7 @@ define('PODUPTIME', microtime(true)); ...@@ -18,6 +18,7 @@ define('PODUPTIME', microtime(true));
// Set up global DB connection. // Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true); R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection'); R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
if ($_format === 'georss') { if ($_format === 'georss') {
echo <<<EOF echo <<<EOF
......
<?php
use RedBeanPHP\R;
defined('PODUPTIME') || die();
try {
$pods = R::getAll('
SELECT domain, masterversion, shortversion, monthsmonitored, score, signup, name, uptime_alltime, active_users_halfyear, active_users_monthly, latency, date_updated, total_users, local_posts, comment_counts, stats_apikey, sslvalid
FROM pods
WHERE score < 50
ORDER BY weightedscore ASC
');
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
?>
<meta property="og:title" content="<?php echo count($pods); ?> #Diaspora Pods listed, Come see the privacy aware social network."/><?php echo count($pods); ?> pods that are open for signup now.
<meta charset="utf-8">
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
<div class="table-responsive">
<table class="table table-striped table-sm tablesorter-bootstrap table-hover tfont">
<thead>
<tr>
<th>Pod<a class="tipsy" title="A pod is a site for you to set up your account.">?</a></th>
<th>Version<a class="tipsy" title="Version of Diaspora this pod runs">?</a></th>
<th>Uptime<a class="tipsy" title="Percent of the time the pod is online for <?php echo date('F') ?>.">?</a></th>
<th>ms</th>
<th>Signups</th>
<th>Total<a class="tipsy" title="Number of total users on this pod.">?</a></th>
<th>Active 6<a class="tipsy" title="Number of users active last 6 months on this pod.">?</a></th>
<th>Active 1<a class="tipsy" title="Number of users active last 1 month on this pod.">?</a></th>
<th>Posts<a class="tipsy" title="Number of total posts on this pod.">?</a></th>
<th>Comm<a class="tipsy" title="Number of total comments on this pod.">?</a></th>
<th>Month<a class="tipsy" title="How many months has this pod been online? Click number for more history.">?</a></th>
<th>Sc<a class="tipsy" title="System Score on a 100 scale.">?</a></th>
<th>conn<a class="tipsy" title="">?</a></th>
<th>Delete?<a class="tipsy" title="Delete this pod from DB?">?</a></th>
</tr>
</thead>
<tbody>
<?php
$tt = 0;
foreach ($pods as $pod) {
$tt++;
$verdiff = (int) str_replace('.', '', $pod['masterversion']) - (int) str_replace('.', '', $pod['shortversion']);
$pod_name = htmlentities($pod['name'], ENT_QUOTES);
$tip = 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 -20 to +20 this pod is a %6$s right now',
$pod_name,
$pod['monthsmonitored'],
$pod['latency'],
$pod['uptime_alltime'],
$pod['date_updated'],
$pod['score']
);
echo '<tr><td><a class="text-success" target="_self" href="https://' . $pod['domain'] . '">' . $pod['domain'] . '<div title="' . $tip . '" class="tipsy" style="display: inline-block">?</div></a></td>';
if (stristr($pod['shortversion'], 'head')) {
$version = '.dev';
$pre = 'This pod runs pre release development code';
} elseif (!$pod['shortversion']) {
$version = '0';
$pre = 'This pod runs unknown code';
} else {
$version = $pod['shortversion'];
$pre = 'This pod runs production code';
}
if ($pod['shortversion'] === $pod['masterversion'] && $pod['shortversion'] !== '') {
$classver = 'text-success';
} elseif ($verdiff > 6) {
$classver = 'text-warning';
} else {
$classver = 'black';
}
echo '<td class="' . $classver . '"><div title="' . $pre . ' codename: ' . $pod['shortversion'] . ' master version is: ' . $pod['masterversion'] . '" class="tipsy">' . $version . '</div></td>';
echo '<td>' . $pod['uptime_alltime'] . '</td>';
echo '<td>' . $pod['latency'] . '</td>';
echo '<td>' . ($pod['signup'] ? 'Open' : 'Closed') . '</td>';
echo '<td>' . $pod['total_users'] . '</td>';
echo '<td>' . $pod['active_users_halfyear'] . '</td>';
echo '<td>' . $pod['active_users_monthly'] . '</td>';
echo '<td>' . $pod['local_posts'] . '</td>';
echo '<td>' . $pod['comment_counts'] . '</td>';
$moreurl = 'https://api.uptimerobot.com/getMonitors?format=json&noJsonCallback=1&customUptimeRatio=7-30-60-90&apiKey=' . $pod['stats_apikey'];
echo '<td><div title="Last Check ' . $pod['date_updated'] . '" class="tipsy"><a target="_self" href="' . $moreurl . '">' . $pod['monthsmonitored'] . '</a></div></td>';
echo '<td>' . $pod['score'] . '</td>';
echo '<td><div class="tipsy" title="' . $pod['sslvalid'] . '">con info</td>';
?>
<td>
<form method="post" action="db/kill.php" target="_blank">
<input type="hidden" name="domain" value="<?php echo $pod['domain']; ?>">
<input type="hidden" name="adminkey" value="<?php echo $_COOKIE['adminkey']; ?>">
<label>Comments<input name="comments" value="<?php echo $pod['sslvalid']; ?>" size="10"></label>
<label><input type="radio" name="action" value="warn">warn</label>
<label><input type="radio" name="action" value="delete">delete</label>
<input type="submit" value="Process">
</form>
</td>
<?php
echo '</tr>';
}
?>
</tbody>
</table>
</div>
{ {
"require": { "require": {
"noplanman/xec": "0.1.0", "noplanman/xec": "0.1.0",
"gabordemooij/redbean": "^4.3" "gabordemooij/redbean": "^5.0",
"jaybizzle/crawler-detect" :"1.*",
"commerceguys/enum": "^1.0"
},
"autoload": {
"classmap": ["lib"]
} }
} }
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8e8b0627248a269ae9d624bef32e61d6", "content-hash": "b753491dc03e2084e9587d0bbafad98c",
"packages": [ "packages": [
{
"name": "commerceguys/enum",
"version": "v1.0",
"source": {
"type": "git",
"url": "https://github.com/commerceguys/enum.git",
"reference": "1d9db2dbeb1a02500e7a14589ae2f9cb402c5c95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/commerceguys/enum/zipball/1d9db2dbeb1a02500e7a14589ae2f9cb402c5c95",
"reference": "1d9db2dbeb1a02500e7a14589ae2f9cb402c5c95",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"CommerceGuys\\Enum\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bojan Zivanovic"
}
],
"description": "A PHP 5.4+ enumeration library.",
"time": "2015-02-27T21:36:56+00:00"
},
{ {
"name": "gabordemooij/redbean", "name": "gabordemooij/redbean",
"version": "v4.3.3", "version": "v5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/gabordemooij/redbean.git", "url": "https://github.com/gabordemooij/redbean.git",
"reference": "1c7ec69850e9f7966ff7feb87b01d8f43a9753d3" "reference": "a02e58ad5519149f572559a8293b5dffea385956"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/gabordemooij/redbean/zipball/1c7ec69850e9f7966ff7feb87b01d8f43a9753d3", "url": "https://api.github.com/repos/gabordemooij/redbean/zipball/a02e58ad5519149f572559a8293b5dffea385956",
"reference": "1c7ec69850e9f7966ff7feb87b01d8f43a9753d3", "reference": "a02e58ad5519149f572559a8293b5dffea385956",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -37,15 +75,64 @@ ...@@ -37,15 +75,64 @@
{ {
"name": "Gabor de Mooij", "name": "Gabor de Mooij",
"email": "gabor@redbeanphp.com", "email": "gabor@redbeanphp.com",
"homepage": "http://redbeanphp.com" "homepage": "https://redbeanphp.com"
} }
], ],
"description": "RedBeanPHP ORM", "description": "RedBeanPHP ORM",
"homepage": "http://redbeanphp.com/", "homepage": "https://redbeanphp.com/",
"keywords": [ "keywords": [
"orm" "orm"
], ],
"time": "2016-10-03T21:25:17+00:00" "time": "2018-04-01T11:51:37+00:00"
},
{
"name": "jaybizzle/crawler-detect",
"version": "v1.2.62",
"source": {
"type": "git",
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
"reference": "f9767578e00f87a081835b49adc7c71074a5b46c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/f9767578e00f87a081835b49adc7c71074a5b46c",
"reference": "f9767578e00f87a081835b49adc7c71074a5b46c",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.8.*",
"satooshi/php-coveralls": "1.*"
},
"type": "library",
"autoload": {
"psr-4": {
"Jaybizzle\\CrawlerDetect\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Beech",
"email": "m@rkbee.ch",
"role": "Developer"
}
],
"description": "CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent",
"homepage": "https://github.com/JayBizzle/Crawler-Detect/",
"keywords": [
"crawler",
"crawler detect",
"crawler detector",
"crawlerdetect",
"php crawler detect"
],
"time": "2018-03-27T18:25:43+00:00"
}, },
{ {
"name": "noplanman/xec", "name": "noplanman/xec",
......
...@@ -16,9 +16,9 @@ $pgpass = ''; ...@@ -16,9 +16,9 @@ $pgpass = '';
$pgdb = ''; $pgdb = '';
//admin email for forms //admin email for forms
$adminemail = ''; $adminemail = '';
//admin key for deleting pods, set this as a cookie on your own //DNS server for dnssec testing. 1.1.1.1 tests the best
$adminkey = '';
//DNS server for dnssec testing
$dnsserver = ''; $dnsserver = '';
//CA for curl to use - suggest wget http://curl.haxx.se/ca/cacert.pem as they pull from mozilla if you use a system CA then certs like wosign and startssl will be valid but users will be unable to connect to them //CA for curl to use - suggest wget http://curl.haxx.se/ca/cacert.pem as they pull from mozilla if you use a system CA then certs like wosign and startssl will be valid but users will be unable to connect to them
$cafullpath = ''; $cafullpath = '';
//Mapbox.com API key. https://www.mapbox.com/help/how-access-tokens-work/
$mapboxkey = '';
...@@ -29,10 +29,11 @@ if (!filter_var(gethostbyname($_domain), FILTER_VALIDATE_IP)) { ...@@ -29,10 +29,11 @@ if (!filter_var(gethostbyname($_domain), FILTER_VALIDATE_IP)) {
// Set up global DB connection. // Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true); R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection'); R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
try { try {
$pods = R::getAll(' $pods = R::getAll('
SELECT id, domain, stats_apikey, publickey, email SELECT id, domain, publickey, email
FROM pods FROM pods
'); ');
} catch (\RedBeanPHP\RedException $e) { } catch (\RedBeanPHP\RedException $e) {
...@@ -57,11 +58,6 @@ foreach ($pods as $pod) { ...@@ -57,11 +58,6 @@ foreach ($pods as $pod) {
$p['token'] = $uuid; $p['token'] = $uuid;
$p['tokenexpire'] = date('Y-m-d H:i:s', $expire); $p['tokenexpire'] = date('Y-m-d H:i:s', $expire);
// @todo Temporary fix! https://github.com/gabordemooij/redbean/issues/547
foreach ($p->getProperties() as $key => $value) {
$p[$key] = $value;
}
R::store($p); R::store($p);
} catch (\RedBeanPHP\RedException $e) { } catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage()); die('Error in SQL query: ' . $e->getMessage());
...@@ -110,11 +106,6 @@ if (stristr($outputssl, 'openRegistrations')) { ...@@ -110,11 +106,6 @@ if (stristr($outputssl, 'openRegistrations')) {
$p['podmin_notify'] = $_podmin_notify; $p['podmin_notify'] = $_podmin_notify;
$p['publickey'] = $publickey; $p['publickey'] = $publickey;
// @todo Temporary fix! https://github.com/gabordemooij/redbean/issues/547
foreach ($p->getProperties() as $key => $value) {
$p[$key] = $value;
}
R::store($p); R::store($p);
} catch (\RedBeanPHP\RedException $e) { } catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage()); die('Error in SQL query: ' . $e->getMessage());
......
...@@ -18,6 +18,7 @@ define('PODUPTIME', microtime(true)); ...@@ -18,6 +18,7 @@ define('PODUPTIME', microtime(true));
// Set up global DB connection. // Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true); R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection'); R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
try { try {
$pod = R::getRow(' $pod = R::getRow('
...@@ -32,7 +33,12 @@ try { ...@@ -32,7 +33,12 @@ try {
if ($_format === 'json') { if ($_format === 'json') {
echo json_encode($pod); echo json_encode($pod);
} else { } else {
echo 'Status: ' . $pod['status'] . '<br>'; if ($pod['status'] === PodStatus::Up) {
echo 'Status: Up<br>';
}
if ($pod['status'] === PodStatus::Down) {
echo 'Status: Down<br>';
}
echo 'Last Git Pull: ' . $pod['hgitdate'] . '<br>'; echo 'Last Git Pull: ' . $pod['hgitdate'] . '<br>';
echo 'Uptime This Month ' . $pod['uptimelast7'] . '<br>'; echo 'Uptime This Month ' . $pod['uptimelast7'] . '<br>';
echo 'Months Monitored: ' . $pod['monthsmonitored'] . '<br>'; echo 'Months Monitored: ' . $pod['monthsmonitored'] . '<br>';
......
<?php <?php
use RedBeanPHP\R; use RedBeanPHP\R;
use CommerceGuys\Enum\AbstractEnum;
// Required parameters. // Required parameters.
($_domain = $_GET['domain'] ?? null) || die('no pod domain given'); ($_domain = $_GET['domain'] ?? null) || die('no pod domain given');
...@@ -17,12 +18,6 @@ $_podmin_notify = $_GET['podmin_notify'] ?? 0; ...@@ -17,12 +18,6 @@ $_podmin_notify = $_GET['podmin_notify'] ?? 0;
require_once __DIR__ . '/../vendor/autoload.php'; require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../config.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');
try { try {
$pod = R::findOne('pods', 'domain = ?', [$_domain]); $pod = R::findOne('pods', 'domain = ?', [$_domain]);
$pod || die('domain not found'); $pod || die('domain not found');
...@@ -35,8 +30,35 @@ $pod['tokenexpire'] >= date('Y-m-d H:i:s') || die('token expired'); ...@@ -35,8 +30,35 @@ $pod['tokenexpire'] >= date('Y-m-d H:i:s') || die('token expired');
// Delete and exit. // Delete and exit.
if ('delete' === $_action) { if ('delete' === $_action) {
R::trash($pod); try {
die('pod removed from DB'); $pod['status'] = PodStatus::User_Deleted;
R::store($pod);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
die('pod deleted');
}
// Pause and exit.
if ('pause' === $_action) {
try {
$pod['status'] = PodStatus::Paused;
R::store($pod);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
die('pod paused');
}
// Un-Pause and exit.
if ('unpause' === $_action) {
try {
$pod['status'] = PodStatus::Recheck;
R::store($pod);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
die('pod unpaused');
} }
// Save and exit. // Save and exit.
...@@ -49,11 +71,6 @@ if ('save' === $_action) { ...@@ -49,11 +71,6 @@ if ('save' === $_action) {
$pod['podmin_statement'] = $_podmin_statement; $pod['podmin_statement'] = $_podmin_statement;
$pod['podmin_notify'] = $_podmin_notify; $pod['podmin_notify'] = $_podmin_notify;
// @todo Temporary fix for RedBean property handling, hope this gets fixed soon!
foreach ($pod->getProperties() as $key => $value) {
$pod[$key] = $value;
}
R::store($pod); R::store($pod);
} catch (\RedBeanPHP\RedException $e) { } catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage()); die('Error in SQL query: ' . $e->getMessage());
...@@ -69,23 +86,38 @@ if ('save' === $_action) { ...@@ -69,23 +86,38 @@ if ('save' === $_action) {
} }
// Forms. // Forms.
?> ?>
Authorized to edit <b><?php echo $_domain; ?></b> until <?php echo $pod['tokenexpire']; ?><br> Authorized to edit <b><?php echo $_domain; ?></b> until <?php echo $pod['tokenexpire']; ?><br>
<form action="edit.php" method="get"> <form>
<input type="hidden" name="edit">
<input type="hidden" name="domain" value="<?php echo $_domain; ?>"> <input type="hidden" name="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>"> <input type="hidden" name="token" value="<?php echo $_token; ?>">
<label>Email <input type="text" size="20" name="email" value="<?php echo $pod['email']; ?>"></label><br> <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="100" rows="7" name="podmin_statement"><?php echo $pod['podmin_statement']; ?></textarea></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>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> <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"> <input type="submit" name="action" value="save">
</form> </form>
<br> <br>
<br>Your pod status is currently: <?php echo PodStatus::getKey((int)$pod['status']); ?>
<br> <br>
<br> <form>
<form action="edit.php" method="get"> <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="domain" value="<?php echo $_domain; ?>">
<input type="hidden" name="token" value="<?php echo $_token; ?>"> <input type="hidden" name="token" value="<?php echo $_token; ?>">
WARNING: This can not be undone, you will need to add your pod again if you want back on list: <input type="submit" name="action" value="delete"> <input type="submit" name="action" value="unpause">
</form> </form>
<?php <?php
...@@ -16,6 +16,7 @@ define('PODUPTIME', microtime(true)); ...@@ -16,6 +16,7 @@ define('PODUPTIME', microtime(true));
// Set up global DB connection. // Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true); R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection'); R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
try { try {
$pod = R::findOne('pods', 'domain = ?', [$_domain]); $pod = R::findOne('pods', 'domain = ?', [$_domain]);
...@@ -26,7 +27,7 @@ try { ...@@ -26,7 +27,7 @@ try {