Skip to content

Commit

Permalink
Updated issue #2427
Browse files Browse the repository at this point in the history
  • Loading branch information
xisi committed Jun 19, 2015
1 parent 02067ac commit 0b91d74
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 8 deletions.
8 changes: 7 additions & 1 deletion include/pages/admin/checks/check_daemon.inc.php
Expand Up @@ -6,8 +6,10 @@
if ($bitcoin->can_connect() !== true) {
$newerror = array();
$newerror['name'] = "Coin daemon";
$newerror['level'] = 3;
$newerror['description'] = "Unable to connect to coin daemon using provided credentials.";
$newerror['configvalue'] = "wallet.*";
$newerror['extdesc'] = "We weren't able to connect to your coin daemon using the host/username/password/port given in the config. Check that your coin daemon is running and mpos is configured with the data from your coin daemon config.";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc";
$error[] = $newerror;
$newerror = null;
Expand All @@ -17,6 +19,8 @@
if ($bitcoin->is_testnet() == true) {
$newerror = array();
$newerror['name'] = "Coin daemon";
$newerror['level'] = 3;
$newerror['extdesc'] = "You may have accidentally mistyped the port, or are running the coin daemon in testnet mode. Check your coin daemon config and MPOS config.";
$newerror['description'] = "The coin daemon service is running as a testnet. Check the TESTNET setting in your coin daemon config and make sure the correct port is set in the MPOS config.";
$newerror['configvalue'] = "wallet.host";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc";
Expand All @@ -28,11 +32,13 @@
if (count($accounts) > 1 && $accounts[''] <= 0) {
$newerror = array();
$newerror['name'] = "Coin daemon";
$newerror['level'] = 3;
$newerror['extdesc'] = "You need at least one account to be able to pay miners! See the above link for more details.";
$newerror['description'] = "There are " . count($accounts) . " Accounts set in local Wallet and Default Account has no liquid funds to pay your miners!";
$newerror['configvalue'] = "wallet.host";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc";
$error[] = $newerror;
$newerror = null;
}
}
}
} catch (Exception $e) {}
2 changes: 2 additions & 0 deletions include/pages/admin/checks/check_fees.inc.php
Expand Up @@ -5,6 +5,8 @@
if ($config['fees'] == 0 && ($config['txfee_auto'] == 0 || $config['txfee_manual'] == 0)) {
$newerror = array();
$newerror['name'] = "Fees and TX Fees 0";
$newerror['level'] = 2;
$newerror['extdesc'] = "This is an issue that can only occur with both your fees set to 0 and auto or manual tx fees set to 0 as well. It's best to avoid it if possible though, as it can prevent payouts; set the txfee to a small amount to avoid this.";
$newerror['description'] = "Having your pool fees set to 0 and tx fees also set to 0 can cause a problem where the wallet cannot payout, consider setting the txfee to a very low amount, ie. 0.0001 to avoid this.";
$newerror['configvalue'] = "fees";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/issues/2424";
Expand Down
8 changes: 8 additions & 0 deletions include/pages/admin/checks/check_memcache.inc.php
Expand Up @@ -5,6 +5,8 @@
if (!class_exists('Memcached') && $config['memcache']['enabled']) {
$newerror = array();
$newerror['name'] = "Memcache Config";
$newerror['level'] = 3;
$newerror['extdesc'] = "Memcache is a service that you run that lets us cache commonly used data and access it quickly. It's highly recommended you <a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#requirements-1'>install the service and php packages</a> for your distro.";
$newerror['description'] = "You have memcached enabled in your config and it's not available as a PHP module. Install the package on your system.";
$newerror['configvalue'] = "memcache.enabled";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-memcache";
Expand All @@ -31,6 +33,8 @@
if (class_exists('Memcached') && $memcache_test_get == $randmctv) {
$newerror = array();
$newerror['name'] = "Memcache Config";
$newerror['level'] = 2;
$newerror['extdesc'] = "Memcache is a service that you run that lets us cache commonly used data and access it quickly. It's highly recommended you <a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#requirements-1'>install the service and php packages</a> for your distro.";
$newerror['description'] = "You have memcache disabled in the config but it's available and works! Enable it for best performance.";
$newerror['configvalue'] = "memcache.enabled";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-memcache";
Expand All @@ -39,6 +43,8 @@
} else {
$newerror = array();
$newerror['name'] = "Memcache Config";
$newerror['level'] = 2;
$newerror['extdesc'] = "Memcache is a service that you run that lets us cache commonly used data and access it quickly. It's highly recommended you <a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#requirements-1'>install the service and php packages</a> for your distro.";
$newerror['description'] = "Memcache is disabled; Almost every linux distro has packages for it, you should be using it if you can.";
$newerror['configvalue'] = "memcache.enabled";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-memcache";
Expand All @@ -51,6 +57,8 @@
if ($config['mc_antidos'] && !$config['memcache']['enabled']) {
$newerror = array();
$newerror['name'] = "Memcache Config";
$newerror['level'] = 3;
$newerror['extdesc'] = "Memcache is a service that you run that lets us cache commonly used data and access it quickly. It's highly recommended you <a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#requirements-1'>install the service and php packages</a> for your distro.";
$newerror['description'] = "mc_antidos is enabled and memcache is not, <u>memcache is required</u> to use this.";
$newerror['configvalue'] = "memcache.enabled";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#memcache-rate-limiting";
Expand Down
14 changes: 11 additions & 3 deletions include/pages/admin/checks/check_permissions.inc.php
Expand Up @@ -6,6 +6,8 @@
if (!is_writable($config['logging']['path'])) {
$newerror = array();
$newerror['name'] = "Log path permissions";
$newerror['level'] = 3;
$newerror['extdesc'] = "In order to log data, we need to be able to write in the logs folder. See the link above for more details.";
$newerror['description'] = "Logging is enabled but we can't write in the logfile path.";
$newerror['configvalue'] = "logging.path";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#configuration-1";
Expand All @@ -18,18 +20,22 @@
if (!is_writable(TEMPLATE_DIR . '/cache')) {
$newerror = array();
$newerror['name'] = "templates/cache permissions";
$newerror['level'] = 3;
$newerror['extdesc'] = "In order to cache template data, we need to be able to write in the templates/cache folder. See the link above for more details.";
$newerror['description'] = "templates/cache folder is not writable for uid {$apache_user['name']}";
$newerror['configvalue'] = "templates/cache folder";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#configuration-1";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#folder-permissions";
$error[] = $newerror;
$newerror = null;
}
if (!is_writable(TEMPLATE_DIR . '/compile')) {
$newerror = array();
$newerror['name'] = "templates/compile permissions";
$newerror['level'] = 3;
$newerror['extdesc'] = "In order to cache compiled template data, we need to be able to write in the templates/compile folder. See the link above for more details.";
$newerror['description'] = "templates/compile folder is not writable for uid {$apache_user['name']}";
$newerror['configvalue'] = "templates/compile folder";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#configuration-1";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#folder-permissions";
$error[] = $newerror;
$newerror = null;
}
Expand All @@ -39,7 +45,9 @@
is_writable(INCLUDE_DIR.'/config/security.inc.php') || is_writable(INCLUDE_DIR.'/config/security.inc.dist.php')) {
$newerror = array();
$newerror['name'] = "Config permissions";
$newerror['description'] = "Your config files <b>SHOULD NOT be writable to this user</b>!";
$newerror['level'] = 2;
$newerror['extdesc'] = "For security purposes, the user your webserver runs as should not be able to write to the config files, only read from them. To fix this, check the ownership and permissions of the include/config files.";
$newerror['description'] = "Your config files <b>SHOULD NOT be writable by this user</b>!";
$newerror['configvalue'] = "global.inc.php and security.inc.php";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#configuration-1";
$error[] = $newerror;
Expand Down
4 changes: 4 additions & 0 deletions include/pages/admin/checks/check_security.inc.php
Expand Up @@ -5,6 +5,8 @@
if (strlen($config['SALT']) < 24 || strlen($config['SALTY']) < 24 || $config['SALT'] == 'PLEASEMAKEMESOMETHINGRANDOM' || $config['SALTY'] == 'THISSHOULDALSOBERRAANNDDOOM') {
$newerror = array();
$newerror['name'] = "Password Salts";
$newerror['level'] = 2;
$newerror['extdesc'] = "Salts are important because they add a random element and 'padding' to passwords and other hashed strings. They should be changed from the default and should not be too short for increased security.";
if ($config['SALT'] == 'PLEASEMAKEMESOMETHINGRANDOM' || $config['SALTY'] == 'THISSHOULDALSOBERRAANNDDOOM') {
$newerror['description'] = "You absolutely <u>SHOULD NOT leave your SALT or SALTY default</u> changing them will require registering again.";
} else {
Expand All @@ -20,6 +22,8 @@
if (!file_exists(BASEPATH.".htaccess")) {
$newerror = array();
$newerror['name'] = ".htaccess";
$newerror['level'] = 2;
$newerror['extdesc'] = ".htaccess files let you control who/how files are accessed for Apache. If you're using Apache for MPOS, you should be using .htaccess.";
$htaccess_link = "<a href='https://github.com/MPOS/php-mpos/blob/next/public/.htaccess'>.htaccess</a>";
$newerror['description'] = "You don't seem to have a .htaccess in your public folder, if you're using Apache set it up: $htaccess_link";
$newerror['configvalue'] = ".htaccess";
Expand Down
4 changes: 4 additions & 0 deletions include/pages/admin/checks/check_stratum.inc.php
Expand Up @@ -15,6 +15,8 @@
} else {
$newerror = array();
$newerror['name'] = "Stratum information";
$newerror['level'] = 1;
$newerror['extdesc'] = "We tried to connect the stratum server that you set in your gettingstarted config, but an error occured somewhere along the way. Your stratum server may not be running currently, your firewall could be blocking the connection, etc.";
$newerror['description'] = "We tried to poke your Stratum server using your \$config['gettingstarted'] settings but it didn't respond - " . socket_strerror(socket_last_error()) . ".";
$newerror['configvalue'] = "gettingstarted";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-getting-started";
Expand All @@ -26,6 +28,8 @@
if (! $fp = @fsockopen($config['gettingstarted']['stratumurl'], $config['gettingstarted']['stratumport'], $errCode, $errStr, 1)) {
$newerror = array();
$newerror['name'] = "Stratum information";
$newerror['level'] = 1;
$newerror['extdesc'] = "We tried to connect the stratum server that you set in your gettingstarted config, but an error occured somewhere along the way. Your stratum server may not be running currently, your firewall could be blocking the connection, etc.";
$newerror['description'] = "We tried to poke your Stratum server using your \$config['gettingstarted'] settings but it didn't respond.";
$newerror['configvalue'] = "gettingstarted";
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-getting-started";
Expand Down
23 changes: 19 additions & 4 deletions templates/bootstrap/admin/setup/default.tpl
Expand Up @@ -8,10 +8,25 @@
<div class="panel-body">
{if $ERRORS|@count > 0}
{section errors $ERRORS}
<p><strong>{$ERRORS[errors].name}</strong></p>
<p>{$ERRORS[errors].description}</p>
<p>See: <a href="{$ERRORS[errors].helplink}">{$ERRORS[errors].configvalue}</a></p>
<hr />
<div class="row">
<div class="col-lg-12">
<div class="panel panel-{if $ERRORS[errors].level >= 2}danger
{elseif $ERRORS[errors].level == 1}warning
{elseif $ERRORS[errors].level == 0}info{/if}">
<div class="panel-heading">
<i class="fa fa-{if $ERRORS[errors].level >= 2}times-circle
{elseif $ERRORS[errors].level == 1}warning
{elseif $ERRORS[errors].level == 0}info{/if} fa-fw"></i> <strong>{$ERRORS[errors].name}</strong>
</div>
<div class="panel-body">
<p>{$ERRORS[errors].description}</p>
<p><pre style='width:35%'>$config.<a href="{$ERRORS[errors].helplink}">{$ERRORS[errors].configvalue}</a></pre></p>
<p>{$ERRORS[errors].extdesc}</p>
</div>
</div>
</div>
<!-- /.col-lg-12 -->
</div>
{/section}
{/if}
</div>
Expand Down

0 comments on commit 0b91d74

Please sign in to comment.