Skip to content

Commit

Permalink
Merge pull request #331 from andreapollastri/3.x
Browse files Browse the repository at this point in the history
3.x to master
  • Loading branch information
andreapollastri authored Dec 16, 2021
2 parents 3f3d881 + eebc3b6 commit def9324
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/Http/Middleware/CipiAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware
* @var array
*/
protected $except = [
'app/login',
//
];
}
11 changes: 10 additions & 1 deletion go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
3 changes: 0 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down

0 comments on commit def9324

Please sign in to comment.