Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Jan 12, 2019
2 parents 8bb60d2 + 3e02db5 commit 24e50c5
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 62 deletions.
8 changes: 4 additions & 4 deletions Blacklight/processing/adult/Popporn.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class Popporn extends AdultMovies

/**
* Override if 18 years+ or older
* Define Popporn url
* Define PopPorn url
* Needed Search Queries Constant.
*/
const IF18 = 'http://www.popporn.com/popporn/4';
const POPURL = 'http://www.popporn.com';
const TRAILINGSEARCH = '/results/index.cfm?v=4&g=0&searchtext=';
protected const IF18 = 'https://www.popporn.com/popporn/4';
protected const POPURL = 'https://www.popporn.com';
protected const TRAILINGSEARCH = '/search&q=';

/**
* Sets the directurl for the return results array.
Expand Down
9 changes: 9 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2019-01-12 DariusIII
* Fix: Fix config/nntmux.php db_name value (Fixes issue #841)
* Chg: Update Vue to version 2.5.22
* Chg: Update Blacklight/processing/adult/Popporn class
2019-01-11 DariusIII
* Chg: Use config key in place of env in firewall config file
* Chg: Update install command and reduce code used
* Chg: Simplify UpdateNNTmuxDB.php handle function, use native artisan commands without Symfony Process component
* Chg: Update czproject/git-php to version 2.15.0
2019-01-10 DariusIII
* Chg: Update fideloper/proxy to version 4.1.0
* Chg: Update .travis.yml
Expand Down
44 changes: 10 additions & 34 deletions app/Console/Commands/InstallNntmux.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,10 @@ public function handle()
}
}
$this->info('Migrating tables and seeding them with initial data');
if (env('APP_ENV') !== 'production') {
$process = new Process('php artisan migrate:fresh --seed');
$process->setTimeout(600);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
} else {
echo $buffer;
}
});
if (config('app.env') !== 'production') {
$this->call('migrate:fresh', ['--seed' => true]);
} else {
$process = new Process('php artisan migrate:fresh --force --seed');
$process->setTimeout(600);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
} else {
echo $buffer;
}
});
$this->call('migrate:fresh', ['--force' => true, '--seed' => true]);
}

$paths = $this->updatePaths();
Expand All @@ -108,15 +92,7 @@ public function handle()
if (! $error && $this->addAdminUser()) {
File::put(base_path().'/_install/install.lock', 'application install locked on '.now());
$this->info('Generating application key');
$process = new Process('php artisan key:generate --force');
$process->setTimeout(600);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
} else {
echo $buffer;
}
});
$this->call('key:generate', ['--force' => true]);
$this->info('NNTmux installation completed successfully');
exit();
}
Expand All @@ -141,7 +117,7 @@ private function updatePaths()
$tmp_path = base_path().'/resources/tmp/';
$unrar_path = $tmp_path.'unrar/';

$nzbPathCheck = is_writable($nzb_path);
$nzbPathCheck = File::isWritable($nzb_path);
if ($nzbPathCheck === false) {
$this->warn($nzb_path.' is not writable. Please fix folder permissions');

Expand All @@ -150,7 +126,7 @@ private function updatePaths()

if (! file_exists($unrar_path)) {
$this->info('Creating missing '.$unrar_path.' folder');
if (! @mkdir($unrar_path) && ! is_dir($unrar_path)) {
if (! @File::makeDirectory($unrar_path) && ! File::isDirectory($unrar_path)) {
throw new \RuntimeException('Unable to create '.$unrar_path.' folder');
}
$this->info('Folder '.$unrar_path.' successfully created');
Expand All @@ -162,7 +138,7 @@ private function updatePaths()
return false;
}

$coversPathCheck = is_writable($covers_path);
$coversPathCheck = File::isWritable($covers_path);
if ($coversPathCheck === false) {
$this->warn($covers_path.' is not writable. Please fix folder permissions');

Expand All @@ -181,15 +157,15 @@ private function updatePaths()
*/
private function addAdminUser(): bool
{
if (env('ADMIN_USER') === '' || env('ADMIN_PASS') === '' || env('ADMIN_EMAIL') === '') {
if (config('nntmux.admin_username') === '' || config('nntmux.admin_password') === '' || config('nntmux.admin_email') === '') {
$this->error('Admin user data cannot be empty! Please edit .env file and fill in admin user details and run this script again!');
exit();
}

$this->info('Adding admin user to database');
try {
User::add(env('ADMIN_USER'), env('ADMIN_PASS'), env('ADMIN_EMAIL'), 2, '', '', '', '');
User::where('username', env('ADMIN_USER'))->update(['verified' => 1]);
User::add(config('nntmux.admin_username'), config('nntmux.admin_password'), config('nntmux.admin_email'), 2, '', '', '', '');
User::where('username', config('nntmux.admin_username'))->update(['verified' => 1]);
} catch (\Throwable $e) {
echo $e->getMessage();
$this->error('Unable to add admin user!');
Expand Down
18 changes: 2 additions & 16 deletions app/Console/Commands/UpdateNNTmuxDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Process\Process;

class UpdateNNTmuxDB extends Command
{
Expand All @@ -21,11 +20,6 @@ class UpdateNNTmuxDB extends Command
*/
protected $description = 'Update NNTmux database with new patches';

/**
* @var \app\extensions\util\Git object.
*/
protected $git;

/**
* Create a new command instance.
*/
Expand All @@ -38,18 +32,10 @@ public function handle()
{
// also prevent web access.
$this->output->writeln('<info>Updating database</info>');
if (env('APP_ENV') !== 'production') {
if (config('app.env') !== 'production') {
$this->call('migrate');
} else {
$process = new Process('php artisan migrate --force');
$process->setTimeout(600);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
} else {
echo $buffer;
}
});
$this->call('migrate', ['--force' => true]);
}
}
}
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/firewall.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
'model' => PragmaRX\Firewall\Vendor\Laravel\Models\User::class,

'emails' => [
env('ADMIN_EMAIL'),
config('nntmux.admin_email'),
],
],

Expand Down
5 changes: 4 additions & 1 deletion config/nntmux.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

return [
'db_name' => env('DB_NAME', 'nntmux'),
'db_name' => env('DB_DATABASE', 'nntmux'),
'items_per_page' => env('ITEMS_PER_PAGE', 50),
'items_per_cover_page' => env('ITEMS_PER_COVER_PAGE', 20),
'max_pager_results' => env('MAX_PAGER_RESULTS', 125000),
Expand All @@ -14,4 +14,7 @@
'cache_expiry_short' => env('CACHE_EXPIRY_SHORT', 5),
'cache_expiry_medium' =>env('CACHE_EXPIRY_MEDIUM', 10),
'cache_expiry_long' => env('CACHE_EXPIRY_LONG', 15),
'admin_username' => env('ADMIN_USER', 'admin'),
'admin_password' => env('ADMIN_PASS', 'admin'),
'admin_email' => env('ADMIN_EMAIL', '[email protected]'),
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"laravel-mix": "^4.0.13",
"lodash": "^4.17.11",
"popper.js": "^1.14.6",
"vue": "^2.5.21"
"vue": "^2.5.22"
},
"dependencies": {
"@fancyapps/fancybox": "^3.5.6",
Expand Down

0 comments on commit 24e50c5

Please sign in to comment.