Compare commits
No commits in common. "4368aec1b1a98a6f4f6d2a55859a8071cafb5313" and "3f21276ec5b455d75ef11599de86be47fac288c0" have entirely different histories.
4368aec1b1
...
3f21276ec5
77
.env.example
77
.env.example
@ -1,9 +1,68 @@
|
|||||||
DOCKER_NGINX_PORT=8080
|
APP_NAME=Laravel
|
||||||
DOCKER_WEBSOCKET_PORT=8081
|
APP_ENV=local
|
||||||
DOCKER_DB_PORT=3306
|
APP_KEY=
|
||||||
MYSQL_ROOT_PASSWORD=root_pass
|
APP_DEBUG=true
|
||||||
DB_DATABASE=captcha
|
APP_URL=http://localhost
|
||||||
DB_USERNAME=captcha
|
|
||||||
DB_PASSWORD=captcha_pass
|
APP_FORCE_HTTPS=false
|
||||||
UID=1000
|
|
||||||
GID=1000
|
APP_DEMO_MODE=false
|
||||||
|
APP_DEMO_EMAIL=
|
||||||
|
APP_DEMO_PASSWORD=
|
||||||
|
|
||||||
|
APP_DEFAULT_USER_TIMEZONE=UTC
|
||||||
|
# Valid languages: ru | en
|
||||||
|
APP_DEFAULT_LOCALE=ru
|
||||||
|
|
||||||
|
LOG_CHANNEL=daily
|
||||||
|
LOG_DEPRECATIONS_CHANNEL=deprecations
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
|
||||||
|
DB_CONNECTION=mysql
|
||||||
|
DB_HOST=127.0.0.1
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=laravel
|
||||||
|
DB_USERNAME=root
|
||||||
|
DB_PASSWORD=
|
||||||
|
|
||||||
|
BROADCAST_DRIVER=log
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
FILESYSTEM_DISK=local
|
||||||
|
QUEUE_CONNECTION=sync
|
||||||
|
SESSION_DRIVER=file
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
|
MEMCACHED_HOST=127.0.0.1
|
||||||
|
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=smtp
|
||||||
|
MAIL_HOST=mailpit
|
||||||
|
MAIL_PORT=1025
|
||||||
|
MAIL_USERNAME=null
|
||||||
|
MAIL_PASSWORD=null
|
||||||
|
MAIL_ENCRYPTION=null
|
||||||
|
MAIL_FROM_ADDRESS="hello@example.com"
|
||||||
|
MAIL_FROM_NAME="${APP_NAME}"
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID=
|
||||||
|
AWS_SECRET_ACCESS_KEY=
|
||||||
|
AWS_DEFAULT_REGION=us-east-1
|
||||||
|
AWS_BUCKET=
|
||||||
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||||
|
|
||||||
|
PUSHER_APP_ID=
|
||||||
|
PUSHER_APP_KEY=
|
||||||
|
PUSHER_APP_SECRET=
|
||||||
|
PUSHER_HOST=
|
||||||
|
PUSHER_PORT=443
|
||||||
|
PUSHER_SCHEME=https
|
||||||
|
PUSHER_APP_CLUSTER=mt1
|
||||||
|
|
||||||
|
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
|
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||||
|
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||||
|
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||||
|
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
|
21
.gitignore
vendored
21
.gitignore
vendored
@ -1,6 +1,19 @@
|
|||||||
|
/.phpunit.cache
|
||||||
|
/node_modules
|
||||||
|
/public/build
|
||||||
|
/public/hot
|
||||||
|
/public/storage
|
||||||
|
/storage/*.key
|
||||||
|
/vendor
|
||||||
.env
|
.env
|
||||||
Homestead.yaml
|
.env.backup
|
||||||
Homestead.json
|
.env.production
|
||||||
/.vagrant
|
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
|
Homestead.json
|
||||||
|
Homestead.yaml
|
||||||
|
auth.json
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
/.fleet
|
||||||
|
/.idea
|
||||||
|
/.vscode
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 - 2024 Leonid Nikitin (kor-elf)
|
Copyright (c) 2023 Leonid Nikitin (kor-elf)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
Захотелось написать свой независимый сервис защиты от роботов. Сервис каптча написан на фреймворке Laravel. Вдохновлялся, а так же брал картинки с проекта <a href="https://github.com/wenlng/go-captcha" target="_blank">Go Captcha</a>.
|
Захотелось написать свой независимый сервис защиты от роботов. Сервис каптча написан на фреймворке Laravel. Вдохновлялся, а так же брал картинки с проекта <a href="https://github.com/wenlng/go-captcha" target="_blank">Go Captcha</a>.
|
||||||
|
|
||||||
[Сайт проекта](https://service-captcha.projects.kor-elf.net/)
|
|
||||||
|
|
||||||
## Зависимости
|
## Зависимости
|
||||||
|
|
||||||
php 8.3 (модули: redis, gd)
|
php 8.2 (модули: redis, gd)
|
||||||
|
|
||||||
redis
|
redis
|
||||||
|
|
||||||
@ -28,7 +26,7 @@ https://captcha-admin-demo.tut-site.net/api-docs/
|
|||||||
https://git.kor-elf.net/kor-elf/service-captcha-gui
|
https://git.kor-elf.net/kor-elf/service-captcha-gui
|
||||||
|
|
||||||
## Как проверять со стороны бэкенда
|
## Как проверять со стороны бэкенда
|
||||||
Для Laravel 10, 11 есть готовый пакет: https://git.kor-elf.net/kor-elf/captcha-rule-for-laravel
|
Для Laravel 10 есть готовый пакет: https://git.kor-elf.net/kor-elf/captcha-rule-for-laravel
|
||||||
|
|
||||||
Можно установить этот пакет так: composer require kor-elf/captcha-rule-for-laravel
|
Можно установить этот пакет так: composer require kor-elf/captcha-rule-for-laravel
|
||||||
|
|
||||||
|
@ -8,9 +8,4 @@ enum CaptchaLogType: int
|
|||||||
case Error = 2;
|
case Error = 2;
|
||||||
case Verified = 3;
|
case Verified = 3;
|
||||||
case ReadVerified = 4;
|
case ReadVerified = 4;
|
||||||
|
|
||||||
public function getTitle(): string
|
|
||||||
{
|
|
||||||
return __('captcha_log_type.' . $this->name);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -19,9 +19,7 @@ public function __construct(
|
|||||||
|
|
||||||
public function login(): View
|
public function login(): View
|
||||||
{
|
{
|
||||||
return view('public/login', [
|
return view('public/login');
|
||||||
'captcha' => config('app.captcha', false)
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function authorization(AuthorizationRequest $request): RedirectResponse
|
public function authorization(AuthorizationRequest $request): RedirectResponse
|
13
app/Http/Controllers/Private/DashboardController.php
Normal file
13
app/Http/Controllers/Private/DashboardController.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Private;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
final class DashboardController extends Controller
|
||||||
|
{
|
||||||
|
public function index(): View
|
||||||
|
{
|
||||||
|
return view('private/dashboard/index');
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,7 @@
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
final class UsersController extends Controller
|
class UsersController extends Controller
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly UserService $userService
|
private readonly UserService $userService
|
@ -13,17 +13,11 @@ final class AuthorizationRequest extends FormRequest implements FormRequestDto
|
|||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
$rules = [
|
return [
|
||||||
'email' => ['required', 'email', 'max:255'],
|
'email' => ['required', 'email', 'max:255'],
|
||||||
'password' => ['required', 'min:3'],
|
'password' => ['required', 'min:3'],
|
||||||
'remember' => ['nullable', 'boolean'],
|
'remember' => ['nullable', 'boolean'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (config('app.captcha', false)) {
|
|
||||||
$rules['captcha-verified'] = ['captcha'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $rules;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDto(): Authorization
|
public function getDto(): Authorization
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user