Compare commits

..

No commits in common. "main" and "0.7.0" have entirely different histories.
main ... 0.7.0

415 changed files with 1882 additions and 4131 deletions

View File

@ -1,9 +1,66 @@
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_DEMO_MODE=false
UID=1000 APP_DEMO_EMAIL=
GID=1000 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
View File

@ -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

View File

@ -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:

View File

@ -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
@ -25,10 +23,10 @@ Email: demo@tut-site.net
https://captcha-admin-demo.tut-site.net/api-docs/ https://captcha-admin-demo.tut-site.net/api-docs/
## Javascript клиент для сайта ## Javascript клиент для сайта
https://git.kor-elf.net/kor-elf/service-captcha-gui https://git.kor-elf.net/kor-elf/captcha-rule-for-laravel
## Как проверять со стороны бэкенда ## Как проверять со стороны бэкенда
Для 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

View File

@ -1,15 +0,0 @@
**/.env
**/*.env
**/.env.example
**/storage/app/*
**/storage/debugbar
**/storage/framework/cache/*
**/storage/framework/sessions/*
**/storage/framework/views/*
**/storage/framework/testing/*
**/storage/logs/*
**/vendor/
**/node_modules/
**/public/build/
**/public/storage

View File

@ -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);
}
} }

View File

@ -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

View 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');
}
}

View File

@ -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

View File

@ -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