diff --git a/app/Console/Commands/ANSIDecode.php b/app/Console/Commands/ANSIDecode.php index f3648e3..d0dccc8 100644 --- a/app/Console/Commands/ANSIDecode.php +++ b/app/Console/Commands/ANSIDecode.php @@ -21,7 +21,7 @@ class ANSIDecode extends Command * * @var string */ - protected $description = 'Encode ANS file to custom binary'; + protected $description = 'Decode ANS file from custom binary'; /** * Execute the console command. diff --git a/app/Console/Commands/BinkpReceive.php b/app/Console/Commands/CommBinkpReceive.php similarity index 92% rename from app/Console/Commands/BinkpReceive.php rename to app/Console/Commands/CommBinkpReceive.php index 5d99e17..6797c5a 100644 --- a/app/Console/Commands/BinkpReceive.php +++ b/app/Console/Commands/CommBinkpReceive.php @@ -10,14 +10,14 @@ use App\Classes\Sock\SocketException; use App\Classes\Sock\SocketServer; use App\Models\Setup; -class BinkpReceive extends Command +class CommBinkpReceive extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'binkp:receive'; + protected $signature = 'comm:binkp:receive'; /** * The console command description. diff --git a/app/Console/Commands/BinkpSend.php b/app/Console/Commands/CommBinkpSend.php similarity index 82% rename from app/Console/Commands/BinkpSend.php rename to app/Console/Commands/CommBinkpSend.php index c79d587..532d3b3 100644 --- a/app/Console/Commands/BinkpSend.php +++ b/app/Console/Commands/CommBinkpSend.php @@ -9,21 +9,21 @@ use Illuminate\Support\Facades\Log; use App\Models\Address; use App\Jobs\AddressPoll as Job; -class BinkpSend extends Command +class CommBinkpSend extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'binkp:send {ftn : FTN to Send to}'; + protected $signature = 'comm:binkp:send {ftn : FTN to Send to}'; /** * The console command description. * * @var string */ - protected $description = 'Binkp send'; + protected $description = 'BINKP send'; /** * Execute the console command. diff --git a/app/Console/Commands/EMSIReceive.php b/app/Console/Commands/CommEMSIReceive.php similarity index 92% rename from app/Console/Commands/EMSIReceive.php rename to app/Console/Commands/CommEMSIReceive.php index f330fe6..40327eb 100644 --- a/app/Console/Commands/EMSIReceive.php +++ b/app/Console/Commands/CommEMSIReceive.php @@ -10,14 +10,14 @@ use App\Classes\Sock\SocketException; use App\Classes\Sock\SocketServer; use App\Models\Setup; -class EMSIReceive extends Command +class CommEMSIReceive extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'emsi:receive'; + protected $signature = 'comm:emsi:receive'; /** * The console command description. diff --git a/app/Console/Commands/EMSISend.php b/app/Console/Commands/CommEMSISend.php similarity index 87% rename from app/Console/Commands/EMSISend.php rename to app/Console/Commands/CommEMSISend.php index b075463..25c1c33 100644 --- a/app/Console/Commands/EMSISend.php +++ b/app/Console/Commands/CommEMSISend.php @@ -9,14 +9,14 @@ use Illuminate\Support\Facades\Log; use App\Models\Address; use App\Jobs\AddressPoll as Job; -class EMSISend extends Command +class CommEMSISend extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'emsi:send {ftn : FTN to Send to}'; + protected $signature = 'comm:emsi:send {ftn : FTN to Send to}'; /** * The console command description. diff --git a/app/Console/Commands/ZmodemReceive.php b/app/Console/Commands/CommZmodemReceive.php similarity index 91% rename from app/Console/Commands/ZmodemReceive.php rename to app/Console/Commands/CommZmodemReceive.php index 522f88c..d771e81 100644 --- a/app/Console/Commands/ZmodemReceive.php +++ b/app/Console/Commands/CommZmodemReceive.php @@ -9,14 +9,14 @@ use App\Classes\Sock\SocketException; use App\Classes\Sock\SocketServer; use App\Classes\Protocol\Zmodem as ZmodemClass; -class ZmodemReceive extends Command +class CommZmodemReceive extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'zmodem:receive'; + protected $signature = 'comm:zmodem:receive'; /** * The console command description. diff --git a/app/Console/Commands/ZmodemSend.php b/app/Console/Commands/CommZmodemSend.php similarity index 90% rename from app/Console/Commands/ZmodemSend.php rename to app/Console/Commands/CommZmodemSend.php index 990cf63..a9782a8 100644 --- a/app/Console/Commands/ZmodemSend.php +++ b/app/Console/Commands/CommZmodemSend.php @@ -6,17 +6,17 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; use App\Classes\Protocol; -use App\Classes\Sock\SocketClient; use App\Classes\Protocol\Zmodem as ZmodemClass; +use App\Classes\Sock\SocketClient; -class ZmodemSend extends Command +class CommZmodemSend extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'zmodem:send {ip}'; + protected $signature = 'comm:zmodem:send {ip}'; /** * The console command description. diff --git a/app/Console/Commands/ConvertMongo.php b/app/Console/Commands/ConvertMongo.php deleted file mode 100644 index 162de7c..0000000 --- a/app/Console/Commands/ConvertMongo.php +++ /dev/null @@ -1,161 +0,0 @@ -collection('netmails')->cursor() as $o) { - $o['mid'] = (string)$o['_id']; - - foreach([ - 'reply'=>'replyid', - 'packet'=>'sent_pkt', - ] as $key => $newkey) { - if (array_key_exists($key,$o)) { - $o[$newkey] = $o[$key]; - unset($o[$key]); - } - } - - unset($o['_id'],$o['sent'],$o['reply']); - - foreach (['created_at','updated_at','sent_at','datetime','deleted_at'] as $key) { - if (Arr::get($o,$key)) - $o[$key] = Carbon::create($o[$key]->toDatetime()); - } - - if (! Arr::get($o,'datetime')) - $o['datetime'] = $o['created_at']; - - $oo = Netmail::withTrashed()->where('mid',$o['mid'])->firstOrNew(); - $oo->forceFill($o); - - try { - $oo->save(['timestamps' => false]); - } catch (\Exception $e) { - $this->warn(sprintf('Netmail didnt move over: %s (%s)',$o['mid'],$e->getMessage())); - } - } - */ - - /**/ - // Echomail - $c = 0; - foreach (DB::connection('mongodb')->collection('echomails')->cursor() as $o) { - if (++$c < $this->argument('start')) - continue; - - if (! ($c%100)) - Log::debug(sprintf('Processed : %d Echomails',$c)); - - $o['mid'] = (string)$o['_id']; - - foreach([ - 'reply'=>'replyid', - 'rogue_seen'=>'rogue_seenby', - ] as $key => $newkey) { - if (array_key_exists($key,$o)) { - $o[$newkey] = $o[$key]; - unset($o[$key]); - } - } - - $path = (array_key_exists('path',$o) && $o['path']) ? $o['path'] : NULL; - $seenby = (array_key_exists('seenby',$o) && $o['seenby']) ? $o['seenby'] : NULL; - $packet = (array_key_exists('packet',$o) && $o['packet']) ? $o['packet'] : NULL; - - unset($o['_id'],$o['reply'],$o['path'],$o['seenby'],$o['toexport'],$o['sent_at'],$o['packet'],$o['sent']); - - foreach (['created_at','updated_at','datetime','deleted_at'] as $key) { - if (Arr::get($o,$key)) - $o[$key] = Carbon::create($o[$key]->toDatetime()); - } - - if (! Arr::get($o,'datetime')) - $o['datetime'] = $o['created_at']; - - if (Arr::get($o,'echoarea') && ! Arr::get($o,'echoarea_id')) { - $ea = Echoarea::where('name',$o['echoarea'])->single(); - $o['echoarea_id'] = $ea->id; - unset($o['echoarea']); - } - - if (! $o['echoarea_id']) { - Log::error(sprintf('Echomail didnt move over: %s [%d] - has no echoarea_id',$o['mid'],$c)); - continue; - } - - if (Arr::get($o,'msg_src') && ! Arr::get($o,'msg_crc')) { - $o['msg_crc'] = 'x'.md5($o['msg_src']); - } - - $oo = Echomail::withTrashed()->where('mid',$o['mid'])->firstOrNew(); - $oo->forceFill($o); - $oo->set_path = $path ? array_filter($path) : []; - $oo->set_seenby = $seenby ? array_filter($seenby): []; - $oo->set_packet = $packet; - $oo->no_export = TRUE; - - try { - $oo->save(['timestamps'=>FALSE]); - - } catch (\Exception $e) { - Log::error(sprintf('Echomail didnt move over: %s [%d] (%s@%d|%s)',$o['mid'],$c,$e->getFile(),$e->getLine(),$e->getMessage())); - dd(['e'=>$e,'o'=>$o,'oo'=>$oo]); - } - - DB::connection('mongodb')->collection('echomails')->delete($o['mid']); - } - /**/ - - // Update old MID seenby with proper ID - foreach (DB::connection('cockroach')->table('echomail_seenby')->whereNotNull('mid')->whereNull('echomail_id')->cursor() as $o) - { - $eo = Echomail::where('mid',$o->mid)->get(); - - if ($eo->count() && $eo->count() == 1) { - DB::update('UPDATE echomail_seenby set echomail_id = ?, mid=NULL where echomail_id IS NULL AND mid = ? ',[ - $eo->first()->id, - $o->mid, - ]); - - } elseif ($eo->count() > 1) { - Log::error(sprintf('Echomail [%s] has more than 1 record [%d] - skipped',$o->mid,$eo->count())); - } - } - } -} diff --git a/app/Console/Commands/EchoareaImport.php b/app/Console/Commands/EchoareaImport.php index 663cc50..75ff521 100644 --- a/app/Console/Commands/EchoareaImport.php +++ b/app/Console/Commands/EchoareaImport.php @@ -2,9 +2,9 @@ namespace App\Console\Commands; -use App\Models\Domain; use Illuminate\Console\Command; +use App\Models\Domain; use App\Jobs\EchoareaImport as Job; class EchoareaImport extends Command diff --git a/app/Console/Commands/SendTestNetmail.php b/app/Console/Commands/NetmailTest.php similarity index 77% rename from app/Console/Commands/SendTestNetmail.php rename to app/Console/Commands/NetmailTest.php index 43d7651..10cd260 100644 --- a/app/Console/Commands/SendTestNetmail.php +++ b/app/Console/Commands/NetmailTest.php @@ -6,9 +6,9 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\Notification; use App\Models\Address; -use App\Notifications\NetmailTest; +use App\Notifications\NetmailTest as NetmailTestNotification; -class SendTestNetmail extends Command +class NetmailTest extends Command { /** * The name and signature of the console command. @@ -35,6 +35,6 @@ class SendTestNetmail extends Command { $ao = Address::findFTN($this->argument('ftn')); - Notification::route('netmail',$ao)->notify(new NetmailTest($ao)); + Notification::route('netmail',$ao)->notify(new NetmailTestNotification($ao)); } } \ No newline at end of file diff --git a/app/Console/Commands/StartServer.php b/app/Console/Commands/ServerStart.php similarity index 98% rename from app/Console/Commands/StartServer.php rename to app/Console/Commands/ServerStart.php index c972beb..b075b45 100644 --- a/app/Console/Commands/StartServer.php +++ b/app/Console/Commands/ServerStart.php @@ -10,7 +10,7 @@ use App\Classes\Sock\SocketException; use App\Classes\Sock\SocketServer; use App\Models\Setup; -class StartServer extends Command +class ServerStart extends Command { private const LOGKEY = 'CSS'; diff --git a/app/Console/Commands/MakeAdmin.php b/app/Console/Commands/UserMakeAdmin.php similarity index 85% rename from app/Console/Commands/MakeAdmin.php rename to app/Console/Commands/UserMakeAdmin.php index 9c45eb4..4846ea2 100644 --- a/app/Console/Commands/MakeAdmin.php +++ b/app/Console/Commands/UserMakeAdmin.php @@ -6,14 +6,14 @@ use Illuminate\Console\Command; use App\Models\User; -class MakeAdmin extends Command +class UserMakeAdmin extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'make:admin {email : User Email}'; + protected $signature = 'user:make:admin {email : User Email}'; /** * The console command description.