diff --git a/be/.env.example b/be/.env.example index 7b49625a..83d7c9c8 100644 --- a/be/.env.example +++ b/be/.env.example @@ -1,64 +1,22 @@ -APP_NAME=Laravel -APP_ENV=local +APP_NAME=open-tbm +APP_ENV=production APP_KEY= -APP_DEBUG=true +APP_DEBUG=false APP_TIMEZONE=UTC APP_URL=http://localhost -APP_LOCALE=en -APP_FALLBACK_LOCALE=en -APP_FAKER_LOCALE=en_US - -APP_MAINTENANCE_DRIVER=file -APP_MAINTENANCE_STORE=database - -BCRYPT_ROUNDS=12 - LOG_CHANNEL=stack LOG_STACK=single LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=sqlite -# DB_HOST=127.0.0.1 -# DB_PORT=3306 -# DB_DATABASE=laravel -# DB_USERNAME=root -# DB_PASSWORD= - -SESSION_DRIVER=database -SESSION_LIFETIME=120 -SESSION_ENCRYPT=false -SESSION_PATH=/ -SESSION_DOMAIN=null - -BROADCAST_CONNECTION=log -FILESYSTEM_DISK=local -QUEUE_CONNECTION=database - -CACHE_STORE=database -CACHE_PREFIX= - -MEMCACHED_HOST=127.0.0.1 - -REDIS_CLIENT=phpredis -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=log -MAIL_HOST=127.0.0.1 -MAIL_PORT=2525 -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 +DB_CONNECTION=pgsql +# https://github.com/laravel/framework/issues/3987 +DB_HOST=/var/run/postgresql +DB_PORT=5432 +DB_SEARCH_PATH= +DB_DATABASE= +DB_USERNAME= +DB_PASSWORD= -VITE_APP_NAME="${APP_NAME}" +RECAPTCHA_SECRET= diff --git a/be/app/Exceptions/Handler.php b/be/app/Exceptions/Handler.php index e6a2ed01..1cdfb319 100644 --- a/be/app/Exceptions/Handler.php +++ b/be/app/Exceptions/Handler.php @@ -3,31 +3,9 @@ namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; -use Throwable; class Handler extends ExceptionHandler { - /** - * The list of the inputs that are never flashed to the session on validation exceptions. - * - * @var array - */ - protected $dontFlash = [ - 'current_password', - 'password', - 'password_confirmation', - ]; - - /** - * Register the exception handling callbacks for the application. - */ - public function register(): void - { - $this->reportable(function (Throwable $e) { - // - }); - } - /** * Override parent method to replace validate fail redirect with global error info json format * diff --git a/be/bootstrap/app.php b/be/bootstrap/app.php index 7b162dac..ec232103 100644 --- a/be/bootstrap/app.php +++ b/be/bootstrap/app.php @@ -6,13 +6,15 @@ return Application::configure(basePath: dirname(__DIR__)) ->withRouting( - web: __DIR__.'/../routes/web.php', - commands: __DIR__.'/../routes/console.php', + api: __DIR__.'/../routes/api.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { // }) + ->withSingletons([ + Illuminate\Contracts\Debug\ExceptionHandler::class => App\Exceptions\Handler::class + ]) ->withExceptions(function (Exceptions $exceptions) { // })->create(); diff --git a/be/config/database.php b/be/config/database.php index f8e8dcb8..1e05810d 100644 --- a/be/config/database.php +++ b/be/config/database.php @@ -90,7 +90,7 @@ 'charset' => env('DB_CHARSET', 'utf8'), 'prefix' => '', 'prefix_indexes' => true, - 'search_path' => 'public', + 'search_path' => env('DB_SEARCH_PATH', 'public'), 'sslmode' => 'prefer', ], diff --git a/be/config/services.php b/be/config/services.php index 27a36175..0d680dfa 100644 --- a/be/config/services.php +++ b/be/config/services.php @@ -35,4 +35,8 @@ ], ], + 'recaptcha' => [ + 'secret' => env('RECAPTCHA_SECRET'), + ], + ]; diff --git a/be/routes/api.php b/be/routes/api.php index 3714b3c5..89234460 100644 --- a/be/routes/api.php +++ b/be/routes/api.php @@ -5,17 +5,6 @@ use App\Http\Middleware\ReCAPTCHACheck; use Illuminate\Support\Facades\Route; -/* -|-------------------------------------------------------------------------- -| API Routes -|-------------------------------------------------------------------------- -| -| Here is where you can register API routes for your application. These -| routes are loaded by the RouteServiceProvider and all of them will -| be assigned to the "api" middleware group. Make something great! -| -*/ - Route::get('/forums', static fn () => \App\Eloquent\Model\Forum::all()->toJson()); Route::middleware(ReCAPTCHACheck::class)->group(static function () { diff --git a/be/storage/clockwork/.gitignore b/be/storage/clockwork/.gitignore deleted file mode 100644 index 3fac1bff..00000000 --- a/be/storage/clockwork/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.json -*.json.gz -index diff --git a/be/storage/clockwork/index b/be/storage/clockwork/index deleted file mode 100644 index e69de29b..00000000