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