Compare commits

...

7 Commits

Author SHA1 Message Date
7df0612db1 Fix for protocols not showing system sysop name and location
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 30s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m33s
Create Docker Image / Final Docker Image Manifest (push) Successful in 8s
2024-11-05 00:29:00 +11:00
9fb7611335 Minor optimisations when editing and viewing domains 2024-11-05 00:28:34 +11:00
05b7c7904a More updates for laravel 11 2024-11-04 23:00:17 +11:00
0bd2f6e82c Continue to show all common addresses in Items Waiting tab, Add Address Clear Queue job to delete anything in the queue for an address 2024-11-04 23:00:17 +11:00
80fa3e840b Fix for 3b7ce4b, change where setup is defined for our protocols 2024-11-04 23:00:17 +11:00
242f4013b1 Added New Nodes Report 2024-11-04 23:00:17 +11:00
3aeeed1686 Consistency and SQL Query optimisations - focused around the UI 2024-11-04 23:00:17 +11:00
83 changed files with 1692 additions and 1768 deletions

View File

@ -1,57 +1,23 @@
APP_NAME="Clearing Houz"
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_URL=http://clrghouz
APP_TIMEZONE=
APP_URL=
LOG_CHANNEL=stack
LOG_LEVEL=info
AUTH_PASSWORD_RESET_TOKEN_TABLE=password_resets
CACHE_STORE=memcached
MEMCACHED_HOST=memcached
DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=clrghouz
DB_USERNAME=clrghouz
DB_PASSWORD=
#DB_SSLMODE=prefer
#DB_SSLROOTCERT=/var/www/html/config/ssl/ca.crt
#DB_SSLCERT=/var/www/html/config/ssl/client.crt
#DB_SSLKEY=/var/www/html/config/ssl/client.key
BROADCAST_DRIVER=log
MEMCACHED_HOST=memcached
CACHE_DRIVER=memcached
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_AUTO_EMBED_METHOD=base64
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
FIDO_DIR=fido
FIDO_PACKET_KEEP=false
FIDO_STRICT=false
FIDO_HAPROXY=false
FILESYSTEM_DISK=s3
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_BUCKET=
@ -59,12 +25,23 @@ AWS_ENDPOINT=
AWS_DEFAULT_REGION=home
AWS_USE_PATH_STYLE_ENDPOINT=true
#MATRIX_SERVER=
#MATRIX_AS_TOKEN=
#MATRIX_HS_TOKEN=
LOG_CHANNEL=daily
LOG_LEVEL=info
LOG_DAILY_DAYS=93
#FIDO_DNS_NS=
#FIDO_DNS_AAAA=
#FIDO_DNS_ORDER_AAAA=
#FIDO_DNS_A=
#FIDO_DNS_ORDER_A=
MAIL_MAILER=smtp
MAIL_HOST=smtp
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_AUTO_EMBED_METHOD=base64
SESSION_DRIVER=file
# Clrghouz configuration
FIDO_DNS_NS=
MATRIX_SERVER=
MATRIX_AS_TOKEN=
MATRIX_HS_TOKEN=

View File

@ -137,7 +137,7 @@ abstract class Protocol
public function __construct()
{
$this->setup = Config::get('setup');
$this->setup = Config::get('setup',Setup::findOrFail(config('app.id')));
}
/**

View File

@ -195,7 +195,7 @@ final class Binkp extends BaseProtocol
$this->msgs(self::BPM_NUL,sprintf('NDL %d,TCP,BINKP',$this->client->speed));
$this->msgs(self::BPM_NUL,sprintf('TIME %s',Carbon::now()->toRfc2822String()));
$this->msgs(self::BPM_NUL,
sprintf('VER %s-%s %s/%s',Setup::PRODUCT_NAME_SHORT,Setup::version(),self::PROT,self::VERSION));
sprintf('VER %s/%s %s/%s',Setup::PRODUCT_NAME_SHORT,Setup::version(),self::PROT,self::VERSION));
if ($this->originate) {
$opt = $this->capGet(self::F_NOREL,self::O_WANT) ? ' NR' : '';
@ -1290,7 +1290,7 @@ final class Binkp extends BaseProtocol
Log::info(sprintf('%s:- SECURE',self::LOGKEY));
// @todo Since we have connected, if the node was marked down/hold reset that
// Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
// Notification::route('netmail',$ao->system->aka_unknown()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
}
return $this->binkp_hsdone();
@ -1389,7 +1389,7 @@ final class Binkp extends BaseProtocol
$this->msgs(self::BPM_OK,sprintf('%ssecure',$have_pwd ? '' : 'non-'));
// @todo Since we have connected, if the node was marked down/hold reset that
// Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
// Notification::route('netmail',$ao->system->aka_unknown()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
} else {
$this->msgs(self::OK,'non-secure');

View File

@ -1062,7 +1062,7 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
}
// @todo Since we have connected, if the node was marked down/hold reset that
// Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
// Notification::route('netmail',$ao->system->aka_unknown()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
// @todo Lock Node AKAs

View File

@ -0,0 +1,42 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Jobs\AddressClearQueue as Job;
use App\Models\Address;
class AddressClearQueue extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'address:clear:queue'
.' {ftn : FTN}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Clear up anything queued for an FTN';
/**
* Execute the console command.
*/
public function handle(): int
{
$ao = Address::findFTN($this->argument('ftn'),TRUE,TRUE);
if (! $ao) {
$this->error('FTN not found: '.$this->argument('ftn'));
return self::FAILURE;
}
return Job::dispatchSync($ao);
}
}

View File

@ -38,7 +38,7 @@ class CommBinkpReceive extends Command
$o = Setup::findOrFail(config('app.id'));
$server = new SocketServer($o->binkp_port,$o->binkp_bind);
$server->handler = [new Binkp($o),'onConnect'];
$server->handler = [new Binkp,'onConnect'];
try {
$server->listen();

View File

@ -38,7 +38,7 @@ class CommEMSIReceive extends Command
$o = Setup::findOrFail(config('app.id'));
$server = new SocketServer($o->emsi_port,$o->emsi_bind);
$server->handler = [new EMSI($o),'onConnect'];
$server->handler = [new EMSI,'onConnect'];
try {
$server->listen();

View File

@ -0,0 +1,50 @@
<?php
namespace App\Console\Commands;
use App\Models\Address;
use Carbon\Carbon;
use Illuminate\Console\Command;
use App\Jobs\NodesNew as Job;
use App\Models\Domain;
class NodesNew extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'nodes:new'
.' {domain : Domain}'
.' {--date= : From a specific date (default 1 since last Saturday)}'
.' {--netmail= : Send a Netmail to FTN}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'List new nodes since last Saturday (or a specific date)';
/**
* Execute the console command.
*/
public function handle(): int
{
$do = Domain::where('name',$this->argument('domain'))->singleOrFail();
$ao = NULL;
if ($this->option('netmail')) {
$ao = Address::findFTN($this->option('netmail'));
if (! $ao) {
$this->error('Address not found: '.$this->option('netmail'));
return self::FAILURE;
}
}
return Job::dispatchSync($do,$this->option('date') ? Carbon::parse($this->option('date')) : Carbon::parse('last saturday'),$ao);
}
}

View File

@ -50,7 +50,7 @@ class ServerStart extends Command
'address'=>$o->binkp_bind,
'port'=>$o->binkp_port,
'proto'=>SOCK_STREAM,
'class'=>new Binkp($o),
'class'=>new Binkp,
]);
if ($o->emsi_active)
@ -58,7 +58,7 @@ class ServerStart extends Command
'address'=>$o->emsi_bind,
'port'=>$o->emsi_port,
'proto'=>SOCK_STREAM,
'class'=>new EMSI($o),
'class'=>new EMSI,
]);
if ($o->dns_active)
@ -66,7 +66,7 @@ class ServerStart extends Command
'address'=>$o->dns_bind,
'port'=>$o->dns_port,
'proto'=>SOCK_DGRAM,
'class'=>new DNS(),
'class'=>new DNS,
]);
$children = collect();

View File

@ -1,46 +0,0 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Jobs\{AddressIdleDomain,MailSend,SystemHeartbeat};
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->job(new MailSend(TRUE))->everyMinute()->withoutOverlapping();
$schedule->job(new MailSend(FALSE))->twiceDaily(1,13);
$schedule->job(new SystemHeartbeat)->hourly();
$schedule->job(new AddressIdleDomain)->weeklyOn(0,'01:00');
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@ -1,40 +0,0 @@
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
}

213
app/Helpers/PageAssets.php Normal file
View File

@ -0,0 +1,213 @@
<?php
namespace App\Helpers;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
/**
* Useful tools (js/css) used when rendering pages
*/
class PageAssets
{
// Types that we can handle
private const array types = [
'css',
'js',
];
public const array assets = [
'datatables' => [
'base' => [
'css' => [
'//cdn.datatables.net/2.1.2/css/dataTables.bootstrap4.css',
//'//cdn.datatables.net/2.1.2/css/dataTables.dataTables.min.css',
],
'js' => [
'//cdn.datatables.net/2.1.2/js/dataTables.min.js',
'//cdn.datatables.net/2.1.2/js/dataTables.bootstrap4.min.js',
],
],
'buttons' => [
'css' => [
'//cdn.datatables.net/buttons/3.1.0/css/buttons.bootstrap4.min.css',
//'//cdn.datatables.net/buttons/3.1.0/css/buttons.dataTables.min.css',
],
'js' => [
'//cdn.datatables.net/buttons/3.1.0/js/dataTables.buttons.min.js',
//'//cdn.datatables.net/buttons/3.1.0/js/buttons.dataTables.min.js',
'//cdn.datatables.net/buttons/3.1.0/js/buttons.bootstrap4.min.js',
'//cdnjs.cloudflare.com/ajax/libs/jszip/3.2.0/jszip.min.js',
],
],
'conditionalpaging' => [
'js' => [
'//cdn.datatables.net/plug-ins/2.0.5/features/conditionalPaging/dataTables.conditionalPaging.min.js',
],
],
'fixedheader' => [
'css' => [
'//cdn.datatables.net/fixedheader/4.0.1/css/fixedHeader.bootstrap4.min.css',
//'//cdn.datatables.net/fixedheader/4.0.1/css/fixedHeader.dataTables.min.css',
],
'js' => [
'//cdn.datatables.net/fixedheader/4.0.1/js/dataTables.fixedHeader.min.js',
//'//cdn.datatables.net/fixedheader/4.0.1/js/fixedHeader.dataTables.min.js',
'//cdn.datatables.net/fixedheader/4.0.1/js/fixedHeader.bootstrap4.min.js',
]
],
'responsive' => [
'css' => [
'//cdn.datatables.net/responsive/3.0.2/css/responsive.bootstrap4.min.css',
//'//cdn.datatables.net/responsive/3.0.2/css/responsive.dataTables.min.css',
],
'js' => [
'//cdn.datatables.net/responsive/3.0.2/js/dataTables.responsive.min.js',
//'//cdn.datatables.net/responsive/3.0.2/js/responsive.bootstrap.min.js',
'//cdn.datatables.net/responsive/3.0.2/js/responsive.bootstrap4.min.js',
]
],
'rowgroup' => [
'css' => [
'//cdn.datatables.net/rowgroup/1.5.0/css/rowGroup.bootstrap4.min.css',
//'//cdn.datatables.net/rowgroup/1.5.0/css/rowGroup.dataTables.min.css',
],
'js' => [
'//cdn.datatables.net/rowgroup/1.5.0/js/dataTables.rowGroup.min.js',
//'//cdn.datatables.net/rowgroup/1.5.0/js/rowGroup.dataTables.min.js',
'//cdn.datatables.net/rowgroup/1.5.0/js/rowGroup.bootstrap4.min.js',
],
],
'searchpanes' => [
'css' => [
'//cdn.datatables.net/searchpanes/2.3.1/css/searchPanes.bootstrap4.min.css',
//'//cdn.datatables.net/searchpanes/2.3.1/css/searchPanes.dataTables.min.css',
],
'js' => [
'//cdn.datatables.net/searchpanes/2.3.1/js/dataTables.searchPanes.min.js',
//'//cdn.datatables.net/searchpanes/2.3.1/js/searchPanes.dataTables.min.js',
'//cdn.datatables.net/searchpanes/2.3.1/js/searchPanes.bootstrap4.min.js',
],
],
'searchpanes-left' => [
'css' => [
'/plugin/dataTables/leftSearchPanes.css',
],
],
'select' => [
'css' => [
'//cdn.datatables.net/select/2.0.3/css/select.bootstrap4.min.css',
//'//cdn.datatables.net/select/2.0.3/css/select.dataTables.min.css',
],
'js' => [
'//cdn.datatables.net/select/2.0.3/js/dataTables.select.min.js',
//'//cdn.datatables.net/select/2.0.3/js/select.dataTables.min.js',
'//cdn.datatables.net/select/2.0.3/js/select.bootstrap4.min.js',
]
],
],
'select2' => [
'base' => [
'css' => [
'//cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css',
],
'js' => [
'//cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js',
],
],
'autofocus' => [
'js' => [
'/plugin/select2/fix-autofocus.js',
],
]
],
'simplemde' => [
'base' => [
'css' => [
'//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css',
],
'js' => [
'//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js',
],
],
],
];
// Items to manage
public static Collection $items;
// Add an item to the list
public static function add(string $type,Collection|array|string $asset): void
{
if (! in_array($type,self::types))
throw new \Exception('Invalid type: '.$type);
if (! isset(self::$items))
self::init();
if (is_string($asset))
self::$items
->get($type)
->push($asset)
->unique();
else
self::$items->put($type,
self::$items
->get($type)
->merge($asset->values())
->unique());
}
// Add a predefined asset
public static function asset(string $id): void
{
if (! isset(self::$items))
self::init();
if (str_contains($id,',')) {
[$item,$arguments] = explode(',',$id,2);
$arguments = collect(explode('|',$arguments));
} else {
$item = $id;
$arguments = collect();
}
$arguments = $arguments->prepend('base');
$asset = collect(Arr::get(self::assets,$item))->only($arguments);
foreach (self::types as $type)
if ($x=$asset->pluck($type)->filter()->flatten())
self::add($type,$x);
}
// Render the CSS items
public static function css(): string
{
return isset(self::$items)
? self::$items
->get('css')
->map(fn($item)=>sprintf('<link rel="stylesheet" href="%s">',$item))
->join('')
: '';
}
public static function init(): void
{
self::$items = collect([
'js' => collect(),
'css' => collect(),
]);
}
// Render the JS items
public static function js(): string
{
return isset(self::$items)
? self::$items
->get('js')
->map(fn($item)=>sprintf('<script type="text/javascript" src="%s"></script>',$item))
->join('')
: '';
}
}

View File

@ -115,7 +115,7 @@ class DomainController extends Controller
if (! $o->public && ! Gate::check('admin',$o))
abort(404);
$o->load(['zones.system','zones.domain','zones.addresses.nodes_hub','zones.addresses']);
$o->load(['zones.system','zones.domain','zones.addresses.nodes_hub','zones.addresses.echomail_from']);
return view('domain.view')
->with('o',$o);

View File

@ -66,7 +66,17 @@ class SystemController extends Controller
->with('saved',TRUE);
}
$o->load(['addresses.zone.domain','addresses.system','sessions.domain','sessions.systems']);
$o->loadMissing([
'zcs',
// For 'ftn' to work
'addresses.zone:id,zone_id,domain_id,active',
'addresses.zone.domain:id,name,active',
// For 'role'
'addresses.system:id,address',
// For system addedit
'sessions.domain:id,name,active',
'sessions.systems:id',
]);
return view('system.addedit')
->with('action',$o->exists ? 'update_nn' : 'create')
@ -611,31 +621,12 @@ class SystemController extends Controller
*/
public function register(SystemRegisterRequest $request)
{
// Step 1, show the user a form to select an existing defined system
if ($request->isMethod('GET'))
return view('user.system.register');
if ($request->action === 'register' && $request->name && is_numeric($request->name))
return view('user.system.widget.register_confirm')
->with('o',System::findOrFail($request->name));
$o = System::findOrNew(is_numeric($request->system_id) ? $request->system_id : NULL);
// If the system exists, and we are 'register', we'll start the address claim process
if ($o->exists && $request->action === 'Link') {
$validate = Setup::findOrFail(config('app.id'))->system->inMyZones($o->addresses);
// If we have addresses, we'll trigger the routed netmail
if ($validate->count()) {
Notification::route('netmail',$x=$validate->first())->notify(new AddressLink(Auth::user()));
AddressPoll::dispatch($x)->delay(15);
}
return view('user.system.widget.register_send')
->with('validate',$validate)
->with('o',$o);
}
// If the system doesnt exist, we'll create it
if (! $o->exist) {
$o->sysop = Auth::user()->name;

View File

@ -1,83 +0,0 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\AddUserToView::class,
],
'api' => [
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'activeuser' => \App\Http\Middleware\ActiveUser::class,
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
/**
* The priority-sorted list of middleware.
*
* This forces the listed middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}

View File

@ -1,21 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}

View File

@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
class CheckForMaintenanceMode extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}

View File

@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}

View File

@ -1,28 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Providers\RouteServiceProvider;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle(Request $request,\Closure $next,?string $guard=NULL)
{
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
return $next($request);
}
}

View File

@ -1,18 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected $except = [
'password',
'password_confirmation',
];
}

View File

@ -1,28 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

View File

@ -1,24 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,67 @@
<?php
namespace App\Jobs;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification;
use App\Classes\FTN\Message;
use App\Models\{Address,Domain,System};
use App\Notifications\Echomails\AbsentNodes;
use App\Notifications\Emails\NodeMarkedDown as NodeMarkedDownEmail;
use App\Notifications\Netmails\NodeMarkedDown as NodeMarkedDownNetmail;
use App\Notifications\Emails\NodeMarkedHold as NodeMarkedHoldEmail;
use App\Notifications\Netmails\NodeMarkedHold as NodeMarkedHoldNetmail;
use App\Notifications\Emails\NodeDelisted as NodeDelistedEmail;
use App\Notifications\Netmails\NodeDelisted as NodeDelistedNetmail;
class AddressClearQueue implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private const LOGKEY = 'JAC';
private Address $ao; // System address
/**
* Create a new job instance.
*/
public function __construct(Address $ao)
{
$this->ao = $ao->withoutRelations();
}
/**
* Execute the job.
*/
public function handle(): void
{
// Remove echomail not collected from echomail_seenby
DB::table('echomail_seenby')
->where('address_id',$this->ao->id)
->whereNotNull('export_at')
->whereNull('sent_at')
->delete();
// Remove FLAG_INTRANSIT from netmail that hasnt been delivered
DB::table('netmails')
->where('tftn_id',$this->ao->id)
->whereRaw(sprintf('(flags & %d) > 0',Message::FLAG_INTRANSIT))
->update(['flags'=>DB::raw(sprintf('(flags & ~%d)',Message::FLAG_INTRANSIT))]);
// Remove files not collected
DB::table('file_seenby')
->where('address_id',$this->ao->id)
->whereNotNull('export_at')
->whereNull('sent_at')
->delete();
}
}

View File

@ -67,26 +67,6 @@ class AddressIdle implements ShouldQueue
Log::info(sprintf('%s:- Delisting [%s], not seen for at least [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays()));
$contact = FALSE;
// Remove echomail not collected from echomail_seenby
DB::table('echomail_seenby')
->where('address_id',$ao->id)
->whereNotNull('export_at')
->whereNull('sent_at')
->delete();
// Remove FLAG_INTRANSIT from netmail that hasnt been delivered
DB::table('netmails')
->where('tftn_id',$ao->id)
->whereRaw(sprintf('(flags & %d) > 0',Message::FLAG_INTRANSIT))
->update(['flags'=>DB::raw(sprintf('(flags & ~%d)',Message::FLAG_INTRANSIT))]);
// Remove files not collected
DB::table('file_seenby')
->where('address_id',$ao->id)
->whereNotNull('export_at')
->whereNull('sent_at')
->delete();
// Remove subscribed echoareas
$ao->echoareas()->detach();
@ -97,6 +77,9 @@ class AddressIdle implements ShouldQueue
$ao->validated = FALSE;
$ao->save();
// Clear the queue
AddressClearQueue::dispatchSync($ao);
// Email Alert
if ($ao->system->users->count()) {
Notification::send($ao->system->users,new NodeDelistedEmail($ao->withoutRelations()));
@ -104,8 +87,8 @@ class AddressIdle implements ShouldQueue
}
// Netmail Alert (to othernet network address)
if ($ao->system->uncommon()->count()) {
Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeDelistedNetmail($ao->withoutRelations()));
if ($ao->system->aka_unknown()->count()) {
Notification::route('netmail',$ao->system->aka_unknown()->first()->withoutRelations())->notify(new NodeDelistedNetmail($ao->withoutRelations()));
$contact = TRUE;
}
@ -140,8 +123,8 @@ class AddressIdle implements ShouldQueue
}
// Netmail Alert (to othernet network address)
if ($ao->system->uncommon()->count()) {
Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
if ($ao->system->aka_unknown()->count()) {
Notification::route('netmail',$ao->system->aka_unknown()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
$contact = TRUE;
}
@ -188,8 +171,8 @@ class AddressIdle implements ShouldQueue
}
// Netmail Alert (to othernet network address)
if ($ao->system->uncommon()->count()) {
Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeMarkedHoldNetmail($ao->withoutRelations()));
if ($ao->system->aka_unknown()->count()) {
Notification::route('netmail',$ao->system->aka_unknown()->first()->withoutRelations())->notify(new NodeMarkedHoldNetmail($ao->withoutRelations()));
$contact = TRUE;
}
@ -203,7 +186,7 @@ class AddressIdle implements ShouldQueue
}
if ($result->count())
Notification::route('echomail',$this->do->nodestatusarea)->notify(new AbsentNodes($result));
Notification::route('echomail',$this->do->nodestatus_echoarea)->notify(new AbsentNodes($result));
}
private function old(Domain $do,int $days,int $flags=0,Address $ao=NULL): Collection
@ -214,21 +197,9 @@ class AddressIdle implements ShouldQueue
$age = Carbon::now()->subDays($days)->endOfDay();
return Address::select([
'addresses.id',
'system_id',
'zone_id',
'region_id',
'host_id',
'node_id',
'point_id',
'addresses.active',
'hub_id',
'role',
'addresses.updated_at',
])
->activeFTN()
->where('systems.active',TRUE)
return Address::FTN()
->ActiveFTN()
->addSelect(['addresses.updated_at'])
->where(fn($query)=>$query->where('point_id',0)->orWhereNull('point_id'))
->whereIn('addresses.id',our_nodes($do)->pluck('id'))
->when($ao,fn($query)=>$query->where('addresses.id',$ao->id))
@ -236,9 +207,7 @@ class AddressIdle implements ShouldQueue
->whereRaw(sprintf('((role IS NULL) OR (role=0) OR ((role & %d) > 0))',$flags))
->whereRaw(sprintf('((role IS NULL) OR ((role & %d) = 0))',Address::NODE_KEEP))
->join('systems',['systems.id'=>'addresses.system_id'])
->ftnOrder()
->with(['system','zone.domain'])
->dontCache()
//->with(['system','zone.domain'])
->get();
}
}

View File

@ -93,13 +93,13 @@ class AddressPoll implements ShouldQueue, ShouldBeUnique
switch ($o->name) {
case 'BINKP':
$s = new Binkp(Setup::findOrFail(config('app.id')));
$s = new Binkp;
$mo = Mailer::where('name','BINKP')->singleOrFail();
break;
case 'EMSI':
$s = new EMSI(Setup::findOrFail(config('app.id')));
$s = new EMSI;
$mo = Mailer::where('name','EMSI')->singleOrFail();
break;

65
app/Jobs/NodesNew.php Normal file
View File

@ -0,0 +1,65 @@
<?php
namespace App\Jobs;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification;
use App\Models\{Address, Domain, System};
use App\Notifications\Netmails\NodesNew as NotificationNodesNew;
class NodesNew implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private const LOGKEY = 'JNN';
private ?Carbon $since; // New nodes since this date
private Address $ao; // Domain we are processing
private Domain $do; // Domain we are processing
/**
* Create a new job instance.
*/
public function __construct(Domain $do,Carbon $since=NULL,Address $ao=NULL)
{
$this->do = $do->withoutRelations();
$this->ao = $ao?->withoutRelations();
$this->since = $since;
}
/**
* Execute the job.
*/
public function handle(): void
{
$since = ($this->since ?: Carbon::parse('last saturday'))->startOfDay();
$result = Address::FTN()
->ActiveFTN()
->join('systems',['systems.id'=>'addresses.system_id'])
->join('system_zone',['system_zone.system_id'=>'systems.id','system_zone.zone_id'=>'zones.id'])
->whereIn('zones.id',$this->do->zones->pluck('id'))
->where('systems.active',TRUE)
->where('systems.created_at','>=',$since)
->get();
if ($result->count()) {
Log::notice(sprintf('%s:- Sending new nodes since [%s] (%d)',self::LOGKEY,$since,$result->count()));
Notification::route('netmail',$this->ao->withoutRelations())
->notify(new NotificationNodesNew(
$since,
$result,
));
} else
Log::notice(sprintf('%s:- No nodes since [%s]',self::LOGKEY,$since));
}
}

View File

@ -24,19 +24,28 @@ use App\Traits\{QueryCacheableConfig,ScopeActive};
*
* If an address is validated, we know that the system is using the address (we've confirmed that during a session).
* validated is update/removed is during a mailer session, confirming if the node has the address
* @todo Remove validated, if that system hasnt used the address for a defined period (eg: 30)
*
* We'll only trigger a poll to a system that we have mail for if active && validated, unless "forced".
*
* Any mail for that address will be delivered, if active && validated.
*
* Address status:
* + Active (active=true/validated=true) - mail can flow and in one of our networks (we have session details)
* + Pending (active=true/validated=false) - remote hasnt configured address during a session and in one of our networks
* + Known (active=true/validated=true) - the node presented this address, but we didnt auth it, and its a network we are not in
* + Unconfirm (active=true/validated=true) - the node presented this address, but we dont manage the address (it uses a different hub)
* + Nodelist (active=true/validated=true) - the node presented this address, but we dont manage the address and its in a recent nodelist
* + Delisted (active=false/validated=true) - this node shouldnt use this address any more
* + Freed (active=false/validated=false) - this node shouldnt is known to not be using this address any more
*
* Other Status
* + citizen - The address belongs to one of our jurisdiction (hub_id = our address, NC,RC,ZC)
* + foreign - The address doesnt belong to our jurisdiction
*
* @see \App\Http\Requests\AddressAdd::class for rules about AKA and role
*/
// Need to add
// Calculated Region for an FTN, ie: find the parent and use their region id
// - if creating an RC, then the region is part of the creation, ZC region is 0
// Then use this in createFTN
class Address extends Model
{
use QueryCacheableConfig,ScopeActive,SoftDeletes;
@ -246,7 +255,7 @@ class Address extends Model
$o = self::findZone($do,$ftn['n'],$ftn['f'],$ftn['p'],$trashed);
}
return ($o && $o->system->active) ? $o : NULL;
return ($o && ($trashed || $o->system->active)) ? $o : NULL;
}
public static function newFTN(string $address): self
@ -395,16 +404,14 @@ class Address extends Model
*
* @param $query
* @return mixed
* @note zones and domains needs to be joined in the base call, or use FTN()
*/
public function scopeActiveFTN($query)
{
return $query->select($this->getTable().'.*')
->join('zones',['zones.id'=>'addresses.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id'])
return $query
->where('zones.active',TRUE)
->where('domains.active',TRUE)
->active()
->FTNorder();
->active();
}
/**
@ -416,13 +423,21 @@ class Address extends Model
public function scopeFTN($query)
{
return $query
->select(['id','addresses.zone_id','host_id','node_id','point_id','system_id'])
->select(['addresses.id','region_id','host_id','node_id','point_id','addresses.zone_id','addresses.active','role','security','addresses.system_id','addresses.active','validated','deleted_at'])
->join('zones',['zones.id'=>'addresses.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id'])
->orderBy('domains.name')
->orderBy('region_id')
->orderBy('host_id')
->orderBy('node_id')
->orderBy('point_id')
->with([
'zone:zones.id,domain_id,zone_id',
'zone.domain:domains.id,name',
'zone:zones.id,domain_id,zone_id,active',
'zone.domain:domains.id,name,active,public',
]);
}
/** @deprecated use FTN() */
public function scopeFTNOrder($query)
{
return $query

View File

@ -1,8 +1,9 @@
<?php
namespace App\Casts;
namespace App\Models\Casts;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
class CollectionOrNull implements CastsAttributes
@ -10,13 +11,13 @@ class CollectionOrNull implements CastsAttributes
/**
* Cast the given value.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
* @param string $key
* @param mixed $value
* @param array $attributes
* @return Collection
*/
public function get($model,string $key,$value,array $attributes): Collection
public function get(Model $model,string $key,$value,array $attributes): Collection
{
return collect(json_decode($value, true));
}
@ -30,7 +31,7 @@ class CollectionOrNull implements CastsAttributes
* @param array $attributes
* @return string|null
*/
public function set($model,string $key,$value,array $attributes): ?string
public function set(Model $model,string $key,$value,array $attributes): ?string
{
return ($value->count()) ? json_encode($value) : NULL;
}

View File

@ -1,6 +1,6 @@
<?php
namespace App\Casts;
namespace App\Models\Casts;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Database\Eloquent\Model;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Casts;
namespace App\Models\Casts;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Database\Eloquent\Model;

View File

@ -11,9 +11,16 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use App\Casts\CompressedStringOrNull;
use App\Models\Casts\CompressedStringOrNull;
use App\Traits\{QueryCacheableConfig,ScopeActive};
/**
* This represents an FTN Domain.
*
* We are either a member of the domain (because we have an AKA in it) or NOT.
*
* The assumption is, if we are a member of the domain, we receive/send mail to an uplink and possibly downlinks
*/
class Domain extends Model
{
use HasFactory,QueryCacheableConfig,ScopeActive;
@ -28,14 +35,16 @@ class Domain extends Model
/* SCOPES */
/**
* Only query active records
* A domain is public (visible), if the user is an admin or, the domain is marked public)
*/
public function scopePublic($query)
{
$user = Auth::user();
return $query
->when(((! $user) || (! $user->isAdmin())),function($query) { return $query->where('public',TRUE)->active(); });
->active()
->when((! $user) || (! $user->isAdmin()),
fn($query)=>$query->where('public',TRUE));
}
/* RELATIONS */
@ -43,13 +52,13 @@ class Domain extends Model
public function echoareas()
{
return $this->hasMany(Echoarea::class)
->orderBY('name');
->orderBy('name');
}
public function fileareas()
{
return $this->hasMany(Filearea::class)
->orderBY('name');
->orderBy('name');
}
public function nodelist_filearea()
@ -57,7 +66,7 @@ class Domain extends Model
return $this->belongsTo(Filearea::class);
}
public function nodestatusarea()
public function nodestatus_echoarea()
{
return $this->belongsTo(Echoarea::class,'nodestatus_id');
}
@ -65,29 +74,37 @@ class Domain extends Model
public function zones()
{
return $this->hasMany(Zone::class)
->select(['id','zone_id','domain_id','active']);
->select(['id','zone_id','domain_id','active'])
->orderBy('zone_id');
}
/* ATTRIBUTES */
/**
* We can accept applications if we have an address in the domain
*
* @return bool
* @throws \Exception
*/
public function getCanAcceptAppAttribute(): bool
{
return ($x=our_address($this))
&& $x->count()
&& $this->active
return $this->isManaged()
&& $this->accept_app
&& Auth::id()
&& $this->userHasSystemsNotInNet(Auth::user())->count();
&& Auth::id();
}
public function getHomePageAttribute(?string $value): string
{
//0xFD2FB528
return $this->castAttribute('homepage',$value) ?: 'No available information at the moment.';
}
/* METHODS */
/**
* Show count of messages by day/week/month/all stats for each echoarea in this domain
*
* @return Collection
*/
public function echoarea_stats(): Collection
{
return Cache::remember(md5(sprintf('%d-%s',$this->id,__METHOD__)),self::CACHE_TIME,function() {
@ -110,6 +127,12 @@ class Domain extends Model
});
}
/**
* Show daily total of messages by echoarea in this domain
*
* @param Collection|NULL $systems
* @return Collection
*/
public function echoarea_total_daily(Collection $systems=NULL): Collection
{
return Cache::remember(md5(sprintf('%d-%s',$this->id,$systems?->pluck('id')->join(','))),self::CACHE_TIME,function() use ($systems) {
@ -120,7 +143,7 @@ class Domain extends Model
->join('echomails',['echomails.echoarea_id'=>'echoareas.id'])
->where('domains.id',$this->id)
->where('echomails.datetime','>=',Carbon::now()->subMonths(self::STATS_MONTHS)->startOfMonth())
->when($systems?->count(),function($query) use ($systems) { return $query->whereIn('echomails.fftn_id',$systems->pluck('addresses')->flatten()->pluck('id')); })
->when($systems?->count(),fn($query)=>$query->whereIn('echomails.fftn_id',$systems->pluck('addresses')->flatten()->pluck('id')))
->groupBy(['echoareas.name','echoareas.show','date'])
->orderBy('echoareas.name')
->orderBy('date')
@ -128,6 +151,9 @@ class Domain extends Model
});
}
/**
* Show count of files by week/month/all status for each filearea in this domain
*/
public function filearea_stats()
{
return Cache::remember(md5(sprintf('%d-%s',$this->id,__METHOD__)),self::CACHE_TIME,function() {
@ -157,28 +183,6 @@ class Domain extends Model
*/
public function isManaged(): bool
{
return ($x=our_address())
&& $x->pluck('zone.domain')
->pluck('id')
->contains($this->id);
}
/**
* Work out which of the users systems are not in this domain
*
* @param User $o
* @return Collection
*/
public function userHasSystemsNotInNet(User $o): Collection
{
$o->load('systems.akas.zone');
$result = collect();
foreach ($o->systems->filter(function($item) { return $item->active; }) as $so) {
if (! $so->akas->pluck('zone')->unique('domain_id')->pluck('domain_id')->contains($this->id))
$result->push($so);
}
return $result;
return our_address($this)->count() > 0;
}
}

View File

@ -5,7 +5,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Casts\CollectionOrNull;
use App\Models\Casts\CollectionOrNull;
class Dynamic extends Model
{

View File

@ -9,10 +9,10 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use App\Casts\{CollectionOrNull,CompressedStringOrNull,UTF8StringOrNull};
use App\Classes\FTN\Message;
use App\Events\Echomail as EchomailEvent;
use App\Interfaces\Packet;
use App\Models\Casts\{CompressedStringOrNull,CollectionOrNull,UTF8StringOrNull};
use App\Traits\{MessageAttributes,MsgID,ParseAddresses,QueryCacheableConfig};
final class Echomail extends Model implements Packet
@ -250,6 +250,7 @@ final class Echomail extends Model implements Packet
}
// See if we need to export this message.
// @todo We need to limit exporting if address/system is not active
if ($model->echoarea->sec_read) {
$exportto = $model
->echoarea

View File

@ -11,7 +11,7 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use App\Casts\{CollectionOrNull,CompressedStringOrNull};
use App\Models\Casts\{CompressedStringOrNull,CollectionOrNull};
class File extends Model
{

View File

@ -10,9 +10,9 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use App\Casts\{CollectionOrNull,CompressedStringOrNull,UTF8StringOrNull};
use App\Interfaces\Packet;
use App\Pivots\ViaPivot;
use App\Models\Casts\{CompressedStringOrNull,CollectionOrNull,UTF8StringOrNull};
use App\Models\Pivots\ViaPivot;
use App\Traits\{MessageAttributes,MsgID};
final class Netmail extends Model implements Packet

View File

@ -2,10 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Casts\UTF8StringOrNull;
use App\Models\Casts\UTF8StringOrNull;
class Origin extends Model
{

View File

@ -1,6 +1,6 @@
<?php
namespace App\Pivots;
namespace App\Models\Pivots;
use Illuminate\Database\Eloquent\Relations\Pivot;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Policies;
namespace App\Models\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Policies;
namespace App\Models\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Policies;
namespace App\Models\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Policies;
namespace App\Models\Policies;
use App\Models\User;

View File

@ -48,35 +48,39 @@ class System extends Model
$uo = Auth::user();
return $query
->when($uo && ! $uo->isAdmin(),function($query) use ($uo) {
return $query->whereIn('id',$uo->systems->pluck('id'))
->orWhere($this->getTable().'.active',TRUE);
},function($query) { $query->where($this->getTable().'.active',TRUE); })
->when(
$uo && ! $uo->isAdmin(),
fn($query)=>
$query
->whereIn('id',$uo->systems->pluck('id'))
->orWhere($this->getTable().'.active',TRUE),
fn($query)=>$query->where($this->getTable().'.active',TRUE))
->orderBy('name');
}
/* RELATIONS */
/**
* All addresses assigned to a system, including addresses pending deletion
* @return mixed
*/
public function addresses()
{
return $this->hasMany(Address::class)
->withTrashed()
->FTNorder();
->FTN()
->withTrashed();
}
/**
* System addresses that are active
*
* @return mixed
*/
public function akas()
{
return $this->hasMany(Address::class)
->select('addresses.*')
->join('zones',['zones.id'=>'addresses.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id'])
->where('addresses.active',TRUE)
->where('zones.active',TRUE)
->where('domains.active',TRUE)
->orderBy('domains.name')
->with(['zone.domain'])
->FTNorder()
->orderBy('role','ASC');
->FTN()
->ActiveFTN();
}
public function mailers()
@ -111,9 +115,10 @@ class System extends Model
public function sessions()
{
return $this->belongsToMany(Zone::class)
->select(['id','zones.zone_id','domain_id','active'])
->select(['zones.id','zones.zone_id','domain_id','zones.active'])
->join('domains',['domains.id'=>'zones.domain_id'])
->withPivot(['sespass','pktpass','ticpass','fixpass','zt_ipv4','zt_ipv6','default'])
->dontCache();
->orderBy('domains.name');
}
/**
@ -136,7 +141,14 @@ class System extends Model
*/
public function zcs()
{
return $this->hasMany(Zone::class);
return $this->hasMany(Zone::class)
->select(['zones.id','zone_id','domain_id','system_id','zones.active'])
->join('domains',['domains.id'=>'zones.domain_id'])
->orderBy('domains.name')
->orderBy('zone_id')
->with([
'domain:id,name,active',
]);
}
/**
@ -189,6 +201,66 @@ class System extends Model
/* METHODS */
public function addresses_common(): Collection
{
$our = our_address()->pluck('zone.domain_id')->unique();
// Return our akas, filter with our_addresses()
return $this->addresses->filter(fn($item)=>$our->contains($item->zone->domain_id));
}
/**
* Return the ACTIVE addresses that are common with our addresses
*
* @return Collection
* @throws \Exception
*/
public function aka_common(): Collection
{
$our = our_address()->pluck('zone.domain_id')->unique();
// Return our akas, filter with our_addresses()
return $this->akas->filter(fn($item)=>$our->contains($item->zone->domain_id));
}
/**
* Return the ACTIVE addresses that we auth with
*
* @return Collection
* @throws \Exception
*/
public function aka_known(): Collection
{
return $this->aka_common()
->filter(fn($item)=>$this->sessions->contains($item->zone_id));
}
/**
* Return the ACTIVE addresses in the same networks as us, but dont auth here
*
* @return Collection
* @throws \Exception
*/
public function aka_unknown(): Collection
{
return $this->aka_common()
->filter(fn($item)=>! $this->sessions->contains($item->zone_id));
}
/**
* Return the AKAs that are in networks not common with us
*
* @return Collection
* @throws \Exception
*/
public function aka_uncommon(): Collection
{
$our = our_address()->pluck('zone.domain_id')->unique();
// Return our akas, filter with our_addresses()
return $this->akas->filter(fn($item)=>! $our->contains($item->zone->domain_id));
}
public function echoareas()
{
return Echoarea::select('echoareas.*')
@ -230,6 +302,13 @@ class System extends Model
}
}
public function inDomain(Domain $o): bool
{
return $this->addresses
->filter(fn($item)=>$item->zone->domain_id === $o->id)
->count() > 0;
}
/**
* Return the system's address in the same zone
* This function can filter based on the address type needed.
@ -250,28 +329,13 @@ class System extends Model
: $akas;
}
/**
* Parse the addresses and return which ones are in my zones
*
* @param \Illuminate\Database\Eloquent\Collection $addresses
* @param int $type
* @return Collection
*/
public function inMyZones(Collection $addresses,int $type=(Address::NODE_HC|Address::NODE_NN|Address::NODE_POINT)): Collection
{
$myzones = $this->addresses->pluck('zone_id')->unique();
return $addresses->filter(function($item) use ($myzones,$type) {
return ($item->role & $type) && ($myzones->search($item->zone_id) !== FALSE);
});
}
/**
* Return the packet that this system uses
*
* @param Address $ao
* @param string|null $password
* @return Packet
* @throws \Exception
*/
public function packet(Address $ao,string $password=NULL): Packet
{
@ -289,22 +353,7 @@ class System extends Model
{
return Job::where('queue',AddressPoll::QUEUE)
->get()
->where(function($item) {
return $this->akas->pluck('id')->search($item->command->address->id) !== FALSE; })
->where(fn($item)=>$this->akas->pluck('id')->contains($item->command->address->id))
->last();
}
/**
* Return other addresses that are not collected here, but are on the same network as us.
*
* @return \Illuminate\Database\Eloquent\Collection
* @throws \Exception
*/
public function uncommon(): Collection
{
$our = our_address();
return $this->akas
->filter(fn($item)=>(($x=$item->parent()) && (! $our->contains($x)) && ($our->pluck('zone.domain_id')->contains($item->zone->domain_id))));
}
}

View File

@ -2,10 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Casts\UTF8StringOrNull;
use App\Models\Casts\UTF8StringOrNull;
class Tagline extends Model
{

View File

@ -2,10 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Casts\UTF8StringOrNull;
use App\Models\Casts\UTF8StringOrNull;
class Tearline extends Model
{

View File

@ -75,19 +75,14 @@ class User extends Authenticatable implements MustVerifyEmail
/* GENERAL METHODS */
public function addresses(Domain $o=NULL): Collection
public function addresses(): Collection
{
return Address::select('addresses.*')
->join('systems',['systems.id'=>'addresses.system_id'])
->join('system_user',['system_user.system_id'=>'systems.id'])
->when(! is_null($o),function($query) use ($o) {
return $query
->join('zones',['zones.id'=>'addresses.zone_id'])
->where('zones.domain_id',$o->id);
})
->where('system_user.user_id',$this->id)
->activeFTN()
->with(['zone.domain'])
->ActiveFTN()
->FTN()
->get();
}

View File

@ -46,9 +46,9 @@ class NodeMarkedDown extends Netmails //implements ShouldQueue
->addText(sprintf("Your system has been marked **DOWN**, because it hasnt polled **%s** with address %s since **%s** (%d days).\r",$this->ao->zone->domain->name,$this->ao->ftn4d,$this->ao->system->last_seen?->format('Y-m-d') ?: 'Not seen',$this->ao->system->last_seen?->diffInDays($now)))
->addText("\r")
->addText("You have (waiting for collection):\r")
->addText(sprintf('* %s Netmails',number_format($this->ao->netmailWaiting()->count())))
->addText(sprintf('* %s Echomails',number_format($this->ao->echomailWaiting()->count())))
->addText(sprintf('* %s Files',number_format($this->ao->filesWaiting()->count())))
->addText(sprintf("* %s Netmails\r",number_format($this->ao->netmailWaiting()->count())))
->addText(sprintf("* %s Echomails\r",number_format($this->ao->echomailWaiting()->count())))
->addText(sprintf("* %s Files\r",number_format($this->ao->filesWaiting()->count())))
->addText("\r")
->addText(sprintf("Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**\r\r",$now->addDays(7)->format('Y-m-d')))
->addText("If you think you've received this netmail by mistake or need help, please let me know.\r");

View File

@ -47,9 +47,9 @@ class NodeMarkedHold extends Netmails //implements ShouldQueue
->addText(sprintf("Your system has been marked **HOLD**, because it hasnt polled **%s** with address %s since **%s** (%d days).\r",$this->ao->zone->domain->name,$this->ao->ftn4d,$this->ao->system->last_seen?->format('Y-m-d') ?: 'Not seen',$this->ao->system->last_seen?->diffInDays($now)))
->addText("\r")
->addText("You have (waiting for collection):\r")
->addText(sprintf('* %s Netmails',number_format($this->ao->netmailWaiting()->count())))
->addText(sprintf('* %s Echomails',number_format($this->ao->echomailWaiting()->count())))
->addText(sprintf('* %s Files',number_format($this->ao->filesWaiting()->count())))
->addText(sprintf("* %s Netmails\r",number_format($this->ao->netmailWaiting()->count())))
->addText(sprintf("* %s Echomails\r",number_format($this->ao->echomailWaiting()->count())))
->addText(sprintf("* %s Files\r",number_format($this->ao->filesWaiting()->count())))
->addText("\r")
->addText(sprintf("To clear this status, all you need to do make sure your system polls and collects mail by **%s**\r\r",($this->ao->system->last_seen ?: Carbon::now())->addDays(config('fido.idle.down'))->format('Y-m-d')))
->addText("If you think you've received this netmail by mistake or need help, please let me know.\r");

View File

@ -0,0 +1,104 @@
<?php
namespace App\Notifications\Netmails;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\Log;
use App\Classes\FTN\Message;
use App\Notifications\Netmails;
use App\Models\{Address,Netmail};
use App\Traits\PageTemplate;
class NodesNew extends Netmails //implements ShouldQueue
{
use Queueable,PageTemplate;
private const LOGKEY = 'NNN';
private Carbon $since;
private Collection $list;
/**
* Create a new notification instance.
*/
public function __construct(Carbon $since,Collection $list)
{
parent::__construct();
$this->list = $list;
$this->since = $since;
}
/**
* Get the mail representation of the notification.
*/
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Sending a NEW NODE LIST to [%s] at address [%s]',self::LOGKEY,$ao->system->sysop,$ao->ftn));
$o->subject = sprintf('Here is a list of new nodes on clrghouz since %s',$x=$this->since->format('Y-m-d'));
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
// Message
$msg = $this->page(FALSE,'new nodes');
$msg->addText(sprintf("Hi %s,\r\r",$ao->system->sysop))
->addText(sprintf("The following new system have been defined on clrghouz since %s.\r\r",$x));
$this->list->loadMissing(['system']);
$space = str_repeat(' ',$this->list->pluck('ftn4d')->max(fn($item)=>strlen($item))+2);
$c = 0;
foreach ($this->list as $oo) {
if ($c++)
$msg->addText("\r");
$msg->addText(sprintf("* %s - %s from %s.\r",$oo->ftn4D,$oo->system->sysop,$oo->system->location));
if ($oo->system->method) {
switch ($oo->system->method) {
case 23:
$msg->addText(sprintf("%s - BBS is available TELNET [%s:%d]\r",$space,$oo->system->address,$oo->system->port));
break;
case 22:
$msg->addText(sprintf("%s - BBS is available SSH [%s:%d]\r",$space,$oo->system->address,$oo->system->port));
break;
case 519:
$msg->addText(sprintf("%s - BBS is available RLOGIN [%s:%d]\r",$space,$oo->system->address,$oo->system->port));
break;
default:
$msg->addText(sprintf("%s - No Details available for connecting to BBS\r",$space));
}
}
if ($oo->system->mailers->count()) {
$msg->addText("\r");
$msg->addText(sprintf("%s - Mail can be sent using:\r",$space));
foreach ($oo->system->mailers as $mo) {
$msg->addText(sprintf("%s * %s [%s:%d]\r",$space,$mo->name,$oo->system->address,$mo->pivot->port));
}
} else {
$msg->addText(sprintf("%s - No mailer information provided, so will be PRIVATE\r",$space));
}
}
$o->msg = $msg->render();
$o->set_tagline = 'All aboard!';
$o->save();
return $o;
}
}

View File

@ -5,15 +5,18 @@ namespace App\Providers;
use Illuminate\Http\Request;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;
use App\Events\Echomail as EchomailEvent;
use App\Events\Matrix\Message;
use App\Listeners\EchomailListener;
use App\Listeners\Matrix\MessageListener;
use App\Notifications\Channels\{EchomailChannel,MatrixChannel,NetmailChannel};
use App\Models\{Echomail,Netmail};
use App\Models\{Echomail,Netmail,User};
use App\Traits\SingleOrFail;
class AppServiceProvider extends ServiceProvider
@ -51,10 +54,21 @@ class AppServiceProvider extends ServiceProvider
{
static::bootSingleOrFail();
// Add our page assets
Blade::directive('pa',function($expression) {
return sprintf('<?php PageAssets::asset(\'%s\') ?>',$expression);
});
Auth::viaRequest('matrix-token',function (Request $request) {
return (config('matrix.hs_token') && ($request->bearerToken() === config('matrix.hs_token'))) ? TRUE : NULL;
});
// Mailer Admin
Gate::define('admin',fn(User $o)=>($o->admin === TRUE));
// ZC of a Zone
Gate::define('zc',fn(User $o)=>(($o->admin === TRUE) || $o->ZC()));
Event::listen(
Message::class,
MessageListener::class,
@ -62,7 +76,7 @@ class AppServiceProvider extends ServiceProvider
// @todo This should be detected automatically?
Event::listen(
\App\Events\Echomail::class,
EchomailEvent::class,
EchomailListener::class,
);
}

View File

@ -1,36 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use App\Models\User;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
//'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
// Mailer Admin
Gate::define('admin',fn(User $o)=>($o->admin === TRUE));
// ZC of a Zone
Gate::define('zc',fn(User $o)=>(($o->admin === TRUE) || $o->ZC()));
}
}

View File

@ -1,21 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@ -1,63 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
public const HOME = '/';
/**
* The controller namespace for the application.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'App\\Http\\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
}
}

View File

@ -13,6 +13,7 @@ trait SingleOrFail
private static function bootSingleOrFail(): void
{
// When a query should return 1 object, or FAIL if it doesnt
// @deprecated use sole()
Builder::macro('singleOrFail',function () {
$result = $this->get();

View File

@ -98,7 +98,7 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
$so = Config::get('setup');
$so->loadMissing([
'system:id,name',
'system:id,name,sysop,location',
'system.akas:addresses.id,addresses.zone_id,region_id,host_id,node_id,point_id,addresses.system_id,addresses.active,role',
'system.akas.zone:id,domain_id,zone_id',
'system.akas.zone.domain:id,name',
@ -114,6 +114,7 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
// We are requesting a list of addresses for a Domain, or a specific Address, and we have more than 1
switch (get_class($o)) {
// Looking for addresses in the same domain, and if fido.strict, addresses that have a higher role (ie: uplink)
case Address::class:
$filter = $so->system->akas
->filter(fn($item)=>$item->zone->domain_id === $o->zone->domain_id)
@ -125,6 +126,7 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
return $filter->count() ? $filter->last()->unsetRelation('nodes_hub') : NULL;
// Addresses in this domain
case Domain::class:
return $so->system->akas
->filter(fn($item)=>$item->zone->domain_id === $o->id)

View File

@ -1,55 +1,27 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
$app = new Illuminate\Foundation\Application(
dirname(__DIR__)
);
use App\Http\Middleware\{ActiveUser,AddUserToView};
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
$middleware->appendToGroup('web', [
AddUserToView::class,
]);
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;
$middleware->alias([
'activeuser' => ActiveUser::class,
]);
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();

6
bootstrap/providers.php Normal file
View File

@ -0,0 +1,6 @@
<?php
return [
App\Providers\AppServiceProvider::class,
App\Providers\CustomBladeServiceProvider::class,
];

View File

@ -5,7 +5,7 @@
"keywords": ["framework","laravel"],
"license": "MIT",
"require": {
"php": "^8.2|8.3",
"php": "^8.3",
"ext-bz2": "*",
"ext-pcntl": "*",
"ext-sockets": "*",

24
composer.lock generated
View File

@ -127,16 +127,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.325.0",
"version": "3.325.2",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "ea36e53745cff21519c2dadd808e2482f0bfadf5"
"reference": "9e354a5e0cd1d563ec85245e3000e98e16a44fce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/ea36e53745cff21519c2dadd808e2482f0bfadf5",
"reference": "ea36e53745cff21519c2dadd808e2482f0bfadf5",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9e354a5e0cd1d563ec85245e3000e98e16a44fce",
"reference": "9e354a5e0cd1d563ec85245e3000e98e16a44fce",
"shasum": ""
},
"require": {
@ -219,9 +219,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.325.0"
"source": "https://github.com/aws/aws-sdk-php/tree/3.325.2"
},
"time": "2024-10-30T18:11:21+00:00"
"time": "2024-11-01T18:08:38+00:00"
},
{
"name": "brick/math",
@ -2625,20 +2625,20 @@
},
{
"name": "nesbot/carbon",
"version": "3.8.0",
"version": "3.8.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f"
"reference": "10ac0aa86b8062219ce21e8189123d611ca3ecd9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/10ac0aa86b8062219ce21e8189123d611ca3ecd9",
"reference": "10ac0aa86b8062219ce21e8189123d611ca3ecd9",
"shasum": ""
},
"require": {
"carbonphp/carbon-doctrine-types": "*",
"carbonphp/carbon-doctrine-types": "<100.0",
"ext-json": "*",
"php": "^8.1",
"psr/clock": "^1.0",
@ -2727,7 +2727,7 @@
"type": "tidelift"
}
],
"time": "2024-08-19T06:22:39+00:00"
"time": "2024-11-03T16:02:24+00:00"
},
{
"name": "nette/schema",

View File

@ -2,244 +2,127 @@
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application, which will be used when the
| framework needs to place the application's name in a notification or
| other UI elements where an application name needs to be displayed.
|
*/
'name' => env('APP_NAME', 'Laravel'),
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| the application so that it's available within Artisan commands.
|
*/
'url' => env('APP_URL', 'http://localhost'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. The timezone
| is set to "UTC" by default as it is suitable for most use cases.
|
*/
'timezone' => env('APP_TIMEZONE', 'UTC'),
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by Laravel's translation / localization methods. This option can be
| set to any locale for which you plan to have translation strings.
|
*/
'locale' => env('APP_LOCALE', 'en'),
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is utilized by Laravel's encryption services and should be set
| to a random, 32 character string to ensure that all encrypted values
| are secure. You should do this prior to deploying the application.
|
*/
'cipher' => 'AES-256-CBC',
'key' => env('APP_KEY'),
'previous_keys' => [
...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', ''))
),
],
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
// @todo MOVE this to a clrghouz configuration file
'id' => env('APP_SETUP_ID', 1),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
// Where the maintenance mode file is stored when calling down
'maintenance' => [
'driver' => 'cache',
//'store' => 'memcached',
],
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => env('APP_TIMEZONE', 'UTC'),
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\CustomBladeServiceProvider::class,
/*
* Other Service Providers...
*/
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Asset' => Orchestra\Support\Facades\Asset::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Carbon' => \Carbon\Carbon::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];

View File

@ -2,140 +2,114 @@
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option defines the default authentication "guard" and password
| reset "broker" for your application. You may change these values
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
'api' => [
'driver' => 'sanctum',
'provider' => 'users',
'hash' => false,
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| If you have multiple user tables or models you may configure multiple
| providers to represent the model / table. These providers may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'token' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
],
'matrix' => [
'driver' => 'matrix-token',
]
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| These configuration options specify the behavior of Laravel's password
| reset functionality, including the table utilized for token storage
| and the user provider that is invoked to actually retrieve users.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
'passwords' => [
'users' => [
'provider' => 'users',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
/*
|--------------------------------------------------------------------------
| Social Network Configuration
|--------------------------------------------------------------------------
*/
'social' => [
'w3id' => [
'name' => 'W3id',
'id' => 'w3id',
'class' => 'btn-primary',
'icon' => 'fas fa-address-card',
],
],
];
];

View File

@ -1,59 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

View File

@ -9,15 +9,13 @@ return [
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file", "memcached", "redis"
| This option controls the default cache store that will be used by the
| framework. This connection is utilized if another isn't explicitly
| specified when running a cache operation inside the application.
|
*/
'default' => env('CACHE_DRIVER', 'file'),
'default' => env('CACHE_STORE', 'database'),
/*
|--------------------------------------------------------------------------
@ -28,27 +26,30 @@ return [
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "array", "database", "file", "memcached",
| "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
@ -59,7 +60,7 @@ return [
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
@ -72,7 +73,21 @@ return [
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
@ -82,12 +97,12 @@ return [
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
| stores, there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

View File

@ -1,5 +1,7 @@
<?php
use Illuminate\Support\Str;
return [
/*
@ -8,26 +10,22 @@ return [
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
| to use as your default connection for database operations. This is
| the connection which will be utilized unless another connection
| is explicitly specified when you execute a query / statement.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
'default' => env('DB_CONNECTION', 'sqlite'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
| Below are all of the database connections defined for your application.
| An example configuration is provided for each database system which
| is supported by Laravel. You're free to add / remove connections.
|
*/
@ -35,6 +33,7 @@ return [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
@ -42,81 +41,72 @@ return [
'mysql' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mariadb' => [
'driver' => 'mariadb',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'disable', //depends on your security level https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
'sslrootcert' => env('DB_SSLROOTCERT', 'config/ssl/ca.crt'),
'sslcert' => env('DB_SSLCERT', 'config/ssl/client.crt'),
'sslkey' => env('DB_SSLKEY', 'config/ssl/client.key'),
'search_path' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
'cockroach' => [
'driver' => 'cockroach',
'host' => env('DB_HOST', 'HOSTNAME-OF-COCKROACH-SERVER'),
'port' => env('DB_PORT', '26257'),
'database' => env('DB_DATABASE', 'DATABASE-NAME'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'schema' => 'public',
'sslmode' => env('DB_SSLMODE', 'prefer'),
// Only set these keys if you want to run en secure mode
// otherwise you can them out of the configuration array
'sslcert' => env('DB_SSLCERT', 'config/ssl/client.crt'),
'sslkey' => env('DB_SSLKEY', 'config/ssl/client.key'),
'sslrootcert' => env('DB_SSLROOTCERT', 'config/ssl/ca.crt'),
],
'mongodb' => [
'driver' => 'mongodb',
'host' => env('DB_MONGO_HOST', '127.0.0.1'),
'port' => env('DB_MONGO_PORT', 27017),
'database' => env('DB_MONGO_DATABASE', 'fido'),
'username' => env('DB_MONGO_USERNAME', 'mongo'),
'password' => env('DB_MONGO_PASSWORD', 'password'),
'options' => [
// here you can pass more settings to the Mongo Driver Manager
// see https://www.php.net/manual/en/mongodb-driver-manager.construct.php under "Uri Options" for a list of complete parameters that you can use
'database' => env('DB_AUTHENTICATION_DATABASE', 'admin'), // required with Mongo 3+
],
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
@ -128,11 +118,14 @@ return [
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
| the migrations on disk haven't actually been run on the database.
|
*/
'migrations' => 'migrations',
'migrations' => [
'table' => 'migrations',
'update_date_on_publish' => true,
],
/*
|--------------------------------------------------------------------------
@ -141,26 +134,35 @@ return [
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
| such as Memcached. You may define your connection settings here.
|
*/
'redis' => [
'client' => 'phpredis',
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],

View File

@ -9,7 +9,7 @@ return [
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
| based disks are available to your application for file storage.
|
*/
@ -20,11 +20,11 @@ return [
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been set up for each driver as an example of the required values.
| Below you may configure as many filesystem disks as necessary, and you
| may even configure multiple disks for the same driver. Examples for
| most supported storage drivers are configured here for reference.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
| Supported drivers: "local", "ftp", "sftp", "s3"
|
*/
@ -33,7 +33,7 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => true,
'throw' => false,
],
'public' => [
@ -53,7 +53,7 @@ return [
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => true,
'throw' => false,
],
],

View File

@ -1,52 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

View File

@ -3,6 +3,7 @@
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
return [
@ -11,33 +12,49 @@ return [
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
| This option defines the default log channel that is utilized to write
| messages to your logs. The value provided here should match one of
| the channels present in the list of "channels" configured below.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
| Here you may configure the log channels for your application. Laravel
| utilizes the Monolog PHP logging library, which includes a variety
| of powerful log handlers and formatters that you're free to use.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
| Available drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['daily'],
'channels' => explode(',', env('LOG_STACK', 'single')),
'ignore_exceptions' => false,
],
@ -45,31 +62,36 @@ return [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 93,
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
@ -80,16 +102,20 @@ return [
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
@ -100,6 +126,7 @@ return [
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

View File

@ -7,13 +7,14 @@ return [
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
| This option controls the default mailer that is used to send all email
| messages unless another mailer is explicitly specified when sending
| the message. All additional mailers can be configured within the
| "mailers" array. Examples of each type of mailer are provided.
|
*/
'default' => env('MAIL_MAILER', 'smtp'),
'default' => env('MAIL_MAILER', 'log'),
/*
|--------------------------------------------------------------------------
@ -24,43 +25,49 @@ return [
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
| Laravel supports a variety of mail "transport" drivers that can be used
| when delivering an email. You may specify which one you're using for
| your mailers below. You may also add additional mailers if needed.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "resend", "log", "array",
| "failover", "roundrobin"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
'verify_peer' => false,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],
'ses' => [
'transport' => 'ses',
],
'mailgun' => [
'transport' => 'mailgun',
],
'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
// 'client' => [
// 'timeout' => 5,
// ],
],
'resend' => [
'transport' => 'resend',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
@ -71,6 +78,23 @@ return [
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],
],
/*
@ -78,9 +102,9 @@ return [
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
| You may wish for all emails sent by your application to be sent from
| the same address. Here you may specify a name and address that is
| used globally for all emails that are sent by your application.
|
*/
@ -89,23 +113,4 @@ return [
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];

View File

@ -7,22 +7,22 @@ return [
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
| Laravel's queue supports a variety of backends via a single, unified
| API, giving you convenient access to each backend using identical
| syntax for each. The default queue connection is defined below.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
'default' => env('QUEUE_CONNECTION', 'database'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
| Here you may configure the connection options for every queue backend
| used by your application. An example configuration is provided for
| each backend supported by Laravel. You're also free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
@ -35,53 +35,77 @@ return [
],
'database' => [
//'connection' => 'jobs',
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('SQS_KEY', 'your-public-key'),
'secret' => env('SQS_SECRET', 'your-secret-key'),
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('SQS_REGION', 'us-east-1'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'after_commit' => false,
],
],
/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/
'batching' => [
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
| can control how and where failed jobs are stored. Laravel ships with
| support for storing failed jobs in a simple file or in a database.
|
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'pgsql'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
],

View File

@ -14,12 +14,6 @@ return [
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
@ -30,11 +24,15 @@ return [
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'w3id' => [
'access' => env('AUTH_W3ID_BLUEGROUP_ACCESS'),
'admin' => env('AUTH_W3ID_BLUEGROUP_ADMIN'),
'client_id' => env('AUTH_W3ID_CLIENT_ID'),
'client_secret' => env('AUTH_W3ID_SECRET'),
'redirect' => '/auth/w3id/callback',
],
'resend' => [
'key' => env('RESEND_KEY'),
],
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],
];

View File

@ -9,16 +9,16 @@ return [
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
| This option determines the default session driver that is utilized for
| incoming requests. Laravel supports a variety of storage options to
| persist session data. Database storage is a great default choice.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
'driver' => env('SESSION_DRIVER', 'database'),
/*
|--------------------------------------------------------------------------
@ -27,13 +27,14 @@ return [
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
| to expire immediately when the browser is closed then you may
| indicate that via the expire_on_close configuration option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
/*
|--------------------------------------------------------------------------
@ -41,21 +42,21 @@ return [
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
| should be encrypted before it's stored. All encryption is performed
| automatically by Laravel and you may use the session like normal.
|
*/
'encrypt' => false,
'encrypt' => env('SESSION_ENCRYPT', false),
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
| When utilizing the "file" session driver, the session files are placed
| on disk. The default storage location is defined here; however, you
| are free to provide another location where they should be stored.
|
*/
@ -72,33 +73,35 @@ return [
|
*/
'connection' => env('SESSION_CONNECTION', null),
'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
| When using the "database" session driver, you may specify the table to
| be used to store sessions. Of course, a sensible default is defined
| for you; however, you're welcome to change this to another table.
|
*/
'table' => 'sessions',
'table' => env('SESSION_TABLE', 'sessions'),
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc" or "memcached" session drivers, you may specify a
| cache store that should be used for these sessions. This value must
| correspond with one of the application's configured cache stores.
| When using one of the framework's cache driven session backends, you may
| define the cache store which should be used to store the session data
| between requests. This must match one of your defined cache stores.
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE', null),
'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
@ -118,9 +121,9 @@ return [
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
| Here you may change the name of the session cookie that is created by
| the framework. Typically, you should not need to change this value
| since doing so does not grant a meaningful security improvement.
|
*/
@ -136,24 +139,24 @@ return [
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
| your application, but you're free to change this when necessary.
|
*/
'path' => '/',
'path' => env('SESSION_PATH', '/'),
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
| This value determines the domain and subdomains the session cookie is
| available to. By default, the cookie will be available to the root
| domain and all subdomains. Typically, this shouldn't be changed.
|
*/
'domain' => env('SESSION_DOMAIN', null),
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------
@ -162,11 +165,11 @@ return [
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
| the cookie from being sent to you when it can't be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE', false),
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
@ -175,11 +178,11 @@ return [
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
| the HTTP protocol. It's unlikely you should disable this option.
|
*/
'http_only' => true,
'http_only' => env('SESSION_HTTP_ONLY', true),
/*
|--------------------------------------------------------------------------
@ -188,12 +191,27 @@ return [
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
| will set this value to "lax" to permit secure cross-site requests.
|
| Supported: "lax", "strict"
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => env('SESSION_SAME_SITE', 'lax'),
/*
|--------------------------------------------------------------------------
| Partitioned Cookies
|--------------------------------------------------------------------------
|
| Setting this value to true will tie the cookie to the top-level site for
| a cross-site context. Partitioned cookies are accepted by the browser
| when flagged "secure" and the Same-Site attribute is set to "none".
|
*/
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
];

View File

@ -1,33 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => realpath(storage_path('framework/views')),
];

View File

@ -28,9 +28,7 @@ $user->load(['systems.akas.zone.domain.echoareas','systems.akas.echoareas']);
@foreach($user
->addresses()
->diff(our_address())
->filter(fn($item)=>($item->point_id === 0))
->filter(function($item) { return $item->zone->domain->active && $item->zone->domain->public && $item->zone->domain->isManaged(); })
->sortBy('zone.domain.name')
->filter(fn($item)=>($item->point_id === 0) && ($item->zone->domain->isManaged()))
->groupBy('zone.domain.name') as $list)
<!-- {{ $x=$list->first()->domain->name }} -->
<div class="accordion-item">

View File

@ -1,14 +1,12 @@
@use(App\Models\Echoarea)
<!-- $o=Domain::class -->
@extends('layouts.app')
@section('htmlheader_title')
@if($o->exists) Update @else Add @endif Domain
@endsection
@php
use App\Models\Echoarea;
@endphp
@section('content')
<form class="needs-validation" method="post" novalidate>
@csrf
@ -107,16 +105,18 @@ use App\Models\Echoarea;
</div>
<div class="col-2">
<label class="form-label">Applications</label>
<div class="input-group">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="accept_app" id="accept_app_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('accept_app',$o->accept_app))checked @endif>
<label class="btn btn-outline-success" for="accept_app_yes">Yes</label>
@if ($o->isManaged())
<label class="form-label">Applications</label>
<div class="input-group">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="accept_app" id="accept_app_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('accept_app',$o->accept_app))checked @endif>
<label class="btn btn-outline-success" for="accept_app_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="accept_app" id="accept_app_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('accept_app',$o->accept_app))checked @endif>
<label class="btn btn-outline-danger" for="accept_app_no">No</label>
<input type="radio" class="btn-check btn-danger" name="accept_app" id="accept_app_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('accept_app',$o->accept_app))checked @endif>
<label class="btn btn-outline-danger" for="accept_app_no">No</label>
</div>
</div>
</div>
@endif
</div>
@if ($o->nodelist_filename)
@ -136,22 +136,24 @@ use App\Models\Echoarea;
<div class="col-8">
</div>
<div class="col-4">
<label for="nodestatus_id" class="form-label">Echoarea Node Status</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-journal-text"></i></span>
<select style="width: 80%;" class="form-select @error('nodestatus_id') is-invalid @enderror" id="nodestatus_id" name="nodestatus_id" @cannot('admin',$o)disabled @endcannot>
<option value="">&nbsp;</option>
@foreach (Echoarea::active()->where('domain_id',$o->id)->orderBy('description')->cursor() as $oo)
<option value="{{ $oo->id }}" @if(old('nodestatus_id',$o->nodestatus_id)==$oo->id)selected @endif>{{ $oo->description }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('nodestatus_id')
{{ $message }}
@enderror
</span>
<span class="input-helper">Add a <a href="{{ url('echoarea/addedit') }}">NEW Echoarea</a>. This echoarea is used to send node status messages.</span>
</div>
@if ($o->isManaged())
<label for="nodestatus_id" class="form-label">Echoarea Node Status</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-journal-text"></i></span>
<select style="width: 80%;" class="form-select @error('nodestatus_id') is-invalid @enderror" id="nodestatus_id" name="nodestatus_id" @cannot('admin',$o)disabled @endcannot>
<option value="">&nbsp;</option>
@foreach (Echoarea::active()->where('domain_id',$o->id)->orderBy('description')->cursor() as $oo)
<option value="{{ $oo->id }}" @if(old('nodestatus_id',$o->nodestatus_id)==$oo->id)selected @endif>{{ $oo->description }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('nodestatus_id')
{{ $message }}
@enderror
</span>
<span class="input-helper">Add a <a href="{{ url('echoarea/addedit') }}">NEW Echoarea</a>. This echoarea is used to send node status messages.</span>
</div>
@endif
</div>
</div>

View File

@ -1,5 +1,6 @@
<!-- $o=Domain::class -->
@use(App\Models\Address)
@use(Illuminate\Mail\Markdown)
<!-- $o=Domain::class -->
@extends('layouts.app')
@section('htmlheader_title')
@ -137,12 +138,13 @@
<div id="collapse_systems" class="accordion-collapse collapse" aria-labelledby="systems" data-bs-parent="#accordion_homepage">
<div class="accordion-body">
<p>The following systems are members of this network.</p>
<table class="table monotable" id="system">
<table class="table monotable w-100" id="system">
<thead>
<tr>
<th>System</th>
<th>Sysop</th>
<th>Location</th>
<th>Region</th>
<th>Address</th>
<th>Last Echomail</th>
</tr>
@ -155,6 +157,7 @@
<td><a href="{{ url('system/addedit',[$ao->system_id]) }}">{{ $ao->system->full_name($ao) }}</a> @auth<span class="float-end"><small>@if($ao->is_hosted)<sup>{{ $ao->is_default ? '**' : '*' }}</sup>@elseif($ao->system->setup)<sup class="success">+</sup>@endif[{{ $ao->system_id }}]</small></span>@endauth</td>
<td>{{ $ao->system->sysop }}</td>
<td>{{ $ao->system->location }}</td>
<td>{{ $ao->region_id }}</td>
<td>{{ $ao->ftn4d }}</td>
<td>{{ $ao->echomail_from->count() ? $ao->echomail_from->first()->datetime->format('Y-m-d H:i') : '-' }}</td>
</tr>
@ -174,7 +177,7 @@
</div>
<!-- Sign up -->
@if ($o->can_accept_app)
@if ($o->can_accept_app && ($x=Auth::user()->systems->filter(fn($item)=>$item->address && (! $item->inDomain($o))))->count())
<div class="accordion-item">
<h3 class="accordion-header">
<span class="accordion-button collapsed" id="signup" data-bs-toggle="collapse" data-bs-target="#collapse_signup" aria-expanded="false" aria-controls="collapse_signup">Join Network</span>
@ -182,7 +185,10 @@
<div id="collapse_signup" class="accordion-collapse collapse" aria-labelledby="signup" data-bs-parent="#accordion_homepage">
<div class="accordion-body">
<p>Your system(s) <strong class="highlight">{!! $o->userHasSystemsNotInNet(Auth::user())->pluck('name')->join('</strong>, <strong class="highlight">') !!}</strong> can join this network.</p>
<p>Your system(s) <strong class="highlight">{!! $x->pluck('name')->sort()->join('</strong>, <strong class="highlight">') !!}</strong> can join this network.</p>
@if (($x=Auth::user()->systems->filter(fn($item)=>(! $item->address) && (! $item->inDomain($o))))->count())
<p><small>Your other systems(s) <strong class="highlight">{!! $x->pluck('name')->sort()->join('</strong>, <strong class="highlight">') !!}</strong> cant use this process, because they are missing network details.</small></p>
@endif
<p>
If you want to join it/them to this network, make sure:
</p>
@ -204,7 +210,7 @@
<li>Enjoy!</li>
</ul>
<button class="btn btn-success">Lets Do It</button>
<button class="btn btn-success">Lets Do It</button> <small><-- NOT READY YET</small>
</div>
</div>
</div>
@ -279,6 +285,18 @@
searching: true,
ordering: true,
order: [],
rowGroup: {
dataSrc: [3],
startRender: function(rows,group) {
return 'Region '+group;
}
},
columnDefs: [
{
targets: [3],
visible: false,
},
],
conditionalPaging: {
style: 'fade',
speed: 500 // optional

View File

@ -1,8 +1,8 @@
<!-- $o=System::class -->
@use(App\Models\Address)
@use(App\Models\Echomail)
@use(App\Models\File)
@use(App\Models\Netmail)
<!-- $o=System::class -->
@extends('layouts.app')
@ -20,7 +20,7 @@
@endif
@if($o->zcs->count())
<p>This system is the ZC for the following zones: <strong class="highlight">{!! $o->zcs->sortBy('zone_id')->map(function($item) { return sprintf('%d@%s',$item->zone_id,$item->domain->name); })->join('</strong>, <strong class="highlight">') !!} </strong></p>
<p>This system is the ZC for the following zones: <strong class="highlight">{!! $o->zcs->map(fn($item)=>sprintf('%d@%s',$item->zone_id,$item->domain->name))->join('</strong>, <strong class="highlight">') !!} </strong></p>
@endif
@include('widgets.error')
@ -123,9 +123,9 @@
</thead>
<tbody>
@foreach ($o->addresses->sortBy(function($item) { return sprintf('%04x%04x%04x%04x%04x',$item->zone->zone_id,$item->region_id,$item->host_id,$item->node_id,$item->point_id); }) as $oo)
@foreach ($o->addresses as $oo)
<tr>
<td @if($oo->trashed()) class="trashed" @elseif (! $oo->active) class="inactive" @endif>{{ $oo->ftn }}<span class="float-end"><data value="{{ $oo->id }}:{{ $oo->validated ? 1 : 0 }}" class="validated"><i title="@if($oo->validated)Mail flowing @else Mail held @endif" @class(['bi','bi-activity'=>$oo->validated,'bi-radioactive'=>(! $oo->validated)])></i></data></span></td>
<td @class(['trashed'=>$oo->trashed(),'inactive'=>(! $oo->trashed()) && (! $oo->active)])>{{ $oo->ftn }}<span class="float-end"><data value="{{ $oo->id }}:{{ $oo->validated ? 1 : 0 }}" class="validated"><i title="@if($oo->validated)Mail flowing @else Mail held @endif" @class(['bi','bi-activity'=>$oo->validated,'bi-radioactive'=>(! $oo->validated)])></i></data></span></td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td class="text-end">{{ $oo->security }}</td>
<td>{{ $oo->role_name }}</td>
@ -156,7 +156,6 @@
</tbody>
</table>
@endif
</div>
</div>
@ -213,7 +212,7 @@
</thead>
<tbody>
@foreach ($o->sessions->sortBy('zone_id') as $oo)
@foreach ($o->sessions as $oo)
<tr>
<td>{{ $oo->zone_id }}<span>@</span>{{ $oo->domain->name }}</td>
<td style="text-align: center;">
@ -321,10 +320,10 @@
</thead>
<tbody>
@foreach ($o->addresses->sortBy('zone.zone_id') as $ao)
@foreach ($o->addresses_common() as $ao)
<tr>
<td>{{ $ao->ftn }}</td>
<td>{{ $ao->netmailWaiting()->count() }}</td>
<td @class(['trashed'=>$ao->trashed(),'inactive'=>(! $ao->trashed()) && (! $ao->active)])>{{ $ao->ftn }}</td>
<td class="text-end">{{ $ao->netmailWaiting()->count() }}</td>
</tr>
@endforeach
</tbody>
@ -343,10 +342,10 @@
</thead>
<tbody>
@foreach ($o->addresses->sortBy('zone.zone_id') as $ao)
@foreach ($o->addresses_common() as $ao)
<tr>
<td>{{ $ao->ftn }}</td>
<td>{{ $ao->echomailWaiting()->count() }}</td>
<td @class(['trashed'=>$ao->trashed(),'inactive'=>(! $ao->trashed()) && (! $ao->active)])>{{ $ao->ftn }}</td>
<td class="text-end">{{ $ao->echomailWaiting()->count() }}</td>
</tr>
@endforeach
</tbody>
@ -365,10 +364,10 @@
</thead>
<tbody>
@foreach ($o->addresses->sortBy('zone.zone_id') as $ao)
@foreach ($o->addresses_common() as $ao)
<tr>
<td>{{ $ao->ftn }}</td>
<td>{{ $ao->filesWaiting()->count() }}</td>
<td @class(['trashed'=>$ao->trashed(),'inactive'=>(! $ao->trashed()) && (! $ao->active)])>{{ $ao->ftn }}</td>
<td class="text-end">{{ $ao->filesWaiting()->count() }}</td>
</tr>
@endforeach
</tbody>

View File

@ -1,91 +1,84 @@
@if(($x=\App\Models\Zone::active()
->whereIn('id',$o->sessions->pluck('pivot.zone_id'))
->orderBy('zone_id')
->with(['domain'])
->get())->count())
<form class="needs-validation" method="post" action="{{ url('system/echoarea',$o->id) }}" novalidate>
@csrf
<form class="needs-validation" method="post" action="{{ url('system/echoarea',$o->id) }}" novalidate>
@csrf
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<div class="row">
<!-- Select Domain -->
<div class="col-3">
<label for="echoarea_domain_id" class="form-label">Network</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="echoarea_domain_id" name="domain_id" required>
<option></option>
@foreach($x as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Select Address -->
<div class="col-3">
<div class="d-none" id="echoarea_address-select">
<label for="echoarea_address_id" class="form-label">Address</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select" id="echoarea_address_id" name="address_id" required>
<option></option>
</select>
</div>
</div>
</div>
<!-- Summary of Addresses -->
<div class="offset-3 col-3" id="echoarea-summary">
<table class="table monotable">
<thead>
<tr>
<th>Network</th>
<th class="text-end">Areas</th>
</tr>
</thead>
<tbody>
@foreach ($o->echoareas()->with(['domain'])->get()->groupBy('domain_id') as $oo)
<tr>
<td>{{ $oo->first()->domain->name }}</td>
<td class="text-end">{{ $oo->count() }}</td>
</tr>
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<div class="row">
<!-- Select Domain -->
<div class="col-3">
<label for="echoarea_domain_id" class="form-label">Network</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="echoarea_domain_id" name="domain_id" required>
<option></option>
@foreach($o->sessions as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</tbody>
</table>
</div>
</div>
@if($errors->count())
<div class="row">
<span class="btn btn-sm btn-danger" role="alert" style="text-align: left;">
There were errors with the submission.
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@enderror
</span>
</div>
@endif
<div class="row">
<div class="col-12 d-none" id="echoarea-select"></div>
</div>
<!-- Select Address -->
<div class="col-3">
<div class="d-none" id="echoarea_address-select">
<label for="echoarea_address_id" class="form-label">Address</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select" id="echoarea_address_id" name="address_id" required>
<option></option>
</select>
</div>
</div>
</div>
<!-- Summary of Addresses -->
<div class="offset-3 col-3" id="echoarea-summary">
<table class="table monotable">
<thead>
<tr>
<th>Network</th>
<th class="text-end">Areas</th>
</tr>
</thead>
<tbody>
@foreach ($o->echoareas()->with(['domain'])->get()->groupBy('domain_id') as $oo)
<tr>
<td>{{ $oo->first()->domain->name }}</td>
<td class="text-end">{{ $oo->count() }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@if($errors->count())
<div class="row">
<span class="btn btn-sm btn-danger" role="alert" style="text-align: left;">
There were errors with the submission.
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</span>
</div>
@endif
<div class="row">
<div class="col-12 d-none" id="echoarea-select"></div>
</div>
</div>
</div>
</form>
@endif
</div>
</form>
@section('page-scripts')
<script type="text/javascript" src="{{ asset('plugin/checkboxes/jquery.checkboxes-1.2.2.min.js') }}"></script>

View File

@ -1,78 +1,71 @@
@if(($x=\App\Models\Zone::active()
->whereIn('id',$o->sessions->pluck('pivot.zone_id'))
->orderBy('zone_id')
->with(['domain'])
->get())->count())
<form class="needs-validation" method="post" action="{{ url('system/filearea',$o->id) }}" novalidate>
@csrf
<form class="needs-validation" method="post" action="{{ url('system/filearea',$o->id) }}" novalidate>
@csrf
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<div class="row">
<!-- Select Domain -->
<div class="col-3">
<label for="domain_id" class="form-label">Network</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="filearea_domain_id" name="domain_id" required>
<option></option>
@foreach($x as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Select Address -->
<div class="col-3">
<div class="d-none" id="filearea_address-select">
<label for="filearea_address_id" class="form-label">Address</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select" id="filearea_address_id" name="address_id" required>
<option></option>
</select>
</div>
</div>
</div>
<!-- Summary of Addresses -->
<div class="offset-3 col-3" id="filearea-summary">
<table class="table monotable">
<thead>
<tr>
<th>Network</th>
<th class="text-end">Areas</th>
</tr>
</thead>
<tbody>
@foreach ($o->fileareas()->with(['domain'])->get()->groupBy('domain_id') as $oo)
<tr>
<td>{{ $oo->first()->domain->name }}</td>
<td class="text-end">{{ $oo->count() }}</td>
</tr>
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<div class="row">
<!-- Select Domain -->
<div class="col-3">
<label for="domain_id" class="form-label">Network</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="filearea_domain_id" name="domain_id" required>
<option></option>
@foreach($o->sessions as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</tbody>
</table>
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@enderror
</span>
</div>
</div>
<div class="row">
<div class="col-12 d-none" id="filearea-select"></div>
<!-- Select Address -->
<div class="col-3">
<div class="d-none" id="filearea_address-select">
<label for="filearea_address_id" class="form-label">Address</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select" id="filearea_address_id" name="address_id" required>
<option></option>
</select>
</div>
</div>
</div>
<!-- Summary of Addresses -->
<div class="offset-3 col-3" id="filearea-summary">
<table class="table monotable">
<thead>
<tr>
<th>Network</th>
<th class="text-end">Areas</th>
</tr>
</thead>
<tbody>
@foreach ($o->fileareas()->with(['domain'])->get()->groupBy('domain_id') as $oo)
<tr>
<td>{{ $oo->first()->domain->name }}</td>
<td class="text-end">{{ $oo->count() }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-12 d-none" id="filearea-select"></div>
</div>
</div>
</div>
</form>
@endif
</div>
</form>
@section('page-scripts')
<script type="text/javascript" src="{{ asset('plugin/checkboxes/jquery.checkboxes-1.2.2.min.js') }}"></script>

View File

@ -6,7 +6,7 @@
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">@can($action,$o) @if($o->exists) Update @else Add @endif @endif System</h2>
<h2 class="cap">@can($action,$o) @if($o->exists) Update @else Add @endif @endcan System</h2>
@include('system.widget.system')
</div>

View File

@ -1,15 +1,9 @@
@php
use App\Models\{Address,Zone};
@endphp
@use(App\Models\Address)
<!-- $o=System::class -->
<div class="row">
<!-- Zone mail sent to -->
<!-- Zone mail sent to, because we dont have session details for these addresses -->
<div class="col-6">
@if(! $o->setup && ($x=Zone::active()
->whereIn('id',$o->zones->pluck('id'))
->whereNotIn('id',$o->sessions->pluck('id'))
->get())->count())
@if($o->aka_unknown()->count())
<h4>This host's mail is sent to:</h4>
<table class="table monotable">
<thead>
@ -20,19 +14,17 @@
</thead>
<tbody>
@foreach($x as $zo)
@foreach ($o->match($zo,Address::NODE_ALL) as $oo)
<tr>
<td>{{ $oo->ftn }}</td>
<td>
@if ($x=$oo->uplink())
{{ $x->ftn4d }}
@else
None
@endif
</td>
</tr>
@endforeach
@foreach($o->aka_unknown() as $ao)
<tr>
<td>{{ $ao->ftn }}</td>
<td>
@if ($xx=$ao->uplink())
{{ $xx->ftn4d }}
@else
None
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@ -41,28 +33,62 @@
<!-- Systems this host collects for -->
<div class="col-6">
@if($o->sessions->count())
<h4>This host collects mail for the following systems:</h4>
<div class="row">
<div class="col-12">
@if($o->sessions->count())
<h4>This host collects mail for the following systems:</h4>
<table class="table monotable">
<thead>
<tr>
<th>AKA</th>
<th>For Systems(s)</th>
</tr>
</thead>
<tbody>
@foreach ($o->sessions->sortBy('zone_id') as $zo)
@foreach ($o->match($zo,Address::NODE_ALL) as $oo)
<table class="table monotable">
<thead>
<tr>
<td>{{ $oo->ftn }}</td>
<td>{!! (($x=$oo->downlinks()) && $x->count()) ? $x->pluck('ftn')->join('<br>') : 'None' !!}</td>
<th>AKA</th>
<th>Incl Systems(s)</th>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</thead>
<tbody>
@foreach ($o->sessions->sortBy('zone_id') as $zo)
@if($zo->pivot->default)
<tr>
<td>{!! $o->akas->filter(fn($item)=>$item->zone->domain_id === $zo->domain_id)->pluck('ftn')->join('<br>') !!}</td>
<td>All <small>(not otherwise routed)</small></td>
</tr>
@else
@foreach ($o->match($zo,Address::NODE_ALL) as $oo)
<tr>
<td>{{ $oo->ftn }}</td>
<td>{!! (($x=$oo->downlinks()) && $x->count()) ? $x->pluck('ftn')->join('<br>') : 'None' !!}</td>
</tr>
@endforeach
@endif
@endforeach
</tbody>
</table>
@endif
</div>
</div>
@if($o->aka_uncommon()->count())
<div class="row">
<div class="rol-12">
<h4>This host's mail not known here:</h4>
<table class="table monotable">
<thead>
<tr>
<th>AKA</th>
</tr>
</thead>
<tbody>
@foreach($o->aka_uncommon() as $ao)
<tr>
<td>{{ $ao->ftn }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
</div>

View File

@ -1,8 +1,6 @@
@php
use App\Classes\FTN\Packet;
use App\Models\{Mailer,User};
@endphp
@use(App\Classes\FTN\Packet)
@use(App\Models\Mailer)
@use(App\Models\User)
<!-- $o=System::class -->
<div class="row">
<div class="col-xl-9 col-12">
@ -20,7 +18,7 @@ use App\Models\{Mailer,User};
<select style="width: 80%;" class="form-select @error('users') is-invalid @enderror" id="users" name="users[]">
<option value="">&nbsp;</option>
@foreach (User::orderBy('name')->active()->get() as $uo)
<option value="{{ $uo->id }}" @if(in_array($uo->id,old('users',$o->users->pluck('id')->toArray())))selected @endif>{{ $uo->name }} <small>({{ $uo->email }})</small></option>
<option value="{{ $uo->id }}" @selected(in_array($uo->id,old('users',$o->users->pluck('id')->toArray())))>{{ $uo->name }} <small>({{ $uo->email }})</small></option>
@endforeach
</select>
@ -325,8 +323,6 @@ use App\Models\{Mailer,User};
</div>
</div>
@endcan
</div>
@if(! is_null($o->pollmode))
@ -438,9 +434,6 @@ use App\Models\{Mailer,User};
@else
<input type="hidden" name="system_id" value="{{ $o->id }}">
<span><small><strong>NOTE:</strong> You'll be able to update these details after registration is completed.</small></span>
{{--
<button type="submit" class="btn btn-success float-end" name="submit" value="register">Register</button>
--}}
@endcan
@else
<button type="submit" class="btn btn-success float-end" name="submit" value="create">Register</button>

View File

@ -29,7 +29,7 @@ use App\Models\System;
@foreach (System::select(['systems.id','systems.name'])
->active()
->where('id','<>',$setup->system_id)
->whereRaw('id NOT IN (SELECT system_id FROM system_user)')
->whereRaw('id NOT IN (SELECT system_id FROM "system_user")')
->cursor() as $oo)
<option value="{{ $oo->id }}" @if(old('id')===$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach

View File

@ -1,18 +1,24 @@
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Schedule;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
use App\Jobs\AddressIdleDomain;
use App\Jobs\MailSend;
use App\Jobs\SystemHeartbeat;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');
Schedule::job(new MailSend(TRUE))
->timezone('Australia/Melbourne')
->everyMinute()
->withoutOverlapping();
Schedule::job(new MailSend(FALSE))
->timezone('Australia/Melbourne')
->twiceDaily(1,13);
Schedule::job(new SystemHeartbeat)
->timezone('Australia/Melbourne')
->hourly();
Schedule::job(new AddressIdleDomain)
->timezone('Australia/Melbourne')
->weeklyOn(0,'01:00');

View File

@ -133,7 +133,8 @@ Route::middleware(['auth','verified','activeuser'])->group(function () {
->where('o','[0-9]+')
->where('packet','[0-9a-zA-Z]+');
Route::match(['get','post'],'user/system/register',[SystemController::class,'register']);
Route::view('user/system/register','user.system.register');
Route::post('user/system/register',[SystemController::class,'register']);
Route::match(['post'],'user/system/link',[SystemController::class,'system_link']);
/* ZONE PATHS */