2016-01-02 19:13:18 +05:30
|
|
|
<?php
|
|
|
|
return [
|
|
|
|
'id' => 'accounts-site-api',
|
|
|
|
'basePath' => dirname(__DIR__),
|
2019-02-21 01:28:52 +05:30
|
|
|
'bootstrap' => ['log', 'authserver', 'internal', 'mojang'],
|
2016-01-02 19:13:18 +05:30
|
|
|
'controllerNamespace' => 'api\controllers',
|
2019-02-21 01:28:52 +05:30
|
|
|
'params' => [
|
|
|
|
'authserverHost' => getenv('AUTHSERVER_HOST'),
|
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
'components' => [
|
|
|
|
'user' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => api\components\User\Component::class,
|
|
|
|
'secret' => getenv('JWT_USER_SECRET'),
|
2019-07-25 18:59:08 +05:30
|
|
|
'publicKey' => getenv('JWT_PUBLIC_KEY') ?: '/data/certs/public.crt',
|
|
|
|
'privateKey' => getenv('JWT_PRIVATE_KEY') ?: '/data/certs/private.key',
|
2016-01-02 19:13:18 +05:30
|
|
|
],
|
|
|
|
'log' => [
|
|
|
|
'traceLevel' => YII_DEBUG ? 3 : 0,
|
|
|
|
'targets' => [
|
2016-11-22 04:17:41 +05:30
|
|
|
[
|
2016-12-08 01:52:49 +05:30
|
|
|
'class' => mito\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' => [
|
|
|
|
'*' => 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
|
|
|
],
|
2016-08-21 04:51:39 +05:30
|
|
|
'modules' => [
|
2019-02-21 01:28:52 +05:30
|
|
|
'authserver' => api\modules\authserver\Module::class,
|
2017-09-19 22:36:16 +05:30
|
|
|
'session' => api\modules\session\Module::class,
|
|
|
|
'mojang' => api\modules\mojang\Module::class,
|
|
|
|
'internal' => api\modules\internal\Module::class,
|
|
|
|
'accounts' => api\modules\accounts\Module::class,
|
2018-02-28 03:57:35 +05:30
|
|
|
'oauth' => api\modules\oauth\Module::class,
|
2016-08-21 04:51:39 +05:30
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
];
|