mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-15 00:26:23 +00:00
Update AppImage
This commit is contained in:
@@ -28,8 +28,8 @@ export async function POST(request: Request) {
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
script_path: "/usr/local/share/proxmenux/scripts/gpu_tpu/nvidia_installer.sh",
|
script_relative_path: "gpu_tpu/nvidia_installer.sh",
|
||||||
env: {
|
params: {
|
||||||
EXECUTION_MODE: "web",
|
EXECUTION_MODE: "web",
|
||||||
WEB_LOG: "/tmp/nvidia_web_install.log",
|
WEB_LOG: "/tmp/nvidia_web_install.log",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6353,15 +6353,21 @@ def execute_script():
|
|||||||
script_name = data.get('script_name')
|
script_name = data.get('script_name')
|
||||||
script_params = data.get('params', {})
|
script_params = data.get('params', {})
|
||||||
|
|
||||||
# Map script names to file paths
|
|
||||||
script_map = {
|
script_relative_path = data.get('script_relative_path')
|
||||||
'nvidia_installer': '/usr/local/share/proxmenux/scripts/gpu_tpu/nvidia_installer.sh',
|
|
||||||
}
|
if not script_relative_path:
|
||||||
|
return jsonify({'error': 'script_relative_path is required'}), 400
|
||||||
if script_name not in script_map:
|
|
||||||
return jsonify({'success': False, 'error': 'Unknown script'}), 400
|
|
||||||
|
BASE_SCRIPTS_DIR = '/usr/local/share/proxmenux/scripts'
|
||||||
script_path = script_map[script_name]
|
script_path = os.path.join(BASE_SCRIPTS_DIR, script_relative_path)
|
||||||
|
|
||||||
|
|
||||||
|
script_path = os.path.abspath(script_path)
|
||||||
|
if not script_path.startswith(BASE_SCRIPTS_DIR):
|
||||||
|
return jsonify({'error': 'Invalid script path'}), 403
|
||||||
|
|
||||||
|
|
||||||
if not os.path.exists(script_path):
|
if not os.path.exists(script_path):
|
||||||
return jsonify({'success': False, 'error': 'Script file not found'}), 404
|
return jsonify({'success': False, 'error': 'Script file not found'}), 404
|
||||||
|
|||||||
Reference in New Issue
Block a user