2016-01-02 19:13:18 +05:30
|
|
|
<?php
|
|
|
|
return [
|
|
|
|
'id' => 'accounts-site-api',
|
|
|
|
'basePath' => dirname(__DIR__),
|
2023-11-20 09:09:13 +05:30
|
|
|
'bootstrap' => [
|
|
|
|
'log',
|
|
|
|
'authserver',
|
|
|
|
'internal',
|
|
|
|
'mojang',
|
|
|
|
api\eventListeners\MockDataResponse::class,
|
|
|
|
api\eventListeners\LogMetricsToStatsd::class,
|
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
'controllerNamespace' => 'api\controllers',
|
2019-02-21 01:28:52 +05:30
|
|
|
'params' => [
|
2019-08-08 05:19:04 +05:30
|
|
|
'authserverHost' => getenv('AUTHSERVER_HOST') ?: 'authserver.ely.by',
|
2019-02-21 01:28:52 +05:30
|
|
|
],
|
2019-12-06 21:01:04 +05:30
|
|
|
'modules' => [
|
|
|
|
'authserver' => api\modules\authserver\Module::class,
|
|
|
|
'session' => api\modules\session\Module::class,
|
|
|
|
'mojang' => api\modules\mojang\Module::class,
|
|
|
|
'internal' => api\modules\internal\Module::class,
|
|
|
|
'accounts' => api\modules\accounts\Module::class,
|
|
|
|
'oauth' => api\modules\oauth\Module::class,
|
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
'components' => [
|
|
|
|
'user' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => api\components\User\Component::class,
|
2019-08-01 14:47:12 +05:30
|
|
|
],
|
|
|
|
'tokens' => [
|
|
|
|
'class' => api\components\Tokens\Component::class,
|
|
|
|
'privateKeyPath' => getenv('JWT_PRIVATE_KEY_PATH') ?: __DIR__ . '/../../data/certs/private.pem',
|
|
|
|
'privateKeyPass' => getenv('JWT_PRIVATE_KEY_PASS') ?: null,
|
2019-12-04 23:40:15 +05:30
|
|
|
'encryptionKey' => getenv('JWT_ENCRYPTION_KEY'),
|
|
|
|
],
|
|
|
|
'tokensFactory' => [
|
2019-12-05 03:22:27 +05:30
|
|
|
'class' => api\components\Tokens\TokensFactory::class,
|
2016-01-02 19:13:18 +05:30
|
|
|
],
|
|
|
|
'log' => [
|
|
|
|
'traceLevel' => YII_DEBUG ? 3 : 0,
|
|
|
|
'targets' => [
|
2016-11-22 04:17:41 +05:30
|
|
|
[
|
2024-12-02 15:40:55 +05:30
|
|
|
'class' => nohnaimer\sentry\Target::class,
|
2016-11-22 04:17:41 +05:30
|
|
|
'levels' => ['error', 'warning'],
|
|
|
|
'except' => [
|
|
|
|
'legacy-authserver',
|
|
|
|
'session',
|
|
|
|
'yii\web\HttpException:*',
|
|
|
|
'api\modules\session\exceptions\SessionServerException:*',
|
|
|
|
'api\modules\authserver\exceptions\AuthserverException:*',
|
|
|
|
],
|
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
[
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => yii\log\FileTarget::class,
|
2016-01-02 19:13:18 +05:30
|
|
|
'levels' => ['error', 'warning'],
|
2016-09-09 03:09:00 +05:30
|
|
|
'except' => [
|
|
|
|
'legacy-authserver',
|
|
|
|
'session',
|
2016-11-20 23:07:08 +05:30
|
|
|
'yii\web\HttpException:*',
|
2016-09-09 03:09:00 +05:30
|
|
|
'api\modules\session\exceptions\SessionServerException:*',
|
|
|
|
'api\modules\authserver\exceptions\AuthserverException:*',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
[
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => yii\log\FileTarget::class,
|
2016-09-09 03:09:00 +05:30
|
|
|
'levels' => ['error', 'info'],
|
2016-11-05 05:23:25 +05:30
|
|
|
'logVars' => [],
|
2016-09-09 03:09:00 +05:30
|
|
|
'categories' => ['legacy-authserver'],
|
|
|
|
'logFile' => '@runtime/logs/authserver.log',
|
|
|
|
],
|
|
|
|
[
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => yii\log\FileTarget::class,
|
2016-09-09 03:09:00 +05:30
|
|
|
'levels' => ['error', 'info'],
|
2016-11-05 05:23:25 +05:30
|
|
|
'logVars' => [],
|
2016-09-09 03:09:00 +05:30
|
|
|
'categories' => ['session'],
|
|
|
|
'logFile' => '@runtime/logs/session.log',
|
2016-01-02 19:13:18 +05:30
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
2016-01-03 05:48:37 +05:30
|
|
|
'request' => [
|
|
|
|
'baseUrl' => '/api',
|
2018-07-11 04:08:48 +05:30
|
|
|
'enableCsrfCookie' => false,
|
2017-05-31 05:40:22 +05:30
|
|
|
'parsers' => [
|
2022-12-10 08:26:19 +05:30
|
|
|
'application/json' => yii\web\JsonParser::class,
|
|
|
|
'multipart/form-data' => yii\web\MultipartFormDataParser::class,
|
2017-05-31 05:40:22 +05:30
|
|
|
'*' => api\request\RequestParser::class,
|
|
|
|
],
|
2016-01-03 05:48:37 +05:30
|
|
|
],
|
|
|
|
'urlManager' => [
|
|
|
|
'enablePrettyUrl' => true,
|
|
|
|
'showScriptName' => false,
|
2016-01-21 02:44:29 +05:30
|
|
|
'rules' => require __DIR__ . '/routes.php',
|
2016-01-03 05:48:37 +05:30
|
|
|
],
|
2016-01-15 14:51:27 +05:30
|
|
|
'reCaptcha' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => api\components\ReCaptcha\Component::class,
|
2019-04-06 07:45:23 +05:30
|
|
|
'public' => getenv('RECAPTCHA_PUBLIC'),
|
|
|
|
'secret' => getenv('RECAPTCHA_SECRET'),
|
2016-01-15 14:51:27 +05:30
|
|
|
],
|
2016-01-21 02:44:29 +05:30
|
|
|
'response' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'format' => yii\web\Response::FORMAT_JSON,
|
2016-01-21 02:44:29 +05:30
|
|
|
],
|
2016-08-31 16:02:14 +05:30
|
|
|
'errorHandler' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => api\components\ErrorHandler::class,
|
2016-08-31 16:02:14 +05:30
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
],
|
|
|
|
];
|