初始化-安装依赖

This commit is contained in:
2026-03-03 10:06:12 +08:00
parent 3f349a35a4
commit ec8cac4221
187 changed files with 26292 additions and 0 deletions

View 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,
],
];

View 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',
],
],
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'enable' => true,
];

View 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
]
];

View 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
',
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'enable' => true,
];

View 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,
];

View File

@@ -0,0 +1,7 @@
<?php
use Webman\Event\EventListCommand;
return [
EventListCommand::class
];