mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-06 22:27:19 +02:00
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).
This commit is contained in:
@@ -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}/')
|
||||
|
||||
Reference in New Issue
Block a user