初始化-安装依赖
This commit is contained in:
83
server/config/plugin/tinywan/jwt/app.php
Normal file
83
server/config/plugin/tinywan/jwt/app.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'jwt' => [
|
||||
/** 算法类型 HS256、HS384、HS512、RS256、RS384、RS512、ES256、ES384、ES512、PS256、PS384、PS512 */
|
||||
'algorithms' => 'HS256',
|
||||
|
||||
/** access令牌秘钥(安装时自动生成64位随机值) */
|
||||
'access_secret_key' => 'd7d2058d654799bfdf290fb91757681793e6549effc2e41c6e7dafe3ecfcbc8a',
|
||||
|
||||
/** access令牌过期时间,单位:秒。默认 2 小时 */
|
||||
'access_exp' => 7200,
|
||||
|
||||
/** refresh令牌秘钥(安装时自动生成64位随机值) */
|
||||
'refresh_secret_key' => 'f02fc466bd03a133fa8f30bd58f302f4ea706c41eff521b6319a8af099b11e64',
|
||||
|
||||
/** refresh令牌过期时间,单位:秒。默认 7 天 */
|
||||
'refresh_exp' => 604800,
|
||||
|
||||
/** refresh 令牌是否禁用,默认不禁用 false */
|
||||
'refresh_disable' => false,
|
||||
|
||||
/** 令牌签发者 */
|
||||
'iss' => 'webman.tinywan.cn',
|
||||
|
||||
/** 某个时间点后才能访问,单位秒。(如:30 表示当前时间30秒后才能使用) */
|
||||
'nbf' => 0,
|
||||
|
||||
/** 时钟偏差冗余时间,单位秒。建议这个余地应该不大于几分钟 */
|
||||
'leeway' => 60,
|
||||
|
||||
/** 是否允许单设备登录,默认不允许 false */
|
||||
'is_single_device' => false,
|
||||
|
||||
/** 缓存令牌时间,单位:秒。默认 7 天 */
|
||||
'cache_token_ttl' => 604800,
|
||||
|
||||
/** 缓存令牌前缀,默认 JWT:TOKEN: */
|
||||
'cache_token_pre' => 'JWT:TOKEN:',
|
||||
|
||||
/** 缓存刷新令牌前缀,默认 JWT:REFRESH_TOKEN: */
|
||||
'cache_refresh_token_pre' => 'JWT:REFRESH_TOKEN:',
|
||||
|
||||
/** 用户信息模型 */
|
||||
'user_model' => function ($uid) {
|
||||
return [];
|
||||
},
|
||||
|
||||
/** 是否支持 get 请求获取令牌 */
|
||||
'is_support_get_token' => false,
|
||||
/** GET 请求获取令牌请求key */
|
||||
'is_support_get_token_key' => 'authorization',
|
||||
|
||||
/** 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,
|
||||
],
|
||||
];
|
||||
76
server/config/plugin/tinywan/storage/app.php
Normal file
76
server/config/plugin/tinywan/storage/app.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @desc app.php 描述信息
|
||||
*
|
||||
* @author Tinywan(ShaoBo Wan)
|
||||
* @date 2022/3/10 19:46
|
||||
*/
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'storage' => [
|
||||
'default' => 'local', // local:本地 oss:阿里云 cos:腾讯云 qos:七牛云
|
||||
'single_limit' => 1024 * 1024 * 200, // 单个文件的大小限制,默认200M 1024 * 1024 * 200
|
||||
'total_limit' => 1024 * 1024 * 200, // 所有文件的大小限制,默认200M 1024 * 1024 * 200
|
||||
'nums' => 10, // 文件数量限制,默认10
|
||||
'include' => [], // 被允许的文件类型列表
|
||||
'exclude' => [], // 不被允许的文件类型列表
|
||||
// 本地对象存储
|
||||
'local' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\LocalAdapter::class,
|
||||
'root' => runtime_path().'/storage',
|
||||
'dirname' => function () {
|
||||
return date('Ymd');
|
||||
},
|
||||
'domain' => 'http://127.0.0.1:8787',
|
||||
'uri' => '/runtime', // 如果 domain + uri 不在 public 目录下,请做好软链接,否则生成的url无法访问
|
||||
'algo' => 'sha1',
|
||||
],
|
||||
// 阿里云对象存储
|
||||
'oss' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\OssAdapter::class,
|
||||
'accessKeyId' => 'xxxxxxxxxxxx',
|
||||
'accessKeySecret' => 'xxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman',
|
||||
'dirname' => function () {
|
||||
return 'storage';
|
||||
},
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
'endpoint' => 'oss-cn-hangzhou.aliyuncs.com',
|
||||
'algo' => 'sha1',
|
||||
],
|
||||
// 腾讯云对象存储
|
||||
'cos' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\CosAdapter::class,
|
||||
'secretId' => 'xxxxxxxxxxxxx',
|
||||
'secretKey' => 'xxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman-xxxxxxxxx',
|
||||
'dirname' => 'storage',
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
'region' => 'ap-shanghai',
|
||||
],
|
||||
// 七牛云对象存储
|
||||
'qiniu' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\QiniuAdapter::class,
|
||||
'accessKey' => 'xxxxxxxxxxxxx',
|
||||
'secretKey' => 'xxxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman',
|
||||
'dirname' => 'storage',
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
],
|
||||
// aws
|
||||
's3' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\S3Adapter::class,
|
||||
'key' => 'xxxxxxxxxxxxx',
|
||||
'secret' => 'xxxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman',
|
||||
'dirname' => 'storage',
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
'region' => 'S3_REGION',
|
||||
'version' => 'latest',
|
||||
'use_path_style_endpoint' => true,
|
||||
'endpoint' => 'S3_ENDPOINT',
|
||||
'acl' => 'public-read',
|
||||
],
|
||||
],
|
||||
];
|
||||
4
server/config/plugin/webman/channel/app.php
Normal file
4
server/config/plugin/webman/channel/app.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
];
|
||||
27
server/config/plugin/webman/channel/process.php
Normal file
27
server/config/plugin/webman/channel/process.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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\Channel\Server;
|
||||
use Workerman\Protocols\Frame;
|
||||
|
||||
return [
|
||||
'server' => [
|
||||
'listen' => 'frame://0.0.0.0:2206',
|
||||
'protocol' => Frame::class,
|
||||
'handler' => Server::class,
|
||||
'reloadable' => false,
|
||||
'count' => 1, // 必须是1
|
||||
]
|
||||
];
|
||||
28
server/config/plugin/webman/console/app.php
Normal file
28
server/config/plugin/webman/console/app.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
|
||||
'build_dir' => BASE_PATH . DIRECTORY_SEPARATOR . 'build',
|
||||
|
||||
'phar_filename' => 'webman.phar',
|
||||
|
||||
'phar_format' => Phar::PHAR, // Phar archive format: Phar::PHAR, Phar::TAR, Phar::ZIP
|
||||
|
||||
'phar_compression' => Phar::NONE, // Compression method for Phar archive: Phar::NONE, Phar::GZ, Phar::BZ2
|
||||
|
||||
'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'
|
||||
],
|
||||
|
||||
'custom_ini' => '
|
||||
memory_limit = 256M
|
||||
',
|
||||
];
|
||||
4
server/config/plugin/webman/event/app.php
Normal file
4
server/config/plugin/webman/event/app.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
];
|
||||
17
server/config/plugin/webman/event/bootstrap.php
Normal file
17
server/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
server/config/plugin/webman/event/command.php
Normal file
7
server/config/plugin/webman/event/command.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Webman\Event\EventListCommand;
|
||||
|
||||
return [
|
||||
EventListCommand::class
|
||||
];
|
||||
Reference in New Issue
Block a user