diff --git a/cli/verify_permissions.php b/cli/verify_permissions.php deleted file mode 100644 index ff3ecdcda..000000000 --- a/cli/verify_permissions.php +++ /dev/null @@ -1,127 +0,0 @@ - [R], - NN_LIBS.'smarty' => [R], - NN_LIBS.'smarty'.DS.'templates_c' => [R, W], - NN_RES => [R, W, E], - NN_RES.'db' => [R, E], - NN_RES.'db'.DS.'patches' => [R, E], - NN_RES.'nzb' => [R], - NN_LOGS => [R, W], - NN_TMP => [R, W], - NN_TMP.DS.'unrar' => [R, W, E], - NN_TMP.DS.'yEnc' => [R, W, E], - NN_VERSIONS => [R], -]; - -// Add nzb folders. -foreach ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f'] as $identifier) { - $nzbFolder = NN_RES.'nzb'.DS.$identifier.DS; - $folders[$nzbFolder] = [R, W]; -} - -// Add covers paths. -foreach (['anime', 'audio', 'audiosample', 'book', 'console', 'games', 'movies', 'music', 'preview', 'sample', 'tvrage', 'video', 'xxx', 'tvshow'] as $identifier) { - $nzbFolder = NN_RES.'covers'.DS.$identifier.DS; - $folders[$nzbFolder] = [R, W]; -} - -// Set up covers paths. -if (env('DB_PASSWORD') !== '') { - $ri = new ReleaseImage(); - - $folders[$ri->audSavePath] = [R, W]; - $folders[$ri->imgSavePath] = [R, W]; - $folders[$ri->jpgSavePath] = [R, W]; - $folders[$ri->movieImgSavePath] = [R, W]; - $folders[$ri->vidSavePath] = [R, W]; -} else { - echo 'Skipping cover folders check, as you have not set up a database yet. You can rerun this script after running install.'.PHP_EOL; -} - -// Check folders. -foreach ($folders as $folder => $check) { - exists($folder); - foreach ($check as $type) { - switch ($type) { - case R: - readable($folder); - break; - case W: - writable($folder); - break; - case E: - executable($folder); - break; - } - } -} - -echo 'Your permissions seem right for this user. Note, this script does not verify all paths, only the most important ones.'.PHP_EOL; - -if (! Utility::isWin()) { - $user = posix_getpwuid(posix_geteuid()); - if ($user['name'] !== 'www-data') { - echo 'If you have not already done so, please rerun this script using the www-data user: sudo -u www-data php verify_permissions.php yes'.PHP_EOL; - } -} - -function readable($folder) -{ - if (! is_readable($folder)) { - exit('Error: This path is not readable: ('.$folder.') resolve this and rerun the script.'.PHP_EOL); - } -} - -function writable($folder) -{ - if (! is_writable($folder)) { - exit('Error: This path is not writable: ('.$folder.') resolve this and rerun the script.'.PHP_EOL); - } -} - -function executable($folder) -{ - if (! is_executable($folder)) { - exit('Error: This path is not executable: ('.$folder.') resolve this and rerun the script.'.PHP_EOL); - } -} - -function exists($folder) -{ - if (! file_exists($folder)) { - exit('Error: This path ('.$folder.') does not exist or is not readable. Create it or make it readable.'.PHP_EOL); - } -} diff --git a/cli/versions.php b/cli/versions.php deleted file mode 100644 index f9dd6ff11..000000000 --- a/cli/versions.php +++ /dev/null @@ -1,52 +0,0 @@ -. - * @author niel - * @copyright 2014 nZEDb - */ -require_once realpath(dirname(__DIR__).DIRECTORY_SEPARATOR.'bootstrap.php'); - -use nntmux\utility\Utility; -use nntmux\utility\Versions; - -if (! Utility::isCLI()) { - exit; -} - -$vers = new Versions(); -if (isset($argc) && $argc > 1 && isset($argv[1]) && $argv[1] == true) { - echo $vers->out->header('Checking versions...'); - - if ($vers->checkAll()) { - $vers->save(); - } else { - echo "No changes detected.\n"; - output($vers); - } -} else { - $vers->checkAll(false); - echo "Version info in file:\n"; - output($vers); -} - -function output($vers) -{ - echo ' Commit: '.$vers->out->primary($vers->getCommit()); - echo 'SQL DB: '.$vers->out->primary($vers->getSQLPatchFromDb()); - echo 'SQL File: '.$vers->out->primary($vers->getSQLPatchFromFiles()); - echo ' Tag: '.$vers->out->primary($vers->getTagVersion()); -} diff --git a/composer.lock b/composer.lock index d62981e5f..597149d8b 100644 --- a/composer.lock +++ b/composer.lock @@ -139,7 +139,7 @@ } ], "description": "PHP Wrapper for Accessing the Steam Storefront API", - "time": "2017-08-27T15:14:06+00:00" + "time": "2017-08-27 15:14:06" }, { "name": "barracudanetworks/forkdaemon-php", @@ -1525,7 +1525,7 @@ } ], "description": "A PHP library that acts as a wrapper for the GiantBomb API.", - "time": "2017-05-29T12:05:57+00:00" + "time": "2017-05-29 12:05:57" }, { "name": "dnoegel/php-xdg-base-dir", @@ -2685,7 +2685,7 @@ } ], "description": "TVMaze-API-Wrapper", - "time": "2016-05-04T01:31:56+00:00" + "time": "2016-05-04 01:31:56" }, { "name": "kevinrob/guzzle-cache-middleware", @@ -3292,7 +3292,7 @@ "support": { "source": "https://github.com/nZEDb/Git.php/tree/master" }, - "time": "2016-10-30T19:06:19+00:00" + "time": "2016-10-30 19:06:19" }, { "name": "paragonie/random_compat", diff --git a/nntmux/constants.php b/nntmux/constants.php index bb25352e3..ec9313af9 100755 --- a/nntmux/constants.php +++ b/nntmux/constants.php @@ -1,6 +1,6 @@