Compare commits
No commits in common. "main" and "0.7.0" have entirely different histories.
75
.env.example
75
.env.example
@ -1,9 +1,66 @@
|
||||
DOCKER_NGINX_PORT=8080
|
||||
DOCKER_WEBSOCKET_PORT=8081
|
||||
DOCKER_DB_PORT=3306
|
||||
MYSQL_ROOT_PASSWORD=root_pass
|
||||
DB_DATABASE=captcha
|
||||
DB_USERNAME=captcha
|
||||
DB_PASSWORD=captcha_pass
|
||||
UID=1000
|
||||
GID=1000
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
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
|
||||
Homestead.yaml
|
||||
Homestead.json
|
||||
/.vagrant
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpunit.result.cache
|
||||
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
auth.json
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/.fleet
|
||||
/.idea
|
||||
/.vscode
|
||||
|
@ -1,6 +1,6 @@
|
||||
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:
|
||||
|
||||
|
@ -2,11 +2,9 @@
|
||||
|
||||
Захотелось написать свой независимый сервис защиты от роботов. Сервис каптча написан на фреймворке 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
|
||||
|
||||
@ -25,10 +23,10 @@ Email: demo@tut-site.net
|
||||
https://captcha-admin-demo.tut-site.net/api-docs/
|
||||
|
||||
## 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
|
||||
|
||||
|
@ -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
|
||||
|
@ -8,9 +8,4 @@ enum CaptchaLogType: int
|
||||
case Error = 2;
|
||||
case Verified = 3;
|
||||
case ReadVerified = 4;
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return __('captcha_log_type.' . $this->name);
|
||||
}
|
||||
}
|
@ -19,9 +19,7 @@ public function __construct(
|
||||
|
||||
public function login(): View
|
||||
{
|
||||
return view('public/login', [
|
||||
'captcha' => config('app.captcha', false)
|
||||
]);
|
||||
return view('public/login');
|
||||
}
|
||||
|
||||
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\View\View;
|
||||
|
||||
final class UsersController extends Controller
|
||||
class UsersController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserService $userService
|
@ -13,17 +13,11 @@ final class AuthorizationRequest extends FormRequest implements FormRequestDto
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
return [
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'password' => ['required', 'min:3'],
|
||||
'remember' => ['nullable', 'boolean'],
|
||||
];
|
||||
|
||||
if (config('app.captcha', false)) {
|
||||
$rules['captcha-verified'] = ['captcha'];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
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