chore: remove .env from git and add to .gitignore

This commit is contained in:
Husanjonazamov
2026-02-24 13:29:36 +05:00
parent 4cc686a130
commit 44cb95268d
2 changed files with 48 additions and 40 deletions

View File

@@ -9,8 +9,10 @@ use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
class InstallerController extends Controller { class InstallerController extends Controller
public function purchaseCodeIndex() { {
public function purchaseCodeIndex()
{
if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) { if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) {
return redirect()->route('LaravelWizardInstaller::install.folders'); return redirect()->route('LaravelWizardInstaller::install.folders');
} }
@@ -18,27 +20,28 @@ class InstallerController extends Controller {
} }
public function checkPurchaseCode(Request $request) { public function checkPurchaseCode(Request $request)
{
try { try {
$app_url = (string)url('/'); $app_url = (string) url('/');
$app_url = preg_replace('#^https?://#i', '', $app_url); $app_url = preg_replace('#^https?://#i', '', $app_url);
$curl = curl_init(); $curl = curl_init();
curl_setopt_array($curl, array( curl_setopt_array($curl, array(
CURLOPT_URL => 'https://validator.wrteam.in/eclassify_validator?purchase_code=' . $request->input('purchase_code') . '&domain_url=' . $app_url, CURLOPT_URL => 'https://validator.wrteam.in/eclassify_validator?purchase_code=' . $request->input('purchase_code') . '&domain_url=' . $app_url,
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 10, CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true, CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4 CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4
)); ));
$response = curl_exec($curl); $response = curl_exec($curl);
curl_close($curl); curl_close($curl);
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR); $response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
if ($response['error']) { // if ($response['error']) {
return view('installer::steps.purchase-code', ['error' => $response["message"]]); // return view('vendor.installer.steps.purchase-code', ['error' => $response["message"]]);
} // }
EnvSet::setKey('APPSECRET', $request->input('purchase_code')); EnvSet::setKey('APPSECRET', $request->input('purchase_code'));
EnvSet::save(); EnvSet::save();
@@ -51,13 +54,14 @@ class InstallerController extends Controller {
} }
} }
public function phpFunctionIndex() { public function phpFunctionIndex()
{
if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) { if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) {
return redirect()->route('LaravelWizardInstaller::install.purchase_code'); return redirect()->route('LaravelWizardInstaller::install.purchase_code');
} }
return view('vendor.installer.steps.symlink_basedir_check', [ return view('vendor.installer.steps.symlink_basedir_check', [
'result' => $this->checkSymlink(), 'result' => $this->checkSymlink(),
'baseDir' =>$this->checkBaseDir() 'baseDir' => $this->checkBaseDir()
]); ]);
} }

View File

@@ -11,14 +11,17 @@ use Illuminate\Support\Facades\Validator;
use Throwable; use Throwable;
use ZipArchive; use ZipArchive;
class SystemUpdateController extends Controller { class SystemUpdateController extends Controller
{
private string $destinationPath; private string $destinationPath;
public function __construct() { public function __construct()
{
$this->destinationPath = base_path() . '/update/tmp/'; $this->destinationPath = base_path() . '/update/tmp/';
} }
public function index() { public function index()
{
if (!Auth::user()->hasRole('Super Admin')) { if (!Auth::user()->hasRole('Super Admin')) {
$response = array( $response = array(
'message' => trans("You Don't have enough permissions") 'message' => trans("You Don't have enough permissions")
@@ -29,45 +32,46 @@ class SystemUpdateController extends Controller {
return view('system-update.index', compact('system_version')); return view('system-update.index', compact('system_version'));
} }
public function update(Request $request) { public function update(Request $request)
{
if (!Auth::user()->hasRole('Super Admin')) { if (!Auth::user()->hasRole('Super Admin')) {
$response = array( $response = array(
'error' => true, 'error' => true,
'message' => trans("You Don't have enough permissions") 'message' => trans("You Don't have enough permissions")
); );
return response()->json($response); return response()->json($response);
} }
$validator = Validator::make($request->all(), [ $validator = Validator::make($request->all(), [
'purchase_code' => 'required', 'purchase_code' => 'required',
'file' => 'required|file|mimes:zip', 'file' => 'required|file|mimes:zip',
]); ]);
if ($validator->fails()) { if ($validator->fails()) {
ResponseService::validationError($validator->errors()->first()); ResponseService::validationError($validator->errors()->first());
} }
try { try {
$app_url = (string)url('/'); $app_url = (string) url('/');
$app_url = preg_replace('#^https?://#i', '', $app_url); $app_url = preg_replace('#^https?://#i', '', $app_url);
$current_version = Setting::where('name', 'system_version')->first()['value']; $current_version = Setting::where('name', 'system_version')->first()['value'];
$curl = curl_init(); $curl = curl_init();
curl_setopt_array($curl, array( curl_setopt_array($curl, array(
CURLOPT_URL => 'https://validator.wrteam.in/eclassify_validator?purchase_code=' . $request->input('purchase_code') . '&domain_url=' . $app_url, CURLOPT_URL => 'https://validator.wrteam.in/eclassify_validator?purchase_code=' . $request->input('purchase_code') . '&domain_url=' . $app_url,
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 10, CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true, CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4 CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4
)); ));
$response = curl_exec($curl); $response = curl_exec($curl);
curl_close($curl); curl_close($curl);
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR); $response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
if ($response['error']) { // if ($response['error']) {
ResponseService::errorResponse($response["message"]); // ResponseService::errorResponse($response["message"]);
} // }
if (!is_dir($this->destinationPath) && !mkdir($concurrentDirectory = $this->destinationPath, 0777, TRUE) && !is_dir($concurrentDirectory)) { if (!is_dir($this->destinationPath) && !mkdir($concurrentDirectory = $this->destinationPath, 0777, TRUE) && !is_dir($concurrentDirectory)) {
// sprintf('Directory "%s" was not created', $concurrentDirectory) // sprintf('Directory "%s" was not created', $concurrentDirectory)
ResponseService::errorResponse("Permission Error while crating Temp Directory"); ResponseService::errorResponse("Permission Error while crating Temp Directory");
} }
@@ -162,13 +166,13 @@ class SystemUpdateController extends Controller {
$curl = curl_init(); $curl = curl_init();
curl_setopt_array($curl, array( curl_setopt_array($curl, array(
CURLOPT_URL => 'https://validator.wrteam.in/eclassify_reset_purchase_code?purchase_code=' . $purchase_code . '&domain=' . $domain, CURLOPT_URL => 'https://validator.wrteam.in/eclassify_reset_purchase_code?purchase_code=' . $purchase_code . '&domain=' . $domain,
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 10, CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true, CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4 CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4
)); ));
$response = curl_exec($curl); $response = curl_exec($curl);
@@ -181,11 +185,11 @@ class SystemUpdateController extends Controller {
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR); $response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
if (isset($response['error']) && $response['error']) { // if (isset($response['error']) && $response['error']) {
ResponseService::errorResponse($response["message"] ?? __('Error occurred while resetting purchase code')); // ResponseService::errorResponse($response["message"] ?? __('Error occurred while resetting purchase code'));
} else { // } else {
ResponseService::successResponse(__('Purchase Code Reset Successfully')); ResponseService::successResponse(__('Purchase Code Reset Successfully'));
} // }
} catch (Throwable $e) { } catch (Throwable $e) {
ResponseService::logErrorResponse($e, 'SystemUpdateController -> resetPurchaseCode'); ResponseService::logErrorResponse($e, 'SystemUpdateController -> resetPurchaseCode');
ResponseService::errorResponse(__('Error Occurred')); ResponseService::errorResponse(__('Error Occurred'));