From 4358b1a520a8a8cf1aed53a91ba32b4f1a5570a3 Mon Sep 17 00:00:00 2001 From: dami Date: Fri, 16 Oct 2026 11:11:00 +0800 Subject: [PATCH] update --- plugins/rapira/conf/rapira.toml | 3 ++- plugins/rapira/index.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/rapira/conf/rapira.toml b/plugins/rapira/conf/rapira.toml index e3e613e2c..056c0879f 100644 --- a/plugins/rapira/conf/rapira.toml +++ b/plugins/rapira/conf/rapira.toml @@ -2,7 +2,8 @@ # Commented keys show defaults or example values. Run it with: rapira serve examples/rapira.toml [http] -listen = "127.0.0.1:8000" # host:port, ":port" (all interfaces), or "unix:/path" + +listen = "unix:/tmp/rapira-cgi-{$PHP_VERSION}.sock" # server_name = "localhost" # server_port = 8000 # what PHP sees as SERVER_PORT; defaults to the listen port # max_body_size_mb = 8 # larger request bodies answer 413 diff --git a/plugins/rapira/index.py b/plugins/rapira/index.py index c12e64eb0..e9ea2f6aa 100755 --- a/plugins/rapira/index.py +++ b/plugins/rapira/index.py @@ -241,6 +241,12 @@ def makePhpIni(version): mw.writeFile(dst_ini, content) +def commonReplace(content,version): + service_path = mw.getServerDir() + content = content.replace('{$VERSION}', version) + content = content.replace('{$SERVER_PATH}', service_path) + return content + def initReplace(version): initD_path = getServerDir() + '/init.d' # if not os.path.exists(initD_path): @@ -259,6 +265,7 @@ def initReplace(version): toml_file = getServerDir()+"/"+version+"/rapira.toml" if not os.path.exists(toml_file): content = mw.readFile(toml_file_tpl) + content = commonReplace(content, version) mw.writeFile(toml_file,content) # 模版例子 @@ -283,10 +290,8 @@ def initReplace(version): systemService = systemDir + '/rapira' + version + '.service' if os.path.exists(systemDir) and not os.path.exists(systemService): systemServiceTpl = getPluginDir() + '/init.d/rapira.service.tpl' - service_path = mw.getServerDir() se_content = mw.readFile(systemServiceTpl) - se_content = se_content.replace('{$VERSION}', version) - se_content = se_content.replace('{$SERVER_PATH}', service_path) + se_content = commonReplace(se_content, version) mw.writeFile(systemService, se_content) mw.execShell('systemctl daemon-reload')