diff --git a/app/Http/Middleware/CipiAuth.php b/app/Http/Middleware/CipiAuth.php index f6c5473d..58221712 100644 --- a/app/Http/Middleware/CipiAuth.php +++ b/app/Http/Middleware/CipiAuth.php @@ -21,6 +21,10 @@ class CipiAuth */ public function handle(Request $request, Closure $next) { + if($request->path() == 'api/login') { + return $next($request); + } + $auth = $request->header('Authorization'); $token = null; $apikey = null; diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 2032faf5..0c13b854 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware * @var array */ protected $except = [ - 'app/login', + // ]; } diff --git a/go.sh b/go.sh index e5c27b38..46e5bf03 100644 --- a/go.sh +++ b/go.sh @@ -5,7 +5,6 @@ BUILD=202112101 PASS=$(openssl rand -base64 32|sha256sum|base64|head -c 32| tr '[:upper:]' '[:lower:]') DBPASS=$(openssl rand -base64 24|sha256sum|base64|head -c 32| tr '[:upper:]' '[:lower:]') SERVERID=$(openssl rand -base64 12|sha256sum|base64|head -c 32| tr '[:upper:]' '[:lower:]') -IP=$(curl -s https://checkip.amazonaws.com) REPO=andreapollastri/cipi if [ -z "$1" ]; BRANCH=latest @@ -119,6 +118,16 @@ sudo apt-get update sudo apt-get -y install software-properties-common curl wget nano vim rpl sed zip unzip openssl expect dirmngr apt-transport-https lsb-release ca-certificates dnsutils dos2unix zsh htop ffmpeg +# GET IP +clear +clear +echo "${bggreen}${black}${bold}" +echo "Getting IP..." +echo "${reset}" +sleep 1s + +IP=$(curl -s https://checkip.amazonaws.com) + # MOTD WELCOME MESSAGE clear diff --git a/routes/api.php b/routes/api.php index fe689be5..882f9195 100644 --- a/routes/api.php +++ b/routes/api.php @@ -44,3 +44,6 @@ Route::get('/sites/{site_id}/aliases', [SiteController::class, 'aliases']); Route::post('/sites/{site_id}/aliases', [SiteController::class, 'createalias']); Route::delete('/sites/{site_id}/aliases/{alias_id}', [SiteController::class, 'destroyalias']); + +// Get API Key From API login +Route::post('/login',[AuthController::class, 'appLogin'])->middleware('throttle:10,3'); diff --git a/routes/web.php b/routes/web.php index 94cc36e0..40994791 100644 --- a/routes/web.php +++ b/routes/web.php @@ -26,9 +26,6 @@ return view('login'); }); -// Login via Mobile App -Route::post('/app/login', [AuthController::class, 'appLogin']); - Route::get('/dashboard', function () { return view('dashboard'); });