Compare commits
25 commits
master
...
MiseAuProp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
441c43f3b0 | ||
|
|
27247cae04 | ||
|
|
55671653ea | ||
|
|
61377d9347 | ||
|
|
5bedc1aeb7 | ||
|
|
96683a0f5a | ||
|
|
746e502b49 | ||
|
|
b4797d92fc | ||
|
|
3d6b775d3d | ||
|
|
6992c5d6d0 | ||
|
|
9f786cbe17 | ||
|
|
dded73e14a | ||
|
|
b16b4a2107 | ||
|
|
1d983f3ff4 | ||
|
|
4419445105 | ||
|
|
71c09ba141 | ||
|
|
39676cf557 | ||
|
|
fe40e02f7c | ||
|
|
3e2ef50e6d | ||
|
|
4441f6d547 | ||
|
|
c6e15928f1 | ||
|
|
81c8cbde69 | ||
|
|
27c296aaff | ||
|
|
96729e4a53 | ||
|
|
2696e19b0e |
93 changed files with 1620 additions and 721 deletions
|
|
@ -1,54 +0,0 @@
|
|||
stages:
|
||||
- Security
|
||||
- CodingStandards
|
||||
|
||||
composer-security:
|
||||
stage: Security
|
||||
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
|
||||
script:
|
||||
- local-php-security-checker --format=json --path=./composer.lock > composer-security-checker-report.json
|
||||
artifacts:
|
||||
when: on_failure
|
||||
expose_as: 'composer-security-checker'
|
||||
paths:
|
||||
- composer-security-checker-report.json
|
||||
allow_failure: true
|
||||
needs: []
|
||||
|
||||
npm-security:
|
||||
stage: Security
|
||||
image: node:17.9.1
|
||||
before_script:
|
||||
- npm install --location=global audit-ci@^6
|
||||
script:
|
||||
- audit-ci -p npm -o json > npm-security-checker-report.json
|
||||
artifacts:
|
||||
when: on_failure
|
||||
expose_as: 'npm-security-checker'
|
||||
paths:
|
||||
- npm-security-checker-report.json
|
||||
allow_failure: true
|
||||
needs: []
|
||||
|
||||
phpcs:
|
||||
stage: CodingStandards
|
||||
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
|
||||
before_script:
|
||||
- composer config gitlab-token.gitlab.com $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
|
||||
- composer install
|
||||
cache:
|
||||
paths:
|
||||
- vendor/
|
||||
script:
|
||||
- vendor/bin/phpcs --report=junit --report-file=phpcs-report.xml
|
||||
artifacts:
|
||||
when: on_failure
|
||||
expose_as: 'phpcs'
|
||||
paths:
|
||||
- phpcs-report.xml
|
||||
reports:
|
||||
junit: phpcs-report.xml
|
||||
allow_failure: false
|
||||
needs:
|
||||
- composer-security
|
||||
- npm-security
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\DatastorePcc;
|
||||
use App\Models\DomainName;
|
||||
use App\Models\GitRepo;
|
||||
use App\Models\LDCNetwork;
|
||||
use App\Models\Project;
|
||||
use App\Models\Server;
|
||||
|
|
@ -35,10 +38,34 @@ class ExportDatas extends Command
|
|||
|
||||
$this->exportProjects("EDL_WEB.csv");
|
||||
$this->exportServers("EDL_Servers.csv");
|
||||
$this->exportDatastorePcc("EDL_Datastore_pcc.csv");
|
||||
$this->exportDomainNames("EDL_Domain_Names.csv");
|
||||
$this->exportLdcNetworks("EDL_LDC_Networks.csv");
|
||||
$this->exportGitRepos("EDL_GIT_Repos.csv");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export git repos as filename.csv
|
||||
*
|
||||
* @param string $filename
|
||||
* @return void
|
||||
*/
|
||||
private function exportGitRepos(string $filename)
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\GitRepo> */
|
||||
$repos = GitRepo::orderBy('name', 'ASC')->get();
|
||||
Storage::disk('export')->append($filename, "Nom");
|
||||
foreach ($repos as $repo) {
|
||||
$infos = [
|
||||
trim($repo->name),
|
||||
];
|
||||
|
||||
Storage::disk('export')->append($filename, implode(";", $infos));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export ldc networks as filename.csv
|
||||
*
|
||||
|
|
@ -61,6 +88,57 @@ class ExportDatas extends Command
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export domain names as filename.csv
|
||||
*
|
||||
* @param string $filename
|
||||
* @return void
|
||||
*/
|
||||
private function exportDomainNames(string $filename)
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\DomainName> */
|
||||
$domains = DomainName::all();
|
||||
Storage::disk('export')->append(
|
||||
$filename,
|
||||
"ASCII;UTF-8;DATE D'EXPIRATION;RENOUVELLEMENT;MARQUE REF.;DNS REDIRIGES;TYPE CERTIFICATS;COMMENTAIRE"
|
||||
);
|
||||
foreach ($domains as $domain) {
|
||||
$infos = [
|
||||
trim($domain->ascii_name),
|
||||
trim($domain->utf8_name),
|
||||
trim($domain->expiration_date),
|
||||
$domain->renew === 1 ? 'OUI' : 'NON',
|
||||
trim($domain->related_brand),
|
||||
trim($domain->redirect_dns),
|
||||
trim($domain->certificats),
|
||||
trim($domain->comment),
|
||||
];
|
||||
|
||||
Storage::disk('export')->append($filename, implode(";", $infos));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export data store pcc as filename.csv
|
||||
*
|
||||
* @param string $filename
|
||||
* @return void
|
||||
*/
|
||||
private function exportDatastorePcc(string $filename)
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\DatastorePcc> */
|
||||
$datastores = DatastorePcc::all();
|
||||
Storage::disk('export')->append($filename, "NOM;COMMENTAIRE");
|
||||
foreach ($datastores as $datastore) {
|
||||
$infos = [
|
||||
trim($datastore->title),
|
||||
trim($datastore->comment)
|
||||
];
|
||||
|
||||
Storage::disk('export')->append($filename, implode(";", $infos));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export servers as filename.csv
|
||||
*
|
||||
|
|
@ -73,7 +151,7 @@ class ExportDatas extends Command
|
|||
$servers = Server::orderBy('env', 'DESC')->get();
|
||||
Storage::disk('export')->append(
|
||||
$filename,
|
||||
"ENV;NOM;TITRE;FUNCTION;SSH;IP INFRAWEB;VIRTUAL IP;COMMENTAIRE"
|
||||
"ENV;NOM;TITRE;FUNCTION;SSH;IP INFRAWEB;VIRTUAL IP;DATASTORE PCC;COMMENTAIRE"
|
||||
);
|
||||
foreach ($servers as $server) {
|
||||
$infos = [
|
||||
|
|
@ -84,6 +162,7 @@ class ExportDatas extends Command
|
|||
trim($server->ssh),
|
||||
trim($server->infraweb_ip),
|
||||
trim($server->virtual_ip),
|
||||
!is_null($server->datastore_pcc_id) ? trim(DatastorePcc::find($server->datastore_pcc_id)->title) : '',
|
||||
trim($server->comment)
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Controllers\API;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\Api\LDCNetworkResource;
|
||||
use App\Models\LDCNetwork;
|
||||
|
||||
class LDCNetworksController extends Controller
|
||||
|
|
@ -14,17 +15,7 @@ class LDCNetworksController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
$ips = [];
|
||||
|
||||
$networks = LDCNetwork::all();
|
||||
foreach ($networks as $network) {
|
||||
$infos = explode('.', $network->first_ip);
|
||||
$min = $infos[3];
|
||||
$max = explode('.', $network->last_ip)[3];
|
||||
for ($i = $min; $i <= $max; $i++) {
|
||||
$ips[] = "$infos[0].$infos[1].$infos[2].$i";
|
||||
}
|
||||
}
|
||||
return response($ips);
|
||||
return \response()->json((new LDCNetworkResource($networks)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace App\Http\Controllers\API;
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Api\UpdateProjectStatusRequest;
|
||||
use App\Models\ProjectStatusChecker;
|
||||
use App\Models\ProjectsStatusChecker;
|
||||
|
||||
class StatusCheckerController extends Controller
|
||||
{
|
||||
|
|
@ -16,12 +16,11 @@ class StatusCheckerController extends Controller
|
|||
*/
|
||||
public function index(UpdateProjectStatusRequest $request)
|
||||
{
|
||||
/** @var \App\Models\ProjectStatusChecker */
|
||||
$project_sc = ProjectStatusChecker::where('project_uuid', '=', $request->project_uuid)
|
||||
/** @var \App\Models\ProjectsStatusChecker */
|
||||
$project_sc = ProjectsStatusChecker::where('project_uuid', '=', $request->uuid)
|
||||
->firstOrNew();
|
||||
|
||||
$project_sc->fill($request->validated());
|
||||
$project_sc->last_call = \now();
|
||||
return $project_sc->save() ? response('OK') : response('KO');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
114
app/Http/Controllers/DatastorePCCController.php
Normal file
114
app/Http/Controllers/DatastorePCCController.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\DatastorePccs\StoreDatastorePccRequest;
|
||||
use App\Http\Requests\DatastorePccs\UpdateDatastorePccRequest;
|
||||
use App\Http\Requests\ValidateOtpRequest;
|
||||
use App\Models\DatastorePcc;
|
||||
use App\Models\Server;
|
||||
|
||||
class DatastorePCCController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$datastore_pccs = DatastorePcc::all();
|
||||
return view('datastore_pccs.index', ['datastore_pccs' => $datastore_pccs]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('datastore_pccs.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\DatastorePccs\StoreDatastorePccRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreDatastorePccRequest $request)
|
||||
{
|
||||
$datastore_pcc = new DatastorePcc();
|
||||
$datastore_pcc->fill($request->validated());
|
||||
if ($datastore_pcc->saveOrFail()) {
|
||||
return redirect()->route('datastore_pccs.edit', compact('datastore_pcc'))
|
||||
->with('success', trans('Datastore Pcc créé créé.'));
|
||||
}
|
||||
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\DatastorePcc $datastore_pcc
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(DatastorePcc $datastore_pcc)
|
||||
{
|
||||
return view('datastore_pccs.edit', ['datastore_pcc' => $datastore_pcc]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\DatastorePccs\UpdateDatastorePccRequest $request
|
||||
* @param \App\Models\DatastorePcc $datastore_pcc
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateDatastorePccRequest $request, DatastorePcc $datastore_pcc)
|
||||
{
|
||||
$datastore_pcc->fill($request->validated());
|
||||
if ($datastore_pcc->saveOrFail()) {
|
||||
return redirect()->route('datastore_pccs.edit', compact('datastore_pcc'))
|
||||
->with('success', trans('Datastore Pcc mis à jour.'));
|
||||
}
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\DatastorePcc $datastore_pcc
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(DatastorePcc $datastore_pcc)
|
||||
{
|
||||
$isUsed = Server::where('datastore_pcc_id', '=', $datastore_pcc->id)->get();
|
||||
if ($isUsed->count() === 0) {
|
||||
$isUsed = false;
|
||||
}
|
||||
|
||||
return view('datastore_pccs.delete', compact('datastore_pcc', 'isUsed'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Http\Requests\ValidateOtpRequest $request
|
||||
* @param \App\Models\DatastorePcc $datastore_pcc
|
||||
* @return \Illuminate\Http\Response
|
||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
*/
|
||||
public function destroySubmit(ValidateOtpRequest $request, DatastorePcc $datastore_pcc)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($datastore_pcc->deleteOrFail()) {
|
||||
return redirect()->route('datastore_pccs.index')
|
||||
->with('warning', 'Datastore Pcc supprimée !');
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
115
app/Http/Controllers/DomainNameController.php
Normal file
115
app/Http/Controllers/DomainNameController.php
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\DomainNames\StoreDomainNameRequest;
|
||||
use App\Http\Requests\DomainNames\UpdateDomainNameRequest;
|
||||
use App\Http\Requests\ValidateOtpRequest;
|
||||
use App\Models\DomainName;
|
||||
use App\Models\EmailAddress;
|
||||
|
||||
class DomainNameController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$domain_names = DomainName::all();
|
||||
return view('domain-names.index', compact('domain_names'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('domain-names.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\DomainNames\StoreDomainNameRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreDomainNameRequest $request)
|
||||
{
|
||||
$domain_name = new DomainName();
|
||||
$domain_name->fill($request->validated());
|
||||
if ($domain_name->saveOrFail()) {
|
||||
return redirect()->route('domain-names.edit', compact('domain_name'))
|
||||
->with('success', trans('Nom de domaine créé créé.'));
|
||||
}
|
||||
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\DomainName $domain_name
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(DomainName $domain_name)
|
||||
{
|
||||
return view('domain-names.edit', ['domain_name' => $domain_name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\DomainNames\UpdateDomainNameRequest $request
|
||||
* @param \App\Models\DomainName $domain_name
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateDomainNameRequest $request, DomainName $domain_name)
|
||||
{
|
||||
$domain_name->fill($request->validated());
|
||||
if ($domain_name->saveOrFail()) {
|
||||
return redirect()->route('domain-names.edit', compact('domain_name'))
|
||||
->with('success', trans('Nom de domaine mis à jour.'));
|
||||
}
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\DomainName $domain_name
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(DomainName $domain_name)
|
||||
{
|
||||
$emails = EmailAddress::whereHas('domainName', function ($q) use ($domain_name) {
|
||||
$q->whereId($domain_name->id);
|
||||
})->get();
|
||||
return view('domain-names.delete', [
|
||||
'domain_name' => $domain_name,
|
||||
'isUsed' => $emails->count() ? $emails : false
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Http\Requests\ValidateOtpRequest $request
|
||||
* @param \App\Models\DomainName $domain_name
|
||||
* @return \Illuminate\Http\Response
|
||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
*/
|
||||
public function destroySubmit(ValidateOtpRequest $request, DomainName $domain_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($domain_name->deleteOrFail()) {
|
||||
return redirect()->route('domain-names.index')
|
||||
->with('warning', 'Nom de domaine supprimée !');
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
114
app/Http/Controllers/EmailAddressController.php
Normal file
114
app/Http/Controllers/EmailAddressController.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\EmailAddresses\StoreEmailAddressRequest;
|
||||
use App\Http\Requests\EmailAddresses\UpdateEmailAddressRequest;
|
||||
use App\Http\Requests\ValidateOtpRequest;
|
||||
use App\Models\DomainName;
|
||||
use App\Models\EmailAddress;
|
||||
|
||||
class EmailAddressController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$email_addresses = EmailAddress::all();
|
||||
return view('email-addresses.index', compact('email_addresses'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$domain_names = DomainName::orderBy('utf8_name')->get();
|
||||
return view('email-addresses.create', compact('domain_names'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\EmailAddresses\StoreEmailAddressRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreEmailAddressRequest $request)
|
||||
{
|
||||
$email_address = new EmailAddress();
|
||||
$email_address->fill($request->validated());
|
||||
if ($email_address->saveOrFail()) {
|
||||
return redirect()->route('email-addresses.edit', compact('email_address'))
|
||||
->with('success', trans('Adresse email créé créé.'));
|
||||
}
|
||||
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\EmailAddress $email_address
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(EmailAddress $email_address)
|
||||
{
|
||||
$domain_names = DomainName::orderBy('utf8_name')->get();
|
||||
return view('email-addresses.edit', [
|
||||
'email_address' => $email_address,
|
||||
'domain_names' => $domain_names
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\EmailAddresses\UpdateEmailAddressRequest $request
|
||||
* @param \App\Models\EmailAddress $email_address
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateEmailAddressRequest $request, EmailAddress $email_address)
|
||||
{
|
||||
$email_address->fill($request->validated());
|
||||
if ($email_address->saveOrFail()) {
|
||||
return redirect()->route('email-addresses.edit', compact('email_address'))
|
||||
->with('success', trans('Adresse email mis à jour.'));
|
||||
}
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\EmailAddress $email_address
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(EmailAddress $email_address)
|
||||
{
|
||||
return view('email-addresses.delete', ['email_address' => $email_address]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Http\Requests\ValidateOtpRequest $request
|
||||
* @param \App\Models\EmailAddress $email_address
|
||||
* @return \Illuminate\Http\Response
|
||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
*/
|
||||
public function destroySubmit(ValidateOtpRequest $request, EmailAddress $email_address)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($email_address->deleteOrFail()) {
|
||||
return redirect()->route('email-addresses.index')
|
||||
->with('warning', 'Adresse email supprimée !');
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
92
app/Http/Controllers/GitRepoController.php
Normal file
92
app/Http/Controllers/GitRepoController.php
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\GitRepos\StoreGitRepoRequest;
|
||||
use App\Http\Requests\GitRepos\UpdateGitRepoRequest;
|
||||
use App\Models\GitRepo;
|
||||
|
||||
class GitRepoController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$git_repos = GitRepo::all();
|
||||
return view('git-repos.index', compact('git_repos'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('git-repos.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\GitRepos\StoreGitRepoRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreGitRepoRequest $request)
|
||||
{
|
||||
$git_repo = new GitRepo();
|
||||
$git_repo->fill($request->validated());
|
||||
if ($git_repo->saveOrFail()) {
|
||||
return redirect()->route('git-repos.edit', compact('git_repo'))
|
||||
->with('success', trans('Dépôt Git créé.'));
|
||||
}
|
||||
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\GitRepo $git_repo
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(GitRepo $git_repo)
|
||||
{
|
||||
return view('git-repos.edit', ['git_repo' => $git_repo]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\GitRepos\UpdateGitRepoRequest $request
|
||||
* @param \App\Models\GitRepo $git_repo
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateGitRepoRequest $request, GitRepo $git_repo)
|
||||
{
|
||||
$git_repo->fill($request->validated());
|
||||
if ($git_repo->saveOrFail()) {
|
||||
return redirect()->route('git-repos.edit', compact('git_repo'))
|
||||
->with('success', trans('Dépôt Git mis à jour.'));
|
||||
}
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\GitRepo $git_repo
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(GitRepo $git_repo)
|
||||
{
|
||||
if ($git_repo->deleteOrFail()) {
|
||||
return redirect()->route('git-repos.index')
|
||||
->with('warning', trans('Dépôt Git supprimé.'));
|
||||
}
|
||||
return \back();
|
||||
}
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ class LDCNetworkController extends Controller
|
|||
// phpcs:enable
|
||||
if ($ldc_network->deleteOrFail()) {
|
||||
return redirect()->route('ldc-networks.index')
|
||||
->with('warning', 'LDC Network supprimé !');
|
||||
->with('warning', 'LDC Network supprimée !');
|
||||
}
|
||||
|
||||
return back();
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\Environment;
|
||||
use App\Enums\ServerType;
|
||||
use App\Http\Requests\Projects\StoreProjectRequest;
|
||||
use App\Http\Requests\Projects\UpdateProjectRequest;
|
||||
use App\Http\Requests\ValidateOtpRequest;
|
||||
|
|
@ -32,20 +30,20 @@ class ProjectController extends Controller
|
|||
public function create()
|
||||
{
|
||||
$dev_db_server = Server::where([
|
||||
['env', Environment::DEV()],
|
||||
['type', ServerType::DB()]
|
||||
['env', 'DEV'],
|
||||
['type', 'DB']
|
||||
])->get();
|
||||
$dev_web_server = Server::where([
|
||||
['env', Environment::DEV()],
|
||||
['type', ServerType::WEB()]
|
||||
['env', 'DEV'],
|
||||
['type', 'WEB']
|
||||
])->get();
|
||||
$prod_db_server = Server::where([
|
||||
['env', Environment::PROD()],
|
||||
['type', ServerType::DB()]
|
||||
['env', 'PROD'],
|
||||
['type', 'DB']
|
||||
])->get();
|
||||
$prod_web_server = Server::where([
|
||||
['env', Environment::PROD()],
|
||||
['type', ServerType::WEB()]
|
||||
['env', 'PROD'],
|
||||
['type', 'WEB']
|
||||
])->get();
|
||||
return view('projects.create', \compact(
|
||||
'dev_db_server',
|
||||
|
|
@ -65,14 +63,8 @@ class ProjectController extends Controller
|
|||
{
|
||||
$project = new Project();
|
||||
$project->uuid = Uuid::uuid4();
|
||||
$project->fill($request->validated());
|
||||
$project->dev_login = \json_decode($project->dev_login);
|
||||
$project->prod_login = \json_decode($project->prod_login);
|
||||
if ($project->saveOrFail()) {
|
||||
return redirect()->route('projects.edit', compact('project'))
|
||||
->with('success', trans('Projet ajouté.'));
|
||||
}
|
||||
return \back();
|
||||
$this->makeChanges($request, $project);
|
||||
return redirect()->route('projects.edit', ['uuid' => $project->uuid])->with('status', 'Sauvegardé !');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -86,20 +78,20 @@ class ProjectController extends Controller
|
|||
{
|
||||
// phpcs:enable
|
||||
$dev_db_server = Server::where([
|
||||
['env', Environment::DEV()],
|
||||
['type', ServerType::DB()]
|
||||
['env', 'DEV'],
|
||||
['type', 'DB']
|
||||
])->get();
|
||||
$dev_web_server = Server::where([
|
||||
['env', Environment::DEV()],
|
||||
['type', ServerType::WEB()]
|
||||
['env', 'DEV'],
|
||||
['type', 'WEB']
|
||||
])->get();
|
||||
$prod_db_server = Server::where([
|
||||
['env', Environment::PROD()],
|
||||
['type', ServerType::DB()]
|
||||
['env', 'PROD'],
|
||||
['type', 'DB']
|
||||
])->get();
|
||||
$prod_web_server = Server::where([
|
||||
['env', Environment::PROD()],
|
||||
['type', ServerType::WEB()]
|
||||
['env', 'PROD'],
|
||||
['type', 'WEB']
|
||||
])->get();
|
||||
return view('projects.edit', \compact(
|
||||
'project',
|
||||
|
|
@ -120,8 +112,6 @@ class ProjectController extends Controller
|
|||
public function update(UpdateProjectRequest $request, Project $project)
|
||||
{
|
||||
$project->fill($request->validated());
|
||||
$project->dev_login = \json_decode($project->dev_login);
|
||||
$project->prod_login = \json_decode($project->prod_login);
|
||||
if ($project->saveOrFail()) {
|
||||
return redirect()->route('projects.edit', compact('project'))
|
||||
->with('success', trans('Projet mis à jour.'));
|
||||
|
|
@ -152,8 +142,8 @@ class ProjectController extends Controller
|
|||
{
|
||||
// phpcs:enable
|
||||
if ($project->deleteOrFail()) {
|
||||
return redirect()->route('projects.index')
|
||||
->with('warning', 'Projet supprimé !');
|
||||
return redirect()->route('domain-names.index')
|
||||
->with('warning', 'Nom de domaine supprimée !');
|
||||
}
|
||||
|
||||
return back();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
|||
use App\Http\Requests\Servers\StoreServerRequest;
|
||||
use App\Http\Requests\Servers\UpdateServerRequest;
|
||||
use App\Http\Requests\ValidateOtpRequest;
|
||||
use App\Models\DatastorePcc;
|
||||
use App\Models\Project;
|
||||
use App\Models\Server;
|
||||
|
||||
|
|
@ -28,7 +29,8 @@ class ServerController extends Controller
|
|||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('servers.create');
|
||||
$datastores_pcc = DatastorePcc::orderBy('title')->get();
|
||||
return view('servers.create', ['datastores_pcc' => $datastores_pcc]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -41,8 +43,9 @@ class ServerController extends Controller
|
|||
{
|
||||
$server = new Server();
|
||||
$server->fill($request->validated());
|
||||
$this->makeChanges($request, $server);
|
||||
if ($server->saveOrFail()) {
|
||||
return redirect()->route('servers.edit', compact('server'))
|
||||
return redirect()->route('servers.edit', compact('servers'))
|
||||
->with('success', trans('Server créé.'));
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +61,8 @@ class ServerController extends Controller
|
|||
*/
|
||||
public function edit(Server $server)
|
||||
{
|
||||
return view('servers.edit', ['server' => $server]);
|
||||
$datastores_pcc = DatastorePcc::orderBy('title')->get();
|
||||
return view('servers.edit', ['server' => $server, 'datastores_pcc' => $datastores_pcc]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -112,7 +116,7 @@ class ServerController extends Controller
|
|||
// phpcs:enable
|
||||
if ($server->deleteOrFail()) {
|
||||
return redirect()->route('servers.index')
|
||||
->with('warning', 'Server supprimé !');
|
||||
->with('warning', 'Server supprimée !');
|
||||
}
|
||||
|
||||
return back();
|
||||
|
|
|
|||
|
|
@ -1,110 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\ServiceAccounts\StoreServiceAccountsRequest;
|
||||
use App\Http\Requests\ServiceAccounts\UpdateServiceAccountsRequest;
|
||||
use App\Http\Requests\ValidateOtpRequest;
|
||||
use App\Models\ServiceAccount;
|
||||
|
||||
class ServiceAccountsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$service_accounts = ServiceAccount::all()->sortBy('name');
|
||||
return view('service-accounts.index', compact('service_accounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('service-accounts.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\ServiceAccounts\StoreServiceAccountsRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreServiceAccountsRequest $request)
|
||||
{
|
||||
$service_account = new ServiceAccount();
|
||||
$service_account->fill($request->validated());
|
||||
if ($service_account->saveOrFail()) {
|
||||
return redirect()->route('service-accounts.edit', compact('service_account'))
|
||||
->with('success', trans('Compte de service créé.'));
|
||||
}
|
||||
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\ServiceAccount $service_account
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(ServiceAccount $service_account)
|
||||
{
|
||||
return view('service-accounts.edit', [
|
||||
'service_account' => $service_account
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\ServiceAccounts\UpdateServiceAccountsRequest $request
|
||||
* @param \App\Models\ServiceAccount $service_account
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateServiceAccountsRequest $request, ServiceAccount $service_account)
|
||||
{
|
||||
$service_account->fill($request->validated());
|
||||
if ($service_account->saveOrFail()) {
|
||||
return redirect()->route('service-accounts.edit', compact('service_account'))
|
||||
->with('success', trans('Compte de service mis à jour.'));
|
||||
}
|
||||
return \back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\ServiceAccount $service_account
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(ServiceAccount $service_account)
|
||||
{
|
||||
return view('service-accounts.delete', ['service_account' => $service_account]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Http\Requests\ValidateOtpRequest $request
|
||||
* @param \App\Models\ServiceAccount $service_account
|
||||
* @return \Illuminate\Http\Response
|
||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
*/
|
||||
public function destroySubmit(ValidateOtpRequest $request, ServiceAccount $service_account)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($service_account->deleteOrFail()) {
|
||||
return redirect()->route('service-accounts.index')
|
||||
->with('warning', 'Compte de service supprimé !');
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
|
|
@ -72,8 +72,7 @@ class Kernel extends HttpKernel
|
|||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'htmlsanitize' => \App\Http\Middleware\HtmlSanitizer::class,
|
||||
'apiCheck' => \App\Http\Middleware\ApiCheckCredentialMiddleware::class,
|
||||
'ldcnetwork' => \App\Http\Middleware\LDCNetwork::class
|
||||
'apiCheck' => \App\Http\Middleware\ApiCheckCredentialMiddleware::class
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\LDCNetwork as ModelsLDCNetwork;
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class LDCNetwork
|
||||
{
|
||||
|
|
@ -17,37 +15,13 @@ class LDCNetwork
|
|||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (\config('app.env') === 'local' || (\config('app.env') === 'production' && \config('app.debug') === true)) {
|
||||
return $next($request);
|
||||
}
|
||||
/**
|
||||
* IpUtils::checkIp();
|
||||
*/
|
||||
|
||||
/** HA PROXY HACK */
|
||||
$ip = request()->server('HTTP_X_FORWARDED_FOR') ?? request()->getClientIp();
|
||||
$restrictedIps = Cache::get('ldcweb_ip_ranges');
|
||||
// * https://github.com/symfony/http-foundation/blob/master/IpUtils.php#L36 .
|
||||
|
||||
if (\is_null($restrictedIps)) {
|
||||
$networks = ModelsLDCNetwork::all();
|
||||
$networks = $networks->map(function (ModelsLDCNetwork $network) {
|
||||
$infos = collect(explode('.', strval($network->first_ip)));
|
||||
$min = intval($infos->get(3));
|
||||
$max = collect(explode('.', strval($network->last_ip)))->get(3);
|
||||
for ($i = $min; $i <= $max; $i++) {
|
||||
$restrictedIps[] = $infos->get(0) . '.' .
|
||||
$infos->get(1) . '.' .
|
||||
$infos->get(2) . ".$i";
|
||||
}
|
||||
return $restrictedIps;
|
||||
});
|
||||
$restrictedIps = [];
|
||||
foreach ($networks->toArray() as $network) {
|
||||
$restrictedIps = array_merge($restrictedIps, $network);
|
||||
}
|
||||
Cache::put('ldcweb_ip_ranges', $restrictedIps, now()->addHours(4));
|
||||
}
|
||||
|
||||
if (!is_null($restrictedIps) && in_array($ip, $restrictedIps)) {
|
||||
return $next($request);
|
||||
}
|
||||
abort(403);
|
||||
/** @var \Illuminate\Http\Request $request */
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,5 +19,5 @@ class TrustProxies extends Middleware
|
|||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $headers = Request::HEADER_X_FORWARDED_FOR;
|
||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class UpdateProjectStatusRequest extends FormRequest
|
|||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return ($this->token === \config('api.key')) && !\is_null($this->datas);
|
||||
return $this->token === \config('api.key');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
32
app/Http/Requests/DatastorePccs/StoreDatastorePccRequest.php
Normal file
32
app/Http/Requests/DatastorePccs/StoreDatastorePccRequest.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\DatastorePccs;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class StoreDatastorePccRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Auth::check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'title' => 'required|min:2|max:50',
|
||||
'comment' => 'required|min:2|max:50'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\DatastorePccs;
|
||||
|
||||
class UpdateDatastorePccRequest extends StoreDatastorePccRequest
|
||||
{
|
||||
}
|
||||
50
app/Http/Requests/DomainNames/StoreDomainNameRequest.php
Normal file
50
app/Http/Requests/DomainNames/StoreDomainNameRequest.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\DomainNames;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class StoreDomainNameRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Auth::check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$this->merge([
|
||||
'renew' => $this->renew ? true : false
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'ascii_name' => 'required|min:2|max:255',
|
||||
'utf8_name' => 'required|min:2|max:255',
|
||||
'expiration_date' => 'required|date',
|
||||
'renew' => 'required|boolean',
|
||||
'related_brand' => 'nullable|min:2|max:255',
|
||||
'redirect_dns' => 'nullable|min:2|max:255',
|
||||
'certificats' => 'nullable|min:2|max:255',
|
||||
'comment' => 'nullable|min:2|max:255'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\DomainNames;
|
||||
|
||||
class UpdateDomainNameRequest extends StoreDomainNameRequest
|
||||
{
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\ServiceAccounts;
|
||||
namespace App\Http\Requests\EmailAddresses;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class StoreServiceAccountsRequest extends FormRequest
|
||||
class StoreEmailAddressRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
|
|
@ -25,10 +25,9 @@ class StoreServiceAccountsRequest extends FormRequest
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|min:2|max:255',
|
||||
'url' => 'required|min:2|max:255|url',
|
||||
'account' => 'required|min:2|max:255',
|
||||
'password' => 'required|max:255'
|
||||
'password' => 'required|max:255',
|
||||
'domain_name_id' => 'required|exists:domain_names,id'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\EmailAddresses;
|
||||
|
||||
class UpdateEmailAddressRequest extends StoreEmailAddressRequest
|
||||
{
|
||||
}
|
||||
46
app/Http/Requests/GitRepos/StoreGitRepoRequest.php
Normal file
46
app/Http/Requests/GitRepos/StoreGitRepoRequest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\GitRepos;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreGitRepoRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Auth::check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => [
|
||||
'string',
|
||||
'required',
|
||||
Rule::unique('git_repos', 'name'),
|
||||
],
|
||||
'login' => [
|
||||
Rule::requiredIf(function () {
|
||||
return !is_null($this->password);
|
||||
})
|
||||
],
|
||||
'password' => [
|
||||
Rule::requiredIf(function () {
|
||||
return !is_null($this->login);
|
||||
})
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
46
app/Http/Requests/GitRepos/UpdateGitRepoRequest.php
Normal file
46
app/Http/Requests/GitRepos/UpdateGitRepoRequest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\GitRepos;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateGitRepoRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Auth::check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => [
|
||||
'string',
|
||||
'required',
|
||||
Rule::unique('git_repos', 'name')->ignore($this->git_repo->id),
|
||||
],
|
||||
'login' => [
|
||||
Rule::requiredIf(function () {
|
||||
return !is_null($this->password);
|
||||
})
|
||||
],
|
||||
'password' => [
|
||||
Rule::requiredIf(function () {
|
||||
return !is_null($this->login);
|
||||
})
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -57,14 +57,14 @@ class StoreProjectRequest extends FormRequest
|
|||
|
||||
'https' => 'required|boolean',
|
||||
|
||||
'prod_haproxy_id' => 'nullable|regex:/^P?\d{3}$/',
|
||||
'dev_haproxy_id' => 'nullable|regex:/^P?\d{3}$/',
|
||||
'prod_haproxy_id' => 'nullable|regex:/^p?\d{3}$/',
|
||||
'dev_haproxy_id' => 'nullable|regex:/^p?\d{3}$/',
|
||||
|
||||
'prod_url' => 'nullable|url|max:255',
|
||||
'dev_url' => 'nullable|url|max:255',
|
||||
|
||||
'prod_document_root' => 'nullable|regex:/^(\/)?([^\/\0]+(\/)?)+$/|max:255',
|
||||
'dev_document_root' => 'nullable|regex:/^(\/)?([^\/\0]+(\/)?)+$/|max:255',
|
||||
'prod_document_root' => 'nullable|regex:/^(\w+/){1,2}\w+\.\w+$/|max:255',
|
||||
'dev_document_root' => 'nullable|regex:/^(\w+/){1,2}\w+\.\w+$/|max:255',
|
||||
|
||||
'prod_unix_user' => 'nullable|string|max:255',
|
||||
'prod_unix_pwd' => 'nullable|string|max:255',
|
||||
|
|
@ -87,8 +87,8 @@ class StoreProjectRequest extends FormRequest
|
|||
'prod_comment' => 'nullable|string|max:255',
|
||||
'dev_comment' => 'nullable|string|max:255',
|
||||
|
||||
'prod_eai' => 'nullable|string|max:255',
|
||||
'dev_eai' => 'nullable|string|max:255',
|
||||
'prod_eai' => 'nullable|stringmax:255',
|
||||
'dev_eai' => 'nullable|stringmax:255',
|
||||
|
||||
'prod_whitelist_fw' => 'nullable|string|max:255',
|
||||
'dev_whitelist_fw' => 'nullable|string|max:255',
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class StoreServerRequest extends FormRequest
|
|||
'title' => 'required|min:2|max:50',
|
||||
'name' => 'required|min:2|max:50',
|
||||
'function' => 'required|min:2|max:50',
|
||||
'datastore_pcc_id' => 'required|exists:datastore_pccs,id',
|
||||
'comment' => 'nullable|string',
|
||||
'type' => [
|
||||
'required', new EnumIsValidRule(ServerType::class)
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\ServiceAccounts;
|
||||
|
||||
class UpdateServiceAccountsRequest extends StoreServiceAccountsRequest
|
||||
{
|
||||
}
|
||||
31
app/Http/Resources/Api/LDCNetworkResource.php
Normal file
31
app/Http/Resources/Api/LDCNetworkResource.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Resources\Api;
|
||||
|
||||
use App\Models\LDCNetwork;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection as JsonResourceCollection;
|
||||
|
||||
class LDCNetworkResource extends JsonResourceCollection
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param mixed $request
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass, Squiz.Commenting.FunctionComment.Missing
|
||||
public function toArray($request)
|
||||
{
|
||||
return $this->collection->map(function (LDCNetwork $network) {
|
||||
$infos = collect(explode('.', strval($network->first_ip)));
|
||||
$min = intval($infos->get(3));
|
||||
$max = collect(explode('.', strval($network->last_ip)))->get(3);
|
||||
for ($i = $min; $i <= $max; $i++) {
|
||||
$ips[] = $infos->get(0) . '.' .
|
||||
$infos->get(1) . '.' .
|
||||
$infos->get(2) . ".$i";
|
||||
}
|
||||
return $ips;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ServiceAccount extends Model
|
||||
class DatastorePcc extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
@ -12,6 +12,6 @@ class ServiceAccount extends Model
|
|||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'account', 'password', 'url'
|
||||
'title', 'comment'
|
||||
];
|
||||
}
|
||||
19
app/Models/DomainName.php
Normal file
19
app/Models/DomainName.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DomainName extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'ascii_name', 'utf8_name', 'expiration_date',
|
||||
'renew', 'related_brand', 'redirect_dns',
|
||||
'certificats', 'comment'
|
||||
];
|
||||
}
|
||||
43
app/Models/EmailAddress.php
Normal file
43
app/Models/EmailAddress.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EmailAddress extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'account', 'password',
|
||||
'domain_name_id'
|
||||
];
|
||||
|
||||
// * METHODS
|
||||
|
||||
/**
|
||||
* domain_name getter
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDomainNameAttribute()
|
||||
{
|
||||
$dn = DomainName::findOrFail($this->domain_name_id);
|
||||
return $dn->utf8_name;
|
||||
}
|
||||
|
||||
// * RELATIONSHIPS
|
||||
|
||||
/**
|
||||
* BelongsTo domain name relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function domainName()
|
||||
{
|
||||
return $this->belongsTo(DomainName::class);
|
||||
}
|
||||
}
|
||||
18
app/Models/GitRepo.php
Normal file
18
app/Models/GitRepo.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GitRepo extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'login',
|
||||
'password'
|
||||
];
|
||||
}
|
||||
|
|
@ -41,8 +41,8 @@ class Project extends Model
|
|||
*/
|
||||
protected $fillable = [
|
||||
'name', 'display_name', 'php', 'type', 'https', 'prod_haproxy_id',
|
||||
'dev_haproxy_id', 'prod_url', 'dev_url', 'prod_bo_url', 'dev_bo_url', 'prod_login', 'dev_login',
|
||||
'prod_document_root', 'dev_document_root', 'prod_unix_user', 'dev_unix_user',
|
||||
'dev_haproxy_id', 'prod_url', 'dev_url', 'prod_document_root',
|
||||
'dev_document_root', 'prod_unix_user', 'dev_unix_user',
|
||||
'prod_unix_pwd', 'dev_unix_pwd', 'prod_db_user', 'dev_db_user',
|
||||
'prod_db_pwd', 'dev_db_pwd', 'prod_db_schema', 'dev_db_schema',
|
||||
'prod_db_server_id', 'dev_db_server_id', 'prod_web_server_id',
|
||||
|
|
@ -53,6 +53,7 @@ class Project extends Model
|
|||
'prod_smtp_config', 'prod_smtp_key',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Get the route key for the model.
|
||||
*
|
||||
|
|
@ -128,11 +129,11 @@ class Project extends Model
|
|||
*/
|
||||
public function getCheckedAttribute()
|
||||
{
|
||||
$value = ProjectStatusChecker::select('last_call')->where('project_uuid', '=', $this->uuid)->first();
|
||||
$value = ProjectsStatusChecker::select('updated_at')->where('project_uuid', '=', $this->uuid)->first();
|
||||
if (!$value) {
|
||||
$value = 'missing';
|
||||
} else {
|
||||
$value = $value->last_call;
|
||||
$value = $value->updated_at;
|
||||
$dt = Carbon::now();
|
||||
if ($dt->diffInMinutes($value) > 30) {
|
||||
$value = 'false';
|
||||
|
|
@ -150,7 +151,7 @@ class Project extends Model
|
|||
*/
|
||||
public function getSitemapCheckedAttribute()
|
||||
{
|
||||
$value = ProjectStatusChecker::select('sitemap')->where('project_uuid', '=', $this->uuid)->first();
|
||||
$value = ProjectsStatusChecker::select('sitemap')->where('project_uuid', '=', $this->uuid)->first();
|
||||
if (!$value) {
|
||||
$value = 'missing';
|
||||
} else {
|
||||
|
|
@ -166,7 +167,7 @@ class Project extends Model
|
|||
*/
|
||||
public function getRobotsCheckedAttribute()
|
||||
{
|
||||
$value = ProjectStatusChecker::select('robots')->where('project_uuid', '=', $this->uuid)->first();
|
||||
$value = ProjectsStatusChecker::select('robots')->where('project_uuid', '=', $this->uuid)->first();
|
||||
if (!$value) {
|
||||
$value = 'missing';
|
||||
} else {
|
||||
|
|
@ -182,7 +183,7 @@ class Project extends Model
|
|||
*/
|
||||
public function getLogsCheckedAttribute()
|
||||
{
|
||||
$value = ProjectStatusChecker::select('logs')->where('project_uuid', '=', $this->uuid)->first();
|
||||
$value = ProjectsStatusChecker::select('logs')->where('project_uuid', '=', $this->uuid)->first();
|
||||
if (!$value) {
|
||||
$value = 'missing';
|
||||
} else {
|
||||
|
|
@ -198,7 +199,7 @@ class Project extends Model
|
|||
*/
|
||||
public function getCodeAttribute()
|
||||
{
|
||||
$value = ProjectStatusChecker::select('code')->where('project_uuid', '=', $this->uuid)->first();
|
||||
$value = ProjectsStatusChecker::select('code')->where('project_uuid', '=', $this->uuid)->first();
|
||||
if (!$value) {
|
||||
$value = 'missing';
|
||||
} else {
|
||||
|
|
@ -214,7 +215,7 @@ class Project extends Model
|
|||
*/
|
||||
public function getLogsHrAttribute(): string
|
||||
{
|
||||
$value = ProjectStatusChecker::select('logs')->where('project_uuid', '=', $this->uuid)->first();
|
||||
$value = ProjectsStatusChecker::select('logs')->where('project_uuid', '=', $this->uuid)->first();
|
||||
return $this->humanFilesize($value->logs);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjectStatusChecker extends Model
|
||||
class ProjectsStatusChecker extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
|
|
@ -23,6 +23,6 @@ class ProjectStatusChecker extends Model
|
|||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'project_uuid', 'code', 'sitemap', 'robots', 'logs', 'last_call'
|
||||
'project_uuid', 'code', 'sitemap', 'robots'
|
||||
];
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ class Server extends Model
|
|||
'env', 'virtual_ip',
|
||||
'ssh', 'infraweb_ip',
|
||||
'title', 'name', 'function',
|
||||
'comment',
|
||||
'datastore_pcc_id', 'comment',
|
||||
'type'
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,13 +45,7 @@ class EventServiceProvider extends ServiceProvider
|
|||
$fromCache = $cache->get(config('cache.prefix') . "_saml_message_id_" . $messageId);
|
||||
|
||||
if (!in_array($cache->getResultCode(), [\Memcached::RES_SUCCESS, \Memcached::RES_NOTFOUND])) {
|
||||
throw new \Exception(
|
||||
\sprintf(
|
||||
"SAML MESSAGE ID HANDLER - Memcached Error : %d - %s",
|
||||
$cache->getResultCode(),
|
||||
"https://www.php.net/manual/en/memcached.getresultcode.php"
|
||||
)
|
||||
);
|
||||
throw new \Exception('SAML MESSAGE ID HANDLER - Memcached Error : ' . $cache->getResultCode() . " - https://www.php.net/manual/en/memcached.getresultcode.php");
|
||||
}
|
||||
|
||||
if ($fromCache) {
|
||||
|
|
|
|||
|
|
@ -70,6 +70,11 @@ return [
|
|||
'driver' => 'eloquent',
|
||||
'model' => App\Models\User::class,
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -60,6 +60,15 @@ $settings = array(
|
|||
// SSL.
|
||||
// LDC WEB SET FALSE IF LOCAL.
|
||||
'proxyVars' => true,
|
||||
|
||||
/**
|
||||
* (Optional) Which class implements the route functions.
|
||||
* If commented out, defaults to this lib's controller (Aacotroneo\Saml2\Http\Controllers\Saml2Controller).
|
||||
* If you need to extend Saml2Controller (e.g. to override the `login()` function to pass
|
||||
* a `$returnTo` argument), this value allows you to pass your own controller, and have
|
||||
* it used in the routes definition.
|
||||
*/
|
||||
// 'saml2_controller' => '',
|
||||
);
|
||||
|
||||
return $settings;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateGitReposTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('git_repos', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name')->unique();
|
||||
$table->string('login')->nullable();
|
||||
$table->string('password')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('git_repos');
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ class ChangeServerEnToEnum extends Migration
|
|||
$table->timestamp('updated_at')->nullable()->default(null)->change();
|
||||
});
|
||||
$servers->map(function (Server $server) {
|
||||
$server->env = $server->getRawOriginal('env') === 'PROD' ? Environment::PROD() : Environment::DEV();
|
||||
$server->env = $server->env === 'PROD' ? Environment::PROD() : Environment::DEV();
|
||||
$server->saveOrFail();
|
||||
});
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ class ChangeServerEnToEnum extends Migration
|
|||
$table->string('env', 20)->change();
|
||||
});
|
||||
$servers->map(function (Server $server) {
|
||||
$server->env = $server->getRawOriginal('env') === Environment::PROD()->value ? 'PROD' : 'DEV';
|
||||
$server->env = $server->env === Environment::PROD()->value ? 'PROD' : 'DEV';
|
||||
$server->saveOrFail();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,12 @@ class AddMissingForeignKeys extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('email_addresses', function (Blueprint $table) {
|
||||
$table->foreign('domain_name_id')->references('id')
|
||||
->on('domain_names');
|
||||
});
|
||||
Schema::rename('projects_status_checker', 'project_status_checkers');
|
||||
Schema::rename('datastore_pcc', 'datastore_pccs');
|
||||
Schema::table('projects', function (Blueprint $table) {
|
||||
$table->foreign('prod_db_server_id')->references('id')
|
||||
->on('servers');
|
||||
|
|
@ -33,6 +38,9 @@ class AddMissingForeignKeys extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('email_addresses', function (Blueprint $table) {
|
||||
$table->dropForeign(['domain_name_id']);
|
||||
});
|
||||
Schema::table('projects', function (Blueprint $table) {
|
||||
$table->dropForeign(['prod_db_server_id']);
|
||||
$table->dropForeign(['dev_db_server_id']);
|
||||
|
|
@ -40,5 +48,6 @@ class AddMissingForeignKeys extends Migration
|
|||
$table->dropForeign(['dev_web_server_id']);
|
||||
});
|
||||
Schema::rename('project_status_checkers', 'projects_status_checker');
|
||||
Schema::rename('datastore_pccs', 'datastore_pcc');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameEmailaddressesToServiceaccount extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('email_addresses', 'service_accounts');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::rename('service_accounts', 'email_addresses');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterServiceAccountTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('service_accounts', function (Blueprint $table) {
|
||||
$table->string('name')->after('id');
|
||||
$table->string('url')->after('password');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('service_accounts', function (Blueprint $table) {
|
||||
$table->dropColumn('name');
|
||||
$table->dropColumn('url');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
use App\Models\ProjectStatusChecker;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class ChangeStatusCheckerBooleanTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$status = ProjectStatusChecker::all();
|
||||
$status->map(function (ProjectStatusChecker $status_data) {
|
||||
$status_data->sitemap = $status_data->getRawOriginal('sitemap') === "true" ? 1 : 0;
|
||||
$status_data->robots = $status_data->getRawOriginal('robots') === "true" ? 1 : 0;
|
||||
$status_data->saveOrFail();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$status = ProjectStatusChecker::all();
|
||||
$status->map(function (ProjectStatusChecker $status_data) {
|
||||
$status_data->sitemap = $status_data->sitemap === 1 ? "true" : 'false';
|
||||
$status_data->robots = $status_data->robots === 1 ? "true" : 'false';
|
||||
$status_data->saveOrFail();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DeleteOldTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('servers', function (Blueprint $table) {
|
||||
$table->dropForeign('FK_servers_datastore_pcc');
|
||||
$table->dropColumn('datastore_pcc_id');
|
||||
});
|
||||
|
||||
Schema::table('service_accounts', function (Blueprint $table) {
|
||||
$table->dropColumn('domain_name_id');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('git_repos');
|
||||
Schema::dropIfExists('domain_names');
|
||||
Schema::dropIfExists('datastore_pcc');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterStatuscheckerTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('project_status_checkers', function (Blueprint $table) {
|
||||
$table->unsignedSmallInteger('sitemap')->comment('Has sitemap ?')->change();
|
||||
$table->unsignedSmallInteger('robots')->comment('Has robots.txt ?')->change();
|
||||
$table->dateTime('last_call')->default('1970-01-01')->comment('Last API call date')->after('logs');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('project_status_checkers', function (Blueprint $table) {
|
||||
$table->string('sitemap', 20)->change();
|
||||
$table->string('robots', 20)->change();
|
||||
$table->dropColumn('last_call');
|
||||
});
|
||||
}
|
||||
}
|
||||
4
resources/scss/back.scss
vendored
4
resources/scss/back.scss
vendored
|
|
@ -53,7 +53,3 @@ input[type=number] {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-primary, .btn-danger {
|
||||
color: white;
|
||||
}
|
||||
|
|
|
|||
5
resources/scss/errors.scss
vendored
5
resources/scss/errors.scss
vendored
File diff suppressed because one or more lines are too long
|
|
@ -2,4 +2,3 @@
|
|||
import "./common";
|
||||
import "./vue";
|
||||
import "./confirm";
|
||||
import "./otpfields";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="row" style="margin: 10px">
|
||||
<div v-if="dataList.length > 0" class="col-md-12">
|
||||
<div class="container">
|
||||
<div class="row mt-2" v-for="(item, index) in dataList">
|
||||
<div class="row" v-for="(item, index) in dataList">
|
||||
<div :class="type === 2 ? 'col-md-4' : 'col-md-5'">
|
||||
<div class="form-group">
|
||||
<input
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<div class="col-md-12 text-center">
|
||||
<button @click="newItem" class="btn btn-primary" type="button">
|
||||
<i class="fa fa-user-plus"></i>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
window.addEventListener("DOMContentLoaded", () => {
|
||||
let elements = document.getElementsByClassName("otp-field");
|
||||
for (const element of elements) {
|
||||
element.addEventListener("input", checkFields);
|
||||
}
|
||||
});
|
||||
|
||||
function checkFields(e: Event) {
|
||||
const target = e.target as HTMLInputElement;
|
||||
if (target) {
|
||||
target.value = target.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
<form ref="otp_form" class="d-inline" method="POST" action="{{ route('auth.otpCheck') }}">
|
||||
@csrf
|
||||
{{ __('Code OTP') }} :
|
||||
<input type="text" name="otp" maxlength="6" class="otp-field" required>
|
||||
<input type="text" name="otp" maxlength="6" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');" required>
|
||||
<button class="btn btn-primary">{{ __('Valider') }}</button>
|
||||
</form>
|
||||
<a href="/login/send-sms-otp" class="btn btn-link">{{ __('SMS') }}</a>
|
||||
|
|
@ -22,4 +22,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
|
|||
51
resources/views/datastore_pccs/create.blade.php
Normal file
51
resources/views/datastore_pccs/create.blade.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ __('Ajout d\'un datastore pcc') }}
|
||||
<a href="{{ route('datastore_pccs.index') }}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('datastore_pccs.store')}}" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Titre') }} :</b></label>
|
||||
<input type="text" class="form-control" name="title" placeholder="{{ __('Titre') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Commentaire') }} :</b></label>
|
||||
<input type="text" class="form-control" name="comment" placeholder="{{ __('Commentaire') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
32
resources/views/datastore_pccs/delete.blade.php
Normal file
32
resources/views/datastore_pccs/delete.blade.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
@if ($isUsed === false)
|
||||
<div class="card-header">{{ __('Confirmation de suppression du datastore pcc') }} <a href="{{route('datastore_pccs.edit', $datastore_pcc)}}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="d-flex d-flex-row justify-content-center">
|
||||
@include('otp-delete', ['route' => route('datastore_pccs.destroySubmit', $datastore_pcc)])
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="card-header">{{ __('Suppression du datastore pcc refusée') }} <a href="{{route('datastore_pccs.edit', $datastore_pcc)}}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>{{ __('Le datastore pcc est utilisé par le(s) serveur(s) suivant(s)') }} :</p>
|
||||
<ul>
|
||||
@foreach($isUsed as $datastore_pcc)
|
||||
<li>{{$datastore_pcc->title}} {{$datastore_pcc->name}}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
40
resources/views/datastore_pccs/edit.blade.php
Normal file
40
resources/views/datastore_pccs/edit.blade.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ __('Détails du datastore pcc') }}
|
||||
<a href="{{route('datastore_pccs.destroy', $datastore_pcc)}}" class="btn btn-sm btn-danger float-end">{{ __('Supprimer') }}</a>
|
||||
<a href="{{ route('datastore_pccs.index') }}" class="btn btn-sm btn-primary float-end me-2">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('datastore_pccs.update', $datastore_pcc)}}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('datastore_pccs.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
14
resources/views/datastore_pccs/form.blade.php
Normal file
14
resources/views/datastore_pccs/form.blade.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Titre') }} :</b></label>
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre" value="{{ optional($datastore_pcc ?? null)->title }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Commentaire') }} :</b></label>
|
||||
<input type="text" class="form-control" name="comment" placeholder="Commentaire" value="{{ optional($datastore_pcc ?? null)->comment }}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
39
resources/views/datastore_pccs/index.blade.php
Normal file
39
resources/views/datastore_pccs/index.blade.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Gestion des datastores PCC') }} <a href="{{ route('datastore_pccs.create') }}" class="btn btn-sm btn-primary float-end">{{__('Ajouter') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">{{ __('Titre') }}</th>
|
||||
<th scope="col">{{ __('Commentaire') }}</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($datastore_pccs as $datastore_pcc)
|
||||
<tr>
|
||||
<td>{{$datastore_pcc->title}}</td>
|
||||
<td>{{$datastore_pcc->comment}}</td>
|
||||
<td><a href="{{route('datastore_pccs.edit', $datastore_pcc)}}" class="btn btn-sm btn-primary">{{ __('Détails') }}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -6,14 +6,14 @@
|
|||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ __('Ajout d\'un compte de service') }}
|
||||
<a href="{{ route('service-accounts.index') }}" class="btn btn-sm btn-primary float-end me-2">{{ __('Retour') }}</a>
|
||||
{{ __('Ajout d\'un nom de domaine') }}
|
||||
<a href="{{ route('domain-names.index') }}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{route('service-accounts.store')}}" method="POST">
|
||||
<form action="{{ route('domain-names.store') }}" method="POST">
|
||||
@csrf
|
||||
@include('service-accounts.form')
|
||||
@include('domain-names.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
30
resources/views/domain-names/delete.blade.php
Normal file
30
resources/views/domain-names/delete.blade.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
@if ($isUsed === false)
|
||||
<div class="card-header">{{ __('Confirmation de suppression du nom de domaine') }} <a href="{{route('domain-names.edit', $domain_name)}}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a></div>
|
||||
<div class="d-flex d-flex-row justify-content-center">
|
||||
@include('otp-delete', ['route' => route('domain-names.destroySubmit', $domain_name)])
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="card-header">{{ __('Suppression du nom de domaine refusée') }} <a href="{{route('domain-names.edit', $domain_name)}}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>{{ __('Le nom de domaine est utilisé par le(s) email(s) suivant(s)') }} :</p>
|
||||
<ul>
|
||||
@foreach($isUsed as $email)
|
||||
<li>{{$email->account}} @ {{$domain_name->utf8_name}}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -6,15 +6,15 @@
|
|||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ __('Détails du compte de service') }}
|
||||
<a href="{{ route('service-accounts.destroy', $service_account) }}" class="btn btn-sm btn-danger float-end">{{ __('Supprimer') }}</a>
|
||||
<a href="{{ route('service-accounts.index') }}" class="btn btn-sm btn-primary float-end me-2">{{ __('Retour') }}</a>
|
||||
{{ __('Détails du nom de domaine') }}
|
||||
<a href="{{route('domain-names.destroy', $domain_name)}}" class="btn btn-sm btn-danger float-end">{{ __('Supprimer') }}</a>
|
||||
<a href="{{ route('domain-names.index') }}" class="btn btn-sm btn-primary float-end me-2">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('service-accounts.update', $service_account) }}" method="POST">
|
||||
<form action="{{route('domain-names.update', $domain_name)}}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('service-accounts.form')
|
||||
@include('domain-names.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
47
resources/views/domain-names/form.blade.php
Normal file
47
resources/views/domain-names/form.blade.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="col-form-label"><b>{{ __('Nom UTF-8') }} :</b></label>
|
||||
<input type="text" class="form-control" name="utf8_name" placeholder="Nom UTF-8" required value="{{ old('utf8_name', optional($domain_name ?? null)->utf8_name) }}">
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="col-form-label"><b>{{ __('Nom ASCII') }} :</b></label>
|
||||
<input type="text" class="form-control" name="ascii_name" placeholder="Nom ASCII" required value="{{ old('ascii_name', optional($domain_name ?? null)->ascii_name) }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="col-form-label"><b>{{ __('Date d\'expiration') }} :</b></label>
|
||||
<input type="date" class="form-control" name="expiration_date" required value="{{ old('expiration_date', optional($domain_name ?? null)->expiration_date) }}">
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<div class="form-check mt-4">
|
||||
<input name="renew" class="form-check-input" type="checkbox" id="dmRenew" value="1" @if(old('renew', $domain_name->renew ?? null))checked @endif>
|
||||
<label class="form-check-label" for="dmRenew"><b>{{ __('Renouvellement ?') }}</b></label><br>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => 'renew'
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<div class="form-group">
|
||||
<label class="col-form-label"><b>{{ __('Marque référente') }} :</b></label>
|
||||
<input type="text" class="form-control" name="related_brand" placeholder="Marque référente" value="{{ old('related_brand', optional($domain_name ?? null)->related_brand) }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="col-form-label"><b>{{ __('Commentaire') }} :</b></label>
|
||||
<input type="text" class="form-control" name="comment" placeholder="Commentaire" value="{{ old('comment', optional($domain_name ?? null)->comment) }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="col-form-label"><b>{{ __('DNS Redirigés') }} :</b></label>
|
||||
<textarea name="redirect_dns" cols="30" rows="5" class="form-control">{{ old('redirect_dns', optional($domain_name ?? null)->redirect_dns) }}</textarea>
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="col-form-label"><b>{{ __('Type Certificats') }} :</b></label>
|
||||
<input type="text" name="certificats" class="form-control" placeholder="Type Certificats" value="{{ old('certificats', optional($domain_name ?? null)->certificats) }}">
|
||||
</div>
|
||||
</div>
|
||||
41
resources/views/domain-names/index.blade.php
Normal file
41
resources/views/domain-names/index.blade.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Gestion des noms de domaine') }} <a href="{{route('domain-names.create')}}" class="btn btn-sm btn-primary float-end">{{__('Ajouter') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">{{ __('Nom UTF-8') }}</th>
|
||||
<th scope="col">{{ __('Expiration') }}</th>
|
||||
<th scope="col">{{ __('Renouvellement ?') }}</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($domain_names as $domain_name)
|
||||
<tr>
|
||||
<td>{{$domain_name->utf8_name}}</td>
|
||||
<td>{{date('d-m-Y', strtotime($domain_name->expiration_date))}}</td>
|
||||
<td>{{$domain_name->renew ? 'OUI' : 'NON'}}</td>
|
||||
<td><a href="{{route('domain-names.edit', $domain_name)}}" class="btn btn-sm btn-primary">{{ __('Détails') }}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
28
resources/views/email-addresses/create.blade.php
Normal file
28
resources/views/email-addresses/create.blade.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ __('Ajout d\'une adresse email') }}
|
||||
<a href="{{ route('email-addresses.index') }}" class="btn btn-sm btn-primary float-end me-2">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{route('email-addresses.store')}}" method="POST">
|
||||
@csrf
|
||||
@include('email-addresses.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -5,11 +5,11 @@
|
|||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Confirmation de suppression du compte de service') }} <a href="{{ route('service-accounts.edit', $service_account) }}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a></div>
|
||||
<div class="card-header">{{ __('Confirmation de suppression de l\'adresse email') }} <a href="{{ route('email-addresses.edit', $email_address) }}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="d-flex d-flex-row justify-content-center">
|
||||
@include('otp-delete', ['route' => route('service-accounts.destroySubmit', $service_account)])
|
||||
@include('otp-delete', ['route' => route('email-addresses.destroySubmit', $email_address)])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
29
resources/views/email-addresses/edit.blade.php
Normal file
29
resources/views/email-addresses/edit.blade.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ __('Détails de l\'adresse email') }}
|
||||
<a href="{{ route('email-addresses.destroy', $email_address) }}" class="btn btn-sm btn-danger float-end">{{ __('Supprimer') }}</a>
|
||||
<a href="{{ route('email-addresses.index') }}" class="btn btn-sm btn-primary float-end me-2">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('email-addresses.update', $email_address) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('email-addresses.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
24
resources/views/email-addresses/form.blade.php
Normal file
24
resources/views/email-addresses/form.blade.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Compte') }} :</b></label>
|
||||
<input type="text" class="form-control" name="account" placeholder="Compte" value="{{ optional($email_address ?? null)->account }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Mot de passe') }} :</b></label>
|
||||
<input type="text" class="form-control" name="password" placeholder="Mot de passe" value="{{ optional($email_address ?? null)->password }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Nom de domaine') }} :</b></label>
|
||||
<select name="domain_name_id" class="form-control" required>
|
||||
@foreach($domain_names as $domain_name)
|
||||
<option value="{{$domain_name->id}}" @if(optional($email_address ?? null)->domain_name_id === $domain_name->id) selected @endif>{{$domain_name->utf8_name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
34
resources/views/email-addresses/index.blade.php
Normal file
34
resources/views/email-addresses/index.blade.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Gestion des adresses email') }} <a href="{{ route('email-addresses.create') }}" class="btn btn-sm btn-primary float-end">{{__('Ajouter') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">{{ __('Compte') }}</th>
|
||||
<th scope="col">{{ __('Nom de domaine') }}</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($email_addresses as $email_address)
|
||||
<tr>
|
||||
<td>{{$email_address->account}}</td>
|
||||
<td>@ {{$email_address->domain_name}}</td>
|
||||
<td><a href="{{route('email-addresses.edit', $email_address)}}" class="btn btn-sm btn-primary">{{ __('Détails') }}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Unauthorized'))
|
||||
@section('code', '401')
|
||||
@section('message', __('Unauthorized'))
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Forbidden'))
|
||||
@section('code', '403')
|
||||
@section('message', __($exception->getMessage() ?: 'Forbidden'))
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Not Found'))
|
||||
@section('code', '404')
|
||||
@section('message', __('Not Found'))
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Page Expired'))
|
||||
@section('code', '419')
|
||||
@section('message', __('Page Expired'))
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Too Many Requests'))
|
||||
@section('code', '429')
|
||||
@section('message', __('Too Many Requests'))
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Server Error'))
|
||||
@section('code', '500')
|
||||
@section('message', __('Server Error'))
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Service Unavailable'))
|
||||
@section('code', '503')
|
||||
@section('message', __('Service Unavailable'))
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>@yield('title')</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ mix('css/errors.css') }}" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
|
||||
<body class="antialiased">
|
||||
<div class="relative flex items-top justify-center min-h-screen bg-gray-100 dark:bg-gray-900 sm:items-center sm:pt-0">
|
||||
<div class="max-w-xl mx-auto sm:px-6 lg:px-8">
|
||||
<div class="flex items-center pt-8 sm:justify-start sm:pt-0">
|
||||
<div class="px-4 text-lg text-gray-500 border-r border-gray-400 tracking-wider">
|
||||
@yield('code')
|
||||
</div>
|
||||
|
||||
<div class="ml-4 text-lg text-gray-500 uppercase tracking-wider">
|
||||
@yield('message')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
28
resources/views/git-repos/create.blade.php
Normal file
28
resources/views/git-repos/create.blade.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ __("Ajout d'un dépôt Git") }}
|
||||
<a href="{{ route('git-repos.index') }}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{route('git-repos.store')}}" method="POST">
|
||||
@csrf
|
||||
@include('git-repos.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
33
resources/views/git-repos/edit.blade.php
Normal file
33
resources/views/git-repos/edit.blade.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Détails du dépôt Git') }}
|
||||
<form action="{{route('git-repos.destroy', $git_repo)}}" method="POST" class="float-end confirmDeleteJS">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-sm btn-danger">{{ __('Supprimer') }}</button>
|
||||
</form>
|
||||
<a href="{{ route('git-repos.index') }}" class="btn btn-sm btn-primary float-end me-2">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{ route('git-repos.update', $git_repo) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('git-repos.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt-2">
|
||||
<input type="submit" value="{{ __('Enregistrer') }}" class="btn btn-primary">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
20
resources/views/git-repos/form.blade.php
Normal file
20
resources/views/git-repos/form.blade.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Nom') }} :</b></label>
|
||||
<input type="text" class="form-control" name="name" placeholder="{{ __('Nom') }}" value="{{ optional($git_repo ?? null)->name }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Identifiant') }} :</b></label>
|
||||
<input type="text" class="form-control" name="login" placeholder="{{ __('Identifiant') }}" value="{{ optional($git_repo ?? null)->login }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Mot de passe') }} :</b></label>
|
||||
<input type="text" class="form-control" name="password" placeholder="{{ __('Mot de passe') }}" value="{{ optional($git_repo ?? null)->password }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
37
resources/views/git-repos/index.blade.php
Normal file
37
resources/views/git-repos/index.blade.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Gestion des dépôts Git') }} <a href="{{route('git-repos.create')}}" class="btn btn-sm btn-primary float-end">{{ __('Ajouter') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">{{ __('Nom') }}</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($git_repos as $git_repo)
|
||||
<tr>
|
||||
<td>{{$git_repo->name}}</td>
|
||||
<td><a href="{{route('git-repos.edit', $git_repo)}}" class="btn btn-sm btn-primary">{{ __('Détails') }}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -9,18 +9,6 @@
|
|||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<a href="{{ route('status-checker') }}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-clipboard-check"></i><br>
|
||||
{{ __('Status Checker') }}
|
||||
</a>
|
||||
<a href="{{route('service-accounts.index')}}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-at"></i><br>
|
||||
{{ __('Comptes de service') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<a href="{{ route('projects.index') }}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-list-alt"></i><br>
|
||||
|
|
@ -30,10 +18,34 @@
|
|||
<i class="fa fa-server"></i><br>
|
||||
{{ __('Serveurs') }}
|
||||
</a>
|
||||
<a href="{{ route('datastore_pccs.index') }}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-database"></i><br>
|
||||
{{ __('Datastores PCC') }}
|
||||
</a>
|
||||
<a href="{{ route('status-checker') }}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-clipboard-check"></i><br>
|
||||
{{ __('Status Checker') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<a href="{{ route('domain-names.index') }}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-copyright"></i><br>
|
||||
{{ __('Noms de domaine') }}
|
||||
</a>
|
||||
<a href="{{route('email-addresses.index')}}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-at"></i><br>
|
||||
{{ __('Adresses email') }}
|
||||
</a>
|
||||
<a href="{{route('ldc-networks.index')}}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-network-wired"></i><br>
|
||||
{{ __('Réseau LDC') }}
|
||||
</a>
|
||||
<a href="{{route('git-repos.index')}}" class="btn btn-lg btn-primary">
|
||||
<i class="fa fa-code-branch"></i><br>
|
||||
{{ __('Dépôts Git') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -41,22 +41,24 @@
|
|||
<li class="nav-item">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/status-checker" class="nav-link">Status Checker</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{route('service-accounts.index')}}" class="nav-link">{{ __('Comptes de service') }}</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
Infra<span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="/projects" class="nav-link">EDL Web</a>
|
||||
<a class="dropdown-item" href="/servers" class="nav-link">Serveurs</a>
|
||||
<a class="dropdown-item" href="/datastore_pccs" class="nav-link">Datastores PCC</a>
|
||||
<a class="dropdown-item" href="/domain-names" class="nav-link">Noms de domaine</a>
|
||||
<a class="dropdown-item" href="{{route('email-addresses.index')}}" class="nav-link">Adresses email</a>
|
||||
<a class="dropdown-item" href="{{route('ldc-networks.index')}}" class="nav-link">Réseau LDC</a>
|
||||
<a class="dropdown-item" href="{{route('git-repos.index')}}" class="nav-link">Dépôts GIT</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/status-checker" class="nav-link">Status Checker</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
{{ Auth::user()->firstname }} {{ Auth::user()->lastname }}<span class="caret"></span>
|
||||
|
|
|
|||
|
|
@ -1,68 +1,68 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
||||
<symbol id="check-circle-fill" fill="currentColor" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
|
||||
</symbol>
|
||||
<symbol id="info-fill" fill="currentColor" viewBox="0 0 16 16">
|
||||
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
|
||||
</symbol>
|
||||
<symbol id="exclamation-triangle-fill" fill="currentColor" viewBox="0 0 16 16">
|
||||
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success d-flex align-items-center alert-dismissible fade show" role="alert">
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Success:">
|
||||
<use xlink:href="#check-circle-fill" />
|
||||
</svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Success:"><use xlink:href="#check-circle-fill"/></svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($message = Session::get('error'))
|
||||
<div class="alert alert-danger d-flex align-items-center alert-dismissible fade show" role="alert">
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Danger:">
|
||||
<use xlink:href="#exclamation-triangle-fill" />
|
||||
</svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Danger:"><use xlink:href="#exclamation-triangle-fill"/></svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($message = Session::get('warning'))
|
||||
<div class="alert alert-warning d-flex align-items-center alert-dismissible fade show" role="alert">
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Warning:">
|
||||
<use xlink:href="#exclamation-triangle-fill" />
|
||||
</svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Warning:"><use xlink:href="#exclamation-triangle-fill"/></svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($message = Session::get('info'))
|
||||
<div class="alert alert-info d-flex align-items-center alert-dismissible fade show" role="alert">
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Info:">
|
||||
<use xlink:href="#info-fill" />
|
||||
</svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Info:"><use xlink:href="#info-fill"/></svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($message = Session::get('message'))
|
||||
<div class="alert alert-info d-flex align-items-center alert-dismissible fade show" role="alert">
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Info:">
|
||||
<use xlink:href="#info-fill" />
|
||||
</svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Info:"><use xlink:href="#info-fill"/></svg>
|
||||
<strong>{!! nl2br(e($message)) !!}</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger d-flex align-items-center alert-dismissible fade show" role="alert">
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Danger:">
|
||||
<use xlink:href="#exclamation-triangle-fill" />
|
||||
</svg>
|
||||
@if ($errors->any())
|
||||
<ul class="list-unstyled">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Danger:"><use xlink:href="#exclamation-triangle-fill"/></svg>
|
||||
@if ($errors->any())
|
||||
<ul class="list-unstyled">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
|
@ -2,7 +2,7 @@
|
|||
@csrf
|
||||
@method('DELETE')
|
||||
{{ __('Code OTP') }} :
|
||||
<input type="text" name="otp" maxlength="6" class="otp-field" required>
|
||||
<input type="text" name="otp" maxlength="6" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');" required>
|
||||
<button class="btn btn-danger">{{ __('Supprimer') }}</button>
|
||||
</form>
|
||||
<a href="{{ route('auth.sms-otp') }}" class="btn btn-link">{{ __('SMS') }}</a>
|
||||
<a href="{{ route('auth.sms-otp') }}" class="btn btn-link">{{ __('SMS') }}</a>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<div class="card-header">{{ __('Confirmation de suppression du projet') }} {{ $project->display_name }} <a href="{{ route('projects.edit', $project) }}" class="btn btn-sm btn-primary float-end">{{ __('Retour') }}</a></div>
|
||||
<div class="card-body">
|
||||
<div class="d-flex d-flex-row justify-content-center">
|
||||
@include('otp-delete', ['route' => route('projects.destroySubmit', $project)])
|
||||
@include('otp-delete', ['route' => route('projects.destroySubmit', $ldc_network)])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
<div class="card">
|
||||
<div class="card-header">
|
||||
OTP QRCode
|
||||
<a href="https://support.google.com/accounts/answer/1066447?hl=FR" target="_blank" class="btn btn-sm btn-primary float-end">Google Authenticator</a>
|
||||
<a href="https://support.google.com/accounts/answer/1066447?hl=FR" target="_blank" class="btn btn-sm btn-primary" style="float: right;">Google Authenticator</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body d-flex justify-content-center">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
{{ $qrcode }}
|
||||
</div>
|
||||
|
|
@ -22,4 +22,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -62,4 +62,14 @@
|
|||
</select>
|
||||
@include('modules.input-error', ['inputName' => 'type'])
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="col-form-label"><b>{{ __('Datastore PCC') }} :</b></label>
|
||||
<select name="datastore_pcc_id" class="form-control">
|
||||
<option value="" @if(is_null(old('datastore_pcc_id', $server->datastore_pcc_id ?? null))) selected @endif disabled>{{ __('Séléctionnez un data store') }}</option>
|
||||
@foreach($datastores_pcc as $datastore_pcc)
|
||||
<option value="{{$datastore_pcc->id}}" @if(old('datastore_pcc_id', optional($server ?? null)->datastore_pcc_id === $datastore_pcc->id)) selected @endif>{{ $datastore_pcc->title }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@include('modules.input-error', ['inputName' => 'env'])
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<tbody>
|
||||
@foreach($servers as $server)
|
||||
<tr>
|
||||
<td>{{$server->env->label}}</td>
|
||||
<td>{{$server->env}}</td>
|
||||
<td>{{$server->name}}</td>
|
||||
<td>{{$server->title}}</td>
|
||||
<td>{{$server->function}}</td>
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Nom') }} :</b></label>
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom" value="{{ optional($service_account ?? null)->name }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('URL') }} :</b></label>
|
||||
<input type="text" class="form-control" name="url" placeholder="URL" value="{{ optional($service_account ?? null)->url }}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Identifiant') }} :</b></label>
|
||||
<input type="text" class="form-control" name="account" placeholder="Identifiant" value="{{ optional($service_account ?? null)->account }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label><b>{{ __('Mot de passe') }} :</b></label>
|
||||
<input type="text" class="form-control" name="password" placeholder="Mot de passe" value="{{ optional($service_account ?? null)->password }}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Gestion des comptes de service') }} <a href="{{ route('service-accounts.create') }}" class="btn btn-sm btn-primary float-end">{{__('Ajouter') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">{{ __('Nom') }}</th>
|
||||
<th scope="col">{{ __('Identifiant') }}</th>
|
||||
<th scope="col">{{ __('Mot de passe') }}</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($service_accounts as $service_account)
|
||||
<tr>
|
||||
<td><b>{{$service_account->name}}</b></td>
|
||||
<td>{{$service_account->account}}</td>
|
||||
<td>{{$service_account->password}}</td>
|
||||
<td>
|
||||
<a href="{{$service_account->url}}" class="btn btn-sm btn-primary" target="_blank"><i class="fa-solid fa-arrow-up-right-from-square"></i></a>
|
||||
</td>
|
||||
<td><a href="{{route('service-accounts.edit', $service_account)}}" class="btn btn-sm btn-primary">{{ __('Éditer') }}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<td>
|
||||
@if ($project->sitemap_checked === 'missing')
|
||||
<i class="fa fa-ghost"></i>
|
||||
@elseif($project->sitemap_checked === true)
|
||||
@elseif($project->sitemap_checked === 'true')
|
||||
<i class="fa fa-check-circle green"></i>
|
||||
@else
|
||||
<i class="fa fa-times-circle red"></i>
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
<td>
|
||||
@if ($project->robots_checked === 'missing')
|
||||
<i class="fa fa-ghost"></i>
|
||||
@elseif($project->robots_checked === true)
|
||||
@elseif($project->robots_checked === 'true')
|
||||
<i class="fa fa-check-circle green"></i>
|
||||
@else
|
||||
<i class="fa fa-times-circle red"></i>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\ServiceAccountsController;
|
||||
use App\Http\Controllers\DatastorePCCController;
|
||||
use App\Http\Controllers\DomainNameController;
|
||||
use App\Http\Controllers\EmailAddressController;
|
||||
use App\Http\Controllers\GitRepoController;
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Http\Controllers\LDCNetworkController;
|
||||
use App\Http\Controllers\ProjectController;
|
||||
|
|
@ -8,20 +11,13 @@ use App\Http\Controllers\ServerController;
|
|||
use App\Http\Controllers\StatusCheckerController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['middleware' => ['ldcnetwork', 'auth']], function () {
|
||||
Route::group(['middleware' => ['auth']], function () {
|
||||
Route::get('/', [HomeController::class, 'index'])->name('home');
|
||||
Route::get('/otp-qr-code', [HomeController::class, 'qr'])->name('otp-qr-code');
|
||||
|
||||
// * STATUS CHECKER
|
||||
Route::get('/status-checker', [StatusCheckerController::class, 'index'])->name('status-checker');
|
||||
|
||||
// * SERVICE ACCOUNTS
|
||||
Route::resource('service-accounts', ServiceAccountsController::class)->except(['show', 'destroy']);
|
||||
Route::get('/service-accounts/{service_account}/destroy', [ServiceAccountsController::class, 'destroy'])
|
||||
->name('service-accounts.destroy');
|
||||
Route::delete('/service-accounts/{service_account}/destroy', [ServiceAccountsController::class, 'destroySubmit'])
|
||||
->name('service-accounts.destroySubmit');
|
||||
|
||||
// * EDL WEB
|
||||
Route::resource('projects', ProjectController::class)->except(['show', 'destroy']);
|
||||
Route::get('/projects/{project}/destroy', [ProjectController::class, 'destroy'])
|
||||
|
|
@ -36,10 +32,34 @@ Route::group(['middleware' => ['ldcnetwork', 'auth']], function () {
|
|||
Route::delete('/servers/{server}/destroy', [ServerController::class, 'destroySubmit'])
|
||||
->name('servers.destroySubmit');
|
||||
|
||||
// * DATASTORE PCC
|
||||
Route::resource('datastore_pccs', DatastorePCCController::class)->except(['show', 'destroy']);
|
||||
Route::get('/datastore_pccs/{datastore_pcc}/destroy', [DatastorePCCController::class, 'destroy'])
|
||||
->name('datastore_pccs.destroy');
|
||||
Route::delete('/datastore_pccs/{datastore_pcc}/destroy', [DatastorePCCController::class, 'destroySubmit'])
|
||||
->name('datastore_pccs.destroySubmit');
|
||||
|
||||
// * DOMAIN NAMES
|
||||
Route::resource('domain-names', DomainNameController::class)->except(['show', 'destroy']);
|
||||
Route::get('/domain-names/{domain_name}/destroy', [DomainNameController::class, 'destroy'])
|
||||
->name('domain-names.destroy');
|
||||
Route::delete('/domain-names/{domain_name}/destroy', [DomainNameController::class, 'destroySubmit'])
|
||||
->name('domain-names.destroySubmit');
|
||||
|
||||
// * EMAIL ADDRESSES
|
||||
Route::resource('email-addresses', EmailAddressController::class)->except(['show', 'destroy']);
|
||||
Route::get('/email-addresses/{email_address}/destroy', [EmailAddressController::class, 'destroy'])
|
||||
->name('email-addresses.destroy');
|
||||
Route::delete('/email-addresses/{email_address}/destroy', [EmailAddressController::class, 'destroySubmit'])
|
||||
->name('email-addresses.destroySubmit');
|
||||
|
||||
// * IP LDC NETWORK
|
||||
Route::resource('ldc-networks', LDCNetworkController::class)->except(['show', 'destroy']);
|
||||
Route::get('/ldc-networks/{ldc_network}/destroy', [LDCNetworkController::class, 'destroy'])
|
||||
->name('ldc-networks.destroy');
|
||||
Route::delete('/ldc-networks/{ldc_network}/destroy', [LDCNetworkController::class, 'destroySubmit'])
|
||||
->name('ldc-networks.destroySubmit');
|
||||
|
||||
// * GIT REPOS
|
||||
Route::resource('git-repos', GitRepoController::class)->except('show');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ use Illuminate\Support\Facades\Route;
|
|||
|
||||
Route::post('/webhooks/gitlab', [GitlabController::class, 'handle']);
|
||||
|
||||
Route::group(['middleware' => ['ldcnetwork']], function () {
|
||||
Route::view('/login/unauthorized', 'auth.unauthorized')->name('unauthorized');
|
||||
Route::get('/login/verify', [OTPController::class, 'verify'])->name('auth.verify');
|
||||
Route::get('/login/send-sms-otp', [OTPController::class, 'sendOtpBySms'])->name('auth.sms-otp');
|
||||
Route::post('/login/checkOTP', [OTPController::class, 'check'])->name('auth.otpCheck');
|
||||
});
|
||||
Route::view('/login/unauthorized', 'auth.unauthorized')->name('unauthorized');
|
||||
|
||||
Route::get('/login/verify', [OTPController::class, 'verify'])->name('auth.verify');
|
||||
Route::get('/login/send-sms-otp', [OTPController::class, 'sendOtpBySms'])->name('auth.sms-otp');
|
||||
Route::post('/login/checkOTP', [OTPController::class, 'check'])->name('auth.otpCheck');
|
||||
|
|
|
|||
11
webpack.mix.js
vendored
11
webpack.mix.js
vendored
|
|
@ -70,19 +70,14 @@ mix.clean({
|
|||
})
|
||||
|
||||
// * BO
|
||||
mix.ts("resources/ts/back.ts", "public/js/back.js", { transpileOnly: true })
|
||||
mix.ts('resources/ts/back.ts', 'public/js/back.js', { transpileOnly: true })
|
||||
.vue({
|
||||
runtimeOnly: true,
|
||||
extractStyles: true,
|
||||
globalStyles: false,
|
||||
globalStyles: false
|
||||
})
|
||||
.sass("resources/scss/back.scss", "public/css/back.css")
|
||||
.sass('resources/scss/back.scss', 'public/css/back.css')
|
||||
.polyfill(polyfill)
|
||||
.version();
|
||||
|
||||
// * Errors
|
||||
mix.sass("resources/scss/errors.scss", "public/css/errors.css")
|
||||
.version();
|
||||
|
||||
// * Copy Blade Images Assets
|
||||
mix.copyDirectory('resources/assets', 'public/assets')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue