初始化
This commit is contained in:
68
config/plugin/gitfei1231/webman-api-sign/app.php
Normal file
68
config/plugin/gitfei1231/webman-api-sign/app.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
|
||||
/**
|
||||
* 配置 driver
|
||||
* 数组配置驱动 \Wengg\WebmanApiSign\Driver\ArrayDriver::class
|
||||
* 数据库配置驱动 \Wengg\WebmanApiSign\Driver\DatabaseDriver::class (使用的是 ThinkORM)
|
||||
* 如需要自定义驱动,继承 \Wengg\WebmanApiSign\Driver\BaseDriver::class
|
||||
*/
|
||||
'driver' => \Wengg\WebmanApiSign\Driver\ArrayDriver::class,
|
||||
'encrypt' => 'sha256', //加密sign方式,
|
||||
'timeout' => 0, //timestamp超时时间秒,0不限制
|
||||
'table' => 'app_sign', //表名
|
||||
|
||||
/**
|
||||
* 防重放请求是否开启 true只能请求一次,时间是上面 timeout内
|
||||
* replay 主要借助与 timeout + noncestr随机值进行验证, 一定的时间内noncestr如果重复,那就判定重放请求
|
||||
* noncestr 建议生成随机唯一UUID 或者你使用 13位时间戳+18位随机数。1678159075243(13位)+随机数(18位)
|
||||
*/
|
||||
'replay' => false,
|
||||
|
||||
/**
|
||||
* 如果使用 DatabaseDriver 需要缓存查询后的数据
|
||||
* 设置缓存时间即可缓存对应的app_id数据
|
||||
* db_cache_time => null 关闭缓存
|
||||
*/
|
||||
'db_cache_time' => 604800, // null 关闭缓存
|
||||
|
||||
//字段对照,可从(header,get,post)获取的值
|
||||
'fields' => [
|
||||
'app_id' => 'appId', //app_id
|
||||
'app_key' => 'appKey', //app_key rsa加密才需要传,appKey为前端随机生成的app_secret秘钥,用于加密sign和报文数据
|
||||
'timestamp' => 'timestamp', //时间戳
|
||||
'noncestr' => 'nonceStr', //随机字符串
|
||||
'signature' => 'signature', //签名字符串
|
||||
],
|
||||
|
||||
//driver为ArrayDriver时生效,对应table
|
||||
'app_sign' => [
|
||||
[
|
||||
'app_id' => '1661408635', //应用id
|
||||
'app_name' => '默认', //应用名称
|
||||
'status' => 1, //状态:0=禁用,1=启用
|
||||
'expired_at' => null, //过期时间,例如:2023-01-01 00:00:00,null不限制
|
||||
'app_secret' => 'D81668E7B3F24F4DAB32E5B88EAE27AC', //应用秘钥 不启用RSA使用
|
||||
'encrypt_body' => 0, //状态:0=禁用,1=启用 算法:aes-128-cbc 是否加密body传入加密后的报文字符串,启用RSA需要使用自动生成的app_secret进行对称加密,否则使用固定的app_secret进行对称加密
|
||||
'rsa_status' => 0, //状态:0=禁用,1=启用 启用RSA,主要用rsa加密随机生成的app_secret,而不使用固定app_secret
|
||||
/**
|
||||
* sign私钥 RS256加密
|
||||
*/
|
||||
'private_key' => <<<EOD
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
EOD,
|
||||
/**
|
||||
* sign公钥 RS256加密
|
||||
*/
|
||||
'public_key' => <<<EOD
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
...
|
||||
-----END PUBLIC KEY-----
|
||||
EOD
|
||||
],
|
||||
],
|
||||
];
|
||||
3
config/plugin/gitfei1231/webman-api-sign/middleware.php
Normal file
3
config/plugin/gitfei1231/webman-api-sign/middleware.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return [];
|
||||
4
config/plugin/rockys/ex-admin-webman/app.php
Normal file
4
config/plugin/rockys/ex-admin-webman/app.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
];
|
||||
17
config/plugin/rockys/ex-admin-webman/bootstrap.php
Normal file
17
config/plugin/rockys/ex-admin-webman/bootstrap.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
return [
|
||||
\ExAdmin\webman\ServiceProvider::class
|
||||
];
|
||||
6
config/plugin/rockys/ex-admin-webman/command.php
Normal file
6
config/plugin/rockys/ex-admin-webman/command.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
\ExAdmin\webman\command\AdminInstall::class,
|
||||
\ExAdmin\webman\command\PluginComposer::class,
|
||||
];
|
||||
39
config/plugin/rockys/ex-admin-webman/filesystems.php
Normal file
39
config/plugin/rockys/ex-admin-webman/filesystems.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. The "local" disk, as well as a variety of cloud
|
||||
| based disks are available to your application. Just store away!
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('FILESYSTEM_DRIVER', 'local'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| been setup for each driver as an example of the required options.
|
||||
|
|
||||
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
'local' => [
|
||||
'driver' => \addons\webman\filesystem\driver\Local::class,
|
||||
'root' => public_path('storage'),
|
||||
'url' => env('APP_URL','http://127.0.0.1:8787').'/storage',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
],
|
||||
];
|
||||
20
config/plugin/rockys/ex-admin-webman/middleware.php
Normal file
20
config/plugin/rockys/ex-admin-webman/middleware.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
return [
|
||||
'' => [
|
||||
\ExAdmin\webman\middleware\RequestMiddleware::class
|
||||
]
|
||||
|
||||
];
|
||||
11
config/plugin/rockys/ex-admin-webman/process.php
Normal file
11
config/plugin/rockys/ex-admin-webman/process.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'ex_admin_consumer' => [
|
||||
'handler' => Webman\RedisQueue\Process\Consumer::class,
|
||||
'count' => 8, // 可以设置多进程同时消费
|
||||
'constructor' => [
|
||||
// 消费者类目录
|
||||
'consumer_dir' => base_path() . '/addons/webman/grid/Jobs'
|
||||
]
|
||||
]
|
||||
];
|
||||
11
config/plugin/rockys/ex-admin-webman/route.php
Normal file
11
config/plugin/rockys/ex-admin-webman/route.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if(plugin()->webman){
|
||||
plugin()->webman->route();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
72
config/plugin/tinywan/jwt/app.php
Normal file
72
config/plugin/tinywan/jwt/app.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'jwt' => [
|
||||
// 算法类型 HS256、HS384、HS512、RS256、RS384、RS512、ES256、ES384、Ed25519
|
||||
'algorithms' => 'HS256',
|
||||
// access令牌秘钥
|
||||
'access_secret_key' => '2022d3d3LmJq',
|
||||
// access令牌过期时间,单位:秒。默认 15天
|
||||
'access_exp' => 1296000,
|
||||
// refresh令牌秘钥
|
||||
'refresh_secret_key' => '2022KTxigxc9o50c',
|
||||
// refresh令牌过期时间,单位:秒。默认 30 天
|
||||
'refresh_exp' => 2592000,
|
||||
// refresh 令牌是否禁用,默认不禁用 false
|
||||
'refresh_disable' => false,
|
||||
// 令牌签发者
|
||||
'iss' => 'webman.tinywan.cn',
|
||||
// 某个时间点后才能访问,单位秒。(如:30 表示当前时间30秒后才能使用)
|
||||
'nbf' => 0,
|
||||
// 时钟偏差冗余时间,单位秒。建议这个余地应该不大于几分钟。
|
||||
'leeway' => 60,
|
||||
// 单设备登录
|
||||
'is_single_device' => true,
|
||||
// 缓存令牌时间,单位:秒。默认 15 天
|
||||
'cache_token_ttl' => 1296000,
|
||||
// 缓存令牌前缀
|
||||
'cache_token_pre' => 'JWT:TOKEN:',
|
||||
'cache_refresh_token_pre' => 'JWT:REFRESH_TOKEN:',
|
||||
// 用户信息模型
|
||||
'user_model' => function($uid){
|
||||
return [];
|
||||
},
|
||||
|
||||
/**
|
||||
* access令牌私钥
|
||||
*/
|
||||
'access_private_key' => <<<EOD
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
EOD,
|
||||
|
||||
/**
|
||||
* access令牌公钥
|
||||
*/
|
||||
'access_public_key' => <<<EOD
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
...
|
||||
-----END PUBLIC KEY-----
|
||||
EOD,
|
||||
|
||||
/**
|
||||
* refresh令牌私钥
|
||||
*/
|
||||
'refresh_private_key' => <<<EOD
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
EOD,
|
||||
|
||||
/**
|
||||
* refresh令牌公钥
|
||||
*/
|
||||
'refresh_public_key' => <<<EOD
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
...
|
||||
-----END PUBLIC KEY-----
|
||||
EOD,
|
||||
],
|
||||
];
|
||||
64
config/plugin/webman-tech/laravel-http-client/app.php
Normal file
64
config/plugin/webman-tech/laravel-http-client/app.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
/**
|
||||
* 日志相关
|
||||
*/
|
||||
'log' => [
|
||||
/**
|
||||
* 日志是否启用,建议启用
|
||||
*/
|
||||
'enable' => false,
|
||||
/**
|
||||
* 日志的 channel
|
||||
*/
|
||||
'channel' => 'default',
|
||||
/**
|
||||
* 日志的级别
|
||||
*/
|
||||
'level' => 'info',
|
||||
/**
|
||||
* 日志格式
|
||||
* 启用 custom 时无实际作用
|
||||
* @link \GuzzleHttp\MessageFormatter::format()
|
||||
*/
|
||||
'format' => \GuzzleHttp\MessageFormatter::CLF,
|
||||
/**
|
||||
* 自定义日志
|
||||
*
|
||||
* 返回 WebmanTech\LaravelHttpClient\Guzzle\Log\CustomLogInterface 时使用 @see WebmanTech\LaravelHttpClient\Guzzle\Log\Middleware::__invoke()
|
||||
* 返回 null 时使用 guzzle 的 @see GuzzleHttp\Middleware::log()
|
||||
* 返回 callable 时使用自定义 middleware @link https://docs.guzzlephp.org/en/stable/handlers-and-middleware.html#middleware
|
||||
*
|
||||
* 建议使用 CustomLogInterface 形式,支持慢请求、请求时长、更多配置
|
||||
*/
|
||||
'custom' => function (array $config) {
|
||||
/**
|
||||
* @see \WebmanTech\LaravelHttpClient\Guzzle\Log\CustomLog::$config
|
||||
*/
|
||||
$config = [
|
||||
'log_channel' => $config['channel'],
|
||||
];
|
||||
return new \WebmanTech\LaravelHttpClient\Guzzle\Log\CustomLog($config);
|
||||
}
|
||||
],
|
||||
/**
|
||||
* guzzle 全局的 options
|
||||
* @link https://laravel.com/docs/8.x/http-client#guzzle-options
|
||||
*/
|
||||
'guzzle' => [
|
||||
'debug' => false,
|
||||
'timeout' => 10,
|
||||
],
|
||||
/**
|
||||
* 扩展 Http 功能,一般可用于快速定义 api 信息
|
||||
* @link https://laravel.com/docs/8.x/http-client#macros
|
||||
*/
|
||||
'macros' => [
|
||||
/*'httpbin' => function() {
|
||||
return Http::baseUrl('https://httpbin.org')
|
||||
->asJson();
|
||||
}*/
|
||||
],
|
||||
];
|
||||
20
config/plugin/webman/console/app.php
Normal file
20
config/plugin/webman/console/app.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
|
||||
'build_dir' => BASE_PATH . DIRECTORY_SEPARATOR . 'build',
|
||||
|
||||
'phar_filename' => 'webman.phar',
|
||||
|
||||
'bin_filename' => 'webman.bin',
|
||||
|
||||
'signature_algorithm'=> Phar::SHA256, //set the signature algorithm for a phar and apply it. The signature algorithm must be one of Phar::MD5, Phar::SHA1, Phar::SHA256, Phar::SHA512, or Phar::OPENSSL.
|
||||
|
||||
'private_key_file' => '', // The file path for certificate or OpenSSL private key file.
|
||||
|
||||
'exclude_pattern' => '#^(?!.*(composer.json|/.github/|/.idea/|/.git/|/.setting/|/runtime/|/vendor-bin/|/build/|/vendor/webman/admin/))(.*)$#',
|
||||
|
||||
'exclude_files' => [
|
||||
'.env', 'LICENSE', 'composer.json', 'composer.lock', 'start.php', 'webman.phar', 'webman.bin'
|
||||
]
|
||||
];
|
||||
4
config/plugin/webman/event/app.php
Normal file
4
config/plugin/webman/event/app.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
];
|
||||
17
config/plugin/webman/event/bootstrap.php
Normal file
17
config/plugin/webman/event/bootstrap.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
return [
|
||||
Webman\Event\BootStrap::class,
|
||||
];
|
||||
7
config/plugin/webman/event/command.php
Normal file
7
config/plugin/webman/event/command.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Webman\Event\EventListCommand;
|
||||
|
||||
return [
|
||||
EventListCommand::class
|
||||
];
|
||||
12
config/plugin/webman/log/app.php
Normal file
12
config/plugin/webman/log/app.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
'exception' => [
|
||||
// 是否记录异常到日志
|
||||
'enable' => true,
|
||||
// 不会记录到日志的异常类
|
||||
'dontReport' => [
|
||||
support\exception\BusinessException::class
|
||||
]
|
||||
]
|
||||
];
|
||||
21
config/plugin/webman/log/middleware.php
Normal file
21
config/plugin/webman/log/middleware.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
use Webman\Log\Middleware;
|
||||
|
||||
return [
|
||||
'' => [
|
||||
Middleware::class
|
||||
]
|
||||
];
|
||||
10
config/plugin/webman/push/app.php
Normal file
10
config/plugin/webman/push/app.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
'websocket' => 'websocket://0.0.0.0:3132',
|
||||
'api' => 'http://127.0.0.1:3233',
|
||||
'app_key' => '20f94408fc4c52845f162e92a253c7a3',
|
||||
'app_secret' => '3151f8648a6ccd9d4515386f34127e28',
|
||||
'channel_hook' => 'http://127.0.0.1:8787/plugin/webman/push/hook',
|
||||
'auth' => '/plugin/webman/push/auth'
|
||||
];
|
||||
21
config/plugin/webman/push/process.php
Normal file
21
config/plugin/webman/push/process.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Webman\Push\Server;
|
||||
|
||||
return [
|
||||
'server' => [
|
||||
'handler' => Server::class,
|
||||
'listen' => config('plugin.webman.push.app.websocket'),
|
||||
'count' => 1, // 必须是1
|
||||
'reloadable' => false, // 执行reload不重启
|
||||
'constructor' => [
|
||||
'api_listen' => config('plugin.webman.push.app.api'),
|
||||
'app_info' => [
|
||||
config('plugin.webman.push.app.app_key') => [
|
||||
'channel_hook' => config('plugin.webman.push.app.channel_hook'),
|
||||
'app_secret' => config('plugin.webman.push.app.app_secret'),
|
||||
],
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
87
config/plugin/webman/push/route.php
Normal file
87
config/plugin/webman/push/route.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
use support\Request;
|
||||
use Webman\Route;
|
||||
use Webman\Push\Api;
|
||||
|
||||
/**
|
||||
* 推送js客户端文件
|
||||
*/
|
||||
Route::get('/plugin/webman/push/push.js', function (Request $request) {
|
||||
return response()->file(base_path().'/vendor/webman/push/src/push.js');
|
||||
});
|
||||
|
||||
/**
|
||||
* 私有频道鉴权,这里应该使用session辨别当前用户身份,然后确定该用户是否有权限监听channel_name
|
||||
*/
|
||||
Route::post(config('plugin.webman.push.app.auth'), function (Request $request) {
|
||||
$pusher = new Api(str_replace('0.0.0.0', '127.0.0.1', config('plugin.webman.push.app.api')), config('plugin.webman.push.app.app_key'), config('plugin.webman.push.app.app_secret'));
|
||||
$channel_name = $request->post('channel_name');
|
||||
$session = $request->session();
|
||||
// 这里应该通过session和channel_name判断当前用户是否有权限监听channel_name
|
||||
$has_authority = true;
|
||||
if ($has_authority) {
|
||||
return response($pusher->socketAuth($channel_name, $request->post('socket_id')));
|
||||
} else {
|
||||
return response('Forbidden', 403);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 当频道上线以及下线时触发的回调
|
||||
* 频道上线:是指某个频道从没有连接在线到有连接在线的事件
|
||||
* 频道下线:是指某个频道的所有连接都断开触发的事件
|
||||
*/
|
||||
Route::post(parse_url(config('plugin.webman.push.app.channel_hook'), PHP_URL_PATH), function (Request $request) {
|
||||
|
||||
// 没有x-pusher-signature头视为伪造请求
|
||||
if (!$webhook_signature = $request->header('x-pusher-signature')) {
|
||||
return response('401 Not authenticated', 401);
|
||||
}
|
||||
|
||||
$body = $request->rawBody();
|
||||
|
||||
// 计算签名,$app_secret 是双方使用的密钥,是保密的,外部无从得知
|
||||
$expected_signature = hash_hmac('sha256', $body, config('plugin.webman.push.app.app_secret'), false);
|
||||
|
||||
// 安全校验,如果签名不一致可能是伪造的请求,返回401状态码
|
||||
if ($webhook_signature !== $expected_signature) {
|
||||
return response('401 Not authenticated', 401);
|
||||
}
|
||||
|
||||
// 这里存储这上线 下线的channel数据
|
||||
$payload = json_decode($body, true);
|
||||
|
||||
$channels_online = $channels_offline = [];
|
||||
|
||||
foreach ($payload['events'] as $event) {
|
||||
if ($event['name'] === 'channel_added') {
|
||||
$channels_online[] = $event['channel'];
|
||||
} else if ($event['name'] === 'channel_removed') {
|
||||
$channels_offline[] = $event['channel'];
|
||||
}
|
||||
}
|
||||
|
||||
// 业务根据需要处理上下线的channel,例如将在线状态写入数据库,通知其它channel等
|
||||
// 上线的所有channel
|
||||
echo 'online channels: ' . implode(',', $channels_online) . "\n";
|
||||
// 下线的所有channel
|
||||
echo 'offline channels: ' . implode(',', $channels_offline) . "\n";
|
||||
|
||||
return 'OK';
|
||||
});
|
||||
|
||||
|
||||
|
||||
4
config/plugin/webman/redis-queue/app.php
Normal file
4
config/plugin/webman/redis-queue/app.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
];
|
||||
7
config/plugin/webman/redis-queue/command.php
Normal file
7
config/plugin/webman/redis-queue/command.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Webman\RedisQueue\Command\MakeConsumerCommand;
|
||||
|
||||
return [
|
||||
MakeConsumerCommand::class
|
||||
];
|
||||
32
config/plugin/webman/redis-queue/log.php
Normal file
32
config/plugin/webman/redis-queue/log.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
return [
|
||||
'default' => [
|
||||
'handlers' => [
|
||||
[
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
'constructor' => [
|
||||
runtime_path() . '/logs/redis-queue/queue.log',
|
||||
7, //$maxFiles
|
||||
Monolog\Logger::DEBUG,
|
||||
],
|
||||
'formatter' => [
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
];
|
||||
11
config/plugin/webman/redis-queue/process.php
Normal file
11
config/plugin/webman/redis-queue/process.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'consumer' => [
|
||||
'handler' => Webman\RedisQueue\Process\Consumer::class,
|
||||
'count' => 8, // 可以设置多进程同时消费
|
||||
'constructor' => [
|
||||
// 消费者类目录
|
||||
'consumer_dir' => app_path() . '/queue/redis'
|
||||
]
|
||||
]
|
||||
];
|
||||
13
config/plugin/webman/redis-queue/redis.php
Normal file
13
config/plugin/webman/redis-queue/redis.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
return [
|
||||
'default' => [
|
||||
'host' => 'redis://127.0.0.1:6379',
|
||||
'options' => [
|
||||
'auth' => null, // 密码,字符串类型,可选参数
|
||||
'db' => 1, // 数据库
|
||||
'prefix' => '', // key 前缀
|
||||
'max_attempts' => 5, // 消费失败后,重试次数
|
||||
'retry_seconds' => 5, // 重试间隔,单位秒
|
||||
]
|
||||
],
|
||||
];
|
||||
11
config/plugin/workbunny/webman-ip-attribution/app.php
Normal file
11
config/plugin/workbunny/webman-ip-attribution/app.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
|
||||
'default' => '--',
|
||||
'language' => ['zh-CN'],
|
||||
|
||||
'db-country' => null,
|
||||
'db-city' => null,
|
||||
'db-asn' => null,
|
||||
];
|
||||
28
config/plugin/yzh52521/jwt_key/private.key
Normal file
28
config/plugin/yzh52521/jwt_key/private.key
Normal file
@@ -0,0 +1,28 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDmA8qKaS3+AIkj
|
||||
t2IsdFQw8kKHVARk2aPBxkV3qIhpaFpvs/uDA5NkGVR/uFFFsSAOGx6JCsdZRQv7
|
||||
byR0NUjyM8iKeHKnSwQwfjuUZkhDd/mVem0RX7GaJJjTqCPYdsZUo1XqCjgHHNUr
|
||||
drx7FoUMUz6Jr9fsYhVL5huDflsQbAFx5JoHY2xQ1ZEahYbV5dZp2Np0s3JsF7rf
|
||||
/WtvUYxg/Mk+8coroMi8OPE/+2PUxxFVyyheNjMIYAvMMQxb3+NowNL8lpz8ZmQa
|
||||
mlWgxDp4d9h+DQWyL+vyJKpqH9azKjlBLsDhPpD/gS7wzyfsuLfePC2rkhrt8zbF
|
||||
cDPX0B81AgMBAAECggEBALuDLbPmiQMABsziLBuXfick6E2QlcBtmM1YyLsC3qon
|
||||
00orDQhCev7ok3VHmqHZAwvc2ejYq6k/28PPWIWQBvbEdmFEThvJ0RGDZyjUtWaj
|
||||
QQm184JtY8kIuroZ4ZcPRSIswdZ5HDHYNIQpWQBzXGWu21W9z6Y6U6g7YASzlqNs
|
||||
DZ3fLXxSRi+r2/TN/gQTFhygvseeTOI76ULiSsB7gocQxpp5tLtBznXqEu74OWoR
|
||||
wH+cwvrxaNnx+zGIJsIGYpaJSZmOvkgAJQ6GTGT65l71O/DX2syOsMFI1k5y7Gjb
|
||||
9jOIivtjbzfP4qFBRKpH2jI56o7/SFenzNe/Iv9DVUECgYEA9Bt0LxUuEEdpjwea
|
||||
+WM1DcLIRuls85S+sSwe72t4mw22b2H7Ta0iP3YXQ2DN+duzXWxsfr2N0XGUDuw3
|
||||
n+WhHqLTA21WFBTdorr0FvgeHPRRnlHS7kjD4AMZS4/wlMhc571fZc2KrJfL/gIr
|
||||
htWbLudaI7b4ZNm8oZtjKsh2jXECgYEA8TiS/MGm05xuq1Gucp/YkUNkEVhpjZeI
|
||||
0m7DHxaOrE322v2HnhyvlZDR+gioStS/EjLbaJ8eJlbjMVmRlrGvIhbzUM77unhF
|
||||
hQLFvEYNEMuUUbVqb3qqJOD+HnO3KDdXTSguhhTuoRxkpbPSrZ9Y5BEAWMDlLBsG
|
||||
sq6+j173HAUCgYBFtFk24Jtotpuj5g4QzI1nwokiBqG/5GeXe/vRbiTgUcgYgiga
|
||||
hCfVa0k1Sj1G7b+IG9/XSRVoC0C2CinQFOgvMVuEDQKZdWPchfoRXQRsTC/KP581
|
||||
v71/CCN++jk+owA0hFTrYwgIRMhRXhlDxVcsy49nx2WilrJQi2iD3P5NYQKBgQDA
|
||||
rh0TEqhsbY8k/5jl7HK0De2XwVSHClz7IghwA7exQJGHeW5jyKwkP0rKezHanDeH
|
||||
lOIXnsoZe9v8ZnxZr9Kh20095ifDWiDFz2IdMqNrIAJ4hf3f0E6qKKIztuC9mf79
|
||||
HbST25KFVMW8anhFwXviqQXq3yHv6iKeheCnawbd9QKBgQCuD0vgx+8/6sKpowx3
|
||||
n11zi1pPv3gEUmAW9ivL/xHHKZbymTZkjPHiRVv6ddlQiLigRnArvyQnhKCSwiVi
|
||||
T/G8hR2axKuEJw0Z6feKRj590ZN2OrbDgEXz45OOvMMktFY+wjJsa9Qouj4Od5br
|
||||
6mIaRJhf1EUlYdMKMJo2f2Te8w==
|
||||
-----END PRIVATE KEY-----
|
||||
9
config/plugin/yzh52521/jwt_key/public.key
Normal file
9
config/plugin/yzh52521/jwt_key/public.key
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5gPKimkt/gCJI7diLHRU
|
||||
MPJCh1QEZNmjwcZFd6iIaWhab7P7gwOTZBlUf7hRRbEgDhseiQrHWUUL+28kdDVI
|
||||
8jPIinhyp0sEMH47lGZIQ3f5lXptEV+xmiSY06gj2HbGVKNV6go4BxzVK3a8exaF
|
||||
DFM+ia/X7GIVS+Ybg35bEGwBceSaB2NsUNWRGoWG1eXWadjadLNybBe63/1rb1GM
|
||||
YPzJPvHKK6DIvDjxP/tj1McRVcsoXjYzCGALzDEMW9/jaMDS/Jac/GZkGppVoMQ6
|
||||
eHfYfg0Fsi/r8iSqah/Wsyo5QS7A4T6Q/4Eu8M8n7Li33jwtq5Ia7fM2xXAz19Af
|
||||
NQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
30
config/plugin/yzh52521/lock/app.php
Normal file
30
config/plugin/yzh52521/lock/app.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Lock\Store\FlockStore;
|
||||
use Symfony\Component\Lock\Store\RedisStore;
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'storage' => 'redis', // file/redis, 建议使用 redis,file 不支持 ttl
|
||||
'storage_configs' => [
|
||||
'file' => [
|
||||
'class' => FlockStore::class,
|
||||
'construct' => [
|
||||
'lockPath' => runtime_path() . '/lock',
|
||||
],
|
||||
],
|
||||
'redis' => [
|
||||
'class' => RedisStore::class,
|
||||
'construct' => function () {
|
||||
return [
|
||||
'redis' => \support\Redis::connection('default')->client(),
|
||||
];
|
||||
},
|
||||
],
|
||||
],
|
||||
'default_config' => [
|
||||
'ttl' => 300, // 默认锁超时时间
|
||||
'auto_release' => true, // 是否自动释放,建议设置为 true
|
||||
'prefix' => 'lock_', // 锁前缀
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user