From ecf3af09863aa364a2de5c1b2297d473f71c6aaf Mon Sep 17 00:00:00 2001 From: master3395 Date: Fri, 6 Mar 2026 20:51:45 +0100 Subject: [PATCH] Plugin install: exclude README.md from wrong-location check (main repo has it at root) Fixes false 'Files extracted to wrong location' when /usr/local/CyberCP/README.md exists. Ensure panel user can create plugin dirs (e.g. chgrp lscpd /usr/local/CyberCP, chmod g+w, and add panel user to group lscpd). --- pluginHolder/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pluginHolder/views.py b/pluginHolder/views.py index 977098540..f00fbf6ff 100644 --- a/pluginHolder/views.py +++ b/pluginHolder/views.py @@ -663,8 +663,8 @@ def install_plugin(request, plugin_name): # Verify plugin was actually installed pluginInstalled = '/usr/local/CyberCP/' + plugin_name if not os.path.exists(pluginInstalled): - # Check if files were extracted to root instead - root_files = ['README.md', 'apps.py', 'meta.xml', 'urls.py', 'views.py'] + # Check if plugin files were extracted to root (exclude README.md - main repo has it at root) + root_files = ['apps.py', 'meta.xml', 'urls.py', 'views.py'] found_root_files = [f for f in root_files if os.path.exists(os.path.join('/usr/local/CyberCP', f))] if found_root_files: raise Exception(f'Plugin installation failed: Files extracted to wrong location. Found {found_root_files} in /usr/local/CyberCP/ root instead of {pluginInstalled}/') @@ -1798,7 +1798,8 @@ def install_from_store(request, plugin_name): # Verify plugin was actually installed pluginInstalled = '/usr/local/CyberCP/' + plugin_name if not os.path.exists(pluginInstalled): - root_files = ['README.md', 'apps.py', 'meta.xml', 'urls.py', 'views.py'] + # Exclude README.md - main CyberPanel repo has it at root + root_files = ['apps.py', 'meta.xml', 'urls.py', 'views.py'] found_root_files = [f for f in root_files if os.path.exists(os.path.join('/usr/local/CyberCP', f))] if found_root_files: raise Exception(f'Plugin installation failed: Files extracted to wrong location. Found {found_root_files} in /usr/local/CyberCP/ root instead of {pluginInstalled}/')