2016-01-02 19:13:18 +05:30
|
|
|
<?php
|
|
|
|
$params = array_merge(
|
|
|
|
require(__DIR__ . '/../../common/config/params.php'),
|
2016-09-16 03:58:28 +05:30
|
|
|
require(__DIR__ . '/params.php')
|
2016-01-02 19:13:18 +05:30
|
|
|
);
|
|
|
|
|
|
|
|
return [
|
|
|
|
'id' => 'accounts-site-api',
|
|
|
|
'basePath' => dirname(__DIR__),
|
2016-09-07 20:26:30 +05:30
|
|
|
'bootstrap' => ['log', 'authserver'],
|
2016-01-02 19:13:18 +05:30
|
|
|
'controllerNamespace' => 'api\controllers',
|
2016-05-31 23:41:11 +05:30
|
|
|
'params' => $params,
|
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'),
|
2016-01-02 19:13:18 +05:30
|
|
|
],
|
2016-08-04 03:37:21 +05:30
|
|
|
'apiUser' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => api\components\ApiUser\Component::class,
|
2016-08-04 03:37:21 +05:30
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
'log' => [
|
|
|
|
'traceLevel' => YII_DEBUG ? 3 : 0,
|
|
|
|
'targets' => [
|
|
|
|
[
|
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',
|
|
|
|
],
|
|
|
|
'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,
|
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-02-14 23:20:10 +05:30
|
|
|
'oauth' => [
|
2016-11-27 03:13:42 +05:30
|
|
|
'class' => api\components\OAuth2\Component::class,
|
2016-02-14 23:20:10 +05:30
|
|
|
'grantTypes' => ['authorization_code'],
|
|
|
|
],
|
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' => [
|
|
|
|
'authserver' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => api\modules\authserver\Module::class,
|
2016-09-21 13:43:43 +05:30
|
|
|
'host' => $params['authserverHost'],
|
2016-08-21 04:51:39 +05:30
|
|
|
],
|
2016-09-07 20:26:30 +05:30
|
|
|
'session' => [
|
2016-09-16 03:58:28 +05:30
|
|
|
'class' => api\modules\session\Module::class,
|
2016-09-03 04:24:22 +05:30
|
|
|
],
|
2016-09-21 13:43:43 +05:30
|
|
|
'mojang' => [
|
|
|
|
'class' => api\modules\mojang\Module::class,
|
|
|
|
],
|
2016-08-21 04:51:39 +05:30
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
];
|