1.修复上传漏洞和SQL注入漏洞-修复服务端无法启动的问题

This commit is contained in:
2026-06-24 10:24:59 +08:00
parent 60f30d8381
commit 546d350f3a
4 changed files with 153 additions and 35 deletions

View File

@@ -16,14 +16,20 @@ use support\Log;
use support\Request;
use app\process\Http;
use app\process\AngpowImportJobs;
use app\process\PlayxJobs;
global $argv;
return [
$workerCount = env('WEBMAN_WORKER_COUNT', '');
if ($workerCount === '' || $workerCount === null) {
$workerCount = max(4, cpu_count() * 4);
}
$process = [
'webman' => [
'handler' => Http::class,
'listen' => 'http://0.0.0.0:6969',
'count' => cpu_count() * 4,
'count' => (int) $workerCount,
'user' => '',
'group' => '',
'reusePort' => false,
@@ -36,12 +42,10 @@ return [
'publicPath' => public_path()
]
],
// File update detection and automatic reload
'monitor' => [
'handler' => app\process\Monitor::class,
'reloadable' => false,
'constructor' => [
// Monitor these directories
'monitorDir' => array_merge([
app_path(),
config_path(),
@@ -49,26 +53,28 @@ return [
base_path() . '/support',
base_path() . '/resource',
base_path() . '/.env',
], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
// Files with these suffixes will be monitored
], glob(base_path() . '/plugin/*/app') ?: [], glob(base_path() . '/plugin/*/config') ?: [], glob(base_path() . '/plugin/*/api') ?: []),
'monitorExtensions' => [
'php', 'html', 'htm', 'env'
],
'options' => [
'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
'enable_file_monitor' => !in_array('-d', $argv ?? []) && DIRECTORY_SEPARATOR === '/',
'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
]
]
]
,
// PlayX 闭环任务:轮询交易终态/失败重试
'playx_jobs' => [
'handler' => app\process\PlayxJobs::class,
'reloadable' => false,
],
// Angpow 导入推送任务:订单兑换后推送到对方平台
'angpow_import_jobs' => [
'handler' => AngpowImportJobs::class,
'reloadable' => false,
],
];
$disableBackgroundJobs = filter_var(env('PLAYX_DISABLE_BACKGROUND_JOBS', '0'), FILTER_VALIDATE_BOOLEAN);
if (!$disableBackgroundJobs) {
$process['playx_jobs'] = [
'handler' => PlayxJobs::class,
'reloadable' => false,
];
$process['angpow_import_jobs'] = [
'handler' => AngpowImportJobs::class,
'reloadable' => false,
];
}
return $process;