diff --git a/.gitignore b/.gitignore index b5c0310..fa48c81 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,14 @@ QWEN.md data/ +# 虚拟环境(用户自行创建) +.venv/ +venv/ +env/ +*.egg-info/ +dist/ +build/ + # 日志 logs/ *.log @@ -11,4 +19,4 @@ data/signature-verifier/keys/private/ # 签名文件(可选,本地开发可能不需要) # store/**/SIGNATURE -.codebuddy/ \ No newline at end of file +.clinerules \ No newline at end of file diff --git a/.pid b/.pid new file mode 100644 index 0000000..1447442 --- /dev/null +++ b/.pid @@ -0,0 +1 @@ +18490 diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..de82293 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,287 @@ +[MASTER] +jobs=4 +persistent=yes +rcfile= +load-plugins= +extension-pkg-whitelist= +ignore-patterns=^test_.*\.py$ +ignore=CVS +output-format=colorized +reports=yes +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +score=yes +fail-under=7.0 + +[MESSAGES CONTROL] +disable=all +enable= + missing-docstring, + empty-docstring, + invalid-name, + too-few-public-methods, + too-many-arguments, + too-many-instance-attributes, + too-many-locals, + too-many-public-methods, + too-many-statements, + redefined-builtin, + redefined-outer-name, + unused-argument, + unused-import, + unused-variable, + unused-wildcard-import, + wrong-import-order, + wrong-import-position, + import-error, + no-name-in-module, + no-member, + no-self-use, + not-callable, + undefined-variable, + used-before-assignment, + broad-except, + bare-except, + try-except-raise, + duplicate-code, + fixme, + trailing-whitespace, + bad-whitespace, + line-too-long, + missing-final-newline, + mixed-line-endings, + bad-continuation, + trailing-newlines, + multiple-statements, + anomalous-backslash-in-string, + deprecated-module, + deprecated-method, + super-with-arguments, + raise-missing-from, + consider-using-f-string, + consider-using-with, + use-implicit-booleaness-not-comparison, + use-list-literal, + use-dict-literal, + consider-using-enumerate, + consider-iterating-dictionary, + consider-using-set-comprehension, + consider-using-generator, + consider-using-any-or-all, + consider-using-in, + consider-using-max-builtin, + consider-using-min-builtin, + consider-using-sum, + consider-merging-isinstance, + chained-comparison, + simplifiable-if-expression, + unnecessary-lambda, + unnecessary-comprehension, + unnecessary-dunder-call, + unnecessary-pass, + unnecessary-ellipsis, + useless-else-on-loop, + useless-return, + useless-object-inheritance, + useless-suppression, + wrong-spelling-in-comment, + wrong-spelling-in-docstring + +[REPORTS] +output-format=text +files-output=no +reports=yes +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +score=yes + +[REFACTORING] +max-nested-blocks=5 +max-line-length=88 +max-module-lines=1000 +max-statements=50 +max-args=5 +max-locals=15 +max-returns=6 +max-branches=12 +max-statements-in-a-loop=20 +max-public-methods=20 +max-attributes=7 +max-parents=7 +max-bool-expr=5 + +[BASIC] +good-names=i, + j, + k, + ex, + Run, + _, + __, + fd, + msg, + v, + var, + x, + y, + z, + ax, + fig, + plt, + df, + idx, + cnt, + doc, + env, + app, + req, + res, + cls, + self, + mcs, + obj, + mod, + pkgs, + pkg, + cfg, + conf, + config, + opts, + args, + kwargs, + logger, + log +bad-names=foo, + bar, + baz, + toto, + tutu, + tata +docstring-min-length=-1 + +[FORMAT] +max-line-length=88 +ignore-long-lines=^\\s*(# )??$ +single-line-if-stmt=no +single-line-class-stmt=no +max-module-lines=1000 +indent-string=' ' + +[SIMILARITIES] +min-similarity-lines=4 +ignore-comments=yes +ignore-docstrings=yes +ignore-imports=no + +[TYPECHECK] +ignored-modules= +ignored-classes=optparse.Values,thread._local,_thread._local +generated-members=REQUEST,acl_users,aq_parent +contextmanager-decorators=contextlib.contextmanager +missing-member-hint=yes +missing-member-hint-distance=1 +missing-member-max-choices=1 +missing-member-local-gt=2 +ignore-on-opaque-inference=yes +ignored-checks-for-mixins= +signature-mutators= +ignore-mixin-members=yes +ignore-none=yes +ignored-parents= +ignore-erase=no +ignore-import-error=yes +ignore-missing-imports=yes +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ +additional-builtins= + +[VARIABLES] +additional-builtins= +init-import=no +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ +callbacks=cb_,_cb +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io +allow-global-unused-variables=no + +[LOGGING] +logging-modules=logging + +[MISCELLANEOUS] +notes=FIXME, + XXX, + TODO, + HACK, + BUG, + NOTE, + OPTIMIZE, + REVIEW, + WARNING, + DEPRECATED +max-string-length=100 + +[DESIGN] +max-args=5 +max-locals=15 +max-returns=6 +max-branches=12 +max-statements=50 +max-parents=7 +max-attributes=7 +min-public-methods=2 +max-public-methods=20 + +[IMPORTS] +deprecated-modules= +import-graph= +ext-import-graph= +int-import-graph= +known-standard-library= +known-third-party= +known-local-folder= +preferred-modules= +allow-wildcard-with-all=no +allow-any-import-level=no +allow-relative-imports=yes +allow-from-import-under-package=yes +allow-import-from-same-module=no +allow-import-from-package=yes +allow-unused-imports=no +allow-cyclic-import=no +cyclic-import-limit=10 +ignore-imports=no +ignore-import-error=yes +ignore-missing-imports=yes +preferred-modules= +single-line-exceptions=no + +[EXCEPTIONS] +overgeneral-exceptions=Exception,BaseException,StandardError,ArithmeticError,LookupError,EnvironmentError,EOFError,ImportError +ignore-on-exception=no + +[CLASSES] +defining-attr-methods=__init__, + __new__, + setUp, + __post_init__ +valid-classmethod-first-arg=cls +valid-metaclass-classmethod-first-arg=mcs +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make +bad-dunder-names=__authors__, + __version__, + __date__, + __credits__, + __status__, + __maintainer__, + __email__, + __contact__, + __copyright__, + __license__, + __uri__, + __url__, + __program__, + __description__, + __build__ + +[STRING] +check-str-concat-over-line-jumps=no diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2e467d5 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,188 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "FutureOSS: 启动服务", + "type": "python", + "request": "launch", + "module": "oss.cli", + "args": ["serve"], + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 调试模式启动", + "type": "python", + "request": "launch", + "module": "oss.cli", + "args": ["serve", "--debug"], + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1", + "LOG_LEVEL": "DEBUG" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 运行测试", + "type": "python", + "request": "launch", + "module": "pytest", + "args": [ + "-v", + "--tb=short", + "--cov=oss", + "--cov-report=html", + "--cov-report=term" + ], + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 调试插件加载器", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/oss/plugin/loader.py", + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 调试日志终端插件", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/store/@{FutureOSS}/log-terminal/main.py", + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 调试WebUI", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/store/@{FutureOSS}/webui/main.py", + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 调试HTTP API", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/store/@{FutureOSS}/http-api/main.py", + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 调试WS API", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/store/@{FutureOSS}/ws-api/main.py", + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 调试特定文件", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + }, + { + "name": "FutureOSS: 附加到进程", + "type": "python", + "request": "attach", + "processId": "${command:pickProcess}", + "host": "localhost", + "port": 5678, + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "." + } + ], + "justMyCode": false + }, + { + "name": "FutureOSS: 运行CLI命令", + "type": "python", + "request": "launch", + "module": "oss.cli", + "args": ["${input:cliCommand}"], + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "cwd": "${workspaceFolder}", + "python": "${command:python.interpreterPath}" + } + ], + "inputs": [ + { + "id": "cliCommand", + "type": "promptString", + "description": "输入要执行的CLI命令(如:install, uninstall, list等)", + "default": "help" + } + ], + "compounds": [ + { + "name": "FutureOSS: 完整调试环境", + "configurations": [ + "FutureOSS: 启动服务", + "FutureOSS: 调试日志终端插件" + ], + "stopAll": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f071da5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,153 @@ +{ + "python.defaultInterpreterPath": "/usr/bin/python3", + "python.terminal.activateEnvironment": true, + "python.terminal.activateEnvInCurrentTerminal": true, + "python.analysis.extraPaths": [ + "${workspaceFolder}", + "${workspaceFolder}/oss", + "${workspaceFolder}/store/@{FutureOSS}" + ], + "python.analysis.typeCheckingMode": "basic", + "python.analysis.autoImportCompletions": true, + "python.linting.enabled": true, + "python.linting.pylintEnabled": true, + "python.linting.pylintPath": "pylint", + "python.linting.pylintArgs": [ + "--rcfile=${workspaceFolder}/.pylintrc" + ], + "python.formatting.provider": "black", + "python.formatting.blackPath": "black", + "python.formatting.blackArgs": [ + "--line-length=88" + ], + "python.testing.pytestEnabled": true, + "python.testing.unittestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.pytestPath": "pytest", + "python.testing.pytestArgs": [ + "-v", + "--tb=short", + "--cov=oss", + "--cov-report=html", + "--cov-report=term" + ], + "python.testing.cwd": "${workspaceFolder}", + "debug.internalConsoleOptions": "neverOpen", + "debug.javascript.usePreview": true, + "debug.onTaskErrors": "showErrors", + "debug.openDebug": "openOnDebugBreak", + "debug.openExplorerOnEnd": false, + "debug.saveBeforeStart": "allEditorsInActiveGroup", + "debug.showInStatusBar": "always", + "debug.toolBarLocation": "floating", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" + }, + "files.exclude": { + "**/__pycache__": true, + "**/.pytest_cache": true, + "**/.coverage": true, + "**/.mypy_cache": true, + "**/.ruff_cache": true, + "**/*.pyc": true, + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + "**/node_modules": true + }, + "files.watcherExclude": { + "**/__pycache__/**": true, + "**/.pytest_cache/**": true, + "**/.git/**": true, + "**/node_modules/**": true, + "**/.venv/**": true + }, + "search.exclude": { + "**/__pycache__": true, + "**/.pytest_cache": true, + "**/.git": true, + "**/node_modules": true, + "**/.venv": true + }, + "terminal.integrated.env.linux": { + "PYTHONPATH": "${workspaceFolder}", + "PYTHONUNBUFFERED": "1" + }, + "terminal.integrated.defaultProfile.linux": "bash", + "terminal.integrated.profiles.linux": { + "bash": { + "path": "bash", + "icon": "terminal-bash" + }, + "zsh": { + "path": "zsh" + }, + "fish": { + "path": "fish" + }, + "tmux": { + "path": "tmux", + "icon": "terminal-tmux" + }, + "pwsh": { + "path": "pwsh", + "icon": "terminal-powershell" + } + }, + "task.problemMatchers.neverPrompt": true, + "task.autoDetect": "on", + "task.saveBeforeRun": "always", + "explorer.autoReveal": true, + "explorer.compactFolders": false, + "explorer.confirmDelete": true, + "explorer.confirmDragAndDrop": false, + "workbench.editor.enablePreview": false, + "workbench.editor.enablePreviewFromQuickOpen": false, + "workbench.startupEditor": "none", + "workbench.colorTheme": "Default Dark Modern", + "workbench.iconTheme": "vs-seti", + "breadcrumbs.enabled": true, + "editor.minimap.enabled": true, + "editor.renderWhitespace": "boundary", + "editor.rulers": [ + 88 + ], + "editor.wordWrap": "on", + "editor.suggestSelection": "first", + "editor.quickSuggestions": { + "strings": true + }, + "editor.acceptSuggestionOnEnter": "smart", + "editor.suggest.showClasses": true, + "editor.suggest.showColors": true, + "editor.suggest.showConstants": true, + "editor.suggest.showConstructors": true, + "editor.suggest.showCustomcolors": true, + "editor.suggest.showDeprecated": true, + "editor.suggest.showEnumMembers": true, + "editor.suggest.showEvents": true, + "editor.suggest.showFields": true, + "editor.suggest.showFiles": true, + "editor.suggest.showFolders": true, + "editor.suggest.showFunctions": true, + "editor.suggest.showInterfaces": true, + "editor.suggest.showIssues": true, + "editor.suggest.showKeywords": true, + "editor.suggest.showMethods": true, + "editor.suggest.showModules": true, + "editor.suggest.showOperators": true, + "editor.suggest.showProperties": true, + "editor.suggest.showReferences": true, + "editor.suggest.showSnippets": true, + "editor.suggest.showStructs": true, + "editor.suggest.showTypeParameters": true, + "editor.suggest.showUnits": true, + "editor.suggest.showUsers": true, + "editor.suggest.showValues": true, + "editor.suggest.showVariables": true, + "editor.suggest.showWords": true +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..fac1aca --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,219 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "FutureOSS: 安装依赖", + "type": "shell", + "command": "pip install -r requirements.txt", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 启动开发服务器", + "type": "shell", + "command": "python -m oss.cli serve", + "group": "none", + "isBackground": true, + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "dedicated", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [ + { + "pattern": [ + { + "regexp": ".", + "file": 1, + "location": 2, + "message": 3 + } + ], + "background": { + "activeOnStart": true, + "beginsPattern": ".*启动 FutureOSS 服务.*", + "endsPattern": ".*服务已启动.*" + } + } + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 运行测试", + "type": "shell", + "command": "pytest -v --tb=short", + "group": "test", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [ + { + "owner": "python", + "fileLocation": ["relative", "${workspaceFolder}"], + "pattern": [ + { + "regexp": "^test_(.*)\\.py::(.*) (PASSED|FAILED|ERROR)$", + "file": 1, + "location": 2, + "severity": 3 + } + ] + } + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 代码检查", + "type": "shell", + "command": "python -m pylint oss/ store/@{FutureOSS}/ --rcfile=${workspaceFolder}/.pylintrc || echo 'Pylint检查完成'", + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [ + { + "owner": "python", + "fileLocation": ["relative", "${workspaceFolder}"], + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+): (\\w+): (.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 格式化代码", + "type": "shell", + "command": "python -m black oss/ store/@{FutureOSS}/", + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 清理缓存文件", + "type": "shell", + "command": "find . -type f -name '*.pyc' -delete && find . -type d -name '__pycache__' -delete && find . -type f -name '.pid' -delete", + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 查看服务状态", + "type": "shell", + "command": "if [ -f .pid ]; then echo '服务正在运行,PID: ' && cat .pid; else echo '服务未运行'; fi", + "group": "none", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "new", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 停止服务", + "type": "shell", + "command": "if [ -f .pid ]; then kill $(cat .pid) && rm -f .pid && echo '服务已停止'; else echo '服务未运行'; fi", + "group": "none", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "new", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "FutureOSS: 重启服务", + "type": "shell", + "dependsOrder": "sequence", + "dependsOn": [ + "FutureOSS: 停止服务", + "FutureOSS: 启动开发服务器" + ], + "group": "none", + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "dedicated", + "showReuseMessage": true, + "clear": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + } + } + ] +} diff --git a/oss/__pycache__/__init__.cpython-313.pyc b/oss/__pycache__/__init__.cpython-313.pyc index 41fd71b..6d77e06 100644 Binary files a/oss/__pycache__/__init__.cpython-313.pyc and b/oss/__pycache__/__init__.cpython-313.pyc differ diff --git a/oss/__pycache__/cli.cpython-313.pyc b/oss/__pycache__/cli.cpython-313.pyc index 226dafc..8d42fc8 100644 Binary files a/oss/__pycache__/cli.cpython-313.pyc and b/oss/__pycache__/cli.cpython-313.pyc differ diff --git a/oss/logger/__pycache__/logger.cpython-313.pyc b/oss/logger/__pycache__/logger.cpython-313.pyc index 05d73c1..f9982f6 100644 Binary files a/oss/logger/__pycache__/logger.cpython-313.pyc and b/oss/logger/__pycache__/logger.cpython-313.pyc differ diff --git a/oss/plugin/__pycache__/capabilities.cpython-313.pyc b/oss/plugin/__pycache__/capabilities.cpython-313.pyc index 57ec4d6..c3efc93 100644 Binary files a/oss/plugin/__pycache__/capabilities.cpython-313.pyc and b/oss/plugin/__pycache__/capabilities.cpython-313.pyc differ diff --git a/oss/plugin/__pycache__/loader.cpython-313.pyc b/oss/plugin/__pycache__/loader.cpython-313.pyc index 3a9d223..87be3c2 100644 Binary files a/oss/plugin/__pycache__/loader.cpython-313.pyc and b/oss/plugin/__pycache__/loader.cpython-313.pyc differ diff --git a/oss/plugin/__pycache__/manager.cpython-313.pyc b/oss/plugin/__pycache__/manager.cpython-313.pyc index 111db9f..31b8ea7 100644 Binary files a/oss/plugin/__pycache__/manager.cpython-313.pyc and b/oss/plugin/__pycache__/manager.cpython-313.pyc differ diff --git a/oss/plugin/__pycache__/types.cpython-313.pyc b/oss/plugin/__pycache__/types.cpython-313.pyc index 58cf0a8..63fbf09 100644 Binary files a/oss/plugin/__pycache__/types.cpython-313.pyc and b/oss/plugin/__pycache__/types.cpython-313.pyc differ diff --git a/oss/shared/__pycache__/__init__.cpython-313.pyc b/oss/shared/__pycache__/__init__.cpython-313.pyc index b56aad0..9455fb8 100644 Binary files a/oss/shared/__pycache__/__init__.cpython-313.pyc and b/oss/shared/__pycache__/__init__.cpython-313.pyc differ diff --git a/oss/shared/__pycache__/router.cpython-313.pyc b/oss/shared/__pycache__/router.cpython-313.pyc index 44b71fa..e52de12 100644 Binary files a/oss/shared/__pycache__/router.cpython-313.pyc and b/oss/shared/__pycache__/router.cpython-313.pyc differ diff --git a/start.bat b/start.bat index ff086f7..d48e5c5 100644 --- a/start.bat +++ b/start.bat @@ -1,56 +1,31 @@ @echo off -chcp 65001 >nul 2>&1 setlocal enabledelayedexpansion -:: ═══════════════════════════════════════════════════════════ -:: FutureOSS 智能启动脚本 - Windows -:: 自动检测环境 / 安装依赖 / 进度显示 / 守护重启 -:: ═══════════════════════════════════════════════════════════ - +:: FutureOSS Smart Startup Script - Windows cd /d "%~dp0" -:: ── 处理命令行参数 ── +:: Handle command line parameters if "%1"=="--help" goto :show_help if "%1"=="-h" goto :show_help if "%1"=="--version" goto :show_version if "%1"=="-v" goto :show_version -:: ── 颜色代码 ── -for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( - set "DEL=%%a" -) - -:: ── 工具函数 ── -call :colorEcho 0B "[信息] 环境检测中..." -call :colorEcho 0A "[成功] 检测完成" -call :colorEcho 0E "[警告] 某些组件缺失" -call :colorEcho 0C "[错误] 检测失败" - -:: ── Logo ── echo. -call :colorEcho 0B " ███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ " -call :colorEcho 0B " ██╔════╝ ██╔══██╗ ██╔══██╗ ██╔══██╗ ██╔══██╗██╔════╝ " -call :colorEcho 0B " █████╗ ██████╔╝ ██████╔╝ ██████╔╝ ██║ ██║██║ ███╗" -call :colorEcho 0B " ██╔══╝ ██╔══██╗ ██╔══██╗ ██╔══██╗ ██║ ██║██║ ██║" -call :colorEcho 0B " ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██████╔╝╚██████╔╝" -call :colorEcho 0B " ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ " -echo. -call :colorEcho 0F " 开发者通用工具套组 · 一切皆为插件" -call :colorEcho 07 " https://gitee.com/starlight-apk/feature-oss" +echo ======================================== +echo FutureOSS Startup Script - Windows +echo ======================================== echo. -:: ── 检查是否已有实例在运行 ── +:: Check if an instance is already running call :check_pid if %errorlevel% neq 0 ( - call :colorEcho 0C "[错误] 检测到已有实例在运行,请先停止" + echo [ERROR] An instance is already running, please stop it first pause exit /b 1 ) -:: ═══════════════════════════════════════════════════════════ -:: 1. 检测 Python -:: ═══════════════════════════════════════════════════════════ -call :colorEcho 0B "[信息] 检测 Python..." +:: 1. Detect Python +echo [INFO] Detecting Python... set "PYTHON_CMD=" for %%p in (python python3 py py3) do ( @@ -63,47 +38,43 @@ for %%p in (python python3 py py3) do ( :found_python if "%PYTHON_CMD%"=="" ( - call :colorEcho 0C "[错误] 未找到 Python,请先安装 Python 3.10+" - call :colorEcho 0E "[提示] 下载地址: https://www.python.org/downloads/" + echo [ERROR] Python not found, please install Python 3.10+ + echo [TIP] Download from: https://www.python.org/downloads/ pause exit /b 1 ) for /f "tokens=*" %%i in ('%PYTHON_CMD% --version 2^>^&1') do set "PY_VER=%%i" -call :colorEcho 0A "[成功] %PY_VER%" +echo [SUCCESS] %PY_VER% -:: 显示系统信息 -call :colorEcho 0B "[信息] 系统信息:" +:: Display system info +echo [INFO] System Information: echo OS: Windows -echo 工作目录: %CD% -echo 时间: %date% %time% +echo Working Directory: %CD% +echo Time: %date% %time% -:: ═══════════════════════════════════════════════════════════ -:: 2. 虚拟环境 -:: ═══════════════════════════════════════════════════════════ +:: 2. Virtual Environment echo. -call :colorEcho 0B "[信息] 配置 Python 环境..." +echo [INFO] Configuring Python environment... if not exist ".venv" ( - call :colorEcho 0E "[信息] 创建虚拟环境..." + echo [INFO] Creating virtual environment... %PYTHON_CMD% -m venv .venv >nul 2>&1 if errorlevel 1 ( - call :colorEcho 0C "[错误] 无法创建虚拟环境" + echo [ERROR] Cannot create virtual environment pause exit /b 1 ) - call :colorEcho 0A "[成功] 虚拟环境已创建" + echo [SUCCESS] Virtual environment created ) else ( - call :colorEcho 0A "[成功] 虚拟环境已存在" + echo [SUCCESS] Virtual environment exists ) call .venv\Scripts\activate.bat >nul 2>&1 -:: ═══════════════════════════════════════════════════════════ -:: 3. 安装依赖 -:: ═══════════════════════════════════════════════════════════ +:: 3. Install Dependencies echo. -call :colorEcho 0B "[信息] 安装 Python 依赖..." +echo [INFO] Installing Python dependencies... set "DEPS=click pyyaml websockets psutil cryptography" set "TOTAL=5" @@ -111,7 +82,7 @@ set "CURRENT=0" for %%d in (%DEPS%) do ( set /a CURRENT+=1 - call :printProgress !CURRENT! !TOTAL! "安装 %%d" + call :printProgress !CURRENT! !TOTAL! "Installing %%d" %PYTHON_CMD% -c "import %%d" 2>nul if errorlevel 1 ( @@ -120,40 +91,35 @@ for %%d in (%DEPS%) do ( ) echo. -echo. -call :colorEcho 0A "[成功] Python 依赖安装完成" +echo [SUCCESS] Python dependencies installed -:: 安装项目依赖 +:: Install project dependencies if exist "pyproject.toml" ( - call :colorEcho 0E "[信息] 安装项目配置依赖..." + echo [INFO] Installing project configuration dependencies... pip install -e . -q 2>nul ) if exist "requirements.txt" ( - call :colorEcho 0E "[信息] 安装 requirements.txt..." + echo [INFO] Installing requirements.txt... pip install -r requirements.txt -q 2>nul ) -:: ═══════════════════════════════════════════════════════════ -:: 4. 检查 PHP -:: ═══════════════════════════════════════════════════════════ +:: 4. Check PHP echo. -call :colorEcho 0B "[信息] 检查 PHP..." +echo [INFO] Checking PHP... where php >nul 2>&1 if errorlevel 1 ( - call :colorEcho 0E "[警告] PHP 未安装,WebUI 可能无法正常工作" - call :colorEcho 07 "[提示] 安装: choco install php 或从 https://windows.php.net/download/ 下载" + echo [WARNING] PHP not installed, WebUI may not work properly + echo [TIP] Install: choco install php or download from https://windows.php.net/download/ ) else ( for /f "tokens=*" %%i in ('php --version 2^>^&1 ^| findstr /r "PHP"') do set "PHP_VER=%%i" - call :colorEcho 0A "[成功] !PHP_VER!" + echo [SUCCESS] !PHP_VER! ) -:: ═══════════════════════════════════════════════════════════ -:: 5. 创建数据目录 -:: ═══════════════════════════════════════════════════════════ +:: 5. Create Data Directories echo. -call :colorEcho 0B "[信息] 初始化数据目录..." +echo [INFO] Initializing data directories... set "DIRS=data data\html-render data\web-toolkit data\plugin-storage data\DCIM data\pkg data\signature-verifier\keys\private data\signature-verifier\keys\public logs" @@ -161,30 +127,28 @@ for %%d in (%DIRS%) do ( if not exist "%%d" ( mkdir "%%d" >nul 2>&1 if errorlevel 1 ( - call :colorEcho 0C "[错误] 无法创建目录: %%d" + echo [ERROR] Cannot create directory: %%d ) ) ) -call :colorEcho 0A "[成功] 数据目录已就绪" +echo [SUCCESS] Data directories ready -:: ═══════════════════════════════════════════════════════════ -:: 6. 启动服务 -:: ═══════════════════════════════════════════════════════════ +:: 6. Start Service echo. -call :colorEcho 0B "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -call :colorEcho 0B " 启动 FutureOSS" -call :colorEcho 0B "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo ======================================== +echo Starting FutureOSS +echo ======================================== echo. -:: 创建 PID 文件 +:: Create PID file call :create_pid "!random!" if "%1"=="--daemon" goto :daemon_mode if "%1"=="-d" goto :daemon_mode -:: 前台模式 -call :colorEcho 0F "运行中... 按 Ctrl+C 停止" +:: Foreground mode +echo Running... Press Ctrl+C to stop echo. set "RESTART_DELAY=3" @@ -196,21 +160,21 @@ set "MAX_RESTARTS=10" set "EXIT_CODE=%errorlevel%" if %EXIT_CODE% equ 0 ( - call :colorEcho 0A "[成功] 服务正常退出" + echo [SUCCESS] Service exited normally goto :end ) -:: 检查是否超过最大重启次数 +:: Check if max restarts exceeded if %RESTART_COUNT% geq %MAX_RESTARTS% ( - call :colorEcho 0C "[错误] 达到最大重启次数 (%MAX_RESTARTS%),停止服务" + echo [ERROR] Reached maximum restart count (%MAX_RESTARTS%), stopping service goto :end ) set /a RESTART_COUNT+=1 -call :colorEcho 0E "[警告] 服务异常退出 (code: %EXIT_CODE%),!RESTART_DELAY!s 后重启... (第 !RESTART_COUNT!/%MAX_RESTARTS% 次)" +echo [WARNING] Service exited abnormally (code: %EXIT_CODE%), restarting in !RESTART_DELAY!s... (!RESTART_COUNT!/%MAX_RESTARTS%) timeout /t !RESTART_DELAY! /nobreak >nul -:: 指数退避 (最大 60 秒) +:: Exponential backoff (max 60 seconds) if !RESTART_DELAY! lss 60 ( set /a RESTART_DELAY=!RESTART_DELAY! * 2 if !RESTART_DELAY! gtr 60 set "RESTART_DELAY=60" @@ -219,10 +183,10 @@ if !RESTART_DELAY! lss 60 ( goto :loop :daemon_mode -call :colorEcho 0E "[警告] Windows 守护模式需要额外配置" -call :colorEcho 07 "[提示] 建议使用任务计划程序或 nssm 工具实现" +echo [WARNING] Windows daemon mode requires additional configuration +echo [TIP] Use Task Scheduler or nssm tool instead echo. -call :colorEcho 0B "[信息] 启动后台服务..." +echo [INFO] Starting background service... start /b %PYTHON_CMD% -m oss.cli serve > logs\daemon.log 2>&1 goto :end @@ -230,65 +194,41 @@ goto :end call :cleanup call .venv\Scripts\deactivate.bat >nul 2>&1 echo. -call :colorEcho 0B "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -call :colorEcho 0F " FutureOSS 已停止" -call :colorEcho 0B "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo ======================================== +echo FutureOSS Stopped +echo ======================================== pause exit /b 0 -:: ── 进度条函数 ── +:: Progress bar function :printProgress set /a "pct=%1 * 100 / %2" set /a "filled=pct / 2" set /a "empty=50-filled" set "bar=" -for /l %%i in (1,1,%filled%) do set "bar=!bar!█" -for /l %%i in (1,1,%empty%) do set "bar=!bar!░" +for /l %%i in (1,1,%filled%) do set "bar=!bar!#" +for /l %%i in (1,1,%empty%) do set "bar=!bar!-" echo [!bar!] !pct!%% - %3 exit /b 0 -:: ── 颜色输出函数 ── -:colorEcho -set "params=%1" -set "msg=%~2" -call :colorText %params% "%msg%" -exit /b 0 - -:colorText -nul 2>&1 exit /b %errorlevel% -:: ── 获取当前时间戳 ── +:: Get current timestamp :get_timestamp for /f "tokens=1-3 delims=/ " %%a in ('date /t') do set "T_DATE=%%c-%%a-%%b" for /f "tokens=1-3 delims=: " %%a in ('time /t') do set "T_TIME=%%a:%%b:%%c" set "TIMESTAMP=%T_DATE% %T_TIME%" exit /b 0 -:: ── 打印分隔线 ── +:: Print separator :print_separator -echo ═══════════════════════════════════════════════════════════ +echo ======================================== exit /b 0 -:: ── 打印带颜色的状态 ── -:print_status -set "status_type=%~1" -set "status_msg=%~2" -if "%status_type%"=="info" call :colorEcho 0B "[信息] %status_msg%" -if "%status_type%"=="success" call :colorEcho 0A "[成功] %status_msg%" -if "%status_type%"=="warn" call :colorEcho 0E "[警告] %status_msg%" -if "%status_type%"=="error" call :colorEcho 0C "[错误] %status_msg%" -exit /b 0 - -:: ── 健康检查 ── +:: Health check :health_check set "check_url=%~1" set "max_retries=%~2" @@ -299,33 +239,33 @@ set "retry_count=0" set /a retry_count+=1 curl -s "%check_url%" >nul 2>&1 if %errorlevel% equ 0 ( - call :colorEcho 0A "[健康检查] 服务已就绪" + echo [HEALTH CHECK] Service is ready exit /b 0 ) if %retry_count% geq %max_retries% ( - call :colorEcho 0C "[健康检查] 服务启动超时" + echo [HEALTH CHECK] Service startup timeout exit /b 1 ) timeout /t 1 /nobreak >nul goto :health_loop -:: ── 创建 PID 文件 ── +:: Create PID file :create_pid echo %~1 > .pid exit /b 0 -:: ── 删除 PID 文件 ── +:: Remove PID file :remove_pid if exist ".pid" del ".pid" exit /b 0 -:: ── 检查 PID 文件 ── +:: Check PID file :check_pid if exist ".pid" ( set /p PID=<.pid tasklist /fi "pid eq %PID%" 2>nul | find "%PID%" >nul if %errorlevel% equ 0 ( - call :colorEcho 0E "[警告] 服务已在运行 (PID: %PID%)" + echo [WARNING] Service already running (PID: %PID%) exit /b 1 ) else ( call :remove_pid @@ -333,34 +273,34 @@ if exist ".pid" ( ) exit /b 0 -:: ── 显示帮助信息 ── +:: Show help information :show_help echo. -call :colorEcho 0F "FutureOSS 启动脚本 - Windows 版本" +echo FutureOSS Startup Script - Windows Version echo. -echo 用法: start.bat [选项] +echo Usage: start.bat [options] echo. -echo 选项: -echo --daemon, -d 以后台模式运行(Windows 建议使用任务计划程序) -echo --help, -h 显示此帮助信息 -echo --version, -v 显示版本信息 +echo Options: +echo --daemon, -d Run in background mode (Windows recommends Task Scheduler) +echo --help, -h Show this help message +echo --version, -v Show version information echo. -echo 示例: -echo start.bat 前台运行模式 -echo start.bat --daemon 后台运行模式 +echo Examples: +echo start.bat Foreground mode +echo start.bat --daemon Background mode echo. exit /b 0 -:: ── 显示版本信息 ── +:: Show version information :show_version echo FutureOSS v1.0.0 -echo 基于 Python 的开发者通用工具套组 +echo Developer toolkit based on Python echo. exit /b 0 -:: ── 清理函数 ── +:: Cleanup function :cleanup -call :colorEcho 0E "[信息] 正在清理..." +echo [INFO] Cleaning up... call :remove_pid -call :colorEcho 0A "[成功] 清理完成" +echo [SUCCESS] Cleanup completed exit /b 0 \ No newline at end of file diff --git a/start.sh b/start.sh old mode 100755 new mode 100644 diff --git a/store/@{Falck}/html-render/__pycache__/main.cpython-313.pyc b/store/@{Falck}/html-render/__pycache__/main.cpython-313.pyc index 7caa987..108a6d0 100644 Binary files a/store/@{Falck}/html-render/__pycache__/main.cpython-313.pyc and b/store/@{Falck}/html-render/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{Falck}/web-toolkit/__pycache__/main.cpython-313.pyc b/store/@{Falck}/web-toolkit/__pycache__/main.cpython-313.pyc index 7914ff3..5beadfb 100644 Binary files a/store/@{Falck}/web-toolkit/__pycache__/main.cpython-313.pyc and b/store/@{Falck}/web-toolkit/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{Falck}/web-toolkit/__pycache__/router.cpython-313.pyc b/store/@{Falck}/web-toolkit/__pycache__/router.cpython-313.pyc index 0a5484a..e30a84b 100644 Binary files a/store/@{Falck}/web-toolkit/__pycache__/router.cpython-313.pyc and b/store/@{Falck}/web-toolkit/__pycache__/router.cpython-313.pyc differ diff --git a/store/@{Falck}/web-toolkit/__pycache__/static.cpython-313.pyc b/store/@{Falck}/web-toolkit/__pycache__/static.cpython-313.pyc index ec28474..340e3f5 100644 Binary files a/store/@{Falck}/web-toolkit/__pycache__/static.cpython-313.pyc and b/store/@{Falck}/web-toolkit/__pycache__/static.cpython-313.pyc differ diff --git a/store/@{Falck}/web-toolkit/__pycache__/template.cpython-313.pyc b/store/@{Falck}/web-toolkit/__pycache__/template.cpython-313.pyc index 75417d0..23ad4ed 100644 Binary files a/store/@{Falck}/web-toolkit/__pycache__/template.cpython-313.pyc and b/store/@{Falck}/web-toolkit/__pycache__/template.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/__pycache__/main.cpython-313.pyc index a869280..ba40ab7 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/__init__.cpython-313.pyc index 4da314b..5bf29df 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/quality.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/quality.cpython-313.pyc index 74e45e5..20cbb6b 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/quality.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/quality.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/references.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/references.cpython-313.pyc index 87afdd6..6055ea0 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/references.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/references.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/security.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/security.cpython-313.pyc index e4a4b60..6b58e98 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/security.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/security.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/style.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/style.cpython-313.pyc index 34d140e..753bfc8 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/style.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/checks/__pycache__/style.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/__init__.cpython-313.pyc index c7265ac..c0798ae 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/reviewer.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/reviewer.cpython-313.pyc index e1a0b32..4e5a564 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/reviewer.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/core/__pycache__/reviewer.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/__init__.cpython-313.pyc index 8b9be99..9f54404 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/formatter.cpython-313.pyc b/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/formatter.cpython-313.pyc index 252d63b..2519a6b 100644 Binary files a/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/formatter.cpython-313.pyc and b/store/@{FutureOSS}/code-reviewer.disabled/report/__pycache__/formatter.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/dashboard/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/dashboard/__pycache__/main.cpython-313.pyc index ec210cf..dfc4c99 100644 Binary files a/store/@{FutureOSS}/dashboard/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/dashboard/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/dashboard/main.py b/store/@{FutureOSS}/dashboard/main.py index 979b0de..ce50094 100644 --- a/store/@{FutureOSS}/dashboard/main.py +++ b/store/@{FutureOSS}/dashboard/main.py @@ -306,7 +306,8 @@ class DashboardPlugin(Plugin): f.write(f"\n{php_content}") result = subprocess.run( ["php", "-f", tmp_file], - capture_output=True, text=True, timeout=10 + capture_output=True, text=True, timeout=10, + encoding='utf-8', errors='replace' ) return result.stdout if result.returncode == 0 else f"
{result.stderr}
" finally: @@ -319,7 +320,8 @@ class DashboardPlugin(Plugin): @staticmethod def _get_php_version() -> str: try: - res = subprocess.run(['php', '-r', 'echo phpversion();'], capture_output=True, text=True, timeout=5) + res = subprocess.run(['php', '-r', 'echo phpversion();'], capture_output=True, text=True, timeout=5, + encoding='utf-8', errors='replace') return res.stdout if res.returncode == 0 else 'N/A' except Exception: return 'N/A' diff --git a/store/@{FutureOSS}/dependency/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/dependency/__pycache__/main.cpython-313.pyc index c38b9c8..4b01bf3 100644 Binary files a/store/@{FutureOSS}/dependency/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/dependency/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/hot-reload.disabled/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/hot-reload.disabled/__pycache__/main.cpython-313.pyc index f19214f..af1cdac 100644 Binary files a/store/@{FutureOSS}/hot-reload.disabled/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/hot-reload.disabled/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-api/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/http-api/__pycache__/main.cpython-313.pyc index 6ca874e..f6b06c5 100644 Binary files a/store/@{FutureOSS}/http-api/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/http-api/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-api/__pycache__/middleware.cpython-313.pyc b/store/@{FutureOSS}/http-api/__pycache__/middleware.cpython-313.pyc index 3307c16..f92c55a 100644 Binary files a/store/@{FutureOSS}/http-api/__pycache__/middleware.cpython-313.pyc and b/store/@{FutureOSS}/http-api/__pycache__/middleware.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-api/__pycache__/router.cpython-313.pyc b/store/@{FutureOSS}/http-api/__pycache__/router.cpython-313.pyc index 694efa8..03188c6 100644 Binary files a/store/@{FutureOSS}/http-api/__pycache__/router.cpython-313.pyc and b/store/@{FutureOSS}/http-api/__pycache__/router.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-api/__pycache__/server.cpython-313.pyc b/store/@{FutureOSS}/http-api/__pycache__/server.cpython-313.pyc index 82e83a0..58eb293 100644 Binary files a/store/@{FutureOSS}/http-api/__pycache__/server.cpython-313.pyc and b/store/@{FutureOSS}/http-api/__pycache__/server.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-api/server.py b/store/@{FutureOSS}/http-api/server.py index a7a4876..4496efd 100644 --- a/store/@{FutureOSS}/http-api/server.py +++ b/store/@{FutureOSS}/http-api/server.py @@ -104,7 +104,7 @@ class HttpServer: self.wfile.write(resp.body.encode("utf-8")) else: self.wfile.write(resp.body) - except BrokenPipeError: + except (BrokenPipeError, ConnectionAbortedError, ConnectionResetError): pass # 忽略客户端断开 def log_message(self, format, *args): diff --git a/store/@{FutureOSS}/http-tcp/__pycache__/events.cpython-313.pyc b/store/@{FutureOSS}/http-tcp/__pycache__/events.cpython-313.pyc index a69b322..296ad48 100644 Binary files a/store/@{FutureOSS}/http-tcp/__pycache__/events.cpython-313.pyc and b/store/@{FutureOSS}/http-tcp/__pycache__/events.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-tcp/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/http-tcp/__pycache__/main.cpython-313.pyc index dddb1a0..3c50217 100644 Binary files a/store/@{FutureOSS}/http-tcp/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/http-tcp/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-tcp/__pycache__/middleware.cpython-313.pyc b/store/@{FutureOSS}/http-tcp/__pycache__/middleware.cpython-313.pyc index 938c0e7..c841a69 100644 Binary files a/store/@{FutureOSS}/http-tcp/__pycache__/middleware.cpython-313.pyc and b/store/@{FutureOSS}/http-tcp/__pycache__/middleware.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-tcp/__pycache__/router.cpython-313.pyc b/store/@{FutureOSS}/http-tcp/__pycache__/router.cpython-313.pyc index c26601e..b6971e4 100644 Binary files a/store/@{FutureOSS}/http-tcp/__pycache__/router.cpython-313.pyc and b/store/@{FutureOSS}/http-tcp/__pycache__/router.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/http-tcp/__pycache__/server.cpython-313.pyc b/store/@{FutureOSS}/http-tcp/__pycache__/server.cpython-313.pyc index 3a842fc..d4819bd 100644 Binary files a/store/@{FutureOSS}/http-tcp/__pycache__/server.cpython-313.pyc and b/store/@{FutureOSS}/http-tcp/__pycache__/server.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/i18n.disabled/__pycache__/i18n.cpython-313.pyc b/store/@{FutureOSS}/i18n.disabled/__pycache__/i18n.cpython-313.pyc index 6b61020..214108e 100644 Binary files a/store/@{FutureOSS}/i18n.disabled/__pycache__/i18n.cpython-313.pyc and b/store/@{FutureOSS}/i18n.disabled/__pycache__/i18n.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/i18n.disabled/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/i18n.disabled/__pycache__/main.cpython-313.pyc index b1a087a..8fe0147 100644 Binary files a/store/@{FutureOSS}/i18n.disabled/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/i18n.disabled/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/i18n.disabled/__pycache__/middleware.cpython-313.pyc b/store/@{FutureOSS}/i18n.disabled/__pycache__/middleware.cpython-313.pyc index d701864..13f7019 100644 Binary files a/store/@{FutureOSS}/i18n.disabled/__pycache__/middleware.cpython-313.pyc and b/store/@{FutureOSS}/i18n.disabled/__pycache__/middleware.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/json-codec/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/json-codec/__pycache__/main.cpython-313.pyc index b991833..33c7d56 100644 Binary files a/store/@{FutureOSS}/json-codec/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/json-codec/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/lifecycle.disabled/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/lifecycle.disabled/__pycache__/main.cpython-313.pyc index 5f33291..a37878d 100644 Binary files a/store/@{FutureOSS}/lifecycle.disabled/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/lifecycle.disabled/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/log-terminal/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/log-terminal/__pycache__/main.cpython-313.pyc index e8de1f3..8c8751d 100644 Binary files a/store/@{FutureOSS}/log-terminal/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/log-terminal/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/log-terminal/main.py b/store/@{FutureOSS}/log-terminal/main.py index 73f00b9..afd2c90 100644 --- a/store/@{FutureOSS}/log-terminal/main.py +++ b/store/@{FutureOSS}/log-terminal/main.py @@ -589,7 +589,8 @@ class LogTerminalPlugin(Plugin): f.write(f"\n{php_content}") result = subprocess.run( ["php", "-f", tmp_file], - capture_output=True, text=True, timeout=10 + capture_output=True, text=True, timeout=10, + encoding='utf-8', errors='replace' ) return result.stdout if result.returncode == 0 else f"
{result.stderr}
" finally: diff --git a/store/@{FutureOSS}/pkg-manager/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/pkg-manager/__pycache__/main.cpython-313.pyc index f68ca7f..e12be44 100644 Binary files a/store/@{FutureOSS}/pkg-manager/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/pkg-manager/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/pkg-manager/main.py b/store/@{FutureOSS}/pkg-manager/main.py index 81020f1..fd07ce5 100644 --- a/store/@{FutureOSS}/pkg-manager/main.py +++ b/store/@{FutureOSS}/pkg-manager/main.py @@ -134,7 +134,8 @@ class PkgManagerPlugin(Plugin): result = subprocess.run( ["php", "-f", tmp_file], - capture_output=True, text=True, timeout=10, cwd=views_dir + capture_output=True, text=True, timeout=10, cwd=views_dir, + encoding='utf-8', errors='replace' ) return result.stdout if result.returncode == 0 else f"
{result.stderr}
" finally: diff --git a/store/@{FutureOSS}/plugin-bridge/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/plugin-bridge/__pycache__/main.cpython-313.pyc index a42905d..fc3f36a 100644 Binary files a/store/@{FutureOSS}/plugin-bridge/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/plugin-bridge/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/__pycache__/main.cpython-313.pyc index 519786d..56859ca 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/__init__.cpython-313.pyc index 4fbec5f..4129143 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/breaker.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/breaker.cpython-313.pyc index f0e5b8a..8d72e34 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/breaker.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/breaker.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/state.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/state.cpython-313.pyc index c3c701b..ec34326 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/state.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/circuit/__pycache__/state.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/__init__.cpython-313.pyc index de50d1d..058c22f 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/config.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/config.cpython-313.pyc index 6f6ed91..9e16a34 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/config.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/config.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/enhancer.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/enhancer.cpython-313.pyc index 2ec0c16..32b0fa3 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/enhancer.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/core/__pycache__/enhancer.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/__init__.cpython-313.pyc index 6935652..62a896b 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/auto_fix.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/auto_fix.cpython-313.pyc index 55d3e7b..58f15d0 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/auto_fix.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/auto_fix.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/health.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/health.cpython-313.pyc index adfc640..4ffbf3c 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/health.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/recovery/__pycache__/health.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/__init__.cpython-313.pyc index 8a02816..5e0d4d0 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/logger.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/logger.cpython-313.pyc index 3ad8bd9..6cec58f 100644 Binary files a/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/logger.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader-pro.disabled/utils/__pycache__/logger.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-loader/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/plugin-loader/__pycache__/main.cpython-313.pyc index 029ba58..ccaf0c6 100644 Binary files a/store/@{FutureOSS}/plugin-loader/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/plugin-loader/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/plugin-storage/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/plugin-storage/__pycache__/main.cpython-313.pyc index 39e6977..99b09b9 100644 Binary files a/store/@{FutureOSS}/plugin-storage/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/plugin-storage/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/signature-verifier/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/signature-verifier/__pycache__/main.cpython-313.pyc index bc65e0c..92aae8d 100644 Binary files a/store/@{FutureOSS}/signature-verifier/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/signature-verifier/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/webui/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/webui/__pycache__/main.cpython-313.pyc index 8de4e5f..569c504 100644 Binary files a/store/@{FutureOSS}/webui/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/webui/__pycache__/main.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/webui/core/__pycache__/__init__.cpython-313.pyc b/store/@{FutureOSS}/webui/core/__pycache__/__init__.cpython-313.pyc index 07feb99..6683f03 100644 Binary files a/store/@{FutureOSS}/webui/core/__pycache__/__init__.cpython-313.pyc and b/store/@{FutureOSS}/webui/core/__pycache__/__init__.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/webui/core/__pycache__/server.cpython-313.pyc b/store/@{FutureOSS}/webui/core/__pycache__/server.cpython-313.pyc index e411ae8..5b5f93d 100644 Binary files a/store/@{FutureOSS}/webui/core/__pycache__/server.cpython-313.pyc and b/store/@{FutureOSS}/webui/core/__pycache__/server.cpython-313.pyc differ diff --git a/store/@{FutureOSS}/webui/core/server.py b/store/@{FutureOSS}/webui/core/server.py index 142f810..b6b4535 100644 --- a/store/@{FutureOSS}/webui/core/server.py +++ b/store/@{FutureOSS}/webui/core/server.py @@ -99,7 +99,8 @@ class WebUIServer: result = subprocess.run( ["php", "-f", tmp_file], - capture_output=True, text=True, timeout=10, cwd=views_dir + capture_output=True, text=True, timeout=10, cwd=views_dir, + encoding='utf-8', errors='replace' ) if result.returncode != 0: diff --git a/store/@{FutureOSS}/ws-api/__pycache__/main.cpython-313.pyc b/store/@{FutureOSS}/ws-api/__pycache__/main.cpython-313.pyc index 9c728e7..6f9ecb9 100644 Binary files a/store/@{FutureOSS}/ws-api/__pycache__/main.cpython-313.pyc and b/store/@{FutureOSS}/ws-api/__pycache__/main.cpython-313.pyc differ