mirror of
https://github.com/elyby/accounts.git
synced 2024-12-27 07:30:18 +05:30
Merge branch 'sentry' into develop
This commit is contained in:
commit
8135d93d04
@ -9,6 +9,7 @@ JWT_USER_SECRET=
|
|||||||
## Внешние сервисы
|
## Внешние сервисы
|
||||||
RECAPTCHA_PUBLIC=
|
RECAPTCHA_PUBLIC=
|
||||||
RECAPTCHA_SECRET=
|
RECAPTCHA_SECRET=
|
||||||
|
SENTRY_DSN=
|
||||||
|
|
||||||
## SMTP параметры
|
## SMTP параметры
|
||||||
SMTP_USER=
|
SMTP_USER=
|
||||||
|
@ -21,6 +21,17 @@ return [
|
|||||||
'log' => [
|
'log' => [
|
||||||
'traceLevel' => YII_DEBUG ? 3 : 0,
|
'traceLevel' => YII_DEBUG ? 3 : 0,
|
||||||
'targets' => [
|
'targets' => [
|
||||||
|
[
|
||||||
|
'class' => mito\sentry\Target::class,
|
||||||
|
'levels' => ['error', 'warning'],
|
||||||
|
'except' => [
|
||||||
|
'legacy-authserver',
|
||||||
|
'session',
|
||||||
|
'yii\web\HttpException:*',
|
||||||
|
'api\modules\session\exceptions\SessionServerException:*',
|
||||||
|
'api\modules\authserver\exceptions\AuthserverException:*',
|
||||||
|
],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'class' => yii\log\FileTarget::class,
|
'class' => yii\log\FileTarget::class,
|
||||||
'levels' => ['error', 'warning'],
|
'levels' => ['error', 'warning'],
|
||||||
|
@ -21,6 +21,7 @@ class Yii extends \yii\BaseYii {
|
|||||||
* @property \common\components\RabbitMQ\Component $amqp
|
* @property \common\components\RabbitMQ\Component $amqp
|
||||||
* @property \GuzzleHttp\Client $guzzle
|
* @property \GuzzleHttp\Client $guzzle
|
||||||
* @property \common\components\EmailRenderer $emailRenderer
|
* @property \common\components\EmailRenderer $emailRenderer
|
||||||
|
* @property \mito\sentry\Component $sentry
|
||||||
*/
|
*/
|
||||||
abstract class BaseApplication extends yii\base\Application {
|
abstract class BaseApplication extends yii\base\Application {
|
||||||
}
|
}
|
||||||
|
18
common/components/Sentry/Component.php
Normal file
18
common/components/Sentry/Component.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
namespace common\components\Sentry;
|
||||||
|
|
||||||
|
use Yii;
|
||||||
|
|
||||||
|
class Component extends \mito\sentry\Component {
|
||||||
|
|
||||||
|
public $jsNotifier = false;
|
||||||
|
|
||||||
|
public function init() {
|
||||||
|
if (is_array($this->client) && !isset($this->client['release'])) {
|
||||||
|
$this->client['release'] = Yii::$app->version;
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::init();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
return [
|
return [
|
||||||
|
'version' => '1.1.3-dev',
|
||||||
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
|
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
|
||||||
'components' => [
|
'components' => [
|
||||||
'cache' => [
|
'cache' => [
|
||||||
@ -34,6 +35,15 @@ return [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'sentry' => [
|
||||||
|
'class' => common\components\Sentry\Component::class,
|
||||||
|
'enabled' => !empty(getenv('SENTRY_DSN')),
|
||||||
|
'dsn' => getenv('SENTRY_DSN'),
|
||||||
|
'environment' => YII_ENV_DEV ? 'development' : 'production',
|
||||||
|
'client' => [
|
||||||
|
'curl_method' => 'async',
|
||||||
|
],
|
||||||
|
],
|
||||||
'security' => [
|
'security' => [
|
||||||
'passwordHashStrategy' => 'password_hash',
|
'passwordHashStrategy' => 'password_hash',
|
||||||
],
|
],
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
"emarref/jwt": "~1.0.3",
|
"emarref/jwt": "~1.0.3",
|
||||||
"ely/amqp-controller": "dev-master#d7f8cdbc66c45e477c9c7d5d509bc0c1b11fd3ec",
|
"ely/amqp-controller": "dev-master#d7f8cdbc66c45e477c9c7d5d509bc0c1b11fd3ec",
|
||||||
"ely/email-renderer": "dev-master#38a148cd5081147acc31125ddc49966b149f65cf",
|
"ely/email-renderer": "dev-master#38a148cd5081147acc31125ddc49966b149f65cf",
|
||||||
"predis/predis": "^1.0"
|
"predis/predis": "^1.0",
|
||||||
|
"mito/yii2-sentry": "dev-fix_init#27f00805cb906f73b2c6f8181c1c655decb9be70"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"yiisoft/yii2-codeception": "*",
|
"yiisoft/yii2-codeception": "*",
|
||||||
@ -57,6 +58,10 @@
|
|||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@gitlab.ely.by:elyby/oauth2-server.git"
|
"url": "git@gitlab.ely.by:elyby/oauth2-server.git"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "git",
|
||||||
|
"url": "git@github.com:erickskrauch/yii2-sentry.git"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -13,6 +13,10 @@ return [
|
|||||||
'components' => [
|
'components' => [
|
||||||
'log' => [
|
'log' => [
|
||||||
'targets' => [
|
'targets' => [
|
||||||
|
[
|
||||||
|
'class' => mito\sentry\Target::class,
|
||||||
|
'levels' => ['error', 'warning'],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'class' => yii\log\FileTarget::class,
|
'class' => yii\log\FileTarget::class,
|
||||||
'levels' => ['error', 'warning'],
|
'levels' => ['error', 'warning'],
|
||||||
|
@ -20,5 +20,8 @@ return [
|
|||||||
'amqp' => [
|
'amqp' => [
|
||||||
'class' => tests\codeception\common\_support\amqp\TestComponent::class,
|
'class' => tests\codeception\common\_support\amqp\TestComponent::class,
|
||||||
],
|
],
|
||||||
|
'sentry' => [
|
||||||
|
'enabled' => false,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user