Fix laravel 8 composer + PHPCBF bump

This commit is contained in:
Jérémy Munsch 2022-06-13 15:49:59 +02:00
parent 4441f6d547
commit 3e2ef50e6d
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
67 changed files with 1223 additions and 1058 deletions

View file

@ -40,7 +40,7 @@ class ExportDatas extends Command
/**
* Execute the console command.
*
* @return int
* @return integer
*/
public function handle()
{
@ -141,7 +141,7 @@ class ExportDatas extends Command
private function ExportProjects($filename)
{
$projects = Projects::orderBy('name', 'ASC')->get();
$fields = [
$fields = [
'DEV',
'name',
'dev_haproxy_id',
@ -166,11 +166,11 @@ class ExportDatas extends Command
Storage::disk('export')->append($filename, "ENV;NOM;ID HAPROXY;URL;HTTPS;PHP;SERVEUR WEB;SSH;USER UNIX;PWD UNIX;DOCUMENT ROOT;SERVEUR BDD;SSH;USER DB;PWD DB;HTACCESS USER;HTACCESS PWD;COMMENTAIRE;FLUX EAI;WHITELIST FW");
$this->writeProjectExport($projects, $fields, $filename);
$prod = implode(";", $fields);
$prod = str_replace("dev", "prod", $prod);
$prod = str_replace("DEV", "PROD", $prod);
$prod = str_replace("prod_htaccess_user", "BLANK", $prod);
$prod = str_replace("prod_htaccess_pwd", "BLANK", $prod);
$prod = implode(";", $fields);
$prod = str_replace("dev", "prod", $prod);
$prod = str_replace("DEV", "PROD", $prod);
$prod = str_replace("prod_htaccess_user", "BLANK", $prod);
$prod = str_replace("prod_htaccess_pwd", "BLANK", $prod);
$fields = explode(";", $prod);
$this->writeProjectExport($projects, $fields, $filename);
@ -187,13 +187,13 @@ class ExportDatas extends Command
$infos[] = $field;
break;
case 'https':
$infos[] = $project->{$field} === 1 ? 'OUI' : 'NON';
$infos[] = $project->{$field} === 1 ? 'OUI' : 'NON';
break;
case 'dev_web_server_id':
case 'dev_db_server_id':
case 'prod_web_server_id':
case 'prod_db_server_id':
$server = Servers::find($project->{$field});
$server = Servers::find($project->{$field});
$infos[] = trim($server->name);
$infos[] = trim($server->ssh);
break;
@ -202,9 +202,9 @@ class ExportDatas extends Command
break;
default:
$infos[] = trim($project->{$field});
}
}
}//end switch
}//end foreach
Storage::disk('export')->append($filename, implode(";", $infos));
}
}//end foreach
}
}

View file

@ -13,19 +13,18 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
//
];
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
// ->hourly();
}
/**
@ -35,7 +34,7 @@ class Kernel extends ConsoleKernel
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__ . '/Commands');
require base_path('routes/console.php');
}

View file

@ -4,7 +4,6 @@ namespace App\Exceptions;
use Throwable;
use Kwaadpepper\ExceptionHandler\Exceptions\ExceptionHandler;
use Illuminate\Support\Facades\Mail;
class Handler extends ExceptionHandler
{
@ -14,8 +13,7 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
//
];
];
/**
* A list of the inputs that are never flashed for validation exceptions.
@ -30,7 +28,7 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* @param \Throwable $exception
* @param \Throwable $exception
* @return void
*
* @throws \Throwable
@ -43,8 +41,8 @@ class Handler extends ExceptionHandler
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception

View file

@ -8,19 +8,21 @@ use Illuminate\Http\Request;
class LDCNetworksController extends Controller
{
public function index(Request $request) {
public function index(Request $request)
{
$token = $request->token;
if ($token !== 'CE8S52Qq7stf5k8frF4T')
if ($token !== 'CE8S52Qq7stf5k8frF4T') {
return response('Unauthorized', 401);
}
$ips = [];
$networks = LDCNetworks::all();
foreach ($networks as $network) {
$infos = explode('.', $network->first_ip);
$min = $infos[3];
$max = explode('.', $network->last_ip)[3];
$min = $infos[3];
$max = explode('.', $network->last_ip)[3];
for ($i = $min; $i <= $max; $i++) {
$ips[] = "$infos[0].$infos[1].$infos[2].$i";
}

View file

@ -6,38 +6,40 @@ use App\Http\Controllers\Controller;
use App\Models\Projects;
use App\Models\ProjectsStatusChecker;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class StatusCheckerController extends Controller
{
public function index(Request $request) {
public function index(Request $request)
{
$token = $request->token;
$datas = $request->datas;
if ($token !== 'CE8S52Qq7stf5k8frF4T')
if ($token !== 'CE8S52Qq7stf5k8frF4T') {
return response('Unauthorized', 401);
}
$oDatas = json_decode($datas);
$app_uuid = $oDatas->uuid;
$sitemap = $oDatas->sitemap;
$robots = $oDatas->robots;
$code = json_encode($oDatas->code);
$logs = $oDatas->logs;
$sitemap = $oDatas->sitemap;
$robots = $oDatas->robots;
$code = json_encode($oDatas->code);
$logs = $oDatas->logs;
$project_sc = ProjectsStatusChecker::where('project_uuid', '=', $app_uuid)->first();
if (!$project_sc) {
$project = Projects::where('uuid', '=', $app_uuid)->first();
if (!$project)
if (!$project) {
return response('Unknown', 404);
$project_sc = new ProjectsStatusChecker();
}
$project_sc = new ProjectsStatusChecker();
$project_sc->project_uuid = $app_uuid;
}
$project_sc->code = $code;
$project_sc->sitemap = $sitemap;
$project_sc->robots = $robots;
$project_sc->logs = $logs;
$project_sc->code = $code;
$project_sc->sitemap = $sitemap;
$project_sc->robots = $robots;
$project_sc->logs = $logs;
$project_sc->updated_at = NOW();
$project_sc->save();

View file

@ -9,5 +9,7 @@ use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}

View file

@ -12,41 +12,48 @@ use lfkeitel\phptotp\Totp;
class DatastorePCCController extends Controller
{
public function index(Request $request) {
public function index(Request $request)
{
$dpccs = DatastorePcc::all();
return view('dpccs.index', ['dpccs' => $dpccs]);
}
public function add(Request $request) {
public function add(Request $request)
{
return view('dpccs.add');
}
public function edit(Request $request) {
public function edit(Request $request)
{
$dpcc_id = $request->id;
$dpcc = DatastorePcc::findOrFail($dpcc_id);
$dpcc = DatastorePcc::findOrFail($dpcc_id);
return view('dpccs.edit', ['dpcc' => $dpcc]);
}
public function update(Request $request) {
public function update(Request $request)
{
$dpcc_id = $request->id;
$dpcc = DatastorePcc::findOrFail($dpcc_id);
$dpcc = DatastorePcc::findOrFail($dpcc_id);
$this->makeChanges($request, $dpcc);
return redirect()->route('dpccs.edit', ['id' => $dpcc->id])->with('status', 'Sauvegardé !');
}
public function store(Request $request) {
public function store(Request $request)
{
$dpcc = new DatastorePcc();
$this->makeChanges($request, $dpcc);
return redirect()->route('dpccs.edit', ['id' => $dpcc->id])->with('status', 'Sauvegardé !');
}
public function delete(Request $request) {
public function delete(Request $request)
{
$dpcc_id = $request->id;
$dpcc = DatastorePcc::findOrFail($dpcc_id);
$dpcc = DatastorePcc::findOrFail($dpcc_id);
$isUsed = Servers::where('datastore_pcc_id', '=', $dpcc->id)->get();
if ($isUsed->count() === 0)
if ($isUsed->count() === 0) {
$isUsed = false;
}
return view('dpccs.delete', ['dpcc' => $dpcc, 'isUsed' => $isUsed]);
}
@ -58,22 +65,23 @@ class DatastorePCCController extends Controller
$otp = $request->otp;
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
if ($otp === $code || $otp === $lastCode) {
$dpcc = DatastorePcc::findOrFail($dpcc_id);
$dpcc->delete();
return redirect()->route('dpccs.index')->with('status', 'Datastore PCC supprimé !');
}else{
} else {
return redirect()->route('dpccs.edit', ['id' => $dpcc_id])->with('error', 'Code de vérification invalide.');
}
}
private function makeChanges($request, $dpcc) {
$title = $request->title;
private function makeChanges($request, $dpcc)
{
$title = $request->title;
$comment = $request->comment;
$dpcc->title = $title;
$dpcc->title = $title;
$dpcc->comment = $comment;
$dpcc->save();
}

View file

@ -26,14 +26,14 @@ class DomainNamesController extends Controller
public function edit(Request $request)
{
$dm_id = $request->id;
$dm = DomainNames::findOrFail($dm_id);
$dm = DomainNames::findOrFail($dm_id);
return view('domain-names.edit', ['dm' => $dm]);
}
public function update(Request $request)
{
$dm_id = $request->id;
$dm = DomainNames::findOrFail($dm_id);
$dm = DomainNames::findOrFail($dm_id);
$this->makeChanges($request, $dm);
return redirect()->route('domain-names.edit', ['id' => $dm->id])->with('status', 'Sauvegardé !');
}
@ -48,11 +48,12 @@ class DomainNamesController extends Controller
public function delete(Request $request)
{
$dm_id = $request->id;
$dm = DomainNames::findOrFail($dm_id);
$dm = DomainNames::findOrFail($dm_id);
$isUsed = EmailAddresses::where('domain_name_id', '=', $dm->id)->get();
if ($isUsed->count() === 0)
if ($isUsed->count() === 0) {
$isUsed = false;
}
return view('domain-names.delete', ['dm' => $dm, 'isUsed' => $isUsed]);
}
@ -60,10 +61,10 @@ class DomainNamesController extends Controller
public function forceDelete(Request $request)
{
$dm_id = $request->id;
$otp = $request->otp;
$otp = $request->otp;
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
if ($otp === $code || $otp === $lastCode) {
$dm = DomainNames::findOrFail($dm_id);
@ -76,23 +77,23 @@ class DomainNamesController extends Controller
private function makeChanges($request, $dm)
{
$ascii_name = $request->ascii_name;
$utf8_name = $request->utf8_name;
$exp_date = $request->expiration_date;
$renew = $request->renew;
$ascii_name = $request->ascii_name;
$utf8_name = $request->utf8_name;
$exp_date = $request->expiration_date;
$renew = $request->renew;
$related_brand = $request->related_brand;
$redirect_dns = $request->redirect_dns;
$certificats = $request->certificats;
$comment = $request->comment;
$redirect_dns = $request->redirect_dns;
$certificats = $request->certificats;
$comment = $request->comment;
$dm->ascii_name = $ascii_name;
$dm->utf8_name = $utf8_name;
$dm->ascii_name = $ascii_name;
$dm->utf8_name = $utf8_name;
$dm->expiration_date = $exp_date;
$dm->renew = $renew;
$dm->related_brand = $related_brand;
$dm->redirect_dns = $redirect_dns;
$dm->certificats = $certificats;
$dm->comment = $comment;
$dm->renew = $renew;
$dm->related_brand = $related_brand;
$dm->redirect_dns = $redirect_dns;
$dm->certificats = $certificats;
$dm->comment = $comment;
$dm->save();
}
}

View file

@ -12,66 +12,73 @@ use lfkeitel\phptotp\Totp;
class EmailAddressesController extends Controller
{
public function index(Request $request) {
public function index(Request $request)
{
$emails = EmailAddresses::all();
return view('email-addresses.index', ['emails' => $emails]);
}
public function add(Request $request) {
public function add(Request $request)
{
$dms = DomainNames::orderBy('utf8_name')->get();
return view('email-addresses.add', ['dms' => $dms]);
}
public function edit(Request $request) {
public function edit(Request $request)
{
$email_id = $request->id;
$email = EmailAddresses::findOrFail($email_id);
$dms = DomainNames::orderBy('utf8_name')->get();
$email = EmailAddresses::findOrFail($email_id);
$dms = DomainNames::orderBy('utf8_name')->get();
return view('email-addresses.edit', ['email' => $email, 'dms' => $dms]);
}
public function update(Request $request) {
public function update(Request $request)
{
$email_id = $request->id;
$email = EmailAddresses::findOrFail($email_id);
$email = EmailAddresses::findOrFail($email_id);
$this->makeChanges($request, $email);
return redirect()->route('email-addresses.edit', ['id' => $email->id])->with('status', 'Sauvegardée !');
}
public function store(Request $request) {
public function store(Request $request)
{
$email = new EmailAddresses();
$this->makeChanges($request, $email);
return redirect()->route('email-addresses.edit', ['id' => $email->id])->with('status', 'Sauvegardée !');
}
public function delete(Request $request) {
public function delete(Request $request)
{
$email_id = $request->id;
$email = EmailAddresses::findOrFail($email_id);
$email = EmailAddresses::findOrFail($email_id);
return view('email-addresses.delete', ['email' => $email]);
}
public function forceDelete(Request $request)
{
$email_id = $request->id;
$otp = $request->otp;
$otp = $request->otp;
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
if ($otp === $code || $otp === $lastCode) {
$email = EmailAddresses::findOrFail($email_id);
$email->delete();
return redirect()->route('email-addresses.index')->with('status', 'Adresse email supprimée !');
}else{
} else {
return redirect()->route('email-addresses.edit', ['id' => $email_id])->with('error', 'Code de vérification invalide.');
}
}
private function makeChanges($request, $email) {
$account = $request->account;
$password = $request->password;
private function makeChanges($request, $email)
{
$account = $request->account;
$password = $request->password;
$domain_name_id = $request->d_n_id;
$email->account = $account;
$email->password = $password;
$email->account = $account;
$email->password = $password;
$email->domain_name_id = $domain_name_id;
$email->save();
}

View file

@ -32,12 +32,12 @@ class GitReposController extends Controller
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\GitReposStoreRequest $request
* @param \Illuminate\Http\GitReposStoreRequest $request
* @return \Illuminate\Http\Response
*/
public function store(GitReposStoreRequest $request)
{
$datas = $request->validated();
$datas = $request->validated();
$git_repo = new GitRepos();
$git_repo->fill($datas);
$git_repo->save();
@ -48,7 +48,7 @@ class GitReposController extends Controller
/**
* Display the specified resource.
*
* @param int $id
* @param integer $id
* @return \Illuminate\Http\Response
*/
public function show($id)
@ -59,7 +59,7 @@ class GitReposController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param GitRepos $git_repo
* @param GitRepos $git_repo
* @return \Illuminate\Http\Response
*/
public function edit(GitRepos $git_repo)
@ -70,8 +70,8 @@ class GitReposController extends Controller
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\GitReposUpdateRequest $request
* @param GitRepos $git_repo
* @param \Illuminate\Http\GitReposUpdateRequest $request
* @param GitRepos $git_repo
* @return \Illuminate\Http\Response
*/
public function update(GitReposUpdateRequest $request, GitRepos $git_repo)
@ -86,10 +86,10 @@ class GitReposController extends Controller
/**
* Remove the specified resource from storage.
*
* @param GitRepos $git_repo
* @param GitRepos $git_repo
* @return \Illuminate\Http\Response
*/
public function destroy(GitRepos $git_repo)
public function destroy(GitRepos $git_repo)
{
$git_repo->delete();
return redirect()->route('git-repos.index')->with('status', __('Dépôt Git supprimé.'));

View file

@ -4,7 +4,6 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use lfkeitel\phptotp\{Base32,Totp};
use SimpleSoftwareIO\QrCode\Facades\QrCode;
class HomeController extends Controller
@ -16,17 +15,17 @@ class HomeController extends Controller
*/
public function index(Request $request)
{
//$secret = Totp::GenerateSecret(16);
# Display new key to user so they can enter it in Google Authenticator or Authy
//echo strtoupper(Base32::encode($secret));exit;
// $secret = Totp::GenerateSecret(16);
// Display new key to user so they can enter it in Google Authenticator or Authy
// echo strtoupper(Base32::encode($secret));exit;
// otpauth://totp/LDC%20WEB:mail@ldc.fr?secret=secret&issuer=LDC%20WEB
return view('home');
}
public function qr()
{
$user = Auth::user();
$qrcode = QrCode::size(200)->generate("otpauth://totp/LDC%20WEB:".$user->email."?secret=".$user->totp_secret."&issuer=LDC%20WEB");
$user = Auth::user();
$qrcode = QrCode::size(200)->generate("otpauth://totp/LDC%20WEB:" . $user->email . "?secret=" . $user->totp_secret . "&issuer=LDC%20WEB");
return view("qrcode", compact('qrcode'));
}
}

View file

@ -11,37 +11,43 @@ use lfkeitel\phptotp\Totp;
class LDCNetworkController extends Controller
{
public function index(Request $request) {
public function index(Request $request)
{
$networks = LDCNetworks::all();
return view('ldc-networks.index', ['networks' => $networks]);
}
public function add(Request $request) {
public function add(Request $request)
{
return view('ldc-networks.add');
}
public function edit(Request $request) {
public function edit(Request $request)
{
$network_id = $request->id;
$network = LDCNetworks::findOrFail($network_id);
$network = LDCNetworks::findOrFail($network_id);
return view('ldc-networks.edit', ['network' => $network]);
}
public function update(Request $request) {
public function update(Request $request)
{
$network_id = $request->id;
$network = LDCNetworks::findOrFail($network_id);
$network = LDCNetworks::findOrFail($network_id);
$this->makeChanges($request, $network);
return redirect()->route('ldc-networks.edit', ['id' => $network->id])->with('status', 'Sauvegardée !');
}
public function store(Request $request) {
public function store(Request $request)
{
$network = new LDCNetworks();
$this->makeChanges($request, $network);
return redirect()->route('ldc-networks.edit', ['id' => $network->id])->with('status', 'Sauvegardée !');
}
public function delete(Request $request) {
public function delete(Request $request)
{
$network_id = $request->id;
$network = LDCNetworks::findOrFail($network_id);
$network = LDCNetworks::findOrFail($network_id);
return view('ldc-networks.delete', ['network' => $network]);
}
@ -49,33 +55,35 @@ class LDCNetworkController extends Controller
public function forceDelete(Request $request)
{
$network_id = $request->id;
$otp = $request->otp;
$otp = $request->otp;
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
if ($otp === $code || $otp === $lastCode) {
$network = LDCNetworks::findOrFail($network_id);
$network->delete();
return redirect()->route('ldc-networks.index')->with('status', 'IP supprimée !');
}else{
} else {
return redirect()->route('ldc-networks.edit', ['id' => $network_id])->with('error', 'Code de vérification invalide.');
}
}
private function makeChanges($request, $network) {
$cidr = $request->cidr;
private function makeChanges($request, $network)
{
$cidr = $request->cidr;
$range = $this->cidrToRange($cidr);
$network->cidr = $cidr;
$network->cidr = $cidr;
$network->first_ip = $range[0];
$network->last_ip = $range[1];
$network->last_ip = $range[1];
$network->save();
}
private function cidrToRange($cidr) {
$range = array();
$cidr = explode('/', $cidr);
private function cidrToRange($cidr)
{
$range = array();
$cidr = explode('/', $cidr);
$range[0] = long2ip((ip2long($cidr[0])) & ((-1 << (32 - (int)$cidr[1]))));
$range[1] = long2ip((ip2long($range[0])) + pow(2, (32 - (int)$cidr[1])) - 1);
return $range;

View file

@ -5,27 +5,32 @@ namespace App\Http\Controllers;
use App\Providers\RouteServiceProvider;
use Carbon\Carbon;
use Illuminate\Http\Request;
use lfkeitel\phptotp\{Base32,Totp};
use lfkeitel\phptotp\Base32;
use lfkeitel\phptotp\Totp;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class OTPController extends Controller
{
public function verify(Request $request) {
public function verify(Request $request)
{
$user = session()->get('tmpUserOTP');
if (!$user)
if (!$user) {
return redirect(RouteServiceProvider::HOME);
}
return view('auth.verify');
}
public function check(Request $request) {
$otp = $request->otp;
public function check(Request $request)
{
$otp = $request->otp;
$user = session()->get('tmpUserOTP');
if (!$user)
if (!$user) {
return redirect(RouteServiceProvider::HOME);
}
$lastCode = (new Totp())->GenerateToken(Base32::decode($user->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
$code = (new Totp())->GenerateToken(Base32::decode($user->totp_secret));
$code = (new Totp())->GenerateToken(Base32::decode($user->totp_secret));
if ($otp === $code || $otp === $lastCode) {
Auth::login($user);
@ -40,25 +45,28 @@ class OTPController extends Controller
public function sendOTPBySMS()
{
$user = session()->get('tmpUserOTP');
if (!$user)
if (!$user) {
return back()->withErrors('User not found.');
}
if (is_null($user->phone))
if (is_null($user->phone)) {
return back()->withErrors('Phone number missing.');
}
$otp = (new Totp())->GenerateToken(Base32::decode($user->totp_secret));
/** @var \App\Lib\LDC\MailjetSms */
$mj = app('MailjetSms');
$mj = app('MailjetSms');
$mjResponse = $mj->send("OTP : " . implode(' ', str_split($otp)), $user->phone);
/** @var \GuzzleHttp\Psr7\Response $mjResponse */
$responseStatus = $mjResponse->getStatusCode(); //"200"
$responsePhrase = $mjResponse->getReasonPhrase(); //"OK"
$responseStatus = $mjResponse->getStatusCode();
// "200"
$responsePhrase = $mjResponse->getReasonPhrase();
// "OK"
if ($responseStatus == 200) {
$mjSmsResponse = $mjResponse->getBody()->getContents();
return back()->with('success', "SMS envoyé.");
}
return back()->withErrors('SMS not sent.');
}
}

View file

@ -6,7 +6,6 @@ use App\Http\Requests\Projects\StoreProjects;
use App\Http\Requests\Projects\UpdateProjects;
use App\Models\Projects;
use App\Models\Servers;
use App\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@ -24,15 +23,15 @@ class ProjectsController extends Controller
public function add(Request $request)
{
$dev_db_server = Servers::where([
$dev_db_server = Servers::where([
['env', 'DEV'],
['type', 'DB']
])->get();
$dev_web_server = Servers::where([
$dev_web_server = Servers::where([
['env', 'DEV'],
['type', 'WEB']
])->get();
$prod_db_server = Servers::where([
$prod_db_server = Servers::where([
['env', 'PROD'],
['type', 'DB']
])->get();
@ -45,20 +44,21 @@ class ProjectsController extends Controller
public function edit(Request $request)
{
$uuid = $request->uuid;
$uuid = $request->uuid;
$project = Projects::where('uuid', '=', $uuid)->first();
if (!$project)
if (!$project) {
abort(404);
}
$dev_db_server = Servers::where([
$dev_db_server = Servers::where([
['env', 'DEV'],
['type', 'DB']
])->get();
$dev_web_server = Servers::where([
$dev_web_server = Servers::where([
['env', 'DEV'],
['type', 'WEB']
])->get();
$prod_db_server = Servers::where([
$prod_db_server = Servers::where([
['env', 'PROD'],
['type', 'DB']
])->get();
@ -71,17 +71,18 @@ class ProjectsController extends Controller
public function update(UpdateProjects $request)
{
$uuid = $request->uuid;
$uuid = $request->uuid;
$project = Projects::where('uuid', '=', $uuid)->first();
if (!$project)
if (!$project) {
abort(404);
}
$this->makeChanges($request, $project);
return redirect()->route('projects.edit', ['uuid' => $project->uuid])->with('status', 'Sauvegardé !');
}
public function store(StoreProjects $request)
{
$project = new Projects();
$project = new Projects();
$project->uuid = Uuid::uuid4();
$this->makeChanges($request, $project);
return redirect()->route('projects.edit', ['uuid' => $project->uuid])->with('status', 'Sauvegardé !');
@ -89,25 +90,27 @@ class ProjectsController extends Controller
public function delete(Request $request)
{
$uuid = $request->uuid;
$uuid = $request->uuid;
$project = Projects::where('uuid', '=', $uuid)->first();
if (!$project)
if (!$project) {
abort(404);
}
return view('projects.delete', ['project' => $project]);
}
public function forceDelete(Request $request)
{
$uuid = $request->uuid;
$otp = $request->otp;
$otp = $request->otp;
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
if ($otp === $code || $otp === $lastCode) {
$project = Projects::where('uuid', '=', $uuid)->first();
if (!$project)
if (!$project) {
abort(404);
}
$project->delete();
return redirect()->route('projects.index')->with('status', 'Projet supprimé !');
} else {
@ -117,96 +120,96 @@ class ProjectsController extends Controller
private function makeChanges(Request $request, $project)
{
$name = $request->name;
$display_name = $request->display_name;
$php = $request->php;
$type = $request->type;
$https = $request->https;
$prod_haproxy_id = $request->prod_haproxy_id;
$dev_haproxy_id = $request->dev_haproxy_id;
$prod_url = $request->prod_url;
$dev_url = $request->dev_url;
$prod_document_root = $request->prod_document_root;
$dev_document_root = $request->dev_document_root;
$prod_unix_user = $request->prod_unix_user;
$dev_unix_user = $request->dev_unix_user;
$prod_unix_pwd = $request->prod_unix_pwd;
$dev_unix_pwd = $request->dev_unix_pwd;
$prod_db_user = $request->prod_db_user;
$dev_db_user = $request->dev_db_user;
$prod_db_pwd = $request->prod_db_pwd;
$dev_db_pwd = $request->dev_db_pwd;
$prod_db_schema = $request->prod_db_schema;
$dev_db_schema = $request->dev_db_schema;
$prod_db_server_id = $request->prod_db_server_id;
$dev_db_server_id = $request->dev_db_server_id;
$prod_web_server_id = $request->prod_web_server_id;
$dev_web_server_id = $request->dev_web_server_id;
$prod_comment = $request->prod_comment;
$dev_comment = $request->dev_comment;
$prod_eai = $request->prod_eai;
$dev_eai = $request->dev_eai;
$prod_whitelist_fw = $request->prod_whitelist_fw;
$dev_whitelist_fw = $request->dev_whitelist_fw;
$dev_htaccess_user = $request->dev_htaccess_user;
$dev_htaccess_pwd = $request->dev_htaccess_pwd;
$prod_ga_id = $request->prod_ga_id;
$name = $request->name;
$display_name = $request->display_name;
$php = $request->php;
$type = $request->type;
$https = $request->https;
$prod_haproxy_id = $request->prod_haproxy_id;
$dev_haproxy_id = $request->dev_haproxy_id;
$prod_url = $request->prod_url;
$dev_url = $request->dev_url;
$prod_document_root = $request->prod_document_root;
$dev_document_root = $request->dev_document_root;
$prod_unix_user = $request->prod_unix_user;
$dev_unix_user = $request->dev_unix_user;
$prod_unix_pwd = $request->prod_unix_pwd;
$dev_unix_pwd = $request->dev_unix_pwd;
$prod_db_user = $request->prod_db_user;
$dev_db_user = $request->dev_db_user;
$prod_db_pwd = $request->prod_db_pwd;
$dev_db_pwd = $request->dev_db_pwd;
$prod_db_schema = $request->prod_db_schema;
$dev_db_schema = $request->dev_db_schema;
$prod_db_server_id = $request->prod_db_server_id;
$dev_db_server_id = $request->dev_db_server_id;
$prod_web_server_id = $request->prod_web_server_id;
$dev_web_server_id = $request->dev_web_server_id;
$prod_comment = $request->prod_comment;
$dev_comment = $request->dev_comment;
$prod_eai = $request->prod_eai;
$dev_eai = $request->dev_eai;
$prod_whitelist_fw = $request->prod_whitelist_fw;
$dev_whitelist_fw = $request->dev_whitelist_fw;
$dev_htaccess_user = $request->dev_htaccess_user;
$dev_htaccess_pwd = $request->dev_htaccess_pwd;
$prod_ga_id = $request->prod_ga_id;
$prod_laravel_app_key = $request->prod_laravel_app_key;
$dev_laravel_app_key = $request->dev_laravel_app_key;
$prod_smtp_config = $request->prod_smtp_config;
$prod_smtp_key = $request->prod_smtp_key;
$dev_laravel_app_key = $request->dev_laravel_app_key;
$prod_smtp_config = $request->prod_smtp_config;
$prod_smtp_key = $request->prod_smtp_key;
if (Auth::user()->role === 1) {
$prod_login = $request->prod_login;
$dev_login = $request->dev_login;
$prod_login = $request->prod_login;
$dev_login = $request->dev_login;
$prod_bo_url = $request->prod_bo_url;
$dev_bo_url = $request->dev_bo_url;
$dev_bo_url = $request->dev_bo_url;
}
$project->name = $name;
$project->display_name = $display_name;
$project->php = $php;
$project->type = $type;
$project->https = $https;
$project->prod_haproxy_id = $prod_haproxy_id;
$project->dev_haproxy_id = $dev_haproxy_id;
$project->prod_url = $prod_url;
$project->dev_url = $dev_url;
$project->prod_document_root = $prod_document_root;
$project->dev_document_root = $dev_document_root;
$project->prod_unix_user = $prod_unix_user;
$project->dev_unix_user = $dev_unix_user;
$project->prod_unix_pwd = $prod_unix_pwd;
$project->dev_unix_pwd = $dev_unix_pwd;
$project->prod_db_user = $prod_db_user;
$project->dev_db_user = $dev_db_user;
$project->prod_db_pwd = $prod_db_pwd;
$project->dev_db_pwd = $dev_db_pwd;
$project->prod_db_schema = $prod_db_schema;
$project->dev_db_schema = $dev_db_schema;
$project->prod_db_server_id = $prod_db_server_id;
$project->dev_db_server_id = $dev_db_server_id;
$project->prod_web_server_id = $prod_web_server_id;
$project->dev_web_server_id = $dev_web_server_id;
$project->prod_comment = $prod_comment;
$project->dev_comment = $dev_comment;
$project->prod_eai = $prod_eai;
$project->dev_eai = $dev_eai;
$project->prod_whitelist_fw = $prod_whitelist_fw;
$project->dev_whitelist_fw = $dev_whitelist_fw;
$project->dev_htaccess_user = $dev_htaccess_user;
$project->dev_htaccess_pwd = $dev_htaccess_pwd;
$project->prod_ga_id = $prod_ga_id;
$project->name = $name;
$project->display_name = $display_name;
$project->php = $php;
$project->type = $type;
$project->https = $https;
$project->prod_haproxy_id = $prod_haproxy_id;
$project->dev_haproxy_id = $dev_haproxy_id;
$project->prod_url = $prod_url;
$project->dev_url = $dev_url;
$project->prod_document_root = $prod_document_root;
$project->dev_document_root = $dev_document_root;
$project->prod_unix_user = $prod_unix_user;
$project->dev_unix_user = $dev_unix_user;
$project->prod_unix_pwd = $prod_unix_pwd;
$project->dev_unix_pwd = $dev_unix_pwd;
$project->prod_db_user = $prod_db_user;
$project->dev_db_user = $dev_db_user;
$project->prod_db_pwd = $prod_db_pwd;
$project->dev_db_pwd = $dev_db_pwd;
$project->prod_db_schema = $prod_db_schema;
$project->dev_db_schema = $dev_db_schema;
$project->prod_db_server_id = $prod_db_server_id;
$project->dev_db_server_id = $dev_db_server_id;
$project->prod_web_server_id = $prod_web_server_id;
$project->dev_web_server_id = $dev_web_server_id;
$project->prod_comment = $prod_comment;
$project->dev_comment = $dev_comment;
$project->prod_eai = $prod_eai;
$project->dev_eai = $dev_eai;
$project->prod_whitelist_fw = $prod_whitelist_fw;
$project->dev_whitelist_fw = $dev_whitelist_fw;
$project->dev_htaccess_user = $dev_htaccess_user;
$project->dev_htaccess_pwd = $dev_htaccess_pwd;
$project->prod_ga_id = $prod_ga_id;
$project->prod_laravel_app_key = $prod_laravel_app_key;
$project->dev_laravel_app_key = $dev_laravel_app_key;
$project->prod_smtp_config = $prod_smtp_config;
$project->prod_smtp_key = $prod_smtp_key;
$project->dev_laravel_app_key = $dev_laravel_app_key;
$project->prod_smtp_config = $prod_smtp_config;
$project->prod_smtp_key = $prod_smtp_key;
if (Auth::user()->role === 1) {
$project->prod_login = $prod_login;
$project->dev_login = $dev_login;
$project->prod_login = $prod_login;
$project->dev_login = $dev_login;
$project->prod_bo_url = $prod_bo_url;
$project->dev_bo_url = $dev_bo_url;
$project->dev_bo_url = $dev_bo_url;
}
$project->save();

View file

@ -13,44 +13,51 @@ use lfkeitel\phptotp\Totp;
class ServersController extends Controller
{
public function index(Request $request) {
public function index(Request $request)
{
$servers = Servers::all();
return view('servers.index', ['servers' => $servers]);
}
public function add(Request $request) {
public function add(Request $request)
{
$datastores_pcc = DatastorePcc::orderBy('title')->get();
return view('servers.add', ['datastores_pcc' => $datastores_pcc]);
}
public function edit(Request $request) {
$server_id = $request->id;
$server = Servers::findOrFail($server_id);
public function edit(Request $request)
{
$server_id = $request->id;
$server = Servers::findOrFail($server_id);
$datastores_pcc = DatastorePcc::orderBy('title')->get();
return view('servers.edit', ['server' => $server, 'datastores_pcc' => $datastores_pcc]);
}
public function update(Request $request) {
public function update(Request $request)
{
$server_id = $request->id;
$server = Servers::findOrFail($server_id);
$server = Servers::findOrFail($server_id);
$this->makeChanges($request, $server);
return redirect()->route('servers.edit', ['id' => $server_id])->with('status', 'Sauvegardé !');
}
public function store(Request $request) {
public function store(Request $request)
{
$server = new Servers();
$this->makeChanges($request, $server);
return redirect()->route('servers.edit', ['id' => $server->id])->with('status', 'Sauvegardé !');
}
public function delete(Request $request) {
public function delete(Request $request)
{
$server_id = $request->id;
$server = Servers::findOrFail($server_id);
$server = Servers::findOrFail($server_id);
if ($server->type === 'DB' || $server->type === 'WEB') {
$isUsed = Projects::where('dev_db_server_id', '=', $server->id)->orWhere('dev_web_server_id', '=', $server->id)->orWhere('prod_db_server_id', '=', $server->id)->orWhere('prod_web_server_id', '=', $server->id)->get();
if ($isUsed->count() === 0)
if ($isUsed->count() === 0) {
$isUsed = false;
}
} else {
$isUsed = false;
}
@ -61,42 +68,43 @@ class ServersController extends Controller
public function forceDelete(Request $request)
{
$server_id = $request->id;
$otp = $request->otp;
$otp = $request->otp;
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
if ($otp === $code || $otp === $lastCode) {
$server = Servers::findOrFail($server_id);
$server->delete();
return redirect()->route('servers.index')->with('status', 'Serveur supprimé !');
}else{
} else {
return redirect()->route('servers.edit', ['id' => $server_id])->with('error', 'Code de vérification invalide.');
}
}
private function makeChanges($request, $server) {
$env = $request->env;
$virtual_ip = $request->virtual_ip;
$ssh = $request->ssh;
private function makeChanges($request, $server)
{
$env = $request->env;
$virtual_ip = $request->virtual_ip;
$ssh = $request->ssh;
$infraweb_ip = $request->infraweb_ip;
$title = $request->title;
$name = $request->name;
$function = $request->function;
$dpcc = $request->datastore_pcc_id;
$comment = $request->comment;
$type = $request->type;
$title = $request->title;
$name = $request->name;
$function = $request->function;
$dpcc = $request->datastore_pcc_id;
$comment = $request->comment;
$type = $request->type;
$server->env = $env;
$server->virtual_ip = $virtual_ip;
$server->ssh = $ssh;
$server->infraweb_ip = $infraweb_ip;
$server->title = $title;
$server->name = $name;
$server->function = $function;
$server->env = $env;
$server->virtual_ip = $virtual_ip;
$server->ssh = $ssh;
$server->infraweb_ip = $infraweb_ip;
$server->title = $title;
$server->name = $name;
$server->function = $function;
$server->datastore_pcc_id = $dpcc;
$server->comment = $comment;
$server->type = $type;
$server->comment = $comment;
$server->type = $type;
$server->save();
}
}

View file

@ -7,21 +7,22 @@ use Illuminate\Http\Request;
class StatusCheckerController extends Controller
{
public function index(Request $request) {
public function index(Request $request)
{
$wp_endpoint = 'https://api.wordpress.org/core/version-check/1.7/';
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', $wp_endpoint);
$content = $response->getBody();
$oContent = json_decode($content);
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', $wp_endpoint);
$content = $response->getBody();
$oContent = json_decode($content);
$laravel_endpoint = 'https://github.com/laravel/laravel/releases/latest';
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', $laravel_endpoint, [
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', $laravel_endpoint, [
'allow_redirects' => false
]);
$content = $response->getBody()->getContents();
$laravel_latest = substr($content, 84);
$laravel_latest = substr($laravel_latest, 0, -31);
$content = $response->getBody()->getContents();
$laravel_latest = substr($content, 84);
$laravel_latest = substr($laravel_latest, 0, -31);
$projects = Projects::orderBy('name')->get();
return view('status-checker.index', ['projects' => $projects, 'wp_latest' => $oContent->offers[0]->version, 'laravel_latest' => $laravel_latest]);

View file

@ -22,19 +22,19 @@ class GitlabController extends Controller
exit;
}
$datas = [];
$datas['user'] = $request->user['name'];
$datas['project_name'] = $request->project['name'];
$datas['project_path'] = $request->project['path_with_namespace'];
$datas['attributes_description'] = $request->object_attributes['description'];
$datas['attributes_status'] = $request->object_attributes['merge_status'];
$datas = [];
$datas['user'] = $request->user['name'];
$datas['project_name'] = $request->project['name'];
$datas['project_path'] = $request->project['path_with_namespace'];
$datas['attributes_description'] = $request->object_attributes['description'];
$datas['attributes_status'] = $request->object_attributes['merge_status'];
$datas['attributes_request_status'] = $request->object_attributes['state'];
$datas['attributes_source_branch'] = $request->object_attributes['source_branch'];
$datas['attributes_target_branch'] = $request->object_attributes['target_branch'];
$datas['attributes_url'] = $request->object_attributes['url'];
$datas['last_commit_author'] = $request->object_attributes['last_commit']['author']['name'];
$datas['attributes_source_branch'] = $request->object_attributes['source_branch'];
$datas['attributes_target_branch'] = $request->object_attributes['target_branch'];
$datas['attributes_url'] = $request->object_attributes['url'];
$datas['last_commit_author'] = $request->object_attributes['last_commit']['author']['name'];
Mail::to(\explode(',', config('webhooks.gitlab.notify')))->send(new Gitlab($datas));
}
}//end if
}
}

View file

@ -10,7 +10,7 @@ class Authenticate extends Middleware
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)

View file

@ -12,6 +12,5 @@ class CheckForMaintenanceMode extends Middleware
* @var array
*/
protected $except = [
//
];
];
}

View file

@ -12,6 +12,5 @@ class EncryptCookies extends Middleware
* @var array
*/
protected $except = [
//
];
];
}

View file

@ -3,20 +3,19 @@
namespace App\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\IpUtils;
class LDCNetwork
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
//IpUtils::checkIp();
// IpUtils::checkIp();
// https://github.com/symfony/http-foundation/blob/master/IpUtils.php#L36
return $next($request);
}

View file

@ -5,7 +5,6 @@ namespace App\Http\Middleware;
use Aacotroneo\Saml2\Saml2Auth;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\URL;
class RedirectIfAuthenticated
@ -13,15 +12,16 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if ($request->ajax()) {
return response('Unauthorized.', 401); // Or, return a response that causes client side js to redirect to '/routesPrefix/myIdp1/login'
return response('Unauthorized.', 401);
// Or, return a response that causes client side js to redirect to '/routesPrefix/myIdp1/login'
} else {
$saml2Auth = new Saml2Auth(Saml2Auth::loadOneLoginAuthFromIpdConfig('ldc'));
session(['redirectURL' => URL::full()]);

View file

@ -17,7 +17,7 @@ class TrustProxies extends Middleware
/**
* The headers that should be used to detect proxies.
*
* @var int
* @var integer
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}

View file

@ -9,7 +9,7 @@ class VerifyCsrfToken extends Middleware
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
* @var boolean
*/
protected $addHttpCookie = true;

View file

@ -11,7 +11,7 @@ class GitReposStoreRequest extends FormRequest
/**
* Determine if the user is authorized to make this request.
*
* @return bool
* @return boolean
*/
public function authorize()
{

View file

@ -11,7 +11,7 @@ class GitReposUpdateRequest extends FormRequest
/**
* Determine if the user is authorized to make this request.
*
* @return bool
* @return boolean
*/
public function authorize()
{

View file

@ -10,7 +10,7 @@ class StoreProjects extends FormRequest
/**
* Determine if the user is authorized to make this request.
*
* @return bool
* @return boolean
*/
public function authorize()
{

View file

@ -10,7 +10,7 @@ class UpdateProjects extends FormRequest
/**
* Determine if the user is authorized to make this request.
*
* @return bool
* @return boolean
*/
public function authorize()
{

View file

@ -9,7 +9,7 @@ class GitlabRequest extends FormRequest
/**
* Determine if the user is authorized to make this request.
*
* @return bool
* @return boolean
*/
public function authorize()
{

View file

@ -11,6 +11,7 @@ class MailjetSms
{
/** @var Application $app */
protected $app;
/** @var array $config */
protected $config = [];
@ -44,7 +45,7 @@ class MailjetSms
public function send(string $message, string $to, $from = null): ResponseInterface
{
$from = $from ?? $this->config['sms_from'];
$from = $from ?? $this->config['sms_from'];
$client = $this->buildHttpClient();
try {
@ -57,8 +58,8 @@ class MailjetSms
]);
} catch (\GuzzleHttp\Exception\RequestException $ex) {
Log::debug('error ' . $ex->getMessage());
if (!is_null($ex->getResponse())){
Log::debug((string) $ex->getResponse()->getBody());
if (!is_null($ex->getResponse())) {
Log::debug((string)$ex->getResponse()->getBody());
}
throw $ex;
}

View file

@ -3,13 +3,13 @@
namespace App\Mail\Webhooks;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class Gitlab extends Mailable
{
use Queueable, SerializesModels;
use Queueable;
use SerializesModels;
public $datas;

View file

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class DomainNames extends Model
{
//
}

View file

@ -6,7 +6,8 @@ use Illuminate\Database\Eloquent\Model;
class EmailAddresses extends Model
{
public function getDomainNameAttribute() {
public function getDomainNameAttribute()
{
$dn = DomainNames::findOrFail($this->domain_name_id);
return $dn->utf8_name;
}

View file

@ -17,41 +17,50 @@ class Projects extends Model
'prod_login' => 'array'
];
public function getDevWebIpAttribute() {
public function getDevWebIpAttribute()
{
$value = Servers::find($this->dev_web_server_id);
if ($value)
if ($value) {
$value = $value->ssh;
}
return $value;
}
public function getDevDbIpAttribute() {
public function getDevDbIpAttribute()
{
$value = Servers::find($this->dev_db_server_id);
if ($value)
if ($value) {
$value = $value->ssh;
}
return $value;
}
public function getProdWebIpAttribute() {
public function getProdWebIpAttribute()
{
$value = Servers::find($this->prod_web_server_id);
if ($value)
if ($value) {
$value = $value->ssh;
}
return $value;
}
public function getProdDbIpAttribute() {
public function getProdDbIpAttribute()
{
$value = Servers::find($this->prod_db_server_id);
if ($value)
if ($value) {
$value = $value->ssh;
}
return $value;
}
public function getCheckedAttribute() {
public function getCheckedAttribute()
{
$value = ProjectsStatusChecker::select('updated_at')->where('project_uuid', '=', $this->uuid)->first();
if (!$value) {
$value = 'missing';
} else {
$value = $value->updated_at;
$dt = Carbon::now();
$dt = Carbon::now();
if ($dt->diffInMinutes($value) > 30) {
$value = 'false';
} else {
@ -60,9 +69,10 @@ class Projects extends Model
}
return $value;
}
public function getSitemapCheckedAttribute() {
public function getSitemapCheckedAttribute()
{
$value = ProjectsStatusChecker::select('sitemap')->where('project_uuid', '=', $this->uuid)->first();
if(!$value) {
if (!$value) {
$value = 'missing';
} else {
$value = $value->sitemap;
@ -70,9 +80,10 @@ class Projects extends Model
return $value;
}
public function getRobotsCheckedAttribute() {
public function getRobotsCheckedAttribute()
{
$value = ProjectsStatusChecker::select('robots')->where('project_uuid', '=', $this->uuid)->first();
if(!$value) {
if (!$value) {
$value = 'missing';
} else {
$value = $value->robots;
@ -80,9 +91,10 @@ class Projects extends Model
return $value;
}
public function getLogsCheckedAttribute() {
public function getLogsCheckedAttribute()
{
$value = ProjectsStatusChecker::select('logs')->where('project_uuid', '=', $this->uuid)->first();
if(!$value) {
if (!$value) {
$value = 'missing';
} else {
$value = $value->logs;
@ -90,9 +102,10 @@ class Projects extends Model
return $value;
}
public function getCodeAttribute() {
public function getCodeAttribute()
{
$value = ProjectsStatusChecker::select('code')->where('project_uuid', '=', $this->uuid)->first();
if(!$value) {
if (!$value) {
$value = 'missing';
} else {
$value = $value->code;
@ -100,13 +113,15 @@ class Projects extends Model
return $value;
}
public function getLogsHrAttribute() {
public function getLogsHrAttribute()
{
$value = ProjectsStatusChecker::select('logs')->where('project_uuid', '=', $this->uuid)->first();
return $this->human_filesize($value->logs);
}
private function human_filesize($size, $precision = 2) {
private function human_filesize($size, $precision = 2)
{
$i = floor(log($size, 1024));
return round($size / pow(1024, $i), [0,0,2,2,3][$i]).[' O',' Ko',' Mo',' Go',' To'][$i];
return round($size / pow(1024, $i), [0,0,2,2,3][$i]) . [' O',' Ko',' Mo',' Go',' To'][$i];
}
}

View file

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Servers extends Model
{
//
}

View file

@ -14,7 +14,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
//
}
/**

View file

@ -3,7 +3,6 @@
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
@ -24,7 +23,5 @@ class AuthServiceProvider extends ServiceProvider
public function boot()
{
$this->registerPolicies();
//
}
}

View file

@ -36,8 +36,7 @@ class EventServiceProvider extends ServiceProvider
Event::listen('Aacotroneo\Saml2\Events\Saml2LoginEvent', function (Saml2LoginEvent $event) {
$messageId = $event->getSaml2Auth()->getLastMessageId();
// TODO : Add your own code preventing reuse of a $messageId to stop replay attacks
$user = $event->getSaml2User();
$user = $event->getSaml2User();
$email = $user->getNameId();
$lUser = User::where('email', '=', $email)->first();
if (!$lUser) {

View file

@ -15,7 +15,6 @@ class MailjetSmsServiceProvider extends ServiceProvider
*/
public function register()
{
//
}
/**

View file

@ -30,7 +30,6 @@ class RouteServiceProvider extends ServiceProvider
*/
public function boot()
{
//
parent::boot();
}
@ -45,8 +44,6 @@ class RouteServiceProvider extends ServiceProvider
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**

View file

@ -2,7 +2,6 @@
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

View file

@ -8,25 +8,27 @@
],
"license": "MIT",
"require": {
"php": "^7.2",
"php": "^7.3",
"aacotroneo/laravel-saml2": "^2.1",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^7.0.1",
"kwaadpepper/enum": "^2.1",
"kwaadpepper/exception-handler": "^0.0.6",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"kwaadpepper/exception-handler": "^0.0.8",
"laravel/framework": "^8.75",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"lfkeitel/phptotp": " 1.0",
"simplesoftwareio/simple-qrcode": "^4.2",
"slevomat/coding-standard": "^7.0"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.0"
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10",
"slevomat/coding-standard": "^7.2"
},
"config": {
"optimize-autoloader": true,

202
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c81746c5c17073865818c1cdc3fb2b4e",
"content-hash": "4124827a814f2cdf1133d366b803501d",
"packages": [
{
"name": "aacotroneo/laravel-saml2",
@ -1108,21 +1108,21 @@
},
{
"name": "kwaadpepper/exception-handler",
"version": "0.0.6",
"version": "0.0.8",
"source": {
"type": "git",
"url": "https://github.com/Kwaadpepper/exception-handler.git",
"reference": "9e17a9c0a43755d91cb98717e3fc7ba17db0c1c7"
"reference": "e8ba0e31ca2bf5971e459c623f0f5322a4c7a630"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kwaadpepper/exception-handler/zipball/9e17a9c0a43755d91cb98717e3fc7ba17db0c1c7",
"reference": "9e17a9c0a43755d91cb98717e3fc7ba17db0c1c7",
"url": "https://api.github.com/repos/Kwaadpepper/exception-handler/zipball/e8ba0e31ca2bf5971e459c623f0f5322a4c7a630",
"reference": "e8ba0e31ca2bf5971e459c623f0f5322a4c7a630",
"shasum": ""
},
"require": {
"illuminate/support": "~7|~8",
"laravel/framework": "~7|~8"
"illuminate/support": "~7|~8|~9",
"laravel/framework": "~7|~8|~9"
},
"require-dev": {
"orchestra/testbench": "^6.13",
@ -1163,9 +1163,9 @@
],
"support": {
"issues": "https://github.com/Kwaadpepper/exception-handler/issues",
"source": "https://github.com/Kwaadpepper/exception-handler/tree/0.0.6"
"source": "https://github.com/Kwaadpepper/exception-handler/tree/0.0.8"
},
"time": "2021-12-01T08:54:11+00:00"
"time": "2022-02-03T15:23:22+00:00"
},
{
"name": "laravel/framework",
@ -5996,6 +5996,73 @@
},
"time": "2020-10-16T08:27:54+00:00"
},
{
"name": "fakerphp/faker",
"version": "v1.19.0",
"source": {
"type": "git",
"url": "https://github.com/FakerPHP/Faker.git",
"reference": "d7f08a622b3346766325488aa32ddc93ccdecc75"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/d7f08a622b3346766325488aa32ddc93ccdecc75",
"reference": "d7f08a622b3346766325488aa32ddc93ccdecc75",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0",
"psr/container": "^1.0 || ^2.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
},
"conflict": {
"fzaninotto/faker": "*"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4.1",
"doctrine/persistence": "^1.3 || ^2.0",
"ext-intl": "*",
"symfony/phpunit-bridge": "^4.4 || ^5.2"
},
"suggest": {
"doctrine/orm": "Required to use Faker\\ORM\\Doctrine",
"ext-curl": "Required by Faker\\Provider\\Image to download images.",
"ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.",
"ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.",
"ext-mbstring": "Required for multibyte Unicode string functionality."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "v1.19-dev"
}
},
"autoload": {
"psr-4": {
"Faker\\": "src/Faker/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "François Zaninotto"
}
],
"description": "Faker is a PHP library that generates fake data for you.",
"keywords": [
"data",
"faker",
"fixtures"
],
"support": {
"issues": "https://github.com/FakerPHP/Faker/issues",
"source": "https://github.com/FakerPHP/Faker/tree/v1.19.0"
},
"time": "2022-02-02T17:38:57+00:00"
},
{
"name": "filp/whoops",
"version": "2.14.5",
@ -6067,61 +6134,6 @@
],
"time": "2022-01-07T12:00:00+00:00"
},
{
"name": "fzaninotto/faker",
"version": "v1.9.2",
"source": {
"type": "git",
"url": "https://github.com/fzaninotto/Faker.git",
"reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e",
"reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"ext-intl": "*",
"phpunit/phpunit": "^4.8.35 || ^5.7",
"squizlabs/php_codesniffer": "^2.9.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Faker\\": "src/Faker/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "François Zaninotto"
}
],
"description": "Faker is a PHP library that generates fake data for you.",
"keywords": [
"data",
"faker",
"fixtures"
],
"support": {
"issues": "https://github.com/fzaninotto/Faker/issues",
"source": "https://github.com/fzaninotto/Faker/tree/v1.9.2"
},
"abandoned": true,
"time": "2020-12-11T09:56:16+00:00"
},
{
"name": "hamcrest/hamcrest-php",
"version": "v2.0.1",
@ -6173,6 +6185,66 @@
},
"time": "2020-07-09T08:09:16+00:00"
},
{
"name": "laravel/sail",
"version": "v1.14.10",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "0ea5d683af4d189071efcdb9e83946c10dab82c3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/0ea5d683af4d189071efcdb9e83946c10dab82c3",
"reference": "0ea5d683af4d189071efcdb9e83946c10dab82c3",
"shasum": ""
},
"require": {
"illuminate/console": "^8.0|^9.0",
"illuminate/contracts": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"php": "^7.3|^8.0"
},
"bin": [
"bin/sail"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Sail\\SailServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Sail\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Docker files for running a basic Laravel application.",
"keywords": [
"docker",
"laravel"
],
"support": {
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2022-06-09T07:10:28+00:00"
},
{
"name": "mockery/mockery",
"version": "1.5.0",
@ -8171,7 +8243,7 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^7.2"
"php": "^7.3"
},
"platform-dev": [],
"plugin-api-version": "2.2.0"

View file

@ -3,53 +3,53 @@
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. 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.
|
*/
'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.
|
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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),
'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
| your application so that it is used when running Artisan tasks.
|
|--------------------------------------------------------------------------
| 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'),
@ -57,66 +57,66 @@ return [
'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.
|
|--------------------------------------------------------------------------
| 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' => 'Europe/Paris',
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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' => 'fr',
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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
|--------------------------------------------------------------------------
|
| 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!
|
|--------------------------------------------------------------------------
| 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'),
@ -124,14 +124,14 @@ return [
'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.
|
|--------------------------------------------------------------------------
| 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' => [
@ -180,14 +180,14 @@ return [
],
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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' => [

View file

@ -3,14 +3,14 @@
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 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.
|
*/
'defaults' => [
@ -19,20 +19,20 @@ return [
],
/*
|--------------------------------------------------------------------------
| 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
| 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"
|
*/
'guards' => [
@ -49,20 +49,20 @@ return [
],
/*
|--------------------------------------------------------------------------
| 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"
|
|--------------------------------------------------------------------------
| 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"
|
*/
'providers' => [
@ -72,24 +72,24 @@ return [
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'passwords' => [
@ -102,14 +102,14 @@ return [
],
/*
|--------------------------------------------------------------------------
| 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 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,

View file

@ -3,29 +3,29 @@
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 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.
|
|--------------------------------------------------------------------------
| 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' => [

View file

@ -5,30 +5,30 @@ use Illuminate\Support\Str;
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", "dynamodb"
|
|--------------------------------------------------------------------------
| 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", "dynamodb"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
@ -88,16 +88,16 @@ 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
];

View file

@ -5,32 +5,32 @@ use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| 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.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'connections' => [
@ -94,27 +94,27 @@ return [
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| 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.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| 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.
|
*/
'redis' => [
@ -123,7 +123,7 @@ return [
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
],
'default' => [

View file

@ -3,42 +3,42 @@
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| 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!
|
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| 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!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| 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 setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
|--------------------------------------------------------------------------
| 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 setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [

View file

@ -3,29 +3,29 @@
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"
|
|--------------------------------------------------------------------------
| 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 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' => [
@ -33,14 +33,14 @@ return [
],
/*
|--------------------------------------------------------------------------
| 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 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' => [

View file

@ -7,31 +7,31 @@ use Monolog\Handler\SyslogUdpHandler;
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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| 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.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
|--------------------------------------------------------------------------
| 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.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [

View file

@ -3,56 +3,56 @@
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/
'driver' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 587),
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'from' => [
@ -61,27 +61,27 @@ return [
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
@ -89,27 +89,27 @@ return [
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| 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 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' => [
@ -121,14 +121,14 @@ return [
],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),

View file

@ -3,29 +3,29 @@
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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| 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.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
|--------------------------------------------------------------------------
| 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.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
@ -69,14 +69,14 @@ return [
],
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'failed' => [

View file

@ -4,9 +4,9 @@
// so you can define different values for each IdP, all starting with 'SAML2_'.$this_idp_env_id
$this_idp_env_id = 'ldc';
//This is variable is for simplesaml example only.
// This is variable is for simplesaml example only.
// For real IdP, you must set the url values in the 'idp' config to conform to the IdP's real urls.
$idp_host = env('SAML2_'.$this_idp_env_id.'_IDP_HOST', 'http://localhost:8000/simplesaml');
$idp_host = env('SAML2_' . $this_idp_env_id . '_IDP_HOST', 'http://localhost:8000/simplesaml');
return $settings = array(
@ -18,8 +18,8 @@ return $settings = array(
// or unencrypted messages if it expects them signed or encrypted
// Also will reject the messages if not strictly follow the SAML
// standard: Destination, NameId, Conditions ... are validated too.
'strict' => true, //@todo: make this depend on laravel config
'strict' => true,
// @todo: make this depend on laravel config
// Enable debug mode (to print errors)
'debug' => env('APP_DEBUG', false),
@ -33,12 +33,12 @@ return $settings = array(
// Usually x509cert and privateKey of the SP are provided by files placed at
// the certs folder. But we can also provide them with the following parameters
'x509cert' => env('SAML2_'.$this_idp_env_id.'_SP_x509',''),
'privateKey' => env('SAML2_'.$this_idp_env_id.'_SP_PRIVATEKEY',''),
'x509cert' => env('SAML2_' . $this_idp_env_id . '_SP_x509', ''),
'privateKey' => env('SAML2_' . $this_idp_env_id . '_SP_PRIVATEKEY', ''),
// Identifier (URI) of the SP entity.
// Leave blank to use the '{idpName}_metadata' route, e.g. 'test_metadata'.
'entityId' => env('SAML2_'.$this_idp_env_id.'_SP_ENTITYID',''),
'entityId' => env('SAML2_' . $this_idp_env_id . '_SP_ENTITYID', ''),
// Specifies info about where and how the <AuthnResponse> message MUST be
// returned to the requester, in this case our SP.
@ -62,21 +62,21 @@ return $settings = array(
// Identity Provider Data that we want connect with our SP
'idp' => array(
// Identifier of the IdP entity (must be a URI)
'entityId' => env('SAML2_'.$this_idp_env_id.'_IDP_ENTITYID', $idp_host . '/saml2/idp/metadata.php'),
'entityId' => env('SAML2_' . $this_idp_env_id . '_IDP_ENTITYID', $idp_host . '/saml2/idp/metadata.php'),
// SSO endpoint info of the IdP. (Authentication Request protocol)
'singleSignOnService' => array(
// URL Target of the IdP where the SP will send the Authentication Request Message,
// using HTTP-Redirect binding.
'url' => env('SAML2_'.$this_idp_env_id.'_IDP_SSO_URL', $idp_host . '/saml2/idp/SSOService.php'),
'url' => env('SAML2_' . $this_idp_env_id . '_IDP_SSO_URL', $idp_host . '/saml2/idp/SSOService.php'),
),
// SLO endpoint info of the IdP.
'singleLogoutService' => array(
// URL Location of the IdP where the SP will send the SLO Request,
// using HTTP-Redirect binding.
'url' => env('SAML2_'.$this_idp_env_id.'_IDP_SL_URL', $idp_host . '/saml2/idp/SingleLogoutService.php'),
'url' => env('SAML2_' . $this_idp_env_id . '_IDP_SL_URL', $idp_host . '/saml2/idp/SingleLogoutService.php'),
),
// Public x509 certificate of the IdP
'x509cert' => env('SAML2_'.$this_idp_env_id.'_IDP_x509', 'MIID/TCCAuWgAwIBAgIJAI4R3WyjjmB1MA0GCSqGSIb3DQEBCwUAMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjAeFw0xNDEyMDExNDM2MjVaFw0yNDExMzAxNDM2MjVaMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbzW/EpEv+qqZzfT1Buwjg9nnNNVrxkCfuR9fQiQw2tSouS5X37W5h7RmchRt54wsm046PDKtbSz1NpZT2GkmHN37yALW2lY7MyVUC7itv9vDAUsFr0EfKIdCKgxCKjrzkZ5ImbNvjxf7eA77PPGJnQ/UwXY7W+cvLkirp0K5uWpDk+nac5W0JXOCFR1BpPUJRbz2jFIEHyChRt7nsJZH6ejzNqK9lABEC76htNy1Ll/D3tUoPaqo8VlKW3N3MZE0DB9O7g65DmZIIlFqkaMH3ALd8adodJtOvqfDU/A6SxuwMfwDYPjoucykGDu1etRZ7dF2gd+W+1Pn7yizPT1q8CAwEAAaNQME4wHQYDVR0OBBYEFPsn8tUHN8XXf23ig5Qro3beP8BuMB8GA1UdIwQYMBaAFPsn8tUHN8XXf23ig5Qro3beP8BuMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAGu60odWFiK+DkQekozGnlpNBQz5lQ/bwmOWdktnQj6HYXu43e7sh9oZWArLYHEOyMUekKQAxOK51vbTHzzw66BZU91/nqvaOBfkJyZKGfluHbD0/hfOl/D5kONqI9kyTu4wkLQcYGyuIi75CJs15uA03FSuULQdY/Liv+czS/XYDyvtSLnu43VuAQWN321PQNhuGueIaLJANb2C5qq5ilTBUw6PxY9Z+vtMjAjTJGKEkE/tQs7CvzLPKXX3KTD9lIILmX5yUC3dLgjVKi1KGDqNApYGOMtjr5eoxPQrqDBmyx3flcy0dQTdLXud3UjWVW3N0PYgJtw5yBsS74QTGD4='),
'x509cert' => env('SAML2_' . $this_idp_env_id . '_IDP_x509', 'MIID/TCCAuWgAwIBAgIJAI4R3WyjjmB1MA0GCSqGSIb3DQEBCwUAMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjAeFw0xNDEyMDExNDM2MjVaFw0yNDExMzAxNDM2MjVaMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbzW/EpEv+qqZzfT1Buwjg9nnNNVrxkCfuR9fQiQw2tSouS5X37W5h7RmchRt54wsm046PDKtbSz1NpZT2GkmHN37yALW2lY7MyVUC7itv9vDAUsFr0EfKIdCKgxCKjrzkZ5ImbNvjxf7eA77PPGJnQ/UwXY7W+cvLkirp0K5uWpDk+nac5W0JXOCFR1BpPUJRbz2jFIEHyChRt7nsJZH6ejzNqK9lABEC76htNy1Ll/D3tUoPaqo8VlKW3N3MZE0DB9O7g65DmZIIlFqkaMH3ALd8adodJtOvqfDU/A6SxuwMfwDYPjoucykGDu1etRZ7dF2gd+W+1Pn7yizPT1q8CAwEAAaNQME4wHQYDVR0OBBYEFPsn8tUHN8XXf23ig5Qro3beP8BuMB8GA1UdIwQYMBaAFPsn8tUHN8XXf23ig5Qro3beP8BuMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAGu60odWFiK+DkQekozGnlpNBQz5lQ/bwmOWdktnQj6HYXu43e7sh9oZWArLYHEOyMUekKQAxOK51vbTHzzw66BZU91/nqvaOBfkJyZKGfluHbD0/hfOl/D5kONqI9kyTu4wkLQcYGyuIi75CJs15uA03FSuULQdY/Liv+czS/XYDyvtSLnu43VuAQWN321PQNhuGueIaLJANb2C5qq5ilTBUw6PxY9Z+vtMjAjTJGKEkE/tQs7CvzLPKXX3KTD9lIILmX5yUC3dLgjVKi1KGDqNApYGOMtjr5eoxPQrqDBmyx3flcy0dQTdLXud3UjWVW3N0PYgJtw5yBsS74QTGD4='),
/*
* Instead of use the whole x509cert you can use a fingerprint
* (openssl x509 -noout -fingerprint -in "idp.crt" to generate it)
@ -95,7 +95,7 @@ return $settings = array(
// Security settings
'security' => array(
'signatureAlgorithm' => 'http://www.w3.org/2000/09/xmldsig#rsa-sha1',
'signatureAlgorithm' => 'http://www.w3.org/2000/09/xmldsig#rsa-sha1',
'digestAlgorithm' => 'http://www.w3.org/2000/09/xmldsig#sha1',
/** signatures and encryptions offered */
@ -116,8 +116,9 @@ return $settings = array(
// will be signed.
'logoutResponseSigned' => true,
/* Sign the Metadata
False || True (use sp certs) || array (
/*
Sign the Metadata
False || True (use sp certs) || array (
keyFileName => 'metadata.key',
certFileName => 'metadata.crt'
)
@ -125,7 +126,7 @@ return $settings = array(
'signMetadata' => true,
/** signatures and encryptions required **/
/** signatures and encryptions required */
// Indicates a requirement for the <samlp:Response>, <samlp:LogoutRequest> and
// <samlp:LogoutResponse> elements received by this SP to be signed.
@ -167,13 +168,14 @@ return $settings = array(
),
),
/* Interoperable SAML 2.0 Web Browser SSO Profile [saml2int] http://saml2int.org/profile/current
/*
Interoperable SAML 2.0 Web Browser SSO Profile [saml2int] http://saml2int.org/profile/current
'authnRequestsSigned' => false, // SP SHOULD NOT sign the <samlp:AuthnRequest>,
'authnRequestsSigned' => false, // SP SHOULD NOT sign the <samlp:AuthnRequest>,
// MUST NOT assume that the IdP validates the sign
'wantAssertionsSigned' => true,
'wantAssertionsEncrypted' => true, // MUST be enabled if SSL/HTTPs is disabled
'wantNameIdEncrypted' => false,
'wantAssertionsSigned' => true,
'wantAssertionsEncrypted' => true, // MUST be enabled if SSL/HTTPs is disabled
'wantNameIdEncrypted' => false,
*/
);

View file

@ -4,9 +4,9 @@
// so you can define different values for each IdP, all starting with 'SAML2_'.$this_idp_env_id
$this_idp_env_id = 'ldc';
//This is variable is for simplesaml example only.
// This is variable is for simplesaml example only.
// For real IdP, you must set the url values in the 'idp' config to conform to the IdP's real urls.
$idp_host = env('SAML2_'.$this_idp_env_id.'_IDP_HOST', 'http://localhost:8000/simplesaml');
$idp_host = env('SAML2_' . $this_idp_env_id . '_IDP_HOST', 'http://localhost:8000/simplesaml');
return $settings = array(
@ -18,8 +18,8 @@ return $settings = array(
// or unencrypted messages if it expects them signed or encrypted
// Also will reject the messages if not strictly follow the SAML
// standard: Destination, NameId, Conditions ... are validated too.
'strict' => true, //@todo: make this depend on laravel config
'strict' => true,
// @todo: make this depend on laravel config
// Enable debug mode (to print errors)
'debug' => env('APP_DEBUG', false),
@ -33,12 +33,12 @@ return $settings = array(
// Usually x509cert and privateKey of the SP are provided by files placed at
// the certs folder. But we can also provide them with the following parameters
'x509cert' => env('SAML2_'.$this_idp_env_id.'_SP_x509',''),
'privateKey' => env('SAML2_'.$this_idp_env_id.'_SP_PRIVATEKEY',''),
'x509cert' => env('SAML2_' . $this_idp_env_id . '_SP_x509', ''),
'privateKey' => env('SAML2_' . $this_idp_env_id . '_SP_PRIVATEKEY', ''),
// Identifier (URI) of the SP entity.
// Leave blank to use the '{idpName}_metadata' route, e.g. 'test_metadata'.
'entityId' => env('SAML2_'.$this_idp_env_id.'_SP_ENTITYID',''),
'entityId' => env('SAML2_' . $this_idp_env_id . '_SP_ENTITYID', ''),
// Specifies info about where and how the <AuthnResponse> message MUST be
// returned to the requester, in this case our SP.
@ -62,21 +62,21 @@ return $settings = array(
// Identity Provider Data that we want connect with our SP
'idp' => array(
// Identifier of the IdP entity (must be a URI)
'entityId' => env('SAML2_'.$this_idp_env_id.'_IDP_ENTITYID', $idp_host . '/saml2/idp/metadata.php'),
'entityId' => env('SAML2_' . $this_idp_env_id . '_IDP_ENTITYID', $idp_host . '/saml2/idp/metadata.php'),
// SSO endpoint info of the IdP. (Authentication Request protocol)
'singleSignOnService' => array(
// URL Target of the IdP where the SP will send the Authentication Request Message,
// using HTTP-Redirect binding.
'url' => env('SAML2_'.$this_idp_env_id.'_IDP_SSO_URL', $idp_host . '/saml2/idp/SSOService.php'),
'url' => env('SAML2_' . $this_idp_env_id . '_IDP_SSO_URL', $idp_host . '/saml2/idp/SSOService.php'),
),
// SLO endpoint info of the IdP.
'singleLogoutService' => array(
// URL Location of the IdP where the SP will send the SLO Request,
// using HTTP-Redirect binding.
'url' => env('SAML2_'.$this_idp_env_id.'_IDP_SL_URL', $idp_host . '/saml2/idp/SingleLogoutService.php'),
'url' => env('SAML2_' . $this_idp_env_id . '_IDP_SL_URL', $idp_host . '/saml2/idp/SingleLogoutService.php'),
),
// Public x509 certificate of the IdP
'x509cert' => env('SAML2_'.$this_idp_env_id.'_IDP_x509', 'MIID/TCCAuWgAwIBAgIJAI4R3WyjjmB1MA0GCSqGSIb3DQEBCwUAMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjAeFw0xNDEyMDExNDM2MjVaFw0yNDExMzAxNDM2MjVaMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbzW/EpEv+qqZzfT1Buwjg9nnNNVrxkCfuR9fQiQw2tSouS5X37W5h7RmchRt54wsm046PDKtbSz1NpZT2GkmHN37yALW2lY7MyVUC7itv9vDAUsFr0EfKIdCKgxCKjrzkZ5ImbNvjxf7eA77PPGJnQ/UwXY7W+cvLkirp0K5uWpDk+nac5W0JXOCFR1BpPUJRbz2jFIEHyChRt7nsJZH6ejzNqK9lABEC76htNy1Ll/D3tUoPaqo8VlKW3N3MZE0DB9O7g65DmZIIlFqkaMH3ALd8adodJtOvqfDU/A6SxuwMfwDYPjoucykGDu1etRZ7dF2gd+W+1Pn7yizPT1q8CAwEAAaNQME4wHQYDVR0OBBYEFPsn8tUHN8XXf23ig5Qro3beP8BuMB8GA1UdIwQYMBaAFPsn8tUHN8XXf23ig5Qro3beP8BuMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAGu60odWFiK+DkQekozGnlpNBQz5lQ/bwmOWdktnQj6HYXu43e7sh9oZWArLYHEOyMUekKQAxOK51vbTHzzw66BZU91/nqvaOBfkJyZKGfluHbD0/hfOl/D5kONqI9kyTu4wkLQcYGyuIi75CJs15uA03FSuULQdY/Liv+czS/XYDyvtSLnu43VuAQWN321PQNhuGueIaLJANb2C5qq5ilTBUw6PxY9Z+vtMjAjTJGKEkE/tQs7CvzLPKXX3KTD9lIILmX5yUC3dLgjVKi1KGDqNApYGOMtjr5eoxPQrqDBmyx3flcy0dQTdLXud3UjWVW3N0PYgJtw5yBsS74QTGD4='),
'x509cert' => env('SAML2_' . $this_idp_env_id . '_IDP_x509', 'MIID/TCCAuWgAwIBAgIJAI4R3WyjjmB1MA0GCSqGSIb3DQEBCwUAMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjAeFw0xNDEyMDExNDM2MjVaFw0yNDExMzAxNDM2MjVaMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBgNVBAMMC09yZy5TaXUuQ29tMSAwHgYJKoZIhvcNAQkBFhFhZG1pbmlAc2l1LmVkdS5hcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbzW/EpEv+qqZzfT1Buwjg9nnNNVrxkCfuR9fQiQw2tSouS5X37W5h7RmchRt54wsm046PDKtbSz1NpZT2GkmHN37yALW2lY7MyVUC7itv9vDAUsFr0EfKIdCKgxCKjrzkZ5ImbNvjxf7eA77PPGJnQ/UwXY7W+cvLkirp0K5uWpDk+nac5W0JXOCFR1BpPUJRbz2jFIEHyChRt7nsJZH6ejzNqK9lABEC76htNy1Ll/D3tUoPaqo8VlKW3N3MZE0DB9O7g65DmZIIlFqkaMH3ALd8adodJtOvqfDU/A6SxuwMfwDYPjoucykGDu1etRZ7dF2gd+W+1Pn7yizPT1q8CAwEAAaNQME4wHQYDVR0OBBYEFPsn8tUHN8XXf23ig5Qro3beP8BuMB8GA1UdIwQYMBaAFPsn8tUHN8XXf23ig5Qro3beP8BuMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAGu60odWFiK+DkQekozGnlpNBQz5lQ/bwmOWdktnQj6HYXu43e7sh9oZWArLYHEOyMUekKQAxOK51vbTHzzw66BZU91/nqvaOBfkJyZKGfluHbD0/hfOl/D5kONqI9kyTu4wkLQcYGyuIi75CJs15uA03FSuULQdY/Liv+czS/XYDyvtSLnu43VuAQWN321PQNhuGueIaLJANb2C5qq5ilTBUw6PxY9Z+vtMjAjTJGKEkE/tQs7CvzLPKXX3KTD9lIILmX5yUC3dLgjVKi1KGDqNApYGOMtjr5eoxPQrqDBmyx3flcy0dQTdLXud3UjWVW3N0PYgJtw5yBsS74QTGD4='),
/*
* Instead of use the whole x509cert you can use a fingerprint
* (openssl x509 -noout -fingerprint -in "idp.crt" to generate it)
@ -113,8 +113,9 @@ return $settings = array(
// will be signed.
'logoutResponseSigned' => false,
/* Sign the Metadata
False || True (use sp certs) || array (
/*
Sign the Metadata
False || True (use sp certs) || array (
keyFileName => 'metadata.key',
certFileName => 'metadata.crt'
)
@ -122,7 +123,7 @@ return $settings = array(
'signMetadata' => false,
/** signatures and encryptions required **/
/** signatures and encryptions required */
// Indicates a requirement for the <samlp:Response>, <samlp:LogoutRequest> and
// <samlp:LogoutResponse> elements received by this SP to be signed.
@ -164,13 +165,14 @@ return $settings = array(
),
),
/* Interoperable SAML 2.0 Web Browser SSO Profile [saml2int] http://saml2int.org/profile/current
/*
Interoperable SAML 2.0 Web Browser SSO Profile [saml2int] http://saml2int.org/profile/current
'authnRequestsSigned' => false, // SP SHOULD NOT sign the <samlp:AuthnRequest>,
'authnRequestsSigned' => false, // SP SHOULD NOT sign the <samlp:AuthnRequest>,
// MUST NOT assume that the IdP validates the sign
'wantAssertionsSigned' => true,
'wantAssertionsEncrypted' => true, // MUST be enabled if SSL/HTTPs is disabled
'wantNameIdEncrypted' => false,
'wantAssertionsSigned' => true,
'wantAssertionsEncrypted' => true, // MUST be enabled if SSL/HTTPs is disabled
'wantNameIdEncrypted' => false,
*/
);

View file

@ -58,7 +58,7 @@ return $settings = array(
// e.g X-Forwarded-Proto / HTTP_X_FORWARDED_PROTO. This is useful if
// your application is running behind a load balancer which terminates
// SSL.
// LDC WEB SET FALSE IF LOCAL
// LDC WEB SET FALSE IF LOCAL
'proxyVars' => true,
/**

View file

@ -3,15 +3,15 @@
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [

View file

@ -5,30 +5,30 @@ use Illuminate\Support\Str;
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.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
|--------------------------------------------------------------------------
| 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.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| 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.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
@ -36,92 +36,92 @@ return [
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| 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.
|
*/
'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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'cookie' => env(
@ -130,68 +130,68 @@ return [
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| 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.
|
*/
'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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| 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.
|
*/
'secure' => env('SESSION_SECURE_COOKIE', null),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| 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.
|
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| 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.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| 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.
|
| Supported: "lax", "strict", "none"
|
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| 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.
|
| Supported: "lax", "strict", "none"
|
*/
'same_site' => null,

View file

@ -3,14 +3,14 @@
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.
|
|--------------------------------------------------------------------------
| 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' => [
@ -18,14 +18,14 @@ return [
],
/*
|--------------------------------------------------------------------------
| 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 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' => env(

View file

@ -0,0 +1,41 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
// * password
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
public function unverified()
{
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
}
}

View file

@ -6,7 +6,7 @@
<arg name="extensions" value="php" />
<file>app/</file>
<file>config/</file>
<file>database/seeders</file>
<file>database/factories</file>
<file>routes/</file>
<file>tests/</file>
<rule ref="PSR1" />
@ -125,4 +125,5 @@
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/database/migrations/*</exclude-pattern>
</rule>
</ruleset>

View file

@ -1,16 +1,14 @@
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::post('/status-checker', 'API\StatusCheckerController@index');

View file

@ -1,16 +1,16 @@
<?php
/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
*/
Broadcast::channel('App.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
return (int)$user->id === (int)$id;
});

View file

@ -3,14 +3,14 @@
use Illuminate\Foundation\Inspiring;
/*
|--------------------------------------------------------------------------
| 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.
|
|--------------------------------------------------------------------------
| 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.
|
*/
Artisan::command('inspire', function () {

View file

@ -1,14 +1,14 @@
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::post('/webhooks/gitlab', 'Webhooks\GitlabController@handle');
@ -22,9 +22,9 @@ Route::view('/login/unauthorized', 'auth.unauthorized')->name('unauthorized');
Route::group(['middleware' => ['auth']], function () {
Route::get('/', 'HomeController@index')->name('home');
Route::get('/otp-qr-code', 'HomeController@qr')->name('otp-qr-code');
/* STATUS CHECKER */
// STATUS CHECKER
Route::get('/status-checker', 'StatusCheckerController@index');
/* EDL WEB */
// EDL WEB
Route::get('/projects', 'ProjectsController@index')->name('projects.index');
Route::get('/projects/{uuid}/edit', 'ProjectsController@edit')->name('projects.edit');
Route::post('/projects/{uuid}/update', 'ProjectsController@update');
@ -32,7 +32,7 @@ Route::group(['middleware' => ['auth']], function () {
Route::post('/projects/{uuid}/force-delete', 'ProjectsController@forceDelete');
Route::get('/projects/add', 'ProjectsController@add');
Route::post('/projects/store', 'ProjectsController@store');
/* SERVERS */
// SERVERS
Route::get('/servers', 'ServersController@index')->name('servers.index');
Route::post('/servers/store', 'ServersController@store')->name('servers.store');
Route::get('/servers/add', 'ServersController@add')->name('servers.add');
@ -40,7 +40,7 @@ Route::group(['middleware' => ['auth']], function () {
Route::post('/servers/{id}/update', 'ServersController@update')->name('servers.update');
Route::get('/servers/{id}/delete', 'ServersController@delete')->name('servers.delete');
Route::post('/servers/{id}/force-delete', 'ServersController@forceDelete')->name('servers.force-delete');
/* DATASTORE PCC */
// DATASTORE PCC
Route::get('/dpccs', 'DatastorePCCController@index')->name('dpccs.index');
Route::post('/dpccs/store', 'DatastorePCCController@store')->name('dpccs.store');
Route::get('/dpccs/add', 'DatastorePCCController@add')->name('dpccs.add');
@ -48,7 +48,7 @@ Route::group(['middleware' => ['auth']], function () {
Route::post('/dpccs/{id}/update', 'DatastorePCCController@update')->name('dpccs.update');
Route::get('/dpccs/{id}/delete', 'DatastorePCCController@delete')->name('dpccs.delete');
Route::post('/dpccs/{id}/force-delete', 'DatastorePCCController@forceDelete')->name('dpccs.force-delete');
/* DOMAIN NAMES */
// DOMAIN NAMES
Route::get('/domain-names', 'DomainNamesController@index')->name('domain-names.index');
Route::post('/domain-names/store', 'DomainNamesController@store')->name('domain-names.store');
Route::get('/domain-names/add', 'DomainNamesController@add')->name('domain-names.add');
@ -56,7 +56,7 @@ Route::group(['middleware' => ['auth']], function () {
Route::post('/domain-names/{id}/update', 'DomainNamesController@update')->name('domain-names.update');
Route::get('/domain-names/{id}/delete', 'DomainNamesController@delete')->name('domain-names.delete');
Route::post('/domain-names/{id}/force-delete', 'DomainNamesController@forceDelete')->name('domain-names.force-delete');
/* EMAIL ADDRESSES */
// EMAIL ADDRESSES
Route::get('/email-addresses', 'EmailAddressesController@index')->name('email-addresses.index');
Route::post('/email-addresses/store', 'EmailAddressesController@store')->name('email-addresses.store');
Route::get('/email-addresses/add', 'EmailAddressesController@add')->name('email-addresses.add');
@ -64,7 +64,7 @@ Route::group(['middleware' => ['auth']], function () {
Route::post('/email-addresses/{id}/update', 'EmailAddressesController@update')->name('email-addresses.update');
Route::get('/email-addresses/{id}/delete', 'EmailAddressesController@delete')->name('email-addresses.delete');
Route::post('/email-addresses/{id}/force-delete', 'EmailAddressesController@forceDelete')->name('email-addresses.force-delete');
/* IP LDC NETWORK */
// IP LDC NETWORK
Route::get('/ldc-networks', 'LDCNetworkController@index')->name('ldc-networks.index');
Route::post('/ldc-networks/store', 'LDCNetworkController@store')->name('ldc-networks.store');
Route::get('/ldc-networks/add', 'LDCNetworkController@add')->name('ldc-networks.add');
@ -72,6 +72,6 @@ Route::group(['middleware' => ['auth']], function () {
Route::post('/ldc-networks/{id}/update', 'LDCNetworkController@update')->name('ldc-networks.update');
Route::get('/ldc-networks/{id}/delete', 'LDCNetworkController@delete')->name('ldc-networks.delete');
Route::post('/ldc-networks/{id}/force-delete', 'LDCNetworkController@forceDelete')->name('ldc-networks.force-delete');
/* GIT REPOS */
// GIT REPOS
Route::resource('git-repos', 'GitReposController');
});

View file

@ -13,7 +13,7 @@ trait CreatesApplication
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app = require __DIR__ . '/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();

View file

@ -2,7 +2,6 @@
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ExampleTest extends TestCase