First batch of chenges from config.php to .env

This commit is contained in:
DariusIII
2017-04-24 15:41:10 +02:00
parent c45824ac54
commit b782fa3e3e
38 changed files with 195 additions and 1772 deletions
+29
View File
@@ -0,0 +1,29 @@
DB_SYSTEM = mysql
DB_HOST = localhost
DB_PORT = 3306
DB_SOCKET =
DB_USER =
DB_PASSWORD =
DB_NAME =
DB_PCONNECT = false
NNTP_USERNAME =
NNTP_PASSWORD =
NNTP_SERVER =
NNTP_PORT =
NNTP_SSLENABLED = false
NNTP_SOCKET_TIMEOUT =120
NNTP_USERNAME_A =
NNTP_PASSWORD_A =
NNTP_SERVER_A =
NNTP_PORT_A =
NNTP_SSLENABLED_A = false
NNTP_SOCKET_TIMEOUT_A = 120
NN_SSL_CAFILE =
NN_SSL_CAPATH =
NN_SSL_VERIFY_PEER =
NN_SSL_VERIFY_HOST =
NN_SSL_ALLOW_SELF_SIGNED = 1
+1
View File
@@ -1,5 +1,6 @@
.DS_Store
config.php
.env
error_log
failed-login.log
php_errors.log
+15 -10
View File
@@ -36,6 +36,11 @@
* @see lithium\core\Environment
*/
use lithium\data\Connections;
use Dotenv\Dotenv;
$dotenv = new Dotenv(dirname(__DIR__, 3));
$dotenv->load();
/**
* Uncomment this configuration to use MongoDB as your default database.
@@ -74,12 +79,12 @@ use lithium\data\Connections;
// ));
$config1 = LITHIUM_APP_PATH . DS . 'config' . DS . 'db-config.php';
$config2 = NN_ROOT . 'nntmux' . DS . 'config' . DS . 'config.php';
$config2 = NN_ROOT . '.env';
$config = file_exists($config1) ? $config1 : $config2;
if (file_exists($config) && !defined('NN_INSTALLER')) {
require_once $config;
switch (DB_SYSTEM) {
if (!defined('NN_INSTALLER')) {
switch (getenv(DB_SYSTEM)) {
case 'mysql':
$adapter = 'MySql';
break;
@@ -91,10 +96,10 @@ if (file_exists($config) && !defined('NN_INSTALLER')) {
}
if (isset($adapter)) {
if (empty(DB_SOCKET)) {
$host = empty(DB_PORT) ? DB_HOST : DB_HOST.':'.DB_PORT;
if (empty(getenv(DB_SOCKET))) {
$host = empty(getenv(DB_PORT)) ? getenv(DB_HOST) : getenv(DB_HOST) . ':' . getenv(DB_PORT);
} else {
$host = DB_SOCKET;
$host = getenv(DB_SOCKET);
}
Connections::add('default',
@@ -102,9 +107,9 @@ if (file_exists($config) && !defined('NN_INSTALLER')) {
'type' => 'database',
'adapter' => $adapter,
'host' => $host,
'login' => DB_USER,
'password' => DB_PASSWORD,
'database' => DB_NAME,
'login' => getenv(DB_USER),
'password' => getenv(DB_PASSWORD),
'database' => getenv(DB_NAME),
'encoding' => 'UTF-8',
'persistent' => false,
]
+1
View File
@@ -16,6 +16,7 @@
* @author niel
* @copyright 2016 nZEDb
*/
require_once __DIR__ . '/app/config/bootstrap.php';
?>
+2 -2
View File
@@ -13,7 +13,7 @@ if (!isset($argv[1]) || $argv[1] !== 'yes') {
);
}
require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'bootstrap.php');
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'bootstrap.php';
define('R', 1);
define('W', 2);
@@ -58,7 +58,7 @@ foreach (['anime', 'audio', 'audiosample', 'book', 'console', 'games', 'movies',
}
// Set up covers paths.
if (defined('DB_PASSWORD') && DB_PASSWORD != '') {
if (getenv(DB_PASSWORD) !== '') {
$ri = new ReleaseImage();
$folders[$ri->audSavePath] = [R, W];
+2 -1
View File
@@ -139,7 +139,8 @@
"unionofrad/lithium": "^1.2-dev",
"illuminate/filesystem": "^5.4",
"monolog/monolog": "^1.22",
"aharen/omdbapi": "^2.0"
"aharen/omdbapi": "^2.0",
"vlucas/phpdotenv": "^2.4"
},
"require-dev": {
Generated
+51 -1
View File
@@ -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": "6889e6fd6afd1695052783a071f42998",
"content-hash": "0789149ed3f34ba2afa5bd5e96b94d31",
"packages": [
{
"name": "adrenth/thetvdb2",
@@ -3813,6 +3813,56 @@
"lithium"
],
"time": "2017-04-23 09:48:41"
},
{
"name": "vlucas/phpdotenv",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c",
"reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
"psr-4": {
"Dotenv\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause-Attribution"
],
"authors": [
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "http://www.vancelucas.com"
}
],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
"keywords": [
"dotenv",
"env",
"environment"
],
"time": "2016-09-01T10:05:43+00:00"
}
],
"packages-dev": [
+4 -4
View File
@@ -53,7 +53,7 @@ if ($handle) {
if (trim($match['table']) === 'collections') {
$tables = $pdo->query("SHOW TABLES");
foreach ($tables as $row) {
$tbl = $row['tables_in_' . DB_NAME];
$tbl = $row['tables_in_' . getenv(DB_NAME)];
if (preg_match('/collections_\d+/', $tbl)) {
$check = $pdo->checkColumnIndex($tbl, $column);
if (!isset($check_collections['key_name'])) {
@@ -67,7 +67,7 @@ if ($handle) {
} else if (trim($match['table']) === 'binaries') {
$tables = $pdo->query("SHOW TABLES");
foreach ($tables as $row) {
$tbl = $row['tables_in_' . DB_NAME];
$tbl = $row['tables_in_' . getenv(DB_NAME)];
if (preg_match('/binaries_\d+/', $tbl)) {
$checkBinaries = $pdo->checkColumnIndex($tbl, $column);
if (!isset($checkBinaries['key_name'])) {
@@ -81,7 +81,7 @@ if ($handle) {
} else if (trim($match['table']) === 'parts') {
$tables = $pdo->query("SHOW TABLES");
foreach ($tables as $row) {
$tbl = $row['tables_in_' . DB_NAME];
$tbl = $row['tables_in_' . getenv(DB_NAME)];
if (preg_match('/parts_\d+/', $tbl)) {
$checkParts = $pdo->checkColumnIndex($tbl, $column);
if (!isset($checkParts['key_name'])) {
@@ -95,7 +95,7 @@ if ($handle) {
} else if (trim($match['table']) === 'missed_parts') {
$tables = $pdo->query("SHOW TABLES");
foreach ($tables as $row) {
$tbl = $row['tables_in_' . DB_NAME];
$tbl = $row['tables_in_' . getenv(DB_NAME)];
if (preg_match('/partrepair_\d+/', $tbl)) {
$checkPartRepair = $pdo->checkColumnIndex($tbl, $column);
if (!isset($checkPartRepair['key_name'])) {
+15 -15
View File
@@ -32,14 +32,14 @@ function builddefaultsfile()
//generate file contents
$filetext = "[mysqldump]"
."\n"
."user = " . DB_USER
."user = " . getenv(DB_USER)
."\n"
."password = " . DB_PASSWORD
."password = " . getenv(DB_PASSWORD)
."\n[mysql]"
."\n"
."user = " . DB_USER
."user = " . getenv(DB_USER)
."\n"
."password = " . DB_PASSWORD;
."password = " . getenv(DB_PASSWORD);
$filehandle = fopen("mysql-defaults.txt", "w+");
if(!$filehandle) {
@@ -51,14 +51,14 @@ function builddefaultsfile()
}
}
$dbhost = DB_HOST;
$dbport = DB_PORT;
$dbsocket = DB_SOCKET;
$dbuser = DB_USER;
$dbpass = DB_PASSWORD;
$dbname = DB_NAME;
$dbhost = getenv(DB_HOST);
$dbport = getenv(DB_PORT);
$dbsocket = getenv(DB_SOCKET);
$dbuser = getenv(DB_USER);
$dbpass = getenv(DB_PASSWORD);
$dbname = getenv(getenv(DB_NAME));
if (DB_SOCKET != '') {
if (getenv(DB_SOCKET) !== '') {
$use = "-S $dbsocket";
} else {
$use = "-P$dbport";
@@ -88,7 +88,7 @@ if((isset($argv[1]) && $argv[1] == "db") && (isset($argv[2]) && $argv[2] == "dum
$sql = "SHOW tables";
$tables = $pdo->query($sql);
foreach($tables as $row) {
$tbl = $row['Tables_in_'.DB_NAME];
$tbl = $row['Tables_in_'. getenv(DB_NAME)];
$filename = $argv[3]."/".$tbl.".gz";
echo $pdo->log->header("Dumping $tbl.");
if (file_exists($filename)) {
@@ -102,7 +102,7 @@ if((isset($argv[1]) && $argv[1] == "db") && (isset($argv[2]) && $argv[2] == "dum
$tables = $pdo->query($sql);
$pdo->queryExec("SET FOREIGN_KEY_CHECKS=0");
foreach($tables as $row) {
$tbl = $row['Tables_in_'.DB_NAME];
$tbl = $row['Tables_in_'.getenv(DB_NAME)];
$filename = $argv[3]."/".$tbl.".gz";
if (file_exists($filename)) {
echo $pdo->log->header("Restoring $tbl.");
@@ -138,7 +138,7 @@ if((isset($argv[1]) && $argv[1] == "db") && (isset($argv[2]) && $argv[2] == "dum
$sql = "SHOW tables";
$tables = $pdo->query($sql);
foreach($tables as $row) {
$tbl = $row['Tables_in_'.DB_NAME];
$tbl = $row['Tables_in_'.getenv(DB_NAME)];
$filename = $argv[3].$tbl.".csv";
echo $pdo->log->header("Dumping $tbl.");
if (file_exists($filename)) {
@@ -151,7 +151,7 @@ if((isset($argv[1]) && $argv[1] == "db") && (isset($argv[2]) && $argv[2] == "dum
$tables = $pdo->query($sql);
$pdo->queryExec("SET FOREIGN_KEY_CHECKS=0");
foreach($tables as $row) {
$tbl = $row['Tables_in_'.DB_NAME];
$tbl = $row['Tables_in_'.getenv(DB_NAME)];
$filename = $argv[3].$tbl.".csv";
if (file_exists($filename)) {
echo $pdo->log->header("Restoring $tbl.");
+1 -1
View File
@@ -27,7 +27,7 @@ if ($argc == 1 || $argv[1] != 'true') {
exit($pdo->log->error("\nThis script will rename every table column to lowercase that is not already lowercase.\nTo run:\nphp $argv[0] true\n"));
}
$database = DB_NAME;
$database = getenv(DB_NAME);
$count = 0;
$list = $pdo->query("SELECT TABLE_NAME, COLUMN_NAME, UPPER(COLUMN_TYPE), EXTRA FROM information_schema.columns WHERE table_schema = '" . $database . "'");
+1 -1
View File
@@ -20,7 +20,7 @@ $table_data = "SELECT TABLE_NAME AS 'Table', TABLE_ROWS AS 'Rows', "
. "((INDEX_LENGTH) / POWER(1024,2)) AS 'index', "
. "((DATA_FREE) / POWER(1024,2)) AS 'free', "
. "((DATA_LENGTH + INDEX_LENGTH) / POWER(1024,2)) AS 'total' "
. "FROM information_schema.TABLES WHERE information_schema.TABLES.table_schema = '" . DB_NAME . "' "
. "FROM information_schema.TABLES WHERE information_schema.TABLES.table_schema = '" . getenv(DB_NAME) . "' "
. "ORDER BY (DATA_LENGTH + INDEX_LENGTH) DESC";
$run = $pdo->queryDirect($table_data);
+2 -2
View File
@@ -18,8 +18,8 @@ $runVar['paths']['misc'] = NN_MISC;
$runVar['paths']['cli'] = NN_ROOT . 'cli/';
$runVar['paths']['scraper'] = NN_MISC . 'IRCScraper' . DS . 'scrape.php';
$db_name = DB_NAME;
$dbtype = DB_SYSTEM;
$db_name = getenv(DB_NAME);
$dbtype = getenv(DB_SYSTEM);
$tmux = $tRun->get('niceness');
$tmux_niceness = $tmux->niceness ?? 2;
+16 -16
View File
@@ -148,7 +148,7 @@ class NNTP extends \Net_NNTP_Client
public function doConnect($compression = true, $alternate = false)
{
if (// (Alternate is wanted, AND current server is alt, OR Alternate is not wanted AND current is main.) AND
(($alternate && $this->_currentServer === NNTP_SERVER_A) || (!$alternate && $this->_currentServer === NNTP_SERVER)) &&
(($alternate && $this->_currentServer === getenv(NNTP_SERVER_A)) || (!$alternate && $this->_currentServer === getenv(NNTP_SERVER))) &&
// Don't reconnect to usenet if:
// We are already connected to usenet.
parent::_isConnected()
@@ -163,19 +163,19 @@ class NNTP extends \Net_NNTP_Client
// Set variables to connect based on if we are using the alternate provider or not.
if (!$alternate) {
$sslEnabled = (NNTP_SSLENABLED ? true : false);
$this->_currentServer = NNTP_SERVER;
$this->_currentPort = NNTP_PORT;
$userName = NNTP_USERNAME;
$password = NNTP_PASSWORD;
$socketTimeout = (defined('NNTP_SOCKET_TIMEOUT') ? NNTP_SOCKET_TIMEOUT : $this->_socketTimeout);
$sslEnabled = getenv(NNTP_SSLENABLED) ? true : false;
$this->_currentServer = getenv(NNTP_SERVER);
$this->_currentPort = getenv(NNTP_PORT);
$userName = getenv(NNTP_USERNAME);
$password = getenv(NNTP_PASSWORD);
$socketTimeout = !empty(getenv(NNTP_SOCKET_TIMEOUT)) ? getenv(NNTP_SOCKET_TIMEOUT) : $this->_socketTimeout;
} else {
$sslEnabled = (NNTP_SSLENABLED_A ? true : false);
$this->_currentServer = NNTP_SERVER_A;
$this->_currentPort = NNTP_PORT_A;
$userName = NNTP_USERNAME_A;
$password = NNTP_PASSWORD_A;
$socketTimeout = (defined('NNTP_SOCKET_TIMEOUT_A') ? NNTP_SOCKET_TIMEOUT_A : $this->_socketTimeout);
$sslEnabled = getenv(NNTP_SSLENABLED_A) ? true : false;
$this->_currentServer = getenv(NNTP_SERVER_A);
$this->_currentPort = getenv(NNTP_PORT_A);
$userName = getenv(NNTP_USERNAME_A);
$password = getenv(NNTP_PASSWORD_A);
$socketTimeout = !empty(getenv(NNTP_SOCKET_TIMEOUT_A)) ? getenv(NNTP_SOCKET_TIMEOUT_A) : $this->_socketTimeout;
}
$enc = ($sslEnabled ? ' (ssl)' : ' (non-ssl)');
@@ -581,7 +581,7 @@ class NNTP extends \Net_NNTP_Client
if ($alternate === true) {
if ($aConnected === false) {
// Check if the current connected server is the alternate or not.
if ($this->_currentServer === NNTP_SERVER) {
if ($this->_currentServer === getenv(NNTP_SERVER)) {
// It's the main so connect to the alternate.
$aConnected = $nntp->doConnect(true, true);
} else {
@@ -1483,13 +1483,13 @@ class NNTP extends \Net_NNTP_Client
$retVal = true;
} else {
switch ($this->_currentServer) {
case NNTP_SERVER:
case getenv(NNTP_SERVER):
if (is_resource($this->_socket)) {
$this->doQuit(true);
}
$retVal = $this->doConnect();
break;
case NNTP_SERVER_A:
case getenv(NNTP_SERVER_A):
if (is_resource($this->_socket)) {
$this->doQuit(true);
}
+4 -4
View File
@@ -90,12 +90,12 @@ class Tmux
public function getConnectionsInfo($constants)
{
$runVar['connections']['port_a'] = $runVar['connections']['host_a'] = $runVar['connections']['ip_a'] = false;
$runVar['connections']['port'] = NNTP_PORT;
$runVar['connections']['host'] = NNTP_SERVER;
$runVar['connections']['port'] = getenv(NNTP_PORT);
$runVar['connections']['host'] = getenv(NNTP_SERVER);
$runVar['connections']['ip'] = gethostbyname($runVar['connections']['host']);
if ($constants['alternate_nntp'] === '1') {
$runVar['connections']['port_a'] = NNTP_PORT_A;
$runVar['connections']['host_a'] = NNTP_SERVER_A;
$runVar['connections']['port_a'] = getenv(NNTP_PORT_A);
$runVar['connections']['host_a'] = getenv(NNTP_SERVER_A);
$runVar['connections']['ip_a'] = gethostbyname($runVar['connections']['host_a']);
}
return $runVar['connections'];
+2 -2
View File
@@ -55,10 +55,10 @@ class Configure
public function loadSettings($filename, $throwException = true)
{
$file = NN_CONFIGS . $filename . '.php';
$file = NN_ROOT . '.env';
if (!file_exists($file)) {
if ($throwException) {
$errorCode = (int)($filename === 'config');
$errorCode = (int)($filename === '.env');
throw new \RuntimeException(
"Unable to load configuration file '$file'. Make sure it has been created and contains correct settings.",
$errorCode
+40
View File
@@ -0,0 +1,40 @@
<?php
//=========================
// Config you must change - updated by installer.
//=========================
define('DB_SYSTEM', 'mysql');
define('DB_HOST', 'localhost');
define('DB_PORT', '3306');
define('DB_SOCKET', '');
define('DB_USER', 'root');
define('DB_PASSWORD', 'kalimdor');
define('DB_NAME', 'nntmux');
define('DB_PCONNECT', false);
define('NNTP_USERNAME', '');
define('NNTP_PASSWORD', '');
define('NNTP_SERVER', '');
define('NNTP_PORT', '');
// If you want to use TLS or SSL on the NNTP connection (the NNTP_PORT must be able to support encryption).
define('NNTP_SSLENABLED', false);
// If we lose connection to the NNTP server, this is the time in seconds to wait before giving up.
define('NNTP_SOCKET_TIMEOUT', '120');
define('NNTP_USERNAME_A', '');
define('NNTP_PASSWORD_A', '');
define('NNTP_SERVER_A', '');
define('NNTP_PORT_A', '');
define('NNTP_SSLENABLED_A', false);
define('NNTP_SOCKET_TIMEOUT_A', '');
// Location to CA bundle file on your system. You can download one here: http://curl.haxx.se/docs/caextract.html
define('NN_SSL_CAFILE', '');
// Path where openssl cert files are stored on your system, this is a fall back if the CAFILE is not found.
define('NN_SSL_CAPATH', '');
// Use the aforementioned CA bundle file to verify remote SSL certificates when connecting to a server using TLS/SSL.
define('NN_SSL_VERIFY_PEER', '');
// Verify the host is who they say they are.
define('NN_SSL_VERIFY_HOST', '');
// Allow self signed certificates. Note this does not work on CURL as CURL does not have this option.
define('NN_SSL_ALLOW_SELF_SIGNED', '1');
+7 -7
View File
@@ -112,13 +112,13 @@ class DB extends \PDO
'checkVersion' => false,
'createDb' => false, // create dbname if it does not exist?
'ct' => new ConsoleTools(),
'dbhost' => defined('DB_HOST') ? DB_HOST : '',
'dbname' => defined('DB_NAME') ? DB_NAME : '',
'dbpass' => defined('DB_PASSWORD') ? DB_PASSWORD : '',
'dbport' => defined('DB_PORT') ? DB_PORT : '',
'dbsock' => defined('DB_SOCKET') ? DB_SOCKET : '',
'dbtype' => defined('DB_SYSTEM') ? DB_SYSTEM : '',
'dbuser' => defined('DB_USER') ? DB_USER : '',
'dbhost' => getenv(DB_HOST),
'dbname' => getenv(DB_NAME),
'dbpass' => getenv(DB_PASSWORD),
'dbport' => getenv(DB_PORT),
'dbsock' => getenv(DB_SOCKET),
'dbtype' => getenv(DB_SYSTEM),
'dbuser' => getenv(DB_USER),
'log' => new ColorCLI(),
'persist' => false,
];
+2 -1
View File
@@ -171,8 +171,9 @@ $page->smarty->assign('book_reqids_selected', $books_selected);
$page->smarty->assign('themelist', Utility::getThemesList());
if (strpos(NNTP_SERVER, "astra")===false)
if (strpos(getenv(NNTP_SERVER), "astra") === false) {
$page->smarty->assign('compress_headers_warning', "compress_headers_warning");
}
$page->content = $page->smarty->fetch('site-edit.tpl');
$page->render();
-1
View File
@@ -1 +0,0 @@
install.lock
-40
View File
@@ -1,40 +0,0 @@
<?php
//=========================
// Config you must change - updated by installer.
//=========================
define('DB_SYSTEM', '%%DB_SYSTEM%%');
define('DB_HOST', '%%DB_HOST%%');
define('DB_PORT', '%%DB_PORT%%');
define('DB_SOCKET', '%%DB_SOCKET%%');
define('DB_USER', '%%DB_USER%%');
define('DB_PASSWORD', '%%DB_PASSWORD%%');
define('DB_NAME', '%%DB_NAME%%');
define('DB_PCONNECT', false);
define('NNTP_USERNAME', '%%NNTP_USERNAME%%');
define('NNTP_PASSWORD', '%%NNTP_PASSWORD%%');
define('NNTP_SERVER', '%%NNTP_SERVER%%');
define('NNTP_PORT', '%%NNTP_PORT%%');
// If you want to use TLS or SSL on the NNTP connection (the NNTP_PORT must be able to support encryption).
define('NNTP_SSLENABLED', %%NNTP_SSLENABLED%%);
// If we lose connection to the NNTP server, this is the time in seconds to wait before giving up.
define('NNTP_SOCKET_TIMEOUT', '%%NNTP_SOCKET_TIMEOUT%%');
define('NNTP_USERNAME_A', '%%NNTP_USERNAME_A%%');
define('NNTP_PASSWORD_A', '%%NNTP_PASSWORD_A%%');
define('NNTP_SERVER_A', '%%NNTP_SERVER_A%%');
define('NNTP_PORT_A', '%%NNTP_PORT_A%%');
define('NNTP_SSLENABLED_A', %%NNTP_SSLENABLED_A%%);
define('NNTP_SOCKET_TIMEOUT_A', '%%NNTP_SOCKET_TIMEOUT_A%%');
// Location to CA bundle file on your system. You can download one here: http://curl.haxx.se/docs/caextract.html
define('NN_SSL_CAFILE', '%%NN_SSL_CAFILE%%');
// Path where openssl cert files are stored on your system, this is a fall back if the CAFILE is not found.
define('NN_SSL_CAPATH', '%%NN_SSL_CAPATH%%');
// Use the aforementioned CA bundle file to verify remote SSL certificates when connecting to a server using TLS/SSL.
define('NN_SSL_VERIFY_PEER', '%%NN_SSL_VERIFY_PEER%%');
// Verify the host is who they say they are.
define('NN_SSL_VERIFY_HOST', '%%NN_SSL_VERIFY_HOST%%');
// Allow self signed certificates. Note this does not work on CURL as CURL does not have this option.
define('NN_SSL_ALLOW_SELF_SIGNED', '%%NN_SSL_ALLOW_SELF_SIGNED%%');
-106
View File
@@ -1,106 +0,0 @@
<?php
@session_start();
if (!defined('NN_INSTALLER')) {
define('NN_INSTALLER', true);
}
require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'smarty.php');
use nntmux\Install;
$page_title = "Welcome";
$cfg = new Install();
if ($cfg->isLocked()) {
$cfg->error = true;
}
$cfg->cacheCheck = is_writable(NN_RES . 'smarty' . DS . 'templates_c');
if ($cfg->cacheCheck === false) {
$cfg->error = true;
}
if (!$cfg->error) {
$cfg->setSession();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
<?php
echo $page_title;
?>
</title>
<link href="./templates/install.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="shortcut icon" type="image/ico" href="../themes/shared/images/favicon.ico" />
</head>
<body>
<h1 id="logo">
<images alt="NNTmux" src="../themes/shared/images/logo.png" />
</h1>
<div class="content">
<h2>Index Usenet. Now.</h2>
<p>Welcome to NNTmux.</p>
<p>Before getting started, you need to make sure that the server meets the minimum requirements. You will also need...</p>
<ol>
<li>Your database credentials.</li>
<li>Your news server credentials.</li>
<li>SSH & root ability on your server (in case you need to install missing packages).</li>
<li>You should consider copying nntmux/nntmux/config/settings.example.php to
nntmux/nntmux/config/settings.php (Default settngs should be fine for installing).</li>
</ol>
<br/><br/>
<p>
<strong>
<div style="color: #ff0000">WARNING: </div>
This software is not practical for use on shared hosting. You should only use this on a server where YOU have the required privileges and knowledge to solve any challenges that might appear.
</strong>
</p>
<div align="center">
<?php
if (!$cfg->error) {
?>
<form action="step1.php">
<input type="submit" value="Go to step one: Pre flight check" />
</form>
<?php
} else {
if (!$cfg->cacheCheck) {
?>
<div class="error">
The template compile dir must be writable.<br />A quick solution is to run: <br />
<?php
echo 'chmod 777 ' . NN_RES . 'smarty' . DS . 'templates_c';
if (extension_loaded('posix') && strtolower(substr(PHP_OS, 0, 3)) !== 'win') {
$group = posix_getgrgid(posix_getgid());
echo
'<br /><br />Another solution is to run:<br />chown -R YourUnixUserName:' . $group['name'] . ' ' . NN_ROOT .
'<br />Then give your user access to the group:<br />usermod -a -G ' . $group['name'] . ' YourUnixUserName' .
'<br />Finally give read/write access to your user/group:<br />chmod -R 774 ' . NN_ROOT;
}
?>
</div>
<?php
} else {
?>
<div class="error">Installation Locked! If reinstalling, please remove www/install/install.lock.</div>
<?php
}
}
?>
</div>
<div class="footer">
<p>
<br />
NN is released under GPL.
</p>
</div>
</div>
</body>
</html>
-42
View File
@@ -1,42 +0,0 @@
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see LICENSE.txt in the base directory. If
* not, see:
*
* @link <http://www.gnu.org/licenses/>.
* @author niel
* @copyright 2015 nZEDb
*/
if (!defined('NN_INSTALLER')) {
define('NN_INSTALLER', true);
}
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'bootstrap.php');
use nntmux\config\Configure;
$config = new Configure('install');
// Path to smarty files. (not prefixed with NNtmux as the name is needed in smarty files).
define('SMARTY_DIR', NN_ROOT . 'app' . DS . 'libraries' . DS . 'smarty' . DS . 'smarty' . DS . 'libs' . DS);
$www_top = str_replace("\\", "/", dirname($_SERVER['PHP_SELF']));
if (strlen($www_top) == 1) {
$www_top = "";
}
// Used everywhere an href is output, includes the full path to the NNTmux install.
define('WWW_TOP', $www_top);
?>
-201
View File
@@ -1,201 +0,0 @@
<?php
/**
* Remember!! Keeps these files simple until after the requirements checks are met.
* No point having a check for PHP version if we can't get to that page because of higher version
* requirements.
*/
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nntmux\Install;
$page = new InstallPage();
$page->title = "Preflight Checklist";
$cfg = new Install();
if (!$cfg->isInitialized()) {
header("Location: index.php");
die();
}
$cfg->setSession();
$cfg = $cfg->getSession();
// Start checks.
$cfg->sessionsPathPermissions = true;
$sessionPath = session_save_path();
$sessionPath = empty($sessionPath) ? sys_get_temp_dir() : $sessionPath;
$page->smarty->assign('sessionsSavePath', $sessionPath);
if (!is_readable($sessionPath) || !is_writable($sessionPath)) {
$cfg->error = true;
$cfg->sessionsPathPermissions = false;
}
$cfg->iconvCheck = function_exists('iconv');
if ($cfg->iconvCheck === false) {
$cfg->error = true;
}
$cfg->cryptCheck = function_exists('crypt');
if ($cfg->cryptCheck === false) {
$cfg->error = true;
}
$cfg->sha1Check = function_exists('sha1');
if ($cfg->sha1Check === false) {
$cfg->error = true;
}
$cfg->PDOCheck = extension_loaded('PDO');
if ($cfg->PDOCheck === false) {
$cfg->error = true;
}
$cfg->jsonCheck = extension_loaded('json');
if ($cfg->jsonCheck === false) {
$cfg->error = true;
}
$cfg->gdCheck = function_exists('imagecreatetruecolor');
$cfg->curlCheck = function_exists('curl_init');
if (extension_loaded('posix') && strtolower(substr(PHP_OS, 0, 3)) !== 'win') {
$group = posix_getgrgid(posix_getgid());
$fixString = '<br /><br />Another solution is to run:<br />chown -R YourUnixUserName:' . $group['name'] . ' ' . NN_ROOT .
'<br />Then give your user access to the group:<br />usermod -a -G ' . $group['name'] . ' YourUnixUserName' .
'<br />Finally give read/write access to your user/group:<br />chmod -R 774 ' . NN_ROOT;
$page->smarty->assign('fixString', $fixString);
$page->smarty->assign('unixGroup', $group['name']);
$page->smarty->assign('rootPath', NN_ROOT);
} else {
$page->smarty->assign('fixString', false);
}
$cfg->cacheCheck = is_writable(NN_RES . 'smarty' . DS . 'templates_c');
if ($cfg->cacheCheck === false) {
$cfg->error = true;
}
$cfg->animeCoversCheck = is_writable($cfg->COVERS_PATH . 'anime');
if ($cfg->animeCoversCheck === false) {
$cfg->error = true;
}
$cfg->audioCoversCheck = is_writable($cfg->COVERS_PATH . 'audio');
if ($cfg->audioCoversCheck === false) {
$cfg->error = true;
}
$cfg->audiosampleCoversCheck = is_writable($cfg->COVERS_PATH . 'audiosample');
if ($cfg->audiosampleCoversCheck === false) {
$cfg->error = true;
}
$cfg->bookCoversCheck = is_writable($cfg->COVERS_PATH . 'book');
if ($cfg->bookCoversCheck === false) {
$cfg->error = true;
}
$cfg->consoleCoversCheck = is_writable($cfg->COVERS_PATH . 'console');
if ($cfg->consoleCoversCheck === false) {
$cfg->error = true;
}
$cfg->movieCoversCheck = is_writable($cfg->COVERS_PATH . 'movies');
if ($cfg->movieCoversCheck === false) {
$cfg->error = true;
}
$cfg->musicCoversCheck = is_writable($cfg->COVERS_PATH . 'music');
if ($cfg->musicCoversCheck === false) {
$cfg->error = true;
}
$cfg->previewCoversCheck = is_writable($cfg->COVERS_PATH . 'preview');
if ($cfg->previewCoversCheck === false) {
$cfg->error = true;
}
$cfg->sampleCoversCheck = is_writable($cfg->COVERS_PATH . 'sample');
if ($cfg->sampleCoversCheck === false) {
$cfg->error = true;
}
$cfg->videoCoversCheck = is_writable($cfg->COVERS_PATH . 'video');
if ($cfg->videoCoversCheck === false) {
$cfg->error = true;
}
$cfg->configCheck = is_writable(NN_CONFIGS);
if ($cfg->configCheck === false) {
$cfg->configCheck = is_file(NN_CONFIGS);
if ($cfg->configCheck === true) {
$cfg->configCheck = false;
$cfg->error = true;
} else {
$cfg->configCheck = is_writable(NN_CONFIGS);
if ($cfg->configCheck === false) {
$cfg->error = true;
}
}
}
$cfg->lockCheck = is_writable($cfg->INSTALL_DIR . 'install.lock');
if ($cfg->lockCheck === false) {
$cfg->lockCheck = is_file($cfg->INSTALL_DIR . 'install.lock');
if ($cfg->lockCheck === true) {
$cfg->lockCheck = false;
$cfg->error = true;
} else {
$cfg->lockCheck = is_writable($cfg->INSTALL_DIR);
if ($cfg->lockCheck === false) {
$cfg->error = true;
}
}
}
$cfg->pearCheck = @include 'System.php';
$cfg->pearCheck = class_exists('System');
if (!$cfg->pearCheck) {
$cfg->error = true;
}
$cfg->schemaCheck = false;
if (is_readable($cfg->DB_DIR . 'mysql-ddl.sql')) {
$cfg->schemaCheck = true;
}
if ($cfg->schemaCheck === false) {
$cfg->error = true;
}
// Don't set error = true for these as we only want to display a warning.
$cfg->phpCheck = (version_compare(PHP_VERSION, NN_MINIMUM_PHP_VERSION, '>=')) ? true : false;
$cfg->timelimitCheck = (ini_get('max_execution_time') >= 120) ? true : false;
$cfg->memlimitCheck = (ini_get('memory_limit') >= 1024 || ini_get('memory_limit') == -1) ? true : false;
$cfg->opensslCheck = extension_loaded("openssl");
$cfg->exifCheck = extension_loaded("exif");
$cfg->timezoneCheck = (ini_get('date.timezone') != "");
if (preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE'])) {
$cfg->rewriteCheck = (function_exists("apache_get_modules") && in_array("mod_rewrite", apache_get_modules())) ? true : false;
} else {
$cfg->rewriteCheck = true;
}
// Load previous config.php.
if (file_exists(NN_CONFIGS . 'config.php') && is_readable(NN_CONFIGS . 'config.php')) {
$tmpCfg = file_get_contents(NN_CONFIGS . 'config.php');
$cfg->setConfig($tmpCfg);
}
if (!$cfg->error) {
$cfg->setSession();
}
$page->smarty->assign('cfg', $cfg);
$page->smarty->assign('page', $page);
$page->content = $page->smarty->fetch('step1.tpl');
$page->render();
-222
View File
@@ -1,222 +0,0 @@
<?php
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use app\extensions\util\Versions;
use nntmux\db\DB;
use nntmux\Install;
$page = new InstallPage();
$page->title = "Database Setup";
$cfg = new Install();
if (!$cfg->isInitialized()) {
header("Location: index.php");
die();
}
/**
* Check if the database exists.
*
* @param string $dbName The name of the database to be checked.
* @param string $dbType mysql
* @param PDO $pdo Class PDO instance.
*
* @return bool
*/
function databaseCheck($dbName, $dbType, $pdo)
{
// Return value.
$retVal = false;
// Prepare queries.
$stmt = ($dbType === "mysql" ? 'SHOW DATABASES' : 'SELECT datname AS Database FROM pg_database');
$stmt = $pdo->prepare($stmt);
$stmt->setFetchMode(PDO::FETCH_ASSOC);
// Run the query.
$stmt->execute();
$tables = $stmt->fetchAll();
// Store the query result as an array.
$tablearr = [];
foreach ($tables as $table) {
$tablearr[] = $table;
}
// Loop over the query result.
foreach ($tablearr as $tab) {
// Check if the database is found.
if (isset($tab["Database"])) {
if ($tab["Database"] == $dbName) {
$retVal = true;
break;
}
}
if (isset($tab["database"])) {
if ($tab["database"] == $dbName) {
$retVal = true;
break;
}
}
}
return $retVal;
}
$cfg = $cfg->getSession();
if ($page->isPostBack()) {
$cfg->doCheck = true;
// Get the information the user typed into the website.
$cfg->DB_HOST = trim($_POST['host']);
$cfg->DB_PORT = trim($_POST['sql_port']);
$cfg->DB_SOCKET = trim($_POST['sql_socket']);
$cfg->DB_USER = trim($_POST['user']);
$cfg->DB_PASSWORD = trim($_POST['pass']);
$cfg->DB_NAME = trim($_POST['db']);
$cfg->DB_SYSTEM = strtolower(trim($_POST['db_system']));
$cfg->error = false;
// Check if user selected right DB type.
if (!in_array($cfg->DB_SYSTEM, ['mysql'])) {
$cfg->emessage = 'Invalid database system. Must be: mysql ; Not: ' . $cfg->DB_SYSTEM;
$cfg->error = true;
} else {
// Connect to the SQL server.
try {
// HAS to be DB because settings table does not exist yet.
$pdo = new DB(
[
'checkVersion' => true,
'createDb' => true,
'dbhost' => $cfg->DB_HOST,
'dbname' => $cfg->DB_NAME,
'dbpass' => $cfg->DB_PASSWORD,
'dbport' => $cfg->DB_PORT,
'dbsock' => $cfg->DB_SOCKET,
'dbtype' => $cfg->DB_SYSTEM,
'dbuser' => $cfg->DB_USER,
]
);
$cfg->dbConnCheck = true;
} catch (\PDOException $e) {
$cfg->emessage = 'Unable to connect to the SQL server.';
$cfg->error = true;
$cfg->dbConnCheck = false;
} catch (\RuntimeException $e) {
switch ($e->getCode()) {
case 1:
case 2:
case 3:
$cfg->error = true;
$cfg->emessage = $e->getMessage();
break;
default:
var_dump($e);
throw new \RuntimeException($e->getMessage(), $e->getCode(), $e);
}
}
// Check if the MySQL version is correct.
$goodVersion = false;
if (!$cfg->error) {
try {
$goodVersion = $pdo->isDbVersionAtLeast(NN_MINIMUM_MYSQL_VERSION);
} catch (\PDOException $e) {
$goodVersion = false;
$cfg->error = true;
$cfg->emessage = 'Could not get version from SQL server.';
}
if ($goodVersion === false) {
$cfg->error = true;
$cfg->emessage =
'You are using an unsupported version of ' .
$cfg->DB_SYSTEM .
' the minimum allowed version is ' .
NN_MINIMUM_MYSQL_VERSION;
}
}
}
// Start inserting data into the DB.
if (!$cfg->error) {
$cfg->setSession();
$DbSetup = new \nntmux\db\DbUpdate(
[
'backup' => false,
'db' => $pdo,
]
);
try {
$DbSetup->processSQLFile(); // Setup default schema
$DbSetup->processSQLFile( // Process any custom stuff.
[
'filepath' => NN_RES . 'db' . DS . 'schema' . DS . 'mysql-data.sql'
]
);
$DbSetup->loadTables(); // Load default data files
} catch (\PDOException $err) {
$cfg->error = true;
$cfg->emessage = "Error inserting: (" . $err->getMessage() . ")";
}
if (!$cfg->error) {
// Check one of the standard tables was created and has data.
$dbInstallWorked = false;
$reschk = $pdo->query("SELECT COUNT(id) AS num FROM tmux");
if ($reschk === false) {
$cfg->dbCreateCheck = false;
$cfg->error = true;
$cfg->emessage = 'Could not select data from your database, check that tables and data are properly created/inserted.';
} else {
foreach ($reschk as $row) {
if ($row['num'] > 0) {
$dbInstallWorked = true;
break;
}
}
}
$ver = new Versions();
$patch = $ver->getSQLPatchFromFile();
if ($dbInstallWorked) {
if ($patch > 0) {
$updateSettings = $pdo->exec(
"UPDATE settings SET value = '$patch' WHERE section = '' AND subsection = '' AND name = 'sqlpatch'"
);
} else {
$updateSettings = false;
}
// If it all worked, move to the next page.
if ($updateSettings) {
header("Location: ?success");
if (file_exists($cfg->DB_DIR . '/post_install.php')) {
exec("php " . $cfg->DB_DIR . "/post_install.php ${pdo}");
}
exit();
} else {
$cfg->error = true;
$cfg->emessage = "Could not update sqlpatch to '$patch' for your database.";
}
} else {
$cfg->dbCreateCheck = false;
$cfg->error = true;
$cfg->emessage = 'Could not select data from your database.';
}
}
}
}
$page->smarty->assign('cfg', $cfg);
$page->smarty->assign('page', $page);
$page->content = $page->smarty->fetch('step2.tpl');
$page->render();
-80
View File
@@ -1,80 +0,0 @@
<?php
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nntmux\Install;
$page = new InstallPage();
$page->title = "OpenSSL Setup";
$cfg = new Install();
if (!$cfg->isInitialized()) {
header("Location: index.php");
die();
}
$cfg = $cfg->getSession();
if ($page->isPostBack()) {
$cfg->doCheck = true;
$cfg->NN_SSL_CAFILE = trim($_POST['cafile']);
$cfg->NN_SSL_CAPATH = trim($_POST['capath']);
$cfg->NN_SSL_VERIFY_PEER = (isset($_POST['verifypeer']) ? (trim($_POST['verifypeer']) == '1' ? true : false) : false);
$cfg->NN_SSL_VERIFY_HOST = (isset($_POST['verifyhost']) ? (trim($_POST['verifyhost']) == '1' ? true : false) : false);
$cfg->NN_SSL_ALLOW_SELF_SIGNED = (isset($_POST['allowselfsigned']) ? (trim($_POST['allowselfsigned']) == '1' ? true : false) : false);
// If the user doesn't want to verify peer, disable everything.
if (!$cfg->NN_SSL_VERIFY_PEER) {
$cfg->NN_SSL_ALLOW_SELF_SIGNED = true;
$cfg->NN_SSL_VERIFY_HOST = false;
$cfg->NN_SSL_CAFILE = $cfg->NN_SSL_CAPATH = '';
}
// If both paths are empty, disable everything.
if (!$cfg->NN_SSL_CAPATH && !$cfg->NN_SSL_CAFILE) {
$cfg->NN_SSL_VERIFY_PEER = $cfg->NN_SSL_VERIFY_HOST = false;
$cfg->NN_SSL_ALLOW_SELF_SIGNED = true;
$cfg->NN_SSL_CAFILE = $cfg->NN_SSL_CAPATH = '';
}
// Make sure the files and all paths are readable.
if ($cfg->NN_SSL_CAFILE != '') {
if (!checkPathsReadable($cfg->NN_SSL_CAFILE)) {
$cfg->error = 'Invalid ca file path or it is not readable or the folders up to it are not readable.';
} else if (1) {
}
}
if ($cfg->NN_SSL_CAPATH != '' && !checkPathsReadable($cfg->NN_SSL_CAPATH)) {
$cfg->error = 'Invalid ca folder path or it is not readable or the folders up to it are not readable.';
}
if (!$cfg->error) {
$cfg->setSession();
header("Location: ?success");
die();
}
}
$page->smarty->assign('cfg', $cfg);
$page->smarty->assign('page', $page);
$page->content = $page->smarty->fetch('step3.tpl');
$page->render();
function checkPathsReadable($location)
{
$paths = preg_split('#\/#', $location);
$directory = '';
if ($paths && count($paths)) {
foreach ($paths as $path) {
$directory .= DS . $path;
if (!is_readable($directory)) {
return false;
}
}
return true;
}
return false;
}
-68
View File
@@ -1,68 +0,0 @@
<?php
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nntmux\Install;
$page = new InstallPage();
$page->title = "News Server Setup";
$cfg = new Install();
if (!$cfg->isInitialized()) {
header("Location: index.php");
die();
}
$cfg = $cfg->getSession();
if ($page->isPostBack()) {
$cfg->doCheck = true;
$cfg->NNTP_SERVER = trim($_POST['server']);
$cfg->NNTP_USERNAME = trim($_POST['user']);
$cfg->NNTP_PASSWORD = trim($_POST['pass']);
$cfg->NNTP_PORT = (trim($_POST['port']) == '') ? 119 : trim($_POST['port']);
$cfg->NNTP_SSLENABLED = (isset($_POST['ssl']) ? (trim($_POST['ssl']) == '1' ? true : false) : false);
$cfg->NNTP_SOCKET_TIMEOUT = (is_numeric(trim($_POST['socket_timeout'])) ? (int)trim($_POST['socket_timeout']) : 120);
$cfg->NNTP_SERVER_A = trim($_POST['servera']);
$cfg->NNTP_USERNAME_A = trim($_POST['usera']);
$cfg->NNTP_PASSWORD_A = trim($_POST['passa']);
$cfg->NNTP_PORT_A = (trim($_POST['porta']) == '') ? 119 : trim($_POST['porta']);
$cfg->NNTP_SSLENABLED_A = (isset($_POST['ssla']) ? (trim($_POST['ssla']) == '1' ? true : false) : false);
$cfg->NNTP_SOCKET_TIMEOUT_A = (is_numeric(trim($_POST['socket_timeouta'])) ? (int)trim($_POST['socket_timeouta']) : 120);
$test = new Net_NNTP_Client();
$pear_obj = new PEAR();
$enc = false;
if ($cfg->NNTP_SSLENABLED) {
$enc = "tls";
}
// test connection
$cfg->nntpCheck = $test->connect($cfg->NNTP_SERVER, $enc, $cfg->NNTP_PORT);
if ($pear_obj->isError($cfg->nntpCheck)) {
$cfg->nntpCheck->message = 'Connection error, check your server name, port and SSL: (' . $cfg->nntpCheck->getMessage() . ')';
$cfg->error = true;
} else if ($cfg->NNTP_USERNAME != '' && $cfg->NNTP_PASSWORD != '') {
//test authentication if username and password are provided
$cfg->nntpCheck = $test->authenticate($cfg->NNTP_USERNAME, $cfg->NNTP_PASSWORD);
if ($pear_obj->isError($cfg->nntpCheck)) {
$cfg->nntpCheck->message = 'Authentication error, check your username and password: (' . $cfg->nntpCheck->getMessage() . ')';
$cfg->error = true;
}
}
if (!$cfg->error) {
$cfg->setSession();
header("Location: ?success");
die();
}
}
$page->smarty->assign('cfg', $cfg);
$page->smarty->assign('page', $page);
$page->content = $page->smarty->fetch('step4.tpl');
$page->render();
-36
View File
@@ -1,36 +0,0 @@
<?php
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nntmux\Install;
$page = new InstallPage();
$page->title = "Save Settings";
$cfg = new Install();
if (!$cfg->isInitialized()) {
header("Location: index.php");
die();
}
$cfg = $cfg->getSession();
$cfg->saveConfigCheck = $cfg->saveConfig();
if ($cfg->saveConfigCheck === false) {
$cfg->error = true;
}
$cfg->saveLockCheck = $cfg->saveInstallLock();
if ($cfg->saveLockCheck === false) {
$cfg->error = true;
}
if (!$cfg->error) {
$cfg->setSession();
}
$page->smarty->assign('cfg', $cfg);
$page->smarty->assign('page', $page);
$page->content = $page->smarty->fetch('step5.tpl');
$page->render();
-98
View File
@@ -1,98 +0,0 @@
<?php
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nntmux\Install;
use nntmux\Users;
$page = new InstallPage();
$page->title = "Setup Admin User";
$cfg = new Install();
if (!$cfg->isInitialized()) {
header("Location: index.php");
die();
}
$cfg = $cfg->getSession();
if ($page->isPostBack()) {
$cfg->doCheck = true;
$cfg->ADMIN_USER = trim($_POST['user']);
$cfg->ADMIN_PASS = trim($_POST['pass']);
$cfg->ADMIN_EMAIL = trim($_POST['email']);
if ($cfg->ADMIN_USER == '' || $cfg->ADMIN_PASS == '' || $cfg->ADMIN_EMAIL == '') {
$cfg->error = true;
} else {
switch (DB_SYSTEM) {
case 'mysql':
$adapter = 'MySql';
break;
case 'pgsql':
$adapter = 'PostgreSql';
break;
default:
break;
}
if (isset($adapter)) {
if (empty(DB_SOCKET)) {
$host = empty(DB_PORT) ? DB_HOST : DB_HOST . ':' . DB_PORT;
} else {
$host = DB_SOCKET;
}
lithium\data\Connections::add('default',
[
'type' => 'database',
'adapter' => $adapter,
'host' => $host,
'login' => DB_USER,
'password' => DB_PASSWORD,
'database' => DB_NAME,
'encoding' => 'UTF-8',
'persistent' => false,
]
);
}
$user = new Users();
if (!$user->isValidUsername($cfg->ADMIN_USER)) {
$cfg->error = true;
$cfg->ADMIN_USER = '';
} else {
$usrCheck = $user->getByUsername($cfg->ADMIN_USER);
if ($usrCheck) {
$cfg->error = true;
$cfg->ADMIN_USER = '';
}
}
if (!$user->isValidEmail($cfg->ADMIN_EMAIL)) {
$cfg->error = true;
$cfg->ADMIN_EMAIL = '';
}
if (!$cfg->error) {
$cfg->adminCheck = $user->add($cfg->ADMIN_USER, $cfg->ADMIN_PASS, $cfg->ADMIN_EMAIL, 2, '', '');
if (!is_numeric($cfg->adminCheck)) {
$cfg->error = true;
} else {
$user->login($cfg->adminCheck, "", 1);
}
}
}
if (!$cfg->error) {
$cfg->setSession();
header("Location: ?success");
die();
}
}
$page->smarty->assign('cfg', $cfg);
$page->smarty->assign('page', $page);
$page->content = $page->smarty->fetch('step6.tpl');
$page->render();
-113
View File
@@ -1,113 +0,0 @@
<?php
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nntmux\Install;
use nntmux\db\DB;
$page = new InstallPage();
if (!isset($_REQUEST["success"])) {
$page->title = "File Paths";
}
$cfg = new Install();
if (!$cfg->isInitialized()) {
header("Location: index.php");
die();
}
$cfg = $cfg->getSession();
if ($page->isPostBack()) {
$cfg->doCheck = true;
$cfg->NZB_PATH = trim($_POST['nzbpath']);
$cfg->COVERS_PATH = trim($_POST['coverspath']);
$cfg->UNRAR_PATH = trim($_POST['tmpunrarpath']);
if (extension_loaded('posix') && strtolower(substr(PHP_OS, 0, 3)) !== 'win') {
$group = posix_getgrgid(posix_getgid());
$fixString = '<br /><br />Another solution is to run:<br />chown -R YourUnixUserName:' . $group['name'] . ' ' . NN_ROOT .
'<br />Then give your user access to the group:<br />usermod -a -G ' . $group['name'] . ' YourUnixUserName' .
'<br />Finally give read/write access to your user/group:<br />chmod -R 774 ' . NN_ROOT;
$page->smarty->assign('fixString', $fixString);
}
if ($cfg->NZB_PATH == '') {
$cfg->error = true;
} else {
$cfg->nzbPathCheck = is_writable($cfg->NZB_PATH);
if ($cfg->nzbPathCheck === false) {
$cfg->error = true;
}
$lastchar = substr($cfg->NZB_PATH, strlen($cfg->NZB_PATH) - 1);
if ($lastchar != "/") {
$cfg->NZB_PATH = $cfg->NZB_PATH . "/";
}
}
if ($cfg->UNRAR_PATH == '') {
$cfg->error = true;
} else {
$cfg->unrarPathCheck = is_writable($cfg->NZB_PATH);
if ($cfg->unrarPathCheck === false) {
$cfg->error = true;
}
$lastchar = substr($cfg->UNRAR_PATH, strlen($cfg->UNRAR_PATH) - 1);
if ($lastchar != "/") {
$cfg->UNRAR_PATH = $cfg->UNRAR_PATH . "/";
}
}
/*
if ($cfg->COVERS_PATH == '') {
$cfg->error = true;
} else {
\nntmux\utility\Misc::trailingSlash($cfg->COVERS_PATH);
$cfg->coverPathCheck = is_writable($cfg->COVERS_PATH);
if ($cfg->coverPathCheck === false) {
$cfg->error = true;
}
}
*/
if (!$cfg->error) {
if (!file_exists($cfg->UNRAR_PATH)) {
mkdir($cfg->UNRAR_PATH);
}
$pdo = new DB();
$sql1 = sprintf("UPDATE settings SET value = %s WHERE setting = 'nzbpath'", $pdo->escapeString($cfg->NZB_PATH));
$sql2 = sprintf("UPDATE settings SET value = %s WHERE setting = 'tmpunrarpath'", $pdo->escapeString($cfg->UNRAR_PATH));
$sql3 = sprintf("UPDATE settings SET value = %s WHERE setting = 'coverspath'", $pdo->escapeString($cfg->COVERS_PATH));
if ($pdo->queryExec($sql1) === false || $pdo->queryExec($sql2) === false || $pdo->queryExec($sql3) === false) {
$cfg->error = true;
}
if ($cfg->error !== true) {
if ($cfg->COVERS_PATH != NN_WWW . 'covers' . DS) {
// TODO clean up old covers location if 'empty' (i.e. only contains the versioned files).
}
if ($cfg->NZB_PATH != NN_ROOT . 'nzbfiles' . DS) {
// TODO clean up old nzbfiles location if 'empty' (i.e. only contains the versioned files).
}
}
}
if (!$cfg->error) {
$cfg->setSession();
header("Location: ?success");
die();
}
}
$page->smarty->assign('cfg', $cfg);
$page->smarty->assign('page', $page);
$page->content = $page->smarty->fetch('step7.tpl');
$page->render();
-46
View File
@@ -1,46 +0,0 @@
/*
site wide html styles
*/
body { margin: 0; padding: 0; background: #FFFFFF url(../../themes/shared/images/menu.gif) repeat-x; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 14px; color: #515151; }
input, select, textarea { font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 14px;}
a { text-decoration: none; color: blue; }
h1, h2, h3 { margin: 0; font-weight: normal; color: #485459; }
li { padding-top:10px; }
textarea { font-family: Arial, Helvetica, sans-serif; height:100px; width:300px;}
h1 { font-size: 3.0em; padding-bottom:10px;}
h2 { font-size: 2.0em; padding-bottom:10px;}
input[type=text], input[type=password], textarea, select { background: #fff; background: -webkit-gradient(linear, left top, left 25, from(#fff), color-stop(4%, #f0f0f0), to(#fff)); border: 1px solid #ccc; border-bottom-color: #999; border-right-color: #999; margin: 0; padding: 4px; color: #444; font-size: 100%; outline: none; width: 97%; }
/*
page layout
*/
#logo { margin-left: 200px; margin-top: 30px; margin-bottom: 30px; }
.content { border: 1px solid #515151; width: 35%; padding: 30px; margin-left: auto; margin-right: auto; background: #FFF; border:1px solid #EEE; -moz-box-shadow: 3px 6px 8px -4px #777; -webkit-box-shadow: 3px 6px 8px -4px #777; box-shadow: 3px 6px 8px -4px #777; }
.footer { font-size: 10px; text-align: center; }
/*
install warning message
*/
div.error { color: red; padding: 20px; }
span.error { color: red; }
span.warn { color: orange; }
span.success { color: green; }
/*
lists
*/
table.data { border-collapse:collapse; }
table.data th { text-align:left; vertical-align:top; background-color:#DDD; border-color: #AAA; border-width: 1px; border-style: solid; padding:3px; font-style:bolder; text-transform:capitalize;}
table.data td { white-space:normal; vertical-align:top; padding:5px; border-color: #AAA; border-width: 1px; border-style: solid; }
table.data td.less { color: #888; font-size: 0.8em; white-space:nowrap; }
table.data td.icons { white-space:nowrap; padding-left:0px; padding-right:0px; width:60px; }
table.highlight tr:hover td { background-color: #E1F0D9; }
table tr.alt { background-color: #EEE; }
table.data em {font-weight:bolder; color:red;}
div.hint, div.hint a {font-size:0.9em; font-style:italic; color:#999;}
div.hint { margin-bottom:10px;}
input.long {width:400px; }
input.short { width:40px; }
input.date { width:70px; }
-21
View File
@@ -1,21 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>{$page->title}</title>
<link href="./templates/install.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="shortcut icon" type="image/ico" href="../themes/shared/images/favicon.ico"/>
{$page->head}
</head>
<body>
<h1 id="logo"><img alt="NNTmux" src="../themes/shared/images/logo.png" /></h1>
<div class="content">
<h2>{$page->title}</h2>
{$page->content}
<div class="footer">
<p>NNTmux is released under GPL.</p>
</div>
</div>
</body>
</html>
-254
View File
@@ -1,254 +0,0 @@
<table width="100%" border="0" style="margin-top:10px;" class="data highlight">
<tr>
<th>check</th>
<th style="width:75px;">status</th>
</tr>
<tr class="alt">
<td>Checking for iconv support:{if !$cfg->iconvCheck}<br /><span class="error">The PHP installation lacks support for iconv.</span>{/if}</td>
<td>{if $cfg->iconvCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking for Curl support:{if !$cfg->curlCheck}<br /><span class="error">The PHP installation lacks support for curl.</span>{/if}</td>
<td>{if $cfg->curlCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking for sha1():{if !$cfg->sha1Check}<br /><span class="error">The PHP installation lacks support for sha1.</span>{/if}</td>
<td>{if $cfg->sha1Check}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking for crypt():{if !$cfg->cryptCheck}<br /><span class="error">The PHP installation lacks support for crypt.</span>{/if}</td>
<td>{if $cfg->sha1Check}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking PHP's version:{if !$cfg->phpCheck}<br /><span class="error">Your PHP version is lower than recommended ({$cfg->minPhpVersion}). You may encounter errors if you proceed.</span>{/if}</td>
<td>{if $cfg->phpCheck}<span class="success">OK</span>{else}<span class="error">Warning</span>{/if}</td>
</tr>
<tr class="">
<td>Checking for Pear:{if !$cfg->pearCheck}<br /><span class="error">Cannot find PEAR. To install PEAR follow the instructions at <a href="http://pear.php.net/manual/en/installation.php" target="_blank">http://pear.php.net/manual/en/installation.php</a></span>{/if}</td>
<td>{if $cfg->pearCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking PHP PDO extension:{if !$cfg->PDOCheck}<br /><span class="error">The PHP installation lacks support for PDO.</span>{/if}</td>
<td>{if $cfg->PDOCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking PHP GD extension:{if !$cfg->gdCheck}<br /><span class="warn">The PHP installation lacks support for GD.</span>{/if}</td>
<td>{if $cfg->gdCheck}<span class="success">OK</span>{else}<span class="warn">Warning</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking PHP OpenSSL Extension:{if !$cfg->opensslCheck}<br /><span class="warn">Your PHP installation does not have the openssl extension loaded. SSL Usenet connections will fail.</span>{/if}</td>
<td>{if $cfg->opensslCheck}<span class="success">OK</span>{else}<span class="warn">Warning</span>{/if}</td>
</tr>
<tr class="">
<td>Checking PHP EXIF Extension:{if !$cfg->exifCheck}<br /><span class="warn">Your PHP installation does not have the exif extension loaded. It is required for NFO checking and various other functions.</span>{/if}</td>
<td>{if $cfg->exifCheck}<span class="success">OK</span>{else}<span class="warn">Warning</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking PHP json extension:{if !$cfg->jsonCheck}<br /><span class="error">The PHP installation lacks support for json.</span>{/if}</td>
<td>{if $cfg->jsonCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking PHP date.timezone:{if !$cfg->timezoneCheck}<br /><span class="warn">You have no default timezone set in php.ini. e.g date.timezone = America/New_York</span>{/if}</td>
<td>{if $cfg->timezoneCheck}<span class="success">OK</span>{else}<span class="warn">Warning</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking PHP max_execution_time:{if !$cfg->timelimitCheck}<br /><span class="warn">Your PHP installation's max_execution_time setting is low, please consider increasing it >= 120</span>{/if}</td>
<td>{if $cfg->timelimitCheck}<span class="success">OK</span>{else}<span class="warn">Warning</span>{/if}</td>
</tr>
<tr class="">
<td>Checking PHP memory_limit:{if !$cfg->memlimitCheck}<br /><span class="warn">Your PHP installation's memory_limit setting is low, please consider increasing it >= 1024M.</span>{/if}</td>
<td>{if $cfg->memlimitCheck}<span class="success">OK</span>{else}<span class="warn">Warning</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking if the Smarty compile dir is writable:
{if !$cfg->cacheCheck}<br />
<span class="error">
The template compile dir must be writable.<br /><br />
A quick solution is to run:<br />
chmod 777 {$cfg->SMARTY_COMPILED_TEMPLATES}
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->cacheCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking if the anime covers dir is writable:
{if !$cfg->animeCoversCheck}<br />
<span class="error">
The covers/anime dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}anime
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->animeCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking if the audio covers dir is writable:
{if !$cfg->audioCoversCheck}<br />
<span class="error">
The covers/audio dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}audio
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->audioCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking if the audio sample dir is writable:
{if !$cfg->audiosampleCoversCheck}<br />
<span class="error">
The covers/audiosample dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}audiosample
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->audiosampleCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking if the book covers dir is writable:
{if !$cfg->bookCoversCheck}<br />
<span class="error">
The covers/book dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}book
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->bookCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking if the console covers dir is writable:
{if !$cfg->consoleCoversCheck}<br />
<span class="error">
The covers/console dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}console
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->consoleCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking if the movie covers dir is writable:
{if !$cfg->movieCoversCheck}<br />
<span class="error">
The covers/movies dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}movies
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->movieCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking if the music covers dir is writable:
{if !$cfg->musicCoversCheck}<br />
<span class="error">
The covers/music dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}music
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->musicCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking if the preview picture dir is writable:
{if !$cfg->previewCoversCheck}<br />
<span class="error">
The covers/preview dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}preview
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->previewCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking if the sample picture dir is writable:
{if !$cfg->sampleCoversCheck}<br />
<span class="error">
The covers/sample dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}sample
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->sampleCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking if the video sample dir is writable:
{if !$cfg->videoCoversCheck}<br />
<span class="error">
The covers/video dir must be writable.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->COVERS_PATH}video
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->videoCoversCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking if the config.php file is writable:
{if !$cfg->configCheck}<br />
<span class="error">
The installer cannot write to {$cfg->CONFIG_PATH}.<br />A quick solution is to run:<br />chmod 777 {$cfg->CONFIG_PATH}
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->configCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
<td>Checking if the install.lock file is writable:
{if !$cfg->lockCheck}<br />
<span class="error">
The installer cannot write to {$cfg->INSTALL_DIR}/install.lock.<br />
A quick solution is to run:<br />
chmod 777 {$cfg->INSTALL_DIR}
{$fixString}
</span>
{/if}
</td>
<td>{if $cfg->lockCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="">
<td>Checking for schema files:{if !$cfg->schemaCheck}<br /><span class="error">One or all of the schema files are missing, please make sure they are placed placed in: {$cfg->DB_DIR}/</span>{/if}</td>
<td>{if $cfg->schemaCheck}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
<tr class="alt">
{if $smarty.server.SERVER_SOFTWARE|truncate:8:"" == 'lighttpd'}
<td>Instructions for Lighttpd's mod_rewrite:<br /><span class="warn">It is not possible for me to check you have enabled this properly! YOU will need to ensure that "mod_rewrite" is included in server.modules, check lighttpd for this, also ensure the rewrite rules are installed for your host. See misc/urlrewriting/lighttpd.txt for examples.</span></td>
<td><span class="warn">Warning</span></td>
{else}
<td>Checking for Apache's mod_rewrite:{if !$cfg->rewriteCheck}<br /><span class="warn">The Apache module mod_rewrite is not loaded. This module is required, please enable it if you are running Apache</span>{/if}</td>
<td>{if $cfg->rewriteCheck}<span class="success">OK</span>{else}<span class="warn">Warning</span>{/if}</td>
{/if}
</tr>
<tr class="">
<td>Checking PHP sessions path permissions:{if !$cfg->sessionsPathPermissions}<br /><span class="error">The PHP sessions path ({$sessionsSavePath}) does not have read or write access.</span>{/if}</td>
<td>{if $cfg->sessionsPathPermissions}<span class="success">OK</span>{else}<span class="error">Error</span>{/if}</td>
</tr>
</table>
<div style="text-align:center">
{if !$cfg->error}
<p>No problems were found and you are ready to install.</p>
<form action="step2.php"><input type="submit" value="Step two: Set up the database" /></form>
{else}
<div class="error">Errors encountered - NNtmux will not function correctly unless these problems are solved.</div>
{/if}
</div>
-78
View File
@@ -1,78 +0,0 @@
{if $page->isSuccess()}
<div style="align=center">
<p style="text-align:center">The database setup is correct, you may continue to the next step.</p>
<form action="step3.php">
<div style="padding-top:20px; text-align:center;">
<input align="center" type="submit" value="Step three: Setup openssl" />
</div>
</form>
</div>
{else}
<p>This page will attempt to use your database information provided below to connect to the database and create the required tables and initial data.</p>
<ul>Notes:
<li>If your database already exists, <span style="text-decoration:underline">it will be overwritten</span> with this version. If not it will be created.</li>
<li>For the database system, use mysql. In the future other database systems might be supported.</li>
<li>The default MySQL port is 3306, you can find this in my.cnf</li>
<li>It is recommended to use the Socket path if you are using a unix based operating system, you can find the socket path in my.cnf</li>
<li>Entering the Socket path will ignore the Hostname and Port.</li>
<li>Using the root MySQL user is not recommended. Please create a MySQL user, read <a href="https://dev.mysql.com/doc/refman/5.6/en/adding-users.html">this</a> manual page for information.</li>
<li>Granting the FILE permission to your user is <span style="text-decoration:underline">required</span>, GRANT ALL does not give you the FILE permission.</li>
<li>It is recommended to secure your MySQL installation, please read <a href="https://dev.mysql.com/doc/refman/5.6/en/mysql-secure-installation.html">this</a> page.</li>
</ul>
<form action="?" method="post">
<div style="padding-top:20px; text-align:center;">
{if $cfg->error}
<div>
The following error(s) were encountered:<br />
{if $cfg->dbConnCheck === false}
<span class="error">&bull; Unable to connect to database:<br />{$cfg->emessage}</span><br />
{elseif $cfg->dbNameCheck === false}
<span class="error">&bull; Unable to select database:<br />{$cfg->emessage}</span><br />
{elseif $cfg->dbCreateCheck === false}
<span class="error">&bull; Unable to create database and data. Check permissions of your mysql user.</span><br />
{else}
<span class="error">{$cfg->emessage}</span><br />
{/if}
<br />
</div>
{/if}
</div>
<table border="0" style="margin-top:10px;width=100%" class="data highlight" align="center">
<tr class="">
<td><label for="host">Database System (type in mysql):</label></td>
<td><input type="text" name="db_system" id="db_system" value="{$cfg->DB_SYSTEM}" /></td>
</tr>
<tr class="alt">
<td><label for="host">Hostname:</label></td>
<td><input type="text" name="host" id="host" value="{$cfg->DB_HOST}" /></td>
</tr>
<tr class="">
<td><label for="sql_port">Port Number:</label></td>
<td><input type="text" name="sql_port" id="sql_port" value="{$cfg->DB_PORT}" /></td>
</tr>
<tr class="alt">
<td><label for="sql_socket">Socket Path(optional):</label></td>
<td><input type="text" name="sql_socket" id="sql_socket" value="{$cfg->DB_SOCKET}" /></td>
</tr>
<tr class="">
<td><label for="user">Username:</label></td>
<td><input type="text" name="user" id="user" value="{$cfg->DB_USER}" /></td>
</tr>
<tr class="alt">
<td><label for="pass">Password:</label></td>
<td><input type="text" name="pass" id="pass" value="{$cfg->DB_PASSWORD}" /></td>
</tr>
<tr class="">
<td><label for="db">Database (to connect to):</label></td>
<td><input type="text" name="db" id="db" value="{$cfg->DB_NAME}" /></td>
</tr>
</table>
<div style="padding-top:20px; text-align:center;">
<input type="submit" value="Setup Database" />
</div>
</form>
{/if}
-82
View File
@@ -1,82 +0,0 @@
{if $page->isSuccess()}
<div style="align=center">
<p style="text-align:center">The openssl setup looks correct, you may continue to the next step.</p>
<form action="step4.php">
<div style="padding-top:20px; text-align:center;">
<input type="submit" value="Step four: Setup news server connection" />
</div>
</form>
</div>
{else}
<form action="?" method="post">
<p>An openssl CA bundle file is recommended to verify the authenticity of remote certificates when connecting to various servers using TLS/SSL.</p>
<ul>
<li>If you do not have a CA bundle, you can download one <a href="http://curl.haxx.se/docs/caextract.html">here</a>.</li>
<li>You can place the CA bundle in the /etc/ssl/certs/ folder if you are on linux.</li>
<li>The file must be readable by both your web user and your CLI user running scripts.</li>
</ul>
<table border="0" style="width:100%;margin-top:10px;" class="data highlight">
<tr class="">
<td><label for="cafile">CA Bundle Path(Optional):</label></td>
<td>
<input type="text" name="cafile" id="cafile" value="{$cfg->NN_SSL_CAFILE}" />
<div>
Location of Certificate Authority file on local filesystem which will be used if the Verify Peer option is enabled to authenticate the identity of the remote peer.
<br />Example: /etc/ssl/certs/cacert.pem
</div>
</td>
</tr>
<tr class="alt">
<td><label for="capath">Certificate Folder(Optional):</label></td>
<td>
<input type="text" name="capath" id="capath" value="{$cfg->NN_SSL_CAPATH}" />
<div>
If the ca bundle cert file is not specified or if the certificate is not found there, you can specify a directory here which will be searched for a suitable certificate.
<br />Example: /etc/ssl/certs/</div>
</td>
</tr>
<tr class="">
<td><label for="verifypeer">Verify peer:</label></td>
<td>
<input type="checkbox" name="verifypeer" id="verifypeer" value="1" {if $cfg->NN_SSL_VERIFY_PEER=="true"}checked="checked"{/if} />
<div>
Enabling this requires the ca bundle cert file path to be set.<br />
Disabling this will disable TLS/SSL remote certificate verification which is not recommended.
</div>
</td>
</tr>
<tr class="alt">
<td><label for="verifyhost">Verify host:</label></td>
<td>
<input type="checkbox" name="verifyhost" id="verifyhost" value="1" {if $cfg->NN_SSL_VERIFY_HOST=="true"}checked="checked"{/if} />
<div>
This makes sure the host is who they say they are.<br />
See <a href="http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html">this</a> link for detailed info.<br />
You might need to disable this as some providers are using the wrong CN in their certs (probably because they are cheap and re-using a cert and rely on people disabling host verification or lack knowledge).<br />
Note that disabling this is a security risk and you should consider getting a usenet provider that has a proper certificate.
</div>
</td>
</tr>
<tr class="">
<td><label for="allowselfsigned">Allow self signed certificates:</label></td>
<td>
<input type="checkbox" name="allowselfsigned" id="allowselfsigned" value="1" {if $cfg->NN_SSL_ALLOW_SELF_SIGNED=="true"}checked="checked"{/if} />
<div>
Enabling this will not verify self-signed openssl certificates.<br />
Note that you will require non self-signed certificates for sabnzbd/nzbget/etc if you disable this.
</div>
</td>
</tr>
</table>
<div style="padding-top:20px; text-align:center;">
{if $cfg->error}
<div>
The following error was encountered:<br />
<span class="error">&bull; {$cfg->error}</span><br /><br /><br />
</div>
{/if}
<input type="submit" value="Verify openssl settings" />
</div>
</form>
{/if}
-98
View File
@@ -1,98 +0,0 @@
{if $page->isSuccess()}
<div style="text-align:center">
<p>The news server setup is correct, you may continue to the next step.</p>
<form action="step5.php"><input type="submit" value="Step five: Save Settings" /></form>
</div>
{else}
<form action="?" method="post">
<p>If you have a primary news server (NNTP), please provide the following information (make sure the information is correct, some servers do not check if the password is good):</p>
<table border="0" style="width:100%;margin-top:10px;" class="data highlight">
<tr class="">
<td><label for="server">Server:</label></td>
<td>
<input type="text" name="server" id="server" value="{$cfg->NNTP_SERVER}" />
<div class="hint">e.g. eu.news.astraweb.com</div>
</td>
</tr>
<tr class="alt">
<td><label for="user">Username:</label></td>
<td><input type="text" name="user" id="user" value="{$cfg->NNTP_USERNAME}" /></td>
</tr>
<tr class="">
<td><label for="pass">Password:</label></td>
<td>
<input type="text" name="pass" id="pass" value="{$cfg->NNTP_PASSWORD}" />
</td>
</tr>
<tr class="alt">
<td><label for="port">Port:</label></td>
<td>
<input type="text" name="port" id="port" value="{$cfg->NNTP_PORT}" />
<div class="hint">e.g. 119 or 443,563 for SSL</div>
</td>
</tr>
<tr>
<td><label for="ssl">SSL?:</label></td>
<td>
<input type="checkbox" name="ssl" id="ssl" value="1" {if $cfg->NNTP_SSLENABLED=="true"}checked="checked"{/if} />
</td>
</tr>
<tr class="alt">
<td><label for="socket_timeout">Socket Timeout:</label></td>
<td>
<input type="text" name="socket_timeout" id="socket_timeout" value="{$cfg->NNTP_SOCKET_TIMEOUT}" />
<div class="hint">Seconds to time out when we lost connection to usenet. Default is 120 seconds.</div>
</td>
</tr>
</table>
<p>(optional) If you have an alternate news server (NNTP), please provide the following information (make sure the information is correct, some servers do not check if the password is good):</p>
<table border="0" style="width:100%;margin-top:10px;" class="data highlight">
<tr class="">
<td><label for="servera">Server:</label></td>
<td>
<input type="text" name="servera" id="servera" value="{$cfg->NNTP_SERVER_A}" />
<div class="hint">e.g. eu.news.astraweb.com</div>
</td>
</tr>
<tr class="alt">
<td><label for="usera">Username:</label></td>
<td><input type="text" name="usera" id="usera" value="{$cfg->NNTP_USERNAME_A}" /></td>
</tr>
<tr class="">
<td><label for="passa">Password:</label></td>
<td>
<input type="text" name="passa" id="passa" value="{$cfg->NNTP_PASSWORD_A}" />
</td>
</tr>
<tr class="alt">
<td><label for="porta">Port:</label></td>
<td>
<input type="text" name="porta" id="porta" value="{$cfg->NNTP_PORT_A}" />
<div class="hint">e.g. 119 or 443,563 for SSL</div>
</td>
</tr>
<tr>
<td><label for="ssla">SSL?:</label></td>
<td>
<input type="checkbox" name="ssla" id="ssla" value="1" {if $cfg->NNTP_SSLENABLED_A=="true"}checked="checked"{/if} />
</td>
</tr>
<tr class="alt">
<td><label for="socket_timeouta">Socket Timeout:</label></td>
<td>
<input type="text" name="socket_timeouta" id="socket_timeouta" value="{$cfg->NNTP_SOCKET_TIMEOUT_A}" />
<div class="hint">Seconds to time out when we lost connection to usenet. Default is 120 seconds.</div>
</td>
</tr>
</table>
<div style="padding-top:20px; text-align:center;">
{if $cfg->error}
<div>
The following error was encountered:<br />
<span class="error">&bull; {$cfg->error}</span><br /><br /><br />
</div>
{/if}
<input type="submit" value="Test Primary Connection" />
</div>
</form>
{/if}
-17
View File
@@ -1,17 +0,0 @@
<div style="text-align:center">
{if !$cfg->error}
<p>The configuration file has been saved, you may continue to the next step.</p>
<form action="step6.php"><input type="submit" value="Step six: Setup admin user" /></form>
{else}
{if !$cfg->saveConfigCheck}
<h3><span class="error">Error saving {$cfg->NN_WWW}/config.php.</span></h3>
<p>Please save the config.php yourself by creating:<br /><b>{$cfg->NN_WWW}/config.php</b><br />and setting its contents to the following:</p>
<p><textarea cols="100" rows="60">{$cfg->COMPILED_CONFIG}</textarea></p>
{/if}
{if !$cfg->saveLockCheck}
<br />
<h3><span class="error">Error saving {$cfg->INSTALL_DIR}/install.lock</span></h3>
<p>Please save the install.lock yourself by creating:<br /><b>{$cfg->INSTALL_DIR}/install.lock</b></p>
{/if}
{/if}
</div>
-44
View File
@@ -1,44 +0,0 @@
{if $page->isSuccess()}
<div style="text-align:center">
<p>The admin user has been setup, you may continue to the next step.</p>
<form action="step7.php"><input type="submit" value="Step seven: Set file paths" /></form>
</div>
{else}
<p>This will set up an administrator account you can use to change site settings.</p>
<ul>
<li>The username must start with a letter followed by a letter or number, it must be 3 characters or longer.</li>
<li>The password must be at least 6 characters long.</li>
<li>The email address is used in case you forget your password.</li>
</ul>
<form action="?" method="post">
<table border="0" style="width:100%;margin-top:10px;" class="data highlight">
<tr class="alt">
<td><label for="user">Username:</label></td>
<td><input autocomplete="off" type="text" name="user" id="user" value="{$cfg->ADMIN_USER}" /></td>
</tr>
<tr class="">
<td><label for="pass">Password:</label></td>
<td><input autocomplete="off" type="text" name="pass" id="pass" value="{$cfg->ADMIN_PASS}" /></td>
</tr>
<tr class="alt">
<td><label for="email">Email:</label> </td>
<td><input autocomplete="off" type="text" name="email" id="email" value="{$cfg->ADMIN_EMAIL}" /></td>
</tr>
</table>
<div style="padding-top:20px; text-align:center;">
{if $cfg->error}
<div>
The following error(s) were encountered:<br />
{if $cfg->ADMIN_USER == ''}<span class="error">&bull; Invalid username</span><br />{/if}
{if $cfg->ADMIN_PASS == ''}<span class="error">&bull; Invalid password</span><br />{/if}
{if $cfg->ADMIN_EMAIL == ''}<span class="error">&bull; Invalid email</span><br />{/if}
<br />
</div>
{/if}
<input type="submit" value="Create Admin User" />
</div>
</form>
{/if}
-58
View File
@@ -1,58 +0,0 @@
{if $page->isSuccess()}
<div style="text-align:center">
<h1>Install Complete!</h1>
<br/>
<p>Continue to the <a href="../admin/">admin home page</a> to give your site a name and learn how to start indexing usenet.</p>
</div>
{else}
<p>You must accept or change these file paths. This is the location where your covers, NZB, and temporary files are stored:</p>
<form action="?" method="post">
<table border="0" style="width:100%;margin-top:10px;" class="data highlight">
<tr class="alt">
<td><label for="coverspath">Place to save Covers\Posters etc.:</label></td>
<td><input type="text" name="coverspath" value="{$cfg->COVERS_PATH}" size="70" /></td>
</tr>
<tr class="alt">
<td><label for="nzbpath">Place to create NZB files:</label></td>
<td><input type="text" name="nzbpath" value="{$cfg->NZB_PATH}" size="70" /></td>
</tr>
<tr class="alt">
<td><label for="tmpunrarpath">Place for unRARing/temp work:</label></td>
<td><input type="text" name="tmpunrarpath" value="{$cfg->UNRAR_PATH}" size="70" /></td>
</tr>
</table>
<div style="padding-top:20px; text-align:center;">
{if $cfg->error}
<div>
The following error was encountered:<br />
<hr>
{if !$cfg->nzbPathCheck}
<span class="error">
The installer cannot write to {$cfg->NZB_PATH}.<br />
A quick solution is to run:<br />
chmod -R 777 {$cfg->NZB_PATH}
{$fixString} {$cfg->NZB_PATH}
</span><br />
<hr>
{/if}
{if !$cfg->coverPathCheck}<br /><span class="error">The installer cannot write to {$cfg->COVERS_PATH}. A quick solution is to run:<br />chmod -R 777 {$cfg->COVERS_PATH}</span><br />{/if}
{if !$cfg->unrarPathCheck}
<span class="error">
The installer cannot write to {$cfg->UNRAR_PATH}.<br />
A quick solution is to run:<br />
chmod -R 777 {$cfg->UNRAR_PATH}
{$fixString} {$cfg->UNRAR_PATH}
</span><br />
<hr>
{/if}
<br />
</div>
{/if}
<input type="submit" value="Set file paths" />
</div>
</form>
{/if}