承接 naugrim/laravel-sentry-tunnel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

naugrim/laravel-sentry-tunnel

Composer 安装命令:

composer require naugrim/laravel-sentry-tunnel

包简介

Provides an endpoint to use the `tunnel`-parameter of the Sentry SDK

README 文档

README

This package provides a URL for use with the tunnel-option of the Sentry SDK.

Installation

composer require naugrim/laravel-sentry-tunnel

The package uses Laravel's auto-discovery.

Configuration

You can optionally publish the configuration files:

php artisan vendor:publish --provider=Naugrim\\LaravelSentryTunnel\\Provider

You must place at least one allowed host in your .env file:

SENTRY_TUNNEL_ALLOWED_HOSTS=my.host.com

NOTE: This essentially creates a reverse proxy to the SENTRY_TUNNEL_ALLOWED_HOSTS. As the Sentry DSN is not kept secret, this enables everyone to send messages to these hosts that seem to originate from your server.

Therefore, the default middleware list for the tunnel URL includes web and auth (so that only authenticated users can use the endpoint).

As you currently cannot pass a dynamic X-XSRF-TOKEN header in Sentry's transportOptions you either have to implement your own transport or place the tunnel URL in the exclude-list in the VerifyCsrfToken middleware.

If you want to change this behavior, provide a custom implementation of \Naugrim\LaravelSentryTunnel\Contracts\MiddlewareList via the container:

// app/Services/MyMiddlewareList.php

namespace App\Services;

use Naugrim\LaravelSentryTunnel\Services\MiddlewareList;

class MyMiddlewareList extends MiddlewareList
{
    public function getMiddlewareList() : array{
        return array_merge(
            parent::getMiddlewareList(),
            [
                "throttle",
            ]
        );       
    }
}

Then add it to the container in your AppServiceProvider:

// app/Providers/AppServiceProvider.php

use Illuminate\Support\ServiceProvider;
use Naugrim\LaravelSentryTunnel\Contracts\MiddlewareList;
use App\Services\MyMiddlewareList;

class AppServiceProvider extends ServiceProvider
{
    public function register(){
        $this->app->alias(MyMiddlewareList::class, MiddlewareList::class);
    }
}

Optionally you can restrict the project IDs that are allowed to use this endpoint. The default behavior is to allow all projects.

SENTRY_TUNNEL_ALLOWED_PROJECTS=1234,456,78

You can change the URL of the tunnel if required. The default value is /sentry/tunnel

SENTRY_TUNNEL_URL="/super/secret/tunnel"

Usage

Consult Sentry's documentation.

统计信息

  • 总下载量: 61.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固