Initial commit for v2.4.3

This commit is contained in:
usmannasir
2025-08-01 14:56:30 +05:00
commit 6dd7114f6d
4521 changed files with 1795978 additions and 0 deletions

BIN
serverStatus/.DS_Store vendored Normal file

Binary file not shown.

0
serverStatus/__init__.py Normal file
View File

6
serverStatus/admin.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from django.contrib import admin
# Register your models here.

8
serverStatus/apps.py Normal file
View File

@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from django.apps import AppConfig
class ServerstatusConfig(AppConfig):
name = 'serverStatus'

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/FIleManager.iml" filepath="$PROJECT_DIR$/.idea/FIleManager.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,600 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="9320a755-b878-4593-8eac-7d773157fabd" name="Default" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="fileManager.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="414">
<caret line="80" column="26" lean-forward="true" selection-start-line="80" selection-start-column="26" selection-end-line="80" selection-end-column="26" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="caller.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="CSS File" />
<option value="HTML File" />
<option value="JavaScript File" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>../../assets</find>
<find>ajax/libs/angularjs/1.2.12/angular.js</find>
<find>AbnTestController</find>
<find>AbnTest</find>
<find>listAction</find>
<find>$commandToExecute</find>
</findStrings>
<replaceStrings>
<replace>assets</replace>
</replaceStrings>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/assets/prac.js" />
<option value="$PROJECT_DIR$/javaprac.html" />
<option value="$PROJECT_DIR$/admin-blog.html" />
<option value="$PROJECT_DIR$/tree.html" />
<option value="$PROJECT_DIR$/js/tree.js" />
<option value="$PROJECT_DIR$/js/fileManager.js" />
<option value="$PROJECT_DIR$/css/fileManager.css" />
<option value="$PROJECT_DIR$/index.html" />
<option value="$PROJECT_DIR$/php/caller.php" />
<option value="$PROJECT_DIR$/php/fileManager.php" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="1419" />
<option name="y" value="-4" />
<option name="width" value="1299" />
<option name="height" value="764" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="FileManager" type="b2602c69:ProjectViewProjectNode" />
<item name="FileManager" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="FileManager" type="b2602c69:ProjectViewProjectNode" />
<item name="FileManager" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="php" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="list.type.of.created.stylesheet" value="CSS" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="9320a755-b878-4593-8eac-7d773157fabd" name="Default" comment="" />
<created>1511505785266</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1511505785266</updated>
<workItem from="1511505786403" duration="25402000" />
<workItem from="1512371928726" duration="717000" />
<workItem from="1512401006678" duration="9000" />
<workItem from="1512401100852" duration="2365000" />
<workItem from="1523948661253" duration="7874000" />
<workItem from="1524303326266" duration="7000" />
<workItem from="1524730597265" duration="8000" />
<workItem from="1525085664919" duration="10000" />
<workItem from="1525683960581" duration="13000" />
<workItem from="1526291898810" duration="13000" />
<workItem from="1526512471223" duration="71000" />
<workItem from="1530908210451" duration="3368000" />
<workItem from="1531046295316" duration="1117000" />
<workItem from="1531052646849" duration="625000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="41599000" />
</component>
<component name="ToolWindowManager">
<frame x="1419" y="-4" width="1303" height="780" extended-state="6" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12759416" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32934132" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="1" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/assets/prac.js" />
<entry file="file://$PROJECT_DIR$/index-alt.html" />
<entry file="file://$PROJECT_DIR$/admin-blog.html" />
<entry file="file://$PROJECT_DIR$/javaprac.html" />
<entry file="file://$PROJECT_DIR$/js/tree.js" />
<entry file="file://$PROJECT_DIR$/tree.html" />
<entry file="file://$PROJECT_DIR$/js/fileManager.js" />
<entry file="file://$PROJECT_DIR$/css/fileManager.css" />
<entry file="file://$PROJECT_DIR$/index.html" />
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.cache/.fr-Tsiwv1/CyberCP/install/FileManager/php/fileManager.php" />
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="414">
<caret line="80" column="26" lean-forward="true" selection-start-line="80" selection-start-column="26" selection-end-line="80" selection-end-column="26" />
<folding>
<element signature="n#listDir#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#getPermissions#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="e#6737#7475#0#PHP" expanded="false" />
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@@ -0,0 +1,127 @@
<?php
class Caller{
private $basePath = null;
public function __construct($basePath = null)
{
$this->basePath = $basePath ?: dirname(__DIR__);
}
public function requestHandler()
{
if ($_SERVER['REQUEST_METHOD'] === 'POST' and isset($_POST['method'])) {
$pathToSeed = '/home/' . $_POST['domainName'] . '/..filemanagerkey';
$receivedSeed = $_POST['domainRandomSeed'];
$myfile = fopen($pathToSeed, "r") or die("Unable to open file!");
$seed = fread($myfile,filesize($pathToSeed));
fclose($myfile);
if ($seed != $receivedSeed){
$answer = array(
'uploadStatus' => 0,
'answer' => 'Not allowed to upload in this path.',
'error_message' => "None",
'fileName' => $_FILES['file']['name']
);
$json = json_encode($answer);
echo $json;
return;
}
switch ($_POST['method']) {
case 'upload':
$this->uploadFile();
break;
}
}
}
private function uploadFile(){
try {
if (!empty($_FILES)) {
if($this->return_bytes(ini_get('upload_max_filesize')) < $_SERVER['CONTENT_LENGTH']){
throw new Exception("Size of uploaded file is greater than upload limit!");
}
$completePath = $this->cleanInput($_POST['completePath']);
$fileName = $this->cleanInput($_FILES['file']['name']);
$homePath = $this->cleanInput($_POST['home']);
$tempPath = $_FILES['file']['tmp_name'];
$uploadPath = $completePath . DIRECTORY_SEPARATOR . $fileName;
$pos = strpos($uploadPath, $homePath);
if ($pos === false) {
throw new Exception("Not allowed to upload in this path!");
}
if(move_uploaded_file($tempPath, $uploadPath)==true){
$answer = array(
'uploadStatus' => 1,
'answer' => 'File transfer completed',
'error_message' => "None",
'fileName' => $_FILES['file']['name']
);
$json = json_encode($answer);
echo $json;
}
else{
throw new Exception("Can not move uploaded file to destination location!");
}
}
else {
throw new Exception("No Files to upload!");
}
}
catch(Exception $e) {
$answer = array(
'uploadStatus' => 0,
'answer' => 'No files',
'error_message' => $e->getMessage(),
'fileName' => $_FILES['file']['name'],
);
$json = json_encode($answer);
echo $json;
}
}
private function return_bytes($val) {
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
switch($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}
return $val;
}
private function cleanInput($input) {
$search = array(
'@<script[^>]*?>.*?</script>@si',
'@<[\/\!]*?[^<>]*?>@si',
'@<style[^>]*?>.*?</style>@siU',
'@<![\s\S]*?--[ \t\n\r]*>@'
);
$output = preg_replace($search, '', $input);
return $output;
}
}
$caller = new Caller("/");
$caller->requestHandler();

View File

@@ -0,0 +1,748 @@
<?php
class fileManager
{
private $basePath = null;
public function requestHandler()
{
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$pathToSeed = '/home/' . $request->domainName . '/..filemanagerkey';
$receivedSeed = $request->domainRandomSeed;
$myfile = fopen($pathToSeed, "r") or die("Unable to open file!");
$seed = fread($myfile,filesize($pathToSeed));
fclose($myfile);
if ($seed != $receivedSeed){
$json_data = array(
"error_message" => "You can not open filemanager for this domain.",
"copied" => 1,
);
$json = json_encode($json_data);
echo $json;
return;
}
if (isset($request->method)) {
switch ($request->method) {
case 'list':
$this->listDir($request->completeStartingPath);
break;
case 'listForTable':
$home = $this->cleanInput($request->home);
$completeStartingPath = $this->cleanInput($request->completeStartingPath);
$this->listForTable($home,$completeStartingPath);
break;
case 'readFileContents':
$this->readFileContents($request->fileName);
break;
case 'writeFileContents':
$this->writeFileContents($request->fileName, $request->fileContent);
break;
case 'createNewFolder':
$folderName = $this->cleanInput($request->folderName);
$this->createNewFolder($folderName);
break;
case 'createNewFile':
$fileName = $this->cleanInput($request->fileName);
$this->createNewFile($fileName);
break;
case 'deleteFolderOrFile':
$this->deleteFolderOrFile($request->path, $request->fileAndFolders);
break;
case 'compress':
$compressedFileName = $this->cleanInput($request->compressedFileName);
$this->compress($request->basePath, $request->listOfFiles, $compressedFileName, $request->compressionType);
break;
case 'extract':
$extractionLocation = $this->cleanInput($request->extractionLocation);
$this->extract($request->home,$request->basePath,$request->fileToExtract,$request->extractionType,$extractionLocation);
break;
case 'move':
$this->moveFileAndFolders($request->home,$request->basePath,$request->newPath,$request->fileAndFolders);
break;
case 'copy':
$this->copyFileAndFolders($request->home,$request->basePath,$request->newPath,$request->fileAndFolders);
break;
case 'rename':
$newFileName = $this->cleanInput($request->newFileName);
$this->renameFileOrFolder($request->basePath,$request->existingName,$newFileName);
break;
case 'changePermissions':
$this->changePermissions($request->basePath, $request->permissionsPath, $request->newPermissions, $request->recursive);
break;
}
}
}
private function changePermissions($basePath, $permissionsPath, $newPermissions, $recursive)
{
try {
$completePath = $basePath . DIRECTORY_SEPARATOR . $permissionsPath;
if($recursive == 1){
$commandToExecute = 'chmod -R ' . $newPermissions . " '". $completePath . "'";
$programOutput = fopen('temp.txt', 'a');
}else{
$commandToExecute = 'chmod ' . $newPermissions . " '". $completePath . "'";
$programOutput = fopen('temp.txt', 'a');
}
exec($commandToExecute, $programOutput);
$json_data = array(
"error_message" => "None",
"permissionsChanged" => 1,
);
$json = json_encode($json_data);
echo $json;
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"permissionsChanged" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function listDir($basePath)
{
try {
$path = "";
$listPath = $basePath . $path;
$files = scandir($listPath);
$json_data = array(
"error_message" => "None",
"fetchStatus" => 1
);
$counter = 0;
$tempDir = array();
$tempFiles = array();
// sorting files at end
foreach ($files as $dirFile) {
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
if (is_dir($completePath) == true) {
array_push($tempDir, $dirFile);
} else {
array_push($tempFiles, $dirFile);
}
}
$result = array_merge($tempDir, $tempFiles);
foreach ($result as $dirFile) {
if ($dirFile == "." or $dirFile == "..") {
continue;
}
$arrayCounter = 0;
$tempArray = array($dirFile);
$arrayCounter += 1;
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
$tempArray[$arrayCounter] = $completePath;
$arrayCounter += 1;
if (is_dir($completePath) == true) {
$list = true;
$tempArray[$arrayCounter] = $list;
} else {
$list = false;
$tempArray[$arrayCounter] = $list;
}
$json_data[(string)$counter] = $tempArray;
$counter += 1;
}
$json = json_encode($json_data);
echo $json;
} catch (Exception $e) {
$answer = array(
'uploadStatus' => 0,
'answer' => [1, 2, 3],
'error_message' => $e->getMessage(),
);
$json = json_encode($answer);
echo $json;
}
}
private function getPermissions($fileName){
$perms = fileperms($fileName);
switch ($perms & 0xF000) {
case 0xC000: // socket
$info = 's';
break;
case 0xA000: // symbolic link
$info = 'l';
break;
case 0x8000: // regular
$info = 'r';
break;
case 0x6000: // block special
$info = 'b';
break;
case 0x4000: // directory
$info = 'd';
break;
case 0x2000: // character special
$info = 'c';
break;
case 0x1000: // FIFO pipe
$info = 'p';
break;
default: // unknown
$info = 'u';
}
// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
return $info;
}
private function listForTable($home,$basePath)
{
try {
$pos = strpos($basePath, $home);
if ($pos === false) {
throw new Exception("Not allowed to browse this path, going back home!");
}
$path = "";
$listPath = $basePath . $path;
$files = scandir($listPath);
$json_data = array("error_message" => "None",
"fetchStatus" => 1
);
$counter = 0;
$tempDir = array();
$tempFiles = array();
// sorting files at end
foreach ($files as $dirFile) {
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
if (is_dir($completePath) == true) {
array_push($tempDir, $dirFile);
} else {
array_push($tempFiles, $dirFile);
}
}
$result = array_merge($tempDir, $tempFiles);
foreach ($result as $dirFile) {
if ($dirFile == "." or $dirFile == "..") {
continue;
}
$arrayCounter = 0;
$tempArray = array($dirFile);
$arrayCounter += 1;
$completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
$tempArray[$arrayCounter] = $completePath;
$arrayCounter += 1;
// find last modified
$lastModified = date("F d Y H:i:s.", filemtime($completePath));
$tempArray[$arrayCounter] = $lastModified;
$arrayCounter += 1;
// find size of file
$fileSize = (int)(filesize($completePath) / 1024);
$tempArray[$arrayCounter] = $fileSize;
$arrayCounter += 1;
// find permissions of file
$tempArray[$arrayCounter] = substr(sprintf('%o', fileperms($completePath)), -4);;
$arrayCounter += 1;
// Deciding if the current path is file or dir.
if (is_dir($completePath) == true) {
$list = true;
$tempArray[$arrayCounter] = $list;
} else {
$list = false;
$tempArray[$arrayCounter] = $list;
}
$json_data[(string)$counter] = $tempArray;
$counter += 1;
}
$json = json_encode($json_data);
echo $json;
} catch (Exception $e) {
$answer = array(
'fetchStatus' => 0,
'error_message' => $e->getMessage(),
);
$json = json_encode($answer);
echo $json;
}
}
private function readFileContents($pathToFile)
{
try {
$listPath = $pathToFile;
$contentsofFile = file_get_contents($pathToFile);
if ($contentsofFile !== false) {
$json_data = array(
"error_message" => "None",
"fetchStatus" => 1,
"fileContents" => $contentsofFile
);
$json = json_encode($json_data);
echo $json;
} else {
throw new Exception("Can not read the file Contents");
}
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"fetchStatus" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function writeFileContents($pathToFile, $fileContent)
{
try {
$contentsofFile = file_put_contents($pathToFile, $fileContent);
if ($contentsofFile !== false) {
$json_data = array(
"error_message" => "None",
"saveStatus" => 1,
);
$json = json_encode($json_data);
echo $json;
} else {
throw new Exception("Can not write the file Contents.");
}
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"saveStatus" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function createNewFolder($folderName)
{
try {
$returnVal = mkdir($folderName);
if ($returnVal !== false) {
$json_data = array(
"error_message" => "None",
"createStatus" => 1,
);
$json = json_encode($json_data);
echo $json;
} else {
throw new Exception("Can not create Folder");
}
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"createStatus" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function createNewFile($fileName)
{
try {
if (touch($fileName)) {
$json_data = array(
"error_message" => "None",
"createStatus" => 1,
);
$json = json_encode($json_data);
echo $json;
} else {
throw new Exception("Can not create file!");
}
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"createStatus" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function deleteFolderOrFile($basePath, $fileAndFolders)
{
try {
foreach ($fileAndFolders as $path) {
$path = $basePath . DIRECTORY_SEPARATOR . $path;
if (is_dir($path) == true) {
$commandToExecute = 'rm -rf ' . "'".$path ."'";
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
} else {
if (unlink($path)) {
continue;
} else {
throw new Exception("Can not delete!");
}
}
}
$json_data = array(
"error_message" => "None",
"deleteStatus" => 1,
);
$json = json_encode($json_data);
echo $json;
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"deleteStatus" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function compress($basePath, $listOfFiles, $compressedFileName, $compressionType)
{
try {
chdir($basePath);
if ($compressionType == "zip") {
$compressedFileName = $basePath . DIRECTORY_SEPARATOR . $compressedFileName . ".zip";
$commandToExecute = 'zip -r ' . $compressedFileName . ' ';
foreach ($listOfFiles as $file) {
$completePathToFile = $file;
$commandToExecute = $commandToExecute ."'". $completePathToFile ."'". ' ';
}
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
$json_data = array(
"error_message" => $commandToExecute,
"compressed" => 1,
);
$json = json_encode($json_data);
echo $json;
}
else {
$compressedFileName = $basePath . DIRECTORY_SEPARATOR . $compressedFileName . ".tar.gz";
$commandToExecute = 'tar -czvf ' . $compressedFileName . ' ';
foreach ($listOfFiles as $file) {
$completePathToFile = $file;
$commandToExecute = $commandToExecute ."'". $completePathToFile ."'". ' ';
}
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
$json_data = array(
"error_message" => "None",
"compressed" => 1,
);
$json = json_encode($json_data);
echo $json;
}
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"compressed" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function extract($home,$basePath,$completeFileToExtract, $extractionType, $extractionLocation)
{
try {
$pos = strpos($extractionLocation, $home);
if ($pos === false) {
throw new Exception("Not allowed to extact in this path, please choose location inside home!");
}
if ($extractionType == "zip") {
$commandToExecute = "unzip -o '" . $completeFileToExtract . "' -d '" . $extractionLocation . "'";
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
$json_data = array(
"error_message" => $commandToExecute,
"extracted" => 1,
);
$json = json_encode($json_data);
echo $json;
} else {
$commandToExecute = "tar xf '" . $completeFileToExtract . "' -C '" . $extractionLocation . "'";
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
$json_data = array(
"error_message" => "None",
"extracted" => 1,
);
$json = json_encode($json_data);
echo $json;
}
}catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"extracted" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function moveFileAndFolders($home,$basePath, $newPath, $fileAndFolders)
{
try {
$pos = strpos($newPath, $home);
if ($pos === false) {
throw new Exception("Not allowed to move in this path, please choose location inside home!");
}
if(!file_exists($newPath)){
if(!mkdir($newPath, 0777, true)){
$json_data = array(
"error_message" => "Can not create the new folder, it already exists!",
"moved" => 0,
);
$json = json_encode($json_data);
echo $json;
die();
}
}
foreach ($fileAndFolders as $path) {
$completePathToFile = $basePath . DIRECTORY_SEPARATOR . $path;
$completeNewPath = $newPath . DIRECTORY_SEPARATOR . $path;
$commandToExecute = 'mv ' ."'". $completePathToFile . "'" . ' ' . "'" . $completeNewPath . "'";
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
}
$json_data = array(
"error_message" => "None",
"moved" => 1,
);
$json = json_encode($json_data);
echo $json;
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"moved" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function copyFileAndFolders($home,$basePath, $newPath, $fileAndFolders)
{
try {
$pos = strpos($newPath, $home);
if ($pos === false) {
throw new Exception("Not allowed to move in this path, please choose location inside home!");
}
if(!file_exists($newPath)){
if(!mkdir($newPath, 0777, true)){
throw new Exception("Can not create the new folder, it already exists!");
}
}
foreach ($fileAndFolders as $path) {
$completePathToFile = $basePath . DIRECTORY_SEPARATOR . $path;
$completeNewPath = $newPath . DIRECTORY_SEPARATOR . $path;
$commandToExecute = 'cp ' ."'". $completePathToFile . "'" . ' ' . "'" . $completeNewPath . "'";
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
}
$json_data = array(
"error_message" => "None",
"copied" => 1,
);
$json = json_encode($json_data);
echo $json;
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"copied" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function renameFileOrFolder($basePath, $currentName, $newName)
{
try {
$completeOldPath = $basePath . DIRECTORY_SEPARATOR . $currentName;
$completeNewPath = $basePath . DIRECTORY_SEPARATOR . $newName;
$commandToExecute = 'mv ' ."'". $completeOldPath . "'" . ' ' . "'" . $completeNewPath . "'";
$programOutput = fopen('temp.txt', 'a');
exec($commandToExecute, $programOutput);
$json_data = array(
"error_message" => "None",
"renamed" => 1,
);
$json = json_encode($json_data);
echo $json;
} catch (Exception $e) {
$json_data = array(
"error_message" => $e->getMessage(),
"renamed" => 0,
);
$json = json_encode($json_data);
echo $json;
}
}
private function cleanInput($input) {
$search = array(
'@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments
);
$output = preg_replace($search, '', $input);
return $output;
}
}
$caller = new fileManager();
$caller->requestHandler();

View File

@@ -0,0 +1,207 @@
#
# PLAIN TEXT CONFIGURATION FILE
#
serverName lscp
user nobody
group nobody
priority 0
inMemBufSize 60M
swappingDir /tmp/lshttpd/swap
autoFix503 1
gracefulRestartTimeout 300
mime $SERVER_ROOT/conf/mime.properties
showVersionNumber 0
adminEmails root@localhost
adminRoot $SERVER_ROOT/admin/
errorlog $SERVER_ROOT/logs/error.log {
logLevel DEBUG
debugLevel 0
rollingSize 10M
enableStderrLog 1
}
accesslog $SERVER_ROOT/logs/access.log {
rollingSize 10M
keepDays 30
compressArchive 0
}
indexFiles index.html, index.php
expires {
enableExpires 1
expiresByType image/*=A604800, text/css=A604800, application/x-javascript=A604800
}
tuning {
eventDispatcher best
maxConnections 2000
maxSSLConnections 1000
connTimeout 300
maxKeepAliveReq 1000
smartKeepAlive 0
keepAliveTimeout 5
sndBufSize 0
rcvBufSize 0
maxReqURLLen 8192
maxReqHeaderSize 16380
maxReqBodySize 2047M
maxDynRespHeaderSize 8192
maxDynRespSize 2047M
maxCachedFileSize 4096
totalInMemCacheSize 20M
maxMMapFileSize 256K
totalMMapCacheSize 40M
useSendfile 1
fileETag 28
enableGzipCompress 1
enableDynGzipCompress 1
gzipCompressLevel 6
compressibleTypes text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml
gzipAutoUpdateStatic 1
gzipStaticCompressLevel 6
gzipMaxFileSize 1M
gzipMinFileSize 300
SSLCryptoDevice null
}
fileAccessControl {
followSymbolLink 1
checkSymbolLink 0
requiredPermissionMask 000
restrictedPermissionMask 000
}
perClientConnLimit {
staticReqPerSec 0
dynReqPerSec 0
outBandwidth 0
inBandwidth 0
softLimit 10000
hardLimit 10000
gracePeriod 15
banPeriod 300
}
CGIRLimit {
maxCGIInstances 20
minUID 11
minGID 10
priority 0
CPUSoftLimit 10
CPUHardLimit 50
memSoftLimit 460M
memHardLimit 470M
procSoftLimit 400
procHardLimit 450
}
accessDenyDir {
dir /
dir /etc/*
dir /dev/*
dir $SERVER_ROOT/conf/*
dir $SERVER_ROOT/admin/conf/*
}
accessControl {
allow ALL
}
scripthandler {
add lsapi:php70 php
}
railsDefaults {
maxConns 5
env LSAPI_MAX_REQS=1000
env LSAPI_MAX_IDLE=60
initTimeout 60
retryTimeout 0
pcKeepAliveTimeout 60
respBuffer 0
backlog 50
runOnStartUp 1
extMaxIdleTime 300
priority 3
memSoftLimit 2047M
memHardLimit 2047M
procSoftLimit 500
procHardLimit 600
}
module cache {
param <<<END_param
enableCache 0
enablePrivateCache 0
checkPublicCache 1
checkPrivateCache 1
qsCache 1
reqCookieCache 1
ignoreReqCacheCtrl 1
ignoreRespCacheCtrl 0
respCookieCache 1
expireInSeconds 3600
privateExpireInSeconds 3600
maxStaleAge 200
maxCacheObjSize 10000000
storagepath cachedata
noCacheDomain
noCacheUrl
no-vary 0
addEtag 0
END_param
}
listener Default{
address *:80
secure 0
map Example *
}
listener Default IPv6{
address [ANY]:80
secure 0
map Example *
}
vhTemplate centralConfigLog {
templateFile $SERVER_ROOT/conf/templates/ccl.conf
listeners Default
}
vhTemplate PHP_SuEXEC {
templateFile $SERVER_ROOT/conf/templates/phpsuexec.conf
listeners Default
}
vhTemplate EasyRailsWithSuEXEC {
templateFile $SERVER_ROOT/conf/templates/rails.conf
listeners Default
}
virtualHost Example{
vhRoot $SERVER_ROOT/Example/
allowSymbolLink 1
enableScript 1
restrained 1
maxKeepAliveReq
smartKeepAlive
setUIDMode 0
chrootMode 0
configFile $SERVER_ROOT/conf/vhosts/Example/vhconf.conf
}
include phpconfigs/php53.conf
include phpconfigs/php54.conf
include phpconfigs/php55.conf
include phpconfigs/php56.conf
include phpconfigs/php70.conf
include phpconfigs/php71.conf

View File

@@ -0,0 +1,158 @@
default = application/octet-stream
3gp = video/3gpp
3g2 = video/3gpp2
ai, eps = application/postscript
aif, aifc, aiff = audio/x-aiff
asc = text/plain
asf = video/asf
asx = video/x-ms-asf
au = audio/basic
avi = video/x-msvideo
bcpio = application/x-bcpio
bmp = image/bmp
bin = application/octet-stream
bz, bz2 = application/x-bzip
cdf = application/x-netcdf
class = application/java-vm
cpio = application/x-cpio
cpt = application/mac-compactpro
crt = application/x-x509-ca-cert
csh = application/x-csh
css = text/css
dcr,dir, dxr = application/x-director
dms = application/octet-stream
doc = application/msword
dtd = application/xml-dtd
dvi = application/x-dvi
eot = application/vnd.ms-fontobject
etx = text/x-setext
exe = application/x-executable
ez = application/andrew-inset
flv = video/x-flv
gif = image/gif
gtar = application/x-gtar
gz, gzip = application/gzip
hdf = application/x-hdf
hqx = application/mac-binhex40
htc = text/x-component
html, htm = text/html
ice = x-conference/x-cooltalk
ico = image/x-icon
ief = image/ief
iges, igs = model/iges
iso = application/x-cd-image
java = text/plain
jar = application/java-archive
jnlp = application/x-java-jnlp-file
jpeg, jpe, jpg = image/jpeg
js = application/x-javascript
js2 = application/javascript
js3 = text/javascript
json = application/json
jsp = text/plain
kar = audio/midi
latex = application/x-latex
lha, lzh = application/octet-stream
man = application/x-troff-man
mdb = application/vnd.ms-access
me = application/x-troff-me
mesh = model/mesh
mid, midi = audio/midi
mif = application/vnd.mif
movie = video/x-sgi-movie
mov = video/quicktime
mp2, mp3, mpga = audio/mpeg
mpeg, mpe, mpg = video/mpeg
mp4 = video/mp4
mpp = application/vnd.ms-project
ms = application/x-troff-ms
msh = model/mesh
nc = application/x-netcdf
oda = application/oda
odb = application/vnd.oasis.opendocument.database
odc = application/vnd.oasis.opendocument.chart
odf = application/vnd.oasis.opendocument.formula
odg = application/vnd.oasis.opendocument.graphics
odi = application/vnd.oasis.opendocument.image
odp = application/vnd.oasis.opendocument.presentation
ods = application/vnd.oasis.opendocument.spreadsheet
odt = application/vnd.oasis.opendocument.text
ogg = audio/ogg
otf = application/x-font-woff
pbm = image/x-portable-bitmap
pdb = chemical/x-pdb
pdf = application/pdf
pgm = image/x-portable-graymap
pgn = application/x-chess-pgn
pls = audio/x-scpls
png = image/png
pnm = image/x-portable-anymap
ppm = image/x-portable-pixmap
ppt = application/vnd.ms-powerpoint
ps = application/postscript
qt,qtvr = video/quicktime
ra = audio/x-realaudio
ram, rm = audio/x-pn-realaudio
rar = application/x-rar-compressed
ras = image/x-cmu-raster
rgb = image/x-rgb
roff, t, tr = application/x-troff
rss = application/rss+xml
rsd = application/rsd+xml
rtf = application/rtf
rtx = text/richtext
ser = application/java-serialized-object
sgml, sgm = text/sgml
sh = application/x-sh
shar = application/x-shar
shtml = application/x-httpd-shtml
silo = model/mesh
sit = application/x-stuffit
skd, skm, skp, skt = application/x-koan
smi,smil = application/smil
snd = audio/basic
spl = application/x-futuresplash
sql = text/x-sql
src = application/x-wais-source
sv4cpio = application/x-sv4cpio
sv4crc = application/x-sv4crc
svg, svgz = image/svg+xml
swf = application/x-shockwave-flash
tar = application/x-tar
tcl = application/x-tcl
tex = application/x-tex
texi, texinfo = application/x-texinfo
tgz = application/x-gtar
tiff, tif = image/tiff
tsv = text/tab-separated-values
ttf, ttc = application/x-font-ttf
txt = text/plain
ustar = application/x-ustar
vcd = application/x-cdlink
vrml = model/vrml
vxml = application/voicexml+xml
wav = audio/vnd.wave
wax = audio/x-ms-wax
wbmp = image/vnd.wap.wbmp
wma = audio/x-ms-wma
wml = text/vnd.wap.wml
wmlc = application/vnd.wap.wmlc
wmls = text/vnd.wap.wmlscript
wmlsc = application/vnd.wap.wmlscriptc
woff = application/font-woff
woff2 = font/woff2
woff_o1 = application/x-font-woff
wtls-ca-certificate = application/vnd.wap.wtls-ca-certificate
wri = application/vnd.ms-write
wrl = model/vrml
xbm = image/x-xbitmap
xhtml, xht = application/xhtml+xml
xls = application/vnd.ms-excel
xml, xsd, xsl = application/xml
xslt = application/xslt+xml
xpm = image/x-xpixmap
xwd = image/x-xwindowdump
xyz = chemical/x-pdb
zip = application/zip
z = application/compress

View File

@@ -0,0 +1,86 @@
allowSymbolLink 1
chrootMode 0
enableScript 1
restrained 1
setUIDMode 0
vhRoot $SERVER_ROOT/$VH_NAME/
configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
virtualHostConfig {
enableGzip 1
docRoot $VH_ROOT/html/
hotlinkCtrl {
allowedHosts
enableHotlinkCtrl 0
suffixes gif, jpeg, jpg
allowDirectAccess 1
redirectUri
onlySelf 1
}
general {
enableContextAC 0
}
expires {
expiresDefault
enableExpires 1
}
rewrite {
enable 0
logLevel 0
rules <<<MY_END
RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot
RewriteRule ^/nospider/ - [F]
MY_END
}
index {
useServer 0
autoIndex 0
indexFiles index.html
autoIndexURI /_autoindex/default.php
}
accessLog $SERVER_ROOT/logs/$VH_NAME.access.log{
useServer 0
keepDays 30
rollingSize 100M
compressArchive 1
logUserAgent 1
logReferer 1
}
errorlog {
useServer 1
}
htAccess {
allowOverride 0
accessFileName .htaccess
}
context /cgi-bin/{
type cgi
location $VH_ROOT/cgi-bin/
allowBrowse 1
}
awstats {
updateMode 0
siteAliases 127.0.0.1 localhost
updateInterval 86400
updateOffset 0
siteDomain localhost
workingDir $VH_ROOT/awstats
awstatsURI /awstats/
}
accessControl {
deny
allow *
}
}

View File

@@ -0,0 +1,111 @@
head 1.1;
access;
symbols;
locks
root:1.1; strict;
comment @# @;
1.1
date 2017.08.17.05.47.23; author root; state Exp;
branches;
next ;
desc
@/usr/local/CyberCP/conf/templates/ccl.conf0
@
1.1
log
@Update
@
text
@allowSymbolLink 1
chrootMode 0
enableScript 1
restrained 1
setUIDMode 0
vhRoot $SERVER_ROOT/$VH_NAME/
configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
virtualHostConfig {
enableGzip 1
docRoot $VH_ROOT/html/
hotlinkCtrl {
allowedHosts
enableHotlinkCtrl 0
suffixes gif, jpeg, jpg
allowDirectAccess 1
redirectUri
onlySelf 1
}
general {
enableContextAC 0
}
expires {
expiresDefault
enableExpires 1
}
rewrite {
enable 0
logLevel 0
rules <<<MY_END
RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot
RewriteRule ^/nospider/ - [F]
MY_END
}
index {
useServer 0
autoIndex 0
indexFiles index.html
autoIndexURI /_autoindex/default.php
}
accessLog $SERVER_ROOT/logs/$VH_NAME.access.log{
useServer 0
keepDays 30
rollingSize 100M
compressArchive 1
logUserAgent 1
logReferer 1
}
errorlog {
useServer 1
}
htAccess {
allowOverride 0
accessFileName .htaccess
}
context /cgi-bin/{
type cgi
location $VH_ROOT/cgi-bin/
allowBrowse 1
}
awstats {
updateMode 0
siteAliases 127.0.0.1 localhost
updateInterval 86400
updateOffset 0
siteDomain localhost
workingDir $VH_ROOT/awstats
awstatsURI /awstats/
}
accessControl {
deny
allow *
}
}
@

View File

@@ -0,0 +1,100 @@
allowSymbolLink 1
chrootMode 0
enableScript 1
restrained 1
setUIDMode 2
vhRoot $SERVER_ROOT/$VH_NAME/
configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
virtualHostConfig {
enableGzip 1
docRoot $VH_ROOT/public_html/
htAccess {
accessFileName .htaccess
allowOverride 31
}
rewrite {
enable 0
logLevel 0
}
awstats {
updateMode 0
workingDir $VH_ROOT/awstats
awstatsURI /awstats/
siteDomain localhost
siteAliases 127.0.0.1 localhost
updateInterval 86400
updateOffset 0
securedConn 0
}
extProcessor $VH_NAME_lsphp{
path $SERVER_ROOT/fcgi-bin/lsphp
backlog 10
instances 5
runOnStartUp 0
respBuffer 0
autoStart 1
extMaxIdleTime 60
priority 0
memSoftLimit 100M
memHardLimit 150M
procSoftLimit 100
procHardLimit 200
type lsapi
address uds://tmp/lshttpd/$VH_NAME_lsphp.sock
maxConns 5
initTimeout 60
retryTimeout 0
persistConn 1
pcKeepAliveTimeout 30
}
index {
useServer 0
autoIndex 0
autoIndexURI /_autoindex/default.php
indexFiles index.html
}
accessLog $SERVER_ROOT/logs/$VH_NAME.access.log{
keepDays 30
rollingSize 100M
compressArchive 1
useServer 0
logHeaders 3
}
errorlog {
useServer 1
}
hotlinkCtrl {
enableHotlinkCtrl 0
suffixes gif, jpeg, jpg
allowDirectAccess 1
onlySelf 1
}
accessControl {
allow *
}
scriptHandler {
add lsapi:$VH_NAME_lsphp php
}
expires {
enableExpires 1
}
context /cgi-bin/{
type cgi
location $VH_ROOT/cgi-bin/
accessControl
rewrite
}
}

View File

@@ -0,0 +1,125 @@
head 1.1;
access;
symbols;
locks
root:1.1; strict;
comment @# @;
1.1
date 2017.08.17.05.47.23; author root; state Exp;
branches;
next ;
desc
@/usr/local/CyberCP/conf/templates/phpsuexec.conf0
@
1.1
log
@Update
@
text
@allowSymbolLink 1
chrootMode 0
enableScript 1
restrained 1
setUIDMode 2
vhRoot $SERVER_ROOT/$VH_NAME/
configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
virtualHostConfig {
enableGzip 1
docRoot $VH_ROOT/public_html/
htAccess {
accessFileName .htaccess
allowOverride 31
}
rewrite {
enable 0
logLevel 0
}
awstats {
updateMode 0
workingDir $VH_ROOT/awstats
awstatsURI /awstats/
siteDomain localhost
siteAliases 127.0.0.1 localhost
updateInterval 86400
updateOffset 0
securedConn 0
}
extProcessor $VH_NAME_lsphp{
path $SERVER_ROOT/fcgi-bin/lsphp
backlog 10
instances 5
runOnStartUp 0
respBuffer 0
autoStart 1
extMaxIdleTime 60
priority 0
memSoftLimit 100M
memHardLimit 150M
procSoftLimit 100
procHardLimit 200
type lsapi
address uds://tmp/lshttpd/$VH_NAME_lsphp.sock
maxConns 5
initTimeout 60
retryTimeout 0
persistConn 1
pcKeepAliveTimeout 30
}
index {
useServer 0
autoIndex 0
autoIndexURI /_autoindex/default.php
indexFiles index.html
}
accessLog $SERVER_ROOT/logs/$VH_NAME.access.log{
keepDays 30
rollingSize 100M
compressArchive 1
useServer 0
logHeaders 3
}
errorlog {
useServer 1
}
hotlinkCtrl {
enableHotlinkCtrl 0
suffixes gif, jpeg, jpg
allowDirectAccess 1
onlySelf 1
}
accessControl {
allow *
}
scriptHandler {
add lsapi:$VH_NAME_lsphp php
}
expires {
enableExpires 1
}
context /cgi-bin/{
type cgi
location $VH_ROOT/cgi-bin/
accessControl
rewrite
}
}
@

View File

@@ -0,0 +1,76 @@
allowSymbolLink 1
chrootMode 0
enableScript 1
restrained 1
setUIDMode 2
vhRoot $SERVER_ROOT/$VH_NAME/
configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
virtualHostConfig {
enableGzip 1
docRoot $VH_ROOT/public/
accessControl {
allow *
}
hotlinkCtrl {
suffixes gif, jpeg, jpg
allowDirectAccess 1
onlySelf 1
enableHotlinkCtrl 0
}
rewrite {
enable 0
logLevel 0
}
index {
useServer 0
autoIndex 0
indexFiles index.html
autoIndexURI /_autoindex/default.php
}
accessLog $SERVER_ROOT/logs/$VH_NAME.access.log{
logHeaders 3
compressArchive 0
useServer 0
keepDays 30
rollingSize 500M
}
errorlog {
useServer 1
}
context /{
railsEnv 1
maxConns 5
location $VH_ROOT/
type rails
accessControl
addDefaultCharset off
}
htAccess {
allowOverride 0
accessFileName .htaccess
}
expires {
enableExpires 1
}
awstats {
workingDir $VH_ROOT/awstats
awstatsURI /awstats/
siteDomain localhost
siteAliases 127.0.0.1 localhost
updateMode 0
updateInterval 86400
updateOffset 0
securedConn 0
}
}

View File

@@ -0,0 +1,101 @@
head 1.1;
access;
symbols;
locks
root:1.1; strict;
comment @# @;
1.1
date 2017.08.17.05.47.23; author root; state Exp;
branches;
next ;
desc
@/usr/local/CyberCP/conf/templates/rails.conf0
@
1.1
log
@Update
@
text
@allowSymbolLink 1
chrootMode 0
enableScript 1
restrained 1
setUIDMode 2
vhRoot $SERVER_ROOT/$VH_NAME/
configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
virtualHostConfig {
enableGzip 1
docRoot $VH_ROOT/public/
accessControl {
allow *
}
hotlinkCtrl {
suffixes gif, jpeg, jpg
allowDirectAccess 1
onlySelf 1
enableHotlinkCtrl 0
}
rewrite {
enable 0
logLevel 0
}
index {
useServer 0
autoIndex 0
indexFiles index.html
autoIndexURI /_autoindex/default.php
}
accessLog $SERVER_ROOT/logs/$VH_NAME.access.log{
logHeaders 3
compressArchive 0
useServer 0
keepDays 30
rollingSize 500M
}
errorlog {
useServer 1
}
context /{
railsEnv 1
maxConns 5
location $VH_ROOT/
type rails
accessControl
addDefaultCharset off
}
htAccess {
allowOverride 0
accessFileName .htaccess
}
expires {
enableExpires 1
}
awstats {
workingDir $VH_ROOT/awstats
awstatsURI /awstats/
siteDomain localhost
siteAliases 127.0.0.1 localhost
updateMode 0
updateInterval 86400
updateOffset 0
securedConn 0
}
}
@

View File

@@ -0,0 +1,4 @@
group1: user1,user2, user3
group2:
user: user8, test
group3:

View File

@@ -0,0 +1,2 @@
test:kF2EDBE2Ux8sQ
user1:SQtevcsBBnBPY

View File

@@ -0,0 +1,119 @@
docRoot $VH_ROOT/html/
enableGzip 1
context /docs/{
allowBrowse 1
location $SERVER_ROOT/docs/
type NULL
}
context /protected/{
required user test
authName Protected
type NULL
allowBrowse 1
location protected/
realm SampleProtectedArea
accessControl {
deny
allow *
}
}
context /blocked/{
allowBrowse 0
type NULL
}
context /cgi-bin/{
allowBrowse 1
location $VH_ROOT/cgi-bin/
type cgi
}
expires {
enableExpires 1
}
index {
autoIndexURI /_autoindex/default.php
indexFiles index.html
autoIndex 0
useServer 0
}
errorPage 404{
url /error404.html
}
errorlog $VH_ROOT/logs/error.log{
logLevel DEBUG
rollingSize 10M
useServer 1
}
accessLog $VH_ROOT/logs/access.log{
compressArchive 0
logReferer 1
keepDays 30
rollingSize 10M
logUserAgent 1
useServer 0
}
htAccess {
accessFileName .htaccess
allowOverride 0
}
awstats {
updateInterval 86400
workingDir $VH_ROOT/awstats
updateOffset 0
siteDomain localhost
siteAliases 127.0.0.1 localhost
updateMode 0
awstatsURI /awstats/
}
rewrite {
enable 0
logLevel 0
rules <<<END_rules
RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot
RewriteRule ^/nospider/ - [F]
END_rules
}
hotlinkCtrl {
suffixes gif, jpeg, jpg
allowedHosts
allowDirectAccess 1
enableHotlinkCtrl 0
onlySelf 1
}
accessControl {
deny
allow *
}
realm SampleProtectedArea {
userDB {
cacheTimeout 60
maxCacheSize 200
location $SERVER_ROOT/conf/vhosts/Example/htpasswd
}
groupDB {
cacheTimeout 60
maxCacheSize 200
location $SERVER_ROOT/conf/vhosts/Example/htgroup
}
}
general {
enableContextAC 0
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,78 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# Warning: Do not edit this file directly, this file is autogenerated.
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
ServerRoot "/usr/local/lsws"
Listen 0.0.0.0:80
Listen [::]:80
Listen 0.0.0.0:443
Listen [::]:443
User nobody
Group nobody
ServerAdmin root@localhost
<Directory />
AllowOverride none
</Directory>
<Directory /home>
AllowOverride All
Options +Includes -Indexes +ExecCGI
</Directory>
DirectoryIndex index.php index.html
<Files ".ht*">
Require all denied
</Files>
ErrorLog "/usr/local/lsws/logs/error.log"
LogLevel warn
LogFormat '"%v %h %l %u %t \"%r\" %>s %b"' combined
CustomLog "/usr/local/lsws/logs/access.log" combined
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
#AddHandler cgi-script .cgi
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
SSLProtocol all -SSLv3 -TLSv1
SSLHonorCipherOrder on
SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:HIGH:!EDH-RSA-DES-CBC3-SHA:!DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4
<IfModule Litespeed>
CacheRoot /home/lscache/
</IfModule>
<VirtualHost *:80>
ServerName RedisDynVhost_80
DocumentRoot "/var/www/html"
</VirtualHost>
Listen 443
<VirtualHost *:443>
ServerName RedisDynVhost_443
DocumentRoot "/var/www/html"
SSLEngine on
SSLCertificateFile "/usr/local/lscp/conf/cert.pem"
SSLCertificateKeyFile "/usr/local/lscp/conf/key.pem"
</VirtualHost>
Include /usr/local/lsws/conf/modsec.conf

View File

@@ -0,0 +1,73 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# Warning: Do not edit this file directly, this file is autogenerated.
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
ServerRoot "/usr/local/lsws"
Listen 0.0.0.0:80
Listen [::]:80
Listen 0.0.0.0:443
Listen [::]:443
User nobody
Group nobody
ServerAdmin root@localhost
<Directory />
AllowOverride none
</Directory>
<Directory /home>
AllowOverride All
Options +Includes -Indexes +ExecCGI
</Directory>
DirectoryIndex index.php index.html
<Files ".ht*">
Require all denied
</Files>
ErrorLog "/usr/local/lsws/logs/error.log"
LogLevel warn
LogFormat '%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"' combined
CustomLog "/usr/local/lsws/logs/access.log" combined
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
#AddHandler cgi-script .cgi
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
SSLProtocol all -SSLv3 -TLSv1
SSLHonorCipherOrder on
SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:HIGH:!EDH-RSA-DES-CBC3-SHA:!DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4
<IfModule Litespeed>
CacheRoot /home/lscache/
</IfModule>
<VirtualHost *:80>
DocumentRoot /usr/local/lsws/DEFAULT/html
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /usr/local/lsws/DEFAULT/html
</VirtualHost>
Include /usr/local/lsws/conf/modsec.conf
Include /usr/local/lsws/conf/pre_main_global.conf

View File

@@ -0,0 +1,418 @@
<?xml version="1.0" encoding="UTF-8"?>
<httpServerConfig>
<serverName>$HOSTNAME</serverName>
<user>nobody</user>
<group>nobody</group>
<priority>0</priority>
<chrootPath>/</chrootPath>
<enableChroot>0</enableChroot>
<inMemBufSize>120M</inMemBufSize>
<swappingDir>/tmp/lshttpd/swap</swappingDir>
<autoFix503>1</autoFix503>
<loadApacheConf>1</loadApacheConf>
<autoReloadApacheConf>0</autoReloadApacheConf>
<apacheConfFile>/usr/local/lsws/conf/httpd.conf</apacheConfFile>
<apachePortOffset>0</apachePortOffset>
<apacheIpOffset>0</apacheIpOffset>
<phpSuExec>1</phpSuExec>
<phpSuExecMaxConn>5</phpSuExecMaxConn>
<mime>$SERVER_ROOT/conf/mime.properties</mime>
<showVersionNumber>0</showVersionNumber>
<useIpInProxyHeader>0</useIpInProxyHeader>
<autoUpdateInterval>86400</autoUpdateInterval>
<autoUpdateDownloadPkg>1</autoUpdateDownloadPkg>
<adminEmails>usman@cyberpersons.com</adminEmails>
<adminRoot>$SERVER_ROOT/admin/</adminRoot>
<logging>
<log>
<fileName>$SERVER_ROOT/logs/error.log</fileName>
<logLevel>DEBUG</logLevel>
<debugLevel>0</debugLevel>
<rollingSize>10M</rollingSize>
<enableStderrLog>1</enableStderrLog>
<enableAioLog>1</enableAioLog>
</log>
<accessLog>
<fileName>$SERVER_ROOT/logs/access.log</fileName>
<logFormat>%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;</logFormat>
<rollingSize>10M</rollingSize>
<keepDays>30</keepDays>
<compressArchive>1</compressArchive>
</accessLog>
</logging>
<indexFiles>index.html, index.php</indexFiles>
<htAccess>
<allowOverride>0</allowOverride>
<accessFileName>.htaccess</accessFileName>
</htAccess>
<expires>
<enableExpires>1</enableExpires>
<expiresByType>image/*=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800</expiresByType>
</expires>
<tuning>
<eventDispatcher>best</eventDispatcher>
<maxConnections>10000</maxConnections>
<maxSSLConnections>10000</maxSSLConnections>
<connTimeout>300</connTimeout>
<maxKeepAliveReq>1000</maxKeepAliveReq>
<smartKeepAlive>0</smartKeepAlive>
<keepAliveTimeout>5</keepAliveTimeout>
<sndBufSize>0</sndBufSize>
<rcvBufSize>0</rcvBufSize>
<maxReqURLLen>8192</maxReqURLLen>
<maxReqHeaderSize>16380</maxReqHeaderSize>
<maxReqBodySize>500M</maxReqBodySize>
<maxDynRespHeaderSize>8K</maxDynRespHeaderSize>
<maxDynRespSize>500M</maxDynRespSize>
<maxCachedFileSize>4096</maxCachedFileSize>
<totalInMemCacheSize>20M</totalInMemCacheSize>
<maxMMapFileSize>256K</maxMMapFileSize>
<totalMMapCacheSize>40M</totalMMapCacheSize>
<useSendfile>1</useSendfile>
<useAIO>1</useAIO>
<AIOBlockSize>4</AIOBlockSize>
<enableGzipCompress>1</enableGzipCompress>
<enableDynGzipCompress>1</enableDynGzipCompress>
<gzipCompressLevel>1</gzipCompressLevel>
<compressibleTypes>text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml</compressibleTypes>
<gzipAutoUpdateStatic>1</gzipAutoUpdateStatic>
<gzipStaticCompressLevel>6</gzipStaticCompressLevel>
<gzipMaxFileSize>1M</gzipMaxFileSize>
<gzipMinFileSize>300</gzipMinFileSize>
<SSLCryptoDevice>null</SSLCryptoDevice>
</tuning>
<quic>
<quicEnable>1</quicEnable>
</quic>
<security>
<fileAccessControl>
<followSymbolLink>1</followSymbolLink>
<checkSymbolLink>0</checkSymbolLink>
<requiredPermissionMask>000</requiredPermissionMask>
<restrictedPermissionMask>000</restrictedPermissionMask>
</fileAccessControl>
<perClientConnLimit>
<staticReqPerSec>0</staticReqPerSec>
<dynReqPerSec>0</dynReqPerSec>
<outBandwidth>0</outBandwidth>
<inBandwidth>0</inBandwidth>
<softLimit>10000</softLimit>
<hardLimit>10000</hardLimit>
<gracePeriod>15</gracePeriod>
<banPeriod>300</banPeriod>
</perClientConnLimit>
<CGIRLimit>
<maxCGIInstances>200</maxCGIInstances>
<minUID>11</minUID>
<minGID>10</minGID>
<priority>0</priority>
<CPUSoftLimit>300</CPUSoftLimit>
<CPUHardLimit>600</CPUHardLimit>
<memSoftLimit>1450M</memSoftLimit>
<memHardLimit>1500M</memHardLimit>
<procSoftLimit>1400</procSoftLimit>
<procHardLimit>1450</procHardLimit>
</CGIRLimit>
<censorshipControl>
<enableCensorship>0</enableCensorship>
<logLevel>0</logLevel>
<defaultAction>deny,log,status:403</defaultAction>
<scanPOST>1</scanPOST>
<uploadTmpDir>/tmp</uploadTmpDir>
<secAuditLog>$SERVER_ROOT/logs/security_audit.log</secAuditLog>
</censorshipControl>
<censorshipRuleSet>
<name>XSS attack</name>
<ruleSetAction>log,deny,status:403,msg:'XSS attack'</ruleSetAction>
<enabled>1</enabled>
<ruleSet></ruleSet>
</censorshipRuleSet>
<accessDenyDir>
<dir>/</dir>
<dir>/etc/*</dir>
<dir>/dev/*</dir>
<dir>$SERVER_ROOT/conf/*</dir>
<dir>$SERVER_ROOT/admin/conf/*</dir>
</accessDenyDir>
<accessControl>
<allow>ALL, 127.0.0.1T, 103.21.244.0/22T, 103.22.200.0/22T, 103.31.4.0/22T, 104.16.0.0/12T, 108.162.192.0/18T, 131.0.72.0/22T, 141.101.64.0/18T, 162.158.0.0/15T, 172.64.0.0/13T, 173.245.48.0/20T, 188.114.96.0/20T, 190.93.240.0/20T, 197.234.240.0/22T, 198.41.128.0/17T, 2400:cb00::/32T, 2405:8100::/32T, 2405:b500::/32T, 2606:4700::/32T, 2803:f800::/32T, 2a06:98c0::/29T, 2c0f:f248::/32T, 192.88.134.0/23T, 185.93.228.0/22, 66.248.200.0/22T, 208.109.0.0/22T, 2a02:fe80::/29T</allow>
</accessControl>
</security>
<extProcessorList>
<extProcessor>
<type>lsapi</type>
<name>lsphp5</name>
<address>uds://tmp/lshttpd/lsphp5.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/fcgi-bin/lsphp5</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp53</name>
<address>uds://tmp/lshttpd/lsphp53.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp53/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp54</name>
<address>uds://tmp/lshttpd/lsphp54.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp54/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp55</name>
<address>uds://tmp/lshttpd/lsphp55.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp55/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp56</name>
<address>uds://tmp/lshttpd/lsphp56.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp56/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp70</name>
<address>uds://tmp/lshttpd/lsphp70.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp70/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp71</name>
<address>uds://tmp/lshttpd/lsphp71.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp71/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp72</name>
<address>uds://tmp/lshttpd/lsphp72.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp72/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp73</name>
<address>uds://tmp/lshttpd/lsphp73.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp73/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
<extProcessor>
<type>lsapi</type>
<name>lsphp74</name>
<address>uds://tmp/lshttpd/lsphp74.sock</address>
<maxConns>35</maxConns>
<env>PHP_LSAPI_CHILDREN=35</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<persistConn>1</persistConn>
<respBuffer>0</respBuffer>
<autoStart>3</autoStart>
<path>$SERVER_ROOT/lsphp74/bin/lsphp</path>
<backlog>100</backlog>
<instances>1</instances>
<priority>0</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</extProcessor>
</extProcessorList>
<scriptHandlerList>
<scriptHandler>
<suffix>php</suffix>
<type>lsapi</type>
<handler>lsphp5</handler>
</scriptHandler>
<scriptHandler>
<suffix>php5</suffix>
<type>lsapi</type>
<handler>lsphp5</handler>
</scriptHandler>
<scriptHandler>
<suffix>php53</suffix>
<type>lsapi</type>
<handler>lsphp53</handler>
</scriptHandler>
<scriptHandler>
<suffix>php54</suffix>
<type>lsapi</type>
<handler>lsphp54</handler>
</scriptHandler>
<scriptHandler>
<suffix>php55</suffix>
<type>lsapi</type>
<handler>lsphp55</handler>
</scriptHandler>
<scriptHandler>
<suffix>php56</suffix>
<type>lsapi</type>
<handler>lsphp56</handler>
</scriptHandler>
<scriptHandler>
<suffix>php70</suffix>
<type>lsapi</type>
<handler>lsphp70</handler>
</scriptHandler>
<scriptHandler>
<suffix>php71</suffix>
<type>lsapi</type>
<handler>lsphp71</handler>
</scriptHandler>
<scriptHandler>
<suffix>php72</suffix>
<type>lsapi</type>
<handler>lsphp72</handler>
</scriptHandler>
<scriptHandler>
<suffix>php73</suffix>
<type>lsapi</type>
<handler>lsphp73</handler>
</scriptHandler>
<scriptHandler>
<suffix>php74</suffix>
<type>lsapi</type>
<handler>lsphp74</handler>
</scriptHandler>
</scriptHandlerList>
<phpConfig>
</phpConfig>
<railsDefaults>
<railsEnv>1</railsEnv>
<maxConns>5</maxConns>
<env>LSAPI_MAX_IDLE=60</env>
<initTimeout>180</initTimeout>
<retryTimeout>0</retryTimeout>
<pcKeepAliveTimeout>60</pcKeepAliveTimeout>
<respBuffer>0</respBuffer>
<backlog>50</backlog>
<runOnStartUp>1</runOnStartUp>
<priority>3</priority>
<memSoftLimit>2047M</memSoftLimit>
<memHardLimit>2047M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>500</procHardLimit>
</railsDefaults>
</httpServerConfig>

View File

@@ -0,0 +1,505 @@
#!/bin/sh
cd `dirname "$0"`
source ./functions.sh 2>/dev/null
if [ $? != 0 ]; then
. ./functions.sh
if [ $? != 0 ]; then
echo [ERROR] Can not include 'functions.sh'.
exit 1
fi
fi
test_license()
{
COPY_LICENSE_KEY=1
if [ -f "$LSWS_HOME/conf/serial.no" ]; then
if [ ! -f "$LSINSTALL_DIR/serial.no" ]; then
cp "$LSWS_HOME/conf/serial.no" "$LSINSTALL_DIR/serial.no"
else
diff "$LSWS_HOME/conf/serial.no" "$LSINSTALL_DIR/serial.no" 1>/dev/null
if [ $? -ne 0 ]; then
COPY_LICENSE_KEY=0
fi
fi
fi
# if [ $COPY_LICENSE_KEY -eq 1 ]; then
# if [ -f "$LSWS_HOME/conf/license.key" ] && [ ! -f "$LSINSTALL_DIR/license.key" ]; then
# cp "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key"
# fi
# if [ -f "$LSWS_HOME/conf/license.key" ] && [ -f "$LSINSTALL_DIR/license.key" ]; then
# diff "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key"
# if [ $? -ne 0 ]; then
# cp "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key"
# fi
# fi
# fi
if [ -f "$LSINSTALL_DIR/license.key" ] && [ -f "$LSINSTALL_DIR/serial.no" ]; then
echo "License key and serial number are available, testing..."
echo
bin/lshttpd -V
if [ $? -eq 0 ]; then
LICENSE_OK=1
if [ -f "$LSINSTALL_DIR/conf/license.key" ]; then
mv "$LSINSTALL_DIR/conf/license.key" "$LSINSTALL_DIR/license.key"
bin/lshttpd -t
fi
fi
echo
fi
if [ "x$LICENSE_OK" = "x" ]; then
if [ -f "$LSINSTALL_DIR/serial.no" ]; then
# echo "Serial number is available."
# printf "Would you like to register a license key for this server? [Y/n]"
# read TMP_YN
# echo ""
# if [ "x$TMP_YN" = "x" ] || [ `expr "$TMP_YN" : '[Yy]'` -gt 0 ]; then
echo "Contacting licensing server ..."
echo ""
$LSINSTALL_DIR/bin/lshttpd -r
if [ $? -eq 0 ]; then
echo "[OK] License key received."
$LSINSTALL_DIR/bin/lshttpd -t
if [ $? -eq 0 ]; then
LICENSE_OK=1
else
echo "The license key received does not work."
fi
fi
# fi
fi
fi
if [ "x$LICENSE_OK" = "x" ]; then
if [ -f "$LSINSTALL_DIR/trial.key" ]; then
$LSINSTALL_DIR/bin/lshttpd -t
if [ $? -ne 0 ]; then
exit 1
fi
else
cat <<EOF
[ERROR] Sorry, installation will abort without a valid license key.
For evaluation purpose, please obtain a trial license key from our web
site http://www.litespeedtech.com, copy it to this directory
and run Installer again.
If a production license has been purchased, please copy the serial number
from your confirmation email to this directory and run Installer again.
NOTE:
Please remember to set ftp to BINARY mode when you ftp trial.key from
another machine.
EOF
exit 1
fi
fi
}
configChroot()
{
ENABLE_CHROOT=0
CHROOT_PATH="/"
if [ -f "$LSWS_HOME/conf/httpd_config.xml" ]; then
OLD_ENABLE_CHROOT_CONF=`grep "<enableChroot>" "$LSWS_HOME/conf/httpd_config.xml"`
OLD_CHROOT_PATH_CONF=`grep "<chrootPath>" "$LSWS_HOME/conf/httpd_config.xml"`
OLD_ENABLE_CHROOT=`expr "$OLD_ENABLE_CHROOT_CONF" : '.*<enableChroot>\(.*\)</enableChroot>.*'`
OLD_CHROOT_PATH=`expr "$OLD_CHROOT_PATH_CONF" : '[^<]*<chrootPath>\([^<]*\)</chrootPath>.*'`
if [ "x$OLD_ENABLE_CHROOT" != "x" ]; then
ENABLE_CHROOT=$OLD_ENABLE_CHROOT
fi
if [ "x$OLD_CHROOT_PATH" != "x" ]; then
CHROOT_PATH=$OLD_CHROOT_PATH
fi
fi
CHANGE_CHROOT=0
if [ $INST_USER = "root" ]; then
CHANGE_CHROOT=1
if [ $INSTALL_TYPE = "upgrade" ]; then
CHANGE_CHROOT=0
if [ $ENABLE_CHROOT -eq 1 ]; then
cat <<EOF
Chroot is enabled with your current setup and root directory is set to
$CHROOT_PATH
EOF
else
echo "Chroot is disabled with your current setup."
echo
fi
printf "%s" "Would you like to change chroot settings [y/N]? "
TMP_URC='n'
echo ""
if [ "x$TMP_URC" != "x" ]; then
if [ `expr "$TMP_URC" : '[Yy]'` -gt 0 ]; then
CHANGE_CHROOT=1
fi
fi
fi
if [ $CHANGE_CHROOT -eq 1 ]; then
cat<<EOF
LiteSpeed Web Server Enterprise Edition can run in chroot environment.
It is impossible for the chrooted process and its children processes to
access files outside the new root directory.
With chroot configured properly, there is no need to worry about sensitive
data being accidentally exposed by insecure CGI programs or web server itself.
Even when a hacker some how gain a shell access, all files he can access is
under the chrooted directory.
This installation script will try to setup the initial chroot environment
automatically.
However, it is not easy to setup a chroot environment and you CGI program may
break. So we do not recommend enabling it for the first time user.
It can be enabled later by running this installation script again.
EOF
SUCC=0
printf "%s" "Enable chroot [y/N]: "
TMP_YN='n'
if [ `expr "x$TMP_YN" : 'x[Yy]'` -gt 1 ]; then
ENABLE_CHROOT=1
fi
LSWS_HOME_LEN=`expr "$LSWS_HOME" : '.*'`
if [ $ENABLE_CHROOT -eq 1 ]; then
while [ $SUCC -eq 0 ]; do
cat <<EOF
Chroot path must be absolute path and the server root
$LSWS_HOME
must be included in the chroot directory tree.
EOF
printf "%s" "Chroot directory without trailing '/': "
TMP_CHROOT='n'
if [ "x$TMP_CHROOT" != "x" ]; then
if [ $TMP_CHROOT = '/' ]; then
echo "Set chroot directory to '/' will disable chroot."
printf "%s" "Are you sure? [y/N]"
read TMP_YN
if [ `expr "x$TMP_YN" : 'x[Yy]'` -gt 1 ]; then
ENABLE_CHROOT=0
SUCC=1
fi
else
CHROOT_LEN=`expr "$TMP_CHROOT" : '.*'`
MATCH_LEN=`expr "$LSWS_HOME" : "$TMP_CHROOT"`
if [ $CHROOT_LEN -ne $MATCH_LEN ]; then
echo "Server root is not included in the chroot directory tree"
else
TMP_CHROOT2="$TMP_CHROOT/"
TMP_HOME="$LSWS_HOME/"
MATCH_LEN=`expr "$TMP_HOME" : "$TMP_CHROOT2"`
if [ $MATCH_LEN -le $CHROOT_LEN ]; then
echo "Server root is not included in the chroot diretory tree"
else
SUCC=1
CHROOT_PATH=$TMP_CHROOT
fi
fi
fi
fi
done
fi
fi
fi
}
changeChroot()
{
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/chroot.sh
if [ $CHANGE_CHROOT -eq 1 ]; then
if [ $ENABLE_CHROOT -eq 1 ]; then
$LSWS_HOME/admin/misc/chroot.sh $CHROOT_PATH
$LSWS_HOME/admin/misc/chroot.sh $CHROOT_PATH $LSWS_HOME/bin/lshttpd
$LSWS_HOME/admin/misc/chroot.sh $CHROOT_PATH $LSWS_HOME/admin/fcgi-bin/admin_php5
$LSWS_HOME/admin/misc/chroot.sh $CHROOT_PATH $LSWS_HOME/bin/lscgid
if [ -f $LSWS_HOME/fcgi-bin/php ]; then
$LSWS_HOME/admin/misc/chroot.sh $CHROOT_PATH $LSWS_HOME/fcgi-bin/php
fi
$LSWS_HOME/admin/misc/chroot.sh $CHROOT_PATH $LSWS_HOME/fcgi-bin/lsphp
if [ `expr "x$CHROOT_PATH" : '^x/[^/]'` -gt 1 ]; then
cp $CHROOT_PATH/etc/passwd $CHROOT_PATH/etc/passwd.ls_bak
cp $CHROOT_PATH/etc/group $CHROOT_PATH/etc/group.ls_bak
egrep "$WS_USER|lsadm" /etc/passwd > $CHROOT_PATH/etc/passwd
grep "$WS_GROUP" /etc/group > $CHROOT_PATH/etc/group
fi
fi
cp $LSWS_HOME/conf/httpd_config.xml $LSWS_HOME/conf/httpd_config.xml.bak
chown "$DIR_OWN" $LSWS_HOME/conf/httpd_config.xml.bak
RES=`grep '</chrootPath>' $LSWS_HOME/conf/httpd_config.xml.bak`
if [ $? -eq 1 ]; then
sed -e "s#</group>#</group><chrootPath>$CHROOT_PATH</chrootPath><enableChroot>$ENABLE_CHROOT</enableChroot>#" "$LSWS_HOME/conf/httpd_config.xml.bak" > "$LSWS_HOME/conf/httpd_config.xml"
else
sed -e "s#<chrootPath>.*<\/chrootPath>#<chrootPath>$CHROOT_PATH<\/chrootPath>#" -e "s/<enableChroot>.*<\/enableChroot>/<enableChroot>$ENABLE_CHROOT<\/enableChroot>/" "$LSWS_HOME/conf/httpd_config.xml.bak" > "$LSWS_HOME/conf/httpd_config.xml"
fi
fi
}
installLicense()
{
if [ -f ./serial.no ]; then
cp -f ./serial.no $LSWS_HOME/conf
chown "$SDIR_OWN" $LSWS_HOME/conf/serial.no
chmod "$DOC_MOD" $LSWS_HOME/conf/serial.no
fi
if [ -f ./license.key ]; then
cp -f ./license.key $LSWS_HOME/conf
chown "$SDIR_OWN" $LSWS_HOME/conf/license.key
chmod "$CONF_MOD" $LSWS_HOME/conf/license.key
fi
if [ -f ./trial.key ]; then
cp -f ./trial.key $LSWS_HOME/conf
chown "$SDIR_OWN" $LSWS_HOME/conf/trial.key
chmod "$DOC_MOD" $LSWS_HOME/conf/trial.key
fi
}
portOffset()
{
SUCC=0
SEL=0
while [ $SUCC -eq "0" ]; do
cat <<EOF
Would you like to run LiteSpeed along side with Apache on another port
to make sure everything work properly? If yes, please set "Port Offset"
to a non-zero value, LiteSpeed will run on Port 80 + "Port Offset",
otherwise, set to "0" to replace Apache.
EOF
printf "%s" "Port Offset [2000]? "
TMPS=0
echo ""
if [ "x$TMPS" != "x" ]; then
if [ `expr "$TMP_PORT" : '.*[^0-9]'` -gt 0 ]; then
echo "[ERROR] Only digits is allowed, try again!"
else
AP_PORT_OFFSET=$TMPS
SUCC=1
fi
else
SUCC=1
fi
done
}
enablePHPsuExec()
{
SUCC=0
SEL=0
while [ $SUCC -eq "0" ]; do
cat <<EOF
PHP suEXEC will run php scripts of each web site as the user who own the
document root directory,
LiteSpeed PHP suEXEC does not have any performance penalty like other PHP
suEXEC implementation, and .htaccess configuration overriden has been fully
supported.
Note: You may need to fix some file/directory permissions if phpSuexec or
suphp was not used with Apache.
Would you like to enable PHP suEXEC?
0. No
1. Yes
2. Only in user's home directory (DirectAdmin should use this)
EOF
printf "%s" "Please select (0-2)? [2]"
TMPS=1
echo ""
if [ "x$TMPS" != "x" ]; then
if [ `expr "$TMPS" : '[012]'` -gt 0 ]; then
PHP_SUEXEC=$TMPS
SUCC=1
else
echo "[ERROR] Wrong selection, try again!"
fi
else
SUCC=1
fi
done
}
hostPanelConfig()
{
SETUP_PHP=1
portOffset
enablePHPsuExec
}
hostPanels()
{
SUCC=0
SEL=0
while [ $SUCC -eq "0" ]; do
cat <<EOF
Will you use LiteSpeed Web Server with a hosting control panel?
0. NONE
1. cPanel
2. DirectAdmin
3. Plesk
4. Hsphere
5. Interworx
6. Lxadmin
7. ISPManager
EOF
printf "%s" "Please select (0-7) [0]? "
TMPS=0
echo ""
if [ "x$TMPS" != "x" ]; then
if [ `expr "$TMPS" : '[01234567]'` -gt 0 ]; then
SEL=$TMPS
SUCC=1
PANEL_VARY=""
if [ $SEL -eq "1" ]; then
HOST_PANEL="cpanel"
WS_USER=nobody
WS_GROUP=nobody
if [ -e "/etc/cpanel/ea4/is_ea4" ] ; then
PANEL_VARY=".ea4"
fi
elif [ $SEL -eq "2" ]; then
HOST_PANEL="directadmin"
WS_USER=apache
WS_GROUP=apache
elif [ $SEL -eq "3" ]; then
HOST_PANEL="plesk"
USER_INFO=`id apache 2>/dev/null`
TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'`
if [ "x$TST_USER" = "xapache" ]; then
WS_USER=apache
WS_GROUP=apache
else
WS_USER=www-data
WS_GROUP=www-data
# default PID FILE, source the real one, debian and ubuntu different
APACHE_PID_FILE=/var/run/apache2/apache2.pid
source /etc/apache2/envvars 2>/dev/null
if [ $? != 0 ]; then
. /etc/apache2/envvars
fi
PANEL_VARY=".debian"
fi
ADMIN_PORT=7088
elif [ $SEL -eq "4" ]; then
HOST_PANEL="hsphere"
WS_USER=httpd
WS_GROUP=httpd
elif [ $SEL -eq "5" ]; then
HOST_PANEL="interworx"
WS_USER=apache
WS_GROUP=apache
elif [ $SEL -eq "6" ]; then
HOST_PANEL="lxadminh"
WS_USER=apache
WS_GROUP=apache
elif [ $SEL -eq "7" ]; then
HOST_PANEL="ispmanager"
WS_USER=apache
WS_GROUP=apache
fi
fi
DIR_OWN=$WS_USER:$WS_GROUP
CONF_OWN=$WS_USER:$WS_GROUP
else
SUCC=1
fi
done
}
LSINSTALL_DIR=`dirname "$0"`
cd $LSINSTALL_DIR
init
license
install_dir
test_license
admin_login
if [ $INSTALL_TYPE = "reinstall" ]; then
configAdminEmail
if [ $INST_USER = "root" ]; then
hostPanels
fi
if [ "x$HOST_PANEL" = "x" ]; then
getUserGroup
stopLshttpd
getServerPort
getAdminPort
configRuby
enablePHPHandler
else
hostPanelConfig
fi
fi
if [ "x$HOST_PANEL" = "x" ]; then
configChroot
fi
cat <<EOF
Installing, please wait...
EOF
if [ "x$HOST_PANEL" = "xdirectadmin" ]; then
chmod g+x /var/log/httpd/
chgrp apache /var/log/httpd/
chown apache:apache /var/log/httpd/domains
fi
if [ "x$HOST_PANEL" = "x" ]; then
buildConfigFiles
else
buildApConfigFiles
fi
installation
installLicense
if [ "x$HOST_PANEL" = "x" ]; then
changeChroot
# setupPHPAccelerator
installAWStats
fi
finish

View File

@@ -0,0 +1,21 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# Warning: Do not edit this file directly, this file is autogenerated.
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
<IfModule security2_module>
SecRuleEngine off
SecAuditEngine on
SecDebugLogLevel 0
SecAuditLogRelevantStatus ^(?:5|4(?!04))
SecAuditLogParts ABIJDEFHZ
SecAuditLogType Serial
SecAuditLog /usr/local/lsws/logs/auditmodsec.log
SecDataDir /usr/local/lsws/modsec
Include /usr/local/lsws/conf/comodo_litespeed/*.conf
Include /usr/local/lsws/conf/rules.conf
</IfModule>

View File

6
serverStatus/models.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from django.db import models
# Create your models here.

View File

@@ -0,0 +1,449 @@
#!/usr/local/CyberCP/bin/python
import os,sys
import time
sys.path.append('/usr/local/CyberCP')
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
django.setup()
import subprocess
import shlex
import argparse
import shutil
import plogical.CyberCPLogFileWriter as logging
from plogical.processUtilities import ProcessUtilities
from websiteFunctions.models import Websites
from plogical.virtualHostUtilities import virtualHostUtilities
from plogical.sslUtilities import sslUtilities
from plogical.vhost import vhost
from shutil import ignore_patterns
import threading as multi
class ServerStatusUtil(multi.Thread):
lswsInstallStatusPath = '/home/cyberpanel/switchLSWSStatus'
serverRootPath = '/usr/local/lsws/'
def __init__(self, key):
multi.Thread.__init__(self)
self.key = key
def run(self):
self.switchTOLSWS(self.key)
@staticmethod
def executioner(command, statusFile):
try:
if os.path.exists(ProcessUtilities.debugPath):
logging.CyberCPLogFileWriter.writeToFile(command)
res = subprocess.call(command, stdout=statusFile, stderr=statusFile, shell=True)
if res == 1:
return 0
else:
return 1
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
@staticmethod
def installLiteSpeed(licenseKey, statusFile):
try:
cwd = os.getcwd()
try:
command = 'groupadd nobody'
ServerStatusUtil.executioner(command, statusFile)
except:
pass
try:
command = 'usermod -a -G nobody nobody'
ServerStatusUtil.executioner(command, statusFile)
except:
pass
try:
command = 'systemctl stop lsws'
ServerStatusUtil.executioner(command, statusFile)
except:
pass
from plogical.acl import ACLManager
if ACLManager.ISARM():
command = 'wget https://www.litespeedtech.com/packages/6.0/lsws-6.2-ent-aarch64-linux.tar.gz'
else:
command = 'wget https://www.litespeedtech.com/packages/6.0/lsws-6.2-ent-x86_64-linux.tar.gz'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
if os.path.exists('/usr/local/CyberCP/lsws-6.0/'):
shutil.rmtree('/usr/local/CyberCP/lsws-6.0')
if os.path.exists('/usr/local/CyberCP/lsws-6.2/'):
shutil.rmtree('/usr/local/CyberCP/lsws-6.2/')
if ACLManager.ISARM():
command = 'tar zxf lsws-6.2-ent-aarch64-linux.tar.gz -C /usr/local/CyberCP'
else:
command = 'tar zxf lsws-6.2-ent-x86_64-linux.tar.gz -C /usr/local/CyberCP'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
if licenseKey == 'trial':
command = 'wget -q --output-document=/usr/local/CyberCP/lsws-6.2/trial.key http://license.litespeedtech.com/reseller/trial.key'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
else:
writeSerial = open('/usr/local/CyberCP/lsws-6.2/serial.no', 'w')
writeSerial.writelines(licenseKey)
writeSerial.close()
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-6.2/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-6.2/')
os.chdir('/usr/local/CyberCP/lsws-6.2/')
command = 'chmod +x install.sh'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
command = 'chmod +x functions.sh'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
command = './install.sh'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
os.chdir(cwd)
confPath = '/usr/local/lsws/conf/'
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/httpd_config.xml', confPath)
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/modsec.conf', confPath)
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/httpd.conf', confPath)
try:
command = 'chown -R lsadm:lsadm ' + confPath
subprocess.call(shlex.split(command))
except:
pass
try:
os.rmdir("/usr/local/CyberCP/lsws-6.2")
except:
pass
files = ['/usr/local/lsws/conf/httpd_config.xml', '/usr/local/lsws/conf/modsec.conf', '/usr/local/lsws/conf/httpd.conf']
for items in files:
command = 'chmod 644 %s' % (items)
ServerStatusUtil.executioner(command, statusFile)
return 1
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
@staticmethod
def setupFileManager(statusFile):
try:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Setting up Filemanager files..\n")
fileManagerPath = ServerStatusUtil.serverRootPath+"FileManager"
if os.path.exists(fileManagerPath):
shutil.rmtree(fileManagerPath)
shutil.copytree("/usr/local/CyberCP/serverStatus/litespeed/FileManager",fileManagerPath)
## remove unnecessary files
command = 'chmod -R 777 ' + fileManagerPath
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Filemanager files are set!\n")
return 1
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
@staticmethod
def recover():
FNULL = open(os.devnull, 'w')
if os.path.exists('/usr/local/lsws'):
shutil.rmtree('/usr/local/lsws')
command = 'mv /usr/local/lswsbak /usr/local/lsws'
ServerStatusUtil.executioner(command, FNULL)
command = '/usr/local/lsws/bin/openlitespeed'
ServerStatusUtil.executioner(command, FNULL)
@staticmethod
def createWebsite(website):
try:
virtualHostName = website.domain
confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
FNULL = open(os.devnull, 'w')
if not os.path.exists(confPath):
command = 'mkdir -p ' + confPath
ServerStatusUtil.executioner(command, FNULL)
completePathToConfigFile = confPath + "/vhost.conf"
if vhost.perHostVirtualConf(completePathToConfigFile, website.adminEmail , website.externalApp, website.phpSelection,
virtualHostName, 1) == 1:
pass
else:
return 0
retValues = vhost.createConfigInMainVirtualHostFile(virtualHostName)
if retValues[0] == 0:
return 0
if os.path.exists('/etc/letsencrypt/live/' + virtualHostName):
sslUtilities.installSSLForDomain(virtualHostName, website.adminEmail)
vhostPath = vhost.Server_root + "/conf/vhosts"
FNULL = open(os.devnull, 'w')
command = "chown -R " + "lsadm" + ":" + "lsadm" + " " + vhostPath
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
@staticmethod
def createDomain(website):
try:
virtualHostName = website.domain
confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
completePathToConfigFile = confPath + "/vhost.conf"
confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
FNULL = open(os.devnull, 'w')
if not os.path.exists(confPath):
command = 'mkdir -p ' + confPath
ServerStatusUtil.executioner(command, FNULL)
if vhost.perHostDomainConf(website.path, website.master.domain, virtualHostName, completePathToConfigFile, website.master.adminEmail, website.phpSelection, website.master.externalApp, 1) == 1:
pass
else:
return 0
retValues = vhost.createConfigInMainDomainHostFile(virtualHostName, website.master.domain)
if retValues[0] == 0:
return 0
if os.path.exists('/etc/letsencrypt/live/' + virtualHostName):
sslUtilities.installSSLForDomain(virtualHostName, website.master.adminEmail)
vhostPath = vhost.Server_root + "/conf/vhosts"
FNULL = open(os.devnull, 'w')
command = "chown -R " + "lsadm" + ":" + "lsadm" + " " + vhostPath
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
@staticmethod
def rebuildvConf():
try:
allWebsites = Websites.objects.all()
for website in allWebsites:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Building vhost conf for: " + website.domain + ".\n", 1)
if ServerStatusUtil.createWebsite(website) == 0:
return 0
childs = website.childdomains_set.all()
for child in childs:
try:
if ServerStatusUtil.createDomain(child) == 0:
logging.CyberCPLogFileWriter.writeToFile(
'Error while creating child domain: ' + child.domain)
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(
'Error while creating child domain: ' + child.domain + ' . Exact message: ' + str(
msg))
aliases = website.aliasdomains_set.all()
for alias in aliases:
try:
aliasDomain = alias.aliasDomain
alias.delete()
virtualHostUtilities.createAlias(website.domain, aliasDomain, 0, '/home', website.adminEmail, website.admin)
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(
'Error while creating alais domain: ' + aliasDomain + ' . Exact message: ' + str(
msg))
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"vhost conf successfully built for: " + website.domain + ".\n", 1)
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
@staticmethod
def switchTOLSWS(licenseKey):
try:
os.environ['TERM'] = "xterm-256color"
statusFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w')
FNULL = open(os.devnull, 'w')
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Starting conversion process..\n")
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Removing OpenLiteSpeed..\n", 1)
## Try to stop current LiteSpeed Process
ProcessUtilities.killLiteSpeed()
if os.path.exists('/usr/local/lsws'):
if not os.path.exists('/usr/local/lswsbak'):
shutil.copytree('/usr/local/lsws', '/usr/local/lswsbak', symlinks=True, ignore=ignore_patterns('*.sock*'))
dirs = os.listdir('/usr/local/lsws')
for dir in dirs:
if dir.find('lsphp') > -1:
continue
finalDir = '/usr/local/lsws/' + dir
try:
shutil.rmtree(finalDir)
except:
pass
if os.path.exists('/etc/redhat-release'):
command = 'yum -y erase openlitespeed'
else:
command = "apt-get -y remove openlitespeed"
ServerStatusUtil.executioner(command, statusFile)
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"OpenLiteSpeed removed.\n", 1)
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Installing LiteSpeed Enterprise Web Server ..\n", 1)
if ServerStatusUtil.installLiteSpeed(licenseKey, statusFile) == 0:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to install LiteSpeed. [404]", 1)
ServerStatusUtil.recover()
return 0
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"LiteSpeed Enterprise Web Server installed.\n", 1)
# if ServerStatusUtil.setupFileManager(statusFile) == 0:
# logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to set up File Manager. [404]", 1)
# ServerStatusUtil.recover()
# return 0
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Rebuilding vhost conf..\n", 1)
ServerStatusUtil.rebuildvConf()
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"vhost conf successfully built.\n", 1)
ProcessUtilities.stopLitespeed()
ProcessUtilities.restartLitespeed()
### Check and remove OLS restart if lsws ent detected
CentOSPath = '/etc/redhat-release'
if os.path.exists(CentOSPath):
cronPath = '/var/spool/cron/root'
else:
cronPath = '/var/spool/cron/crontabs/root'
data = open(cronPath, 'r').readlines()
writeToFile = open(cronPath, 'w')
for items in data:
if items.find('-maxdepth 2 -type f -newer') > -1:
pass
else:
writeToFile.writelines(items)
writeToFile.close()
###
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Successfully switched to LITESPEED ENTERPRISE WEB SERVER. [200]\n", 1)
except BaseException as msg:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"%s. [404]" % (str(msg)), 1)
logging.CyberCPLogFileWriter.writeToFile(str(msg))
ServerStatusUtil.recover()
@staticmethod
def switchTOLSWSCLI(licenseKey):
try:
ssu = ServerStatusUtil(licenseKey)
ssu.start()
while(True):
command = 'sudo cat ' + ServerStatusUtil.lswsInstallStatusPath
output = ProcessUtilities.outputExecutioner(command)
if output.find('[404]') > -1:
command = "sudo rm -f " + ServerStatusUtil.lswsInstallStatusPath
ProcessUtilities.popenExecutioner(command)
data_ret = {'status': 1, 'abort': 1, 'requestStatus': output, 'installed': 0}
print(str(data_ret))
return 0
elif output.find('[200]') > -1:
command = "sudo rm -f " + ServerStatusUtil.lswsInstallStatusPath
ProcessUtilities.popenExecutioner(command)
data_ret = {'status': 1, 'abort': 1, 'requestStatus': 'Successfully converted.', 'installed': 1}
print(str(data_ret))
return 1
else:
data_ret = {'status': 1, 'abort': 0, 'requestStatus': output, 'installed': 0}
#print(output)
time.sleep(2)
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
def main():
parser = argparse.ArgumentParser(description='Server Status Util.')
parser.add_argument('function', help='Specific a function to call!')
parser.add_argument('--licenseKey', help='LITESPEED ENTERPRISE WEB SERVER License Key')
args = parser.parse_args()
if args.function == "switchTOLSWS":
ServerStatusUtil.switchTOLSWS(args.licenseKey)
if __name__ == "__main__":
main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,170 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Switch off security - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<style>
.tagcontainer {
display: flex;
justify-content: space-evenly;
}
.tags-container {
width: 200px;
height: 300px;
overflow-y: auto;
margin-right: 10px;
border: 1px solid #ccc;
}
.tags-label {
font-weight: bold;
margin-bottom: 5px;
}
.tags {
width: calc(100% - 20px); /* Adjusted width to accommodate the icon */
justify-content: space-between;
margin: 5px 0; /* Added margin top and bottom */
display: flex; /* Added to ensure icon and text are aligned */
align-items: center; /* Added to vertically center the icon */
padding: 5px;
}
.tags:hover {
background-color: lightblue;
}
.tag-icon {
display: none; /* Initially hide the SVG icon */
}
.tags:hover .tag-icon {
display: inline-block; /* Show the SVG icon on hover */
}
/* Adjusted SVG styling */
svg {
flex-shrink: 0; /* Prevent SVG from shrinking */
margin-left: 5px; /* Added space between text and icon */
}
.search-input {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><g fill="none" stroke="currentColor"><circle cx="11" cy="11" r="5.5"/><path stroke-linecap="round" stroke-linejoin="round" d="m15 15l4 4"/></g></svg>');
background-repeat: no-repeat;
background-position: calc(100% - 10px) center;
padding-right: 30px; /* Adjust based on the size of your SVG icon */
}
.search-input:focus {
outline: none; /* Optional: Remove outline on focus */
}
</style>
<div class="container">
<div id="page-title">
<h2>{% trans "Switch off security rules" %} <img src="{% static 'images/lsON.png' %}"
style="margin-bottom: 5px;"></h2>
<p>{% trans "Here you can switch off security rules. It is handy if you find out that a security rule is too restrictive for some websites. To deactivate security rules, specify their IDs (for example, 340003 or 340005-340007), tags (for example, CVE-2011-4898), or regular expressions used in rule messages (for example, XSS)." %}</p>
</div>
<div ng-controller="securityrule" class="panel">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "Security Rules" %} <img ng-hide="securityruleLoading"
src="{% static 'images/loading.gif' %}">
</h3>
<div class="example-box-wrapper">
<form action="/" id="createPackages"
class="form-horizontal bordered-row panel-body">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Security Rule IDs" %}</label>
<div class="col-sm-6">
<input name="dom" type="text" class="form-control" ng-model="ruleID"
required>
</div>
</div>
<div class="form-group tagcontainer">
<div>
<div class="tags-label">Activate Tags</div>
<div class="tags-container">
<input type="text" ng-model="tagFilter" placeholder="Search tags"
class="search-input">
<div ng-repeat="tag in ActivateTags | filter:tagFilter"
ng-click="toggleActivation(tag)">
<span class="tags">{$ tag $}
<svg class="tag-icon" xmlns="http://www.w3.org/2000/svg" width="1em"
height="1em"
viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2" d="m10 17l5-5-5-5"/>
</svg>
</span>
</div>
</div>
</div>
<div>
<div class="tags-label">Deactivated Tags</div>
<div class="tags-container">
<input type="text" ng-model="deactivatedTagFilter" placeholder="Search tags"
class="search-input">
<div ng-repeat="tag in DeactivatedTags | filter:deactivatedTagFilter"
ng-click="toggleActivation(tag)">
<span class="tags">{$ tag $}
<svg class="tag-icon" xmlns="http://www.w3.org/2000/svg" width="1em"
height="1em"
viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2" d="m14 7l-5 5 5 5"/>
</svg>
</span>
</div>
</div>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Regular expressions in rule messages " %}</label>
<div class="col-sm-6">
<textarea name="dom" type="text" class="form-control" ng-model="Regular_expressions"
rows="5"
required> </textarea>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button
type="button" ng-click="applychanges()"
class="btn btn-primary btn-lg">{% trans "Save Changes" %}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,443 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Change CyberPanel Access Port - CyberPanel" %}{% endblock %}
{% block header_scripts %}
<style>
/* Angular cloak to prevent flashing */
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
/* Default state before Angular loads */
.btn-primary .loading-spinner,
.btn-primary span:nth-child(4) {
display: none !important;
}
/* Angular hide class */
.ng-hide {
display: none !important;
}
/* Show loading spinner when not hidden */
.ng-scope .loading-spinner:not(.ng-hide) {
display: inline-block !important;
}
/* Ensure default text is visible */
.btn-primary i.fas.fa-save,
.btn-primary span:nth-child(3) {
display: inline-block;
}
/* Page Specific Styles */
.page-wrapper {
background: transparent;
padding: 20px;
}
.page-container {
max-width: 800px;
margin: 0 auto;
}
/* Form Section */
.form-section {
background: white;
border-radius: 12px;
padding: 30px;
margin-bottom: 25px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
}
.section-title {
font-size: 18px;
font-weight: 700;
color: #2f3640;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.section-title::before {
content: '';
width: 4px;
height: 24px;
background: #5b5fcf;
border-radius: 2px;
}
.section-description {
font-size: 14px;
color: #64748b;
margin-bottom: 30px;
line-height: 1.6;
}
.form-content {
max-width: 600px;
margin: 0 auto;
}
.form-group {
margin-bottom: 25px;
}
.form-label {
display: block;
font-size: 13px;
font-weight: 600;
color: #2f3640;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.form-control-wrapper {
position: relative;
}
.form-control {
width: 100%;
padding: 12px 16px;
font-size: 14px;
border: 1px solid #e8e9ff;
border-radius: 8px;
background: #f8f9ff;
color: #2f3640;
transition: all 0.3s ease;
}
.form-control:focus {
outline: none;
border-color: #5b5fcf;
background: white;
box-shadow: 0 0 0 3px rgba(91,95,207,0.1);
}
.form-help {
font-size: 12px;
color: #8893a7;
margin-top: 8px;
display: flex;
align-items: center;
gap: 6px;
}
.form-help i {
font-size: 13px;
color: #5b5fcf;
}
.form-actions {
display: flex;
gap: 15px;
justify-content: center;
margin-top: 35px;
}
.btn-primary {
background: #5b5fcf;
color: white;
border: none;
padding: 12px 30px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-transform: uppercase;
letter-spacing: 0.5px;
display: inline-flex;
align-items: center;
gap: 8px;
}
.btn-primary:hover {
background: #4b4fbf;
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(91,95,207,0.3);
}
.btn-primary:disabled {
background: #94a3b8;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
/* Loading State */
.loading-spinner {
display: inline-block;
width: 14px;
height: 14px;
border: 2px solid #ffffff;
border-radius: 50%;
border-top-color: transparent;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Info Box */
.info-box {
background: #f0f0ff;
border: 1px solid #e8e9ff;
border-radius: 8px;
padding: 16px;
margin-bottom: 25px;
}
.info-box-title {
font-size: 13px;
font-weight: 600;
color: #2f3640;
margin-bottom: 8px;
display: flex;
align-items: center;
gap: 8px;
}
.info-box-title i {
color: #5b5fcf;
font-size: 16px;
}
.info-box-content {
font-size: 13px;
color: #64748b;
line-height: 1.6;
}
.info-box-content strong {
color: #2f3640;
font-weight: 600;
}
/* Warning Box */
.warning-box {
background: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 8px;
padding: 16px;
margin-bottom: 25px;
}
.warning-box-title {
font-size: 13px;
font-weight: 600;
color: #856404;
margin-bottom: 8px;
display: flex;
align-items: center;
gap: 8px;
}
.warning-box-title i {
color: #f39c12;
font-size: 16px;
}
.warning-box-content {
font-size: 13px;
color: #856404;
line-height: 1.6;
}
/* Bootstrap Toggle Styling Override */
.toggle {
position: relative;
overflow: hidden;
width: 70px !important;
height: 32px !important;
border-radius: 8px !important;
border: 1px solid #e8e9ff !important;
}
.toggle.off {
background: #f8f9ff !important;
border-color: #e8e9ff !important;
}
.toggle.on {
background: #5b5fcf !important;
border-color: #5b5fcf !important;
}
.toggle .toggle-handle {
position: absolute;
top: 2px;
bottom: 2px;
width: 26px !important;
background: white !important;
border-radius: 6px !important;
box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
transition: all 0.3s ease !important;
}
.toggle.off .toggle-handle {
left: 2px;
}
.toggle.on .toggle-handle {
right: 2px;
left: auto;
}
.toggle-group {
transition: all 0.3s ease !important;
}
.toggle-on, .toggle-off {
font-size: 12px !important;
font-weight: 600 !important;
letter-spacing: 0.5px !important;
text-transform: uppercase !important;
}
.toggle-on {
background: transparent !important;
color: white !important;
box-shadow: none !important;
}
.toggle-off {
background: transparent !important;
color: #64748b !important;
box-shadow: none !important;
}
/* Toggle Container Styling */
.toggle-container {
margin-bottom: 25px;
}
.toggle-label {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.toggle-label span {
font-size: 13px;
font-weight: 600;
color: #2f3640;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.toggle-help {
font-size: 12px;
color: #8893a7;
margin-top: 8px;
display: flex;
align-items: center;
gap: 6px;
}
.toggle-help i {
font-size: 13px;
color: #5b5fcf;
}
/* Responsive */
@media (max-width: 768px) {
.form-section {
padding: 20px;
}
.section-title {
font-size: 16px;
}
.form-actions {
flex-direction: column;
}
.btn-primary {
width: 100%;
justify-content: center;
}
}
</style>
{% endblock %}
{% block content %}
<div class="page-wrapper">
<div class="page-container" ng-controller="changePort">
<!-- Form Section -->
<div class="form-section">
<h2 class="section-title">{% trans "Change CyberPanel Port" %}</h2>
<p class="section-description">
{% trans "Configure the port used to access your CyberPanel control panel. The default port is 8090." %}
</p>
<!-- Warning Box -->
<div class="warning-box">
<div class="warning-box-title">
<i class="fas fa-exclamation-triangle"></i>
{% trans "Important Notice" %}
</div>
<div class="warning-box-content">
{% trans "After changing the port, you will need to access CyberPanel using the new port number. Make sure to update your firewall rules to allow access through the new port." %}
</div>
</div>
<!-- Info Box -->
<div class="info-box">
<div class="info-box-title">
<i class="fas fa-info-circle"></i>
{% trans "Current Configuration" %}
</div>
<div class="info-box-content">
{% trans "Your CyberPanel is currently accessible on port" %} <strong>{{ port }}</strong>
</div>
</div>
<div class="form-content">
<form action="/" method="post">
<div class="form-group">
<label class="form-label">{% trans "New Port Number" %}</label>
<div class="form-control-wrapper">
<input type="text"
name="port"
class="form-control"
ng-model="port"
ng-init="port={{ port }}"
placeholder="{% trans 'Enter port number (e.g., 8090)' %}"
required
pattern="[0-9]+"
min="1"
max="65535">
</div>
<div class="form-help">
<i class="fas fa-lightbulb"></i>
{% trans "Valid port range: 1 - 65535. Common ports: 8090, 8443, 7080." %}
</div>
</div>
<div class="form-actions">
<button type="button"
class="btn-primary"
ng-click="changeCPPort()"
ng-disabled="cyberpanelLoading">
<i class="fas fa-save" ng-class="{'ng-hide': cyberpanelLoading}"></i>
<span class="loading-spinner" ng-class="{'ng-hide': !cyberpanelLoading}"></span>
<span ng-class="{'ng-hide': cyberpanelLoading}">{% trans "Change Port" %}</span>
<span ng-class="{'ng-hide': !cyberpanelLoading}">{% trans "Changing..." %}</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,509 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "CyberPanel Main Log File - CyberPanel" %}{% endblock %}
{% block header_scripts %}
<style>
.modern-container {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
}
.page-header {
text-align: center;
margin-bottom: 3rem;
padding: 3rem 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
animation: fadeInDown 0.5s ease-out;
position: relative;
overflow: hidden;
color: white;
}
.page-header::before {
content: '';
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
animation: rotate 30s linear infinite;
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.header-content {
position: relative;
z-index: 1;
}
.page-title {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.log-icon {
width: 60px;
height: 60px;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.page-subtitle {
font-size: 1.125rem;
color: rgba(255, 255, 255, 0.9);
max-width: 700px;
margin: 0 auto;
line-height: 1.6;
}
.log-viewer-panel {
background: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
overflow: hidden;
animation: fadeInUp 0.5s ease-out;
}
.panel-header {
background: #1e293b;
color: white;
padding: 1rem 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #334155;
}
.panel-title {
font-size: 1rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.75rem;
color: #e2e8f0;
}
.panel-icon {
width: 32px;
height: 32px;
background: #334155;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #64748b;
}
.log-stats {
display: flex;
align-items: center;
gap: 1.5rem;
}
.stat-item {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.875rem;
color: #94a3b8;
}
.stat-value {
color: #e2e8f0;
font-weight: 600;
}
.log-controls {
background: #f8f9ff;
padding: 1rem 1.5rem;
border-bottom: 1px solid #e8e9ff;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 1rem;
}
.control-group {
display: flex;
align-items: center;
gap: 1rem;
}
.search-box {
position: relative;
min-width: 300px;
}
.search-input {
width: 100%;
padding: 0.5rem 1rem 0.5rem 2.5rem;
border: 1px solid #e8e9ff;
border-radius: 8px;
font-size: 0.875rem;
transition: all 0.3s ease;
}
.search-input:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.search-icon {
position: absolute;
left: 0.75rem;
top: 50%;
transform: translateY(-50%);
color: #94a3b8;
font-size: 0.875rem;
}
.log-content {
background: #1e293b;
padding: 1.5rem;
min-height: 600px;
max-height: 700px;
overflow-y: auto;
position: relative;
}
.log-textarea {
width: 100%;
background: transparent;
color: #10b981;
font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
font-size: 1.125rem;
line-height: 1.6;
border: none;
outline: none;
resize: none;
min-height: 550px;
}
.log-textarea::placeholder {
color: #475569;
}
.log-line-numbers {
position: absolute;
left: 0;
top: 1.5rem;
width: 50px;
text-align: right;
color: #475569;
font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
font-size: 1.125rem;
line-height: 1.6;
user-select: none;
padding-right: 1rem;
border-right: 1px solid #334155;
}
.log-content-wrapper {
padding-left: 60px;
}
.action-bar {
background: #f8f9ff;
padding: 1.5rem;
border-top: 1px solid #e8e9ff;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.btn {
padding: 0.625rem 1.5rem;
border-radius: 8px;
font-weight: 500;
font-size: 0.875rem;
cursor: pointer;
transition: all 0.3s ease;
border: none;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.btn-primary {
background: #667eea;
color: white;
}
.btn-primary:hover {
background: #5a67d8;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-danger {
background: #ef4444;
color: white;
}
.btn-danger:hover {
background: #dc2626;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-secondary {
background: #64748b;
color: white;
}
.btn-secondary:hover {
background: #475569;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}
.loading-spinner {
width: 20px;
height: 20px;
border: 2px solid #f3f3f3;
border-top: 2px solid #667eea;
border-radius: 50%;
animation: spin 1s linear infinite;
display: inline-block;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.alert {
padding: 1rem 1.5rem;
border-radius: 8px;
margin: 1rem 1.5rem;
display: flex;
align-items: center;
gap: 0.75rem;
animation: fadeInUp 0.3s ease-out;
}
.alert-success {
background: #d1fae5;
color: #065f46;
border: 1px solid #a7f3d0;
}
.alert-danger {
background: #fee2e2;
color: #991b1b;
border: 1px solid #fecaca;
}
.alert-icon {
font-size: 1.25rem;
}
.empty-state {
text-align: center;
padding: 4rem 2rem;
color: #64748b;
}
.empty-icon {
font-size: 4rem;
color: #94a3b8;
margin-bottom: 1rem;
}
.empty-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 0.5rem;
color: #475569;
}
.empty-text {
font-size: 0.875rem;
color: #64748b;
}
/* Custom Scrollbar */
.log-content::-webkit-scrollbar {
width: 8px;
}
.log-content::-webkit-scrollbar-track {
background: #334155;
border-radius: 4px;
}
.log-content::-webkit-scrollbar-thumb {
background: #64748b;
border-radius: 4px;
}
.log-content::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* Log Level Colors */
.log-error { color: #ef4444; }
.log-warning { color: #f59e0b; }
.log-info { color: #3b82f6; }
.log-debug { color: #8b5cf6; }
.log-success { color: #10b981; }
/* Responsive */
@media (max-width: 768px) {
.modern-container {
padding: 1rem;
}
.page-title {
font-size: 2rem;
}
.log-controls {
flex-direction: column;
align-items: stretch;
}
.search-box {
min-width: 100%;
}
.control-group {
flex-direction: column;
align-items: stretch;
width: 100%;
}
.action-bar {
flex-direction: column;
gap: 0.5rem;
}
.btn {
width: 100%;
justify-content: center;
}
}
</style>
{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="modern-container" ng-controller="readCyberCPLogFile">
<!-- Page Header -->
<div class="page-header">
<div class="header-content">
<div class="page-title">
<div class="log-icon">
<i class="fas fa-file-alt fa-2x"></i>
</div>
{% trans "CyberPanel Main Log File" %}
</div>
<p class="page-subtitle">
{% trans "This log file corresponds to errors generated by CyberPanel. For domain-specific error logs, check /home/domain/logs." %}
</p>
</div>
</div>
<!-- Log Viewer Panel -->
<div class="log-viewer-panel">
<!-- Panel Header -->
<div class="panel-header">
<div class="panel-title">
<div class="panel-icon">
<i class="fas fa-terminal"></i>
</div>
{% trans "Log Viewer" %}
</div>
<div class="log-stats">
<div class="stat-item">
<span>{% trans "Showing:" %}</span>
<span class="stat-value">{% trans "Last 50 lines" %}</span>
</div>
<div ng-hide="logFileLoading" class="stat-item">
<i class="fas fa-check-circle" style="color: #10b981;"></i>
<span>{% trans "Live" %}</span>
</div>
<div ng-show="!logFileLoading" class="loading-spinner"></div>
</div>
</div>
<!-- Log Content -->
<div class="log-content">
<div class="log-content-wrapper">
<textarea ng-model="logsData"
class="log-textarea"
readonly
placeholder="{% trans 'Log content will appear here...' %}"></textarea>
</div>
</div>
<!-- Success/Error Messages -->
<div ng-hide="logsFeteched" class="alert alert-success">
<i class="fas fa-check-circle alert-icon"></i>
<span>{% trans "Last 50 lines fetched successfully" %}</span>
</div>
<div ng-hide="couldNotFetchLogs" class="alert alert-danger">
<i class="fas fa-exclamation-circle alert-icon"></i>
<span>{% trans "Could not fetch logs. Use the command line to view the log file." %}</span>
</div>
<!-- Action Bar -->
<div class="action-bar">
<button type="button"
ng-click="fetchLogs()"
class="btn btn-primary">
<i class="fas fa-sync-alt"></i>
{% trans "Refresh Logs" %}
</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,83 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Server Status - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container">
<div id="page-title">
<h2>{% trans "Server Status" %}</h2>
<p>{% trans "View LiteSpeed status and log files." %}</p>
</div>
<div class="panel col-md-12">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "Available Functions" %}
</h3>
<div class="example-box-wrapper">
<div class="row">
<div class="col-md-3 btn-min-width">
<a href="{% url 'topProcesses' %}" title="{% trans 'Top Processes' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Top Processes" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-heartbeat"></i>
</div>
</a>
</div>
<div class="col-md-3 btn-min-width">
<a href="{% url 'litespeedStatus' %}" title="{% trans 'LiteSpeed Status' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "LiteSpeed Status" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-heartbeat"></i>
</div>
</a>
</div>
<div class="col-md-3 btn-min-width">
<a href="{% url 'cyberCPMainLogFile' %}" title="{% trans 'CyberPanel Main Log File' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "CyberPanel Main Log" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-file"></i>
</div>
</a>
</div>
<div class="col-md-3 btn-min-width">
<a href="{% url 'services' %}" title="{% trans 'Services Status' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Services Status" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-file"></i>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,809 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "LiteSpeed Status - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<style>
.modern-container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
.page-header {
text-align: center;
margin-bottom: 3rem;
padding: 3rem 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
animation: fadeInDown 0.5s ease-out;
position: relative;
overflow: hidden;
color: white;
}
.page-header::before {
content: '';
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
animation: rotate 30s linear infinite;
}
.header-content {
position: relative;
z-index: 1;
}
.page-title {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.server-icon {
width: 60px;
height: 60px;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.page-subtitle {
font-size: 1.125rem;
color: rgba(255, 255, 255, 0.9);
max-width: 600px;
margin: 0 auto;
}
.status-indicator {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: rgba(255, 255, 255, 0.2);
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.875rem;
margin-top: 1rem;
}
.status-dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: #4ade80;
animation: pulse 2s infinite;
}
.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.info-card {
background: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
overflow: hidden;
transition: all 0.3s ease;
animation: fadeInUp 0.5s ease-out;
}
.info-card:hover {
transform: translateY(-5px);
box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 20px 60px rgba(0,0,0,0.1);
}
.card-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.card-title {
font-size: 1.125rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.75rem;
}
.card-icon {
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.2);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.card-content {
padding: 1.5rem;
}
.process-table {
width: 100%;
border-collapse: collapse;
}
.process-table th {
padding: 1rem;
text-align: left;
font-weight: 600;
color: #475569;
font-size: 0.875rem;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 2px solid #e8e9ff;
}
.process-table td {
padding: 1rem;
font-size: 0.875rem;
color: #1e293b;
border-bottom: 1px solid #f1f5f9;
}
.process-id {
font-family: 'Monaco', 'Consolas', monospace;
font-weight: 600;
color: #667eea;
}
.process-badge {
display: inline-flex;
padding: 0.25rem 0.75rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 500;
}
.badge-main {
background: #d1fae5;
color: #065f46;
}
.badge-worker {
background: #dbeafe;
color: #1e40af;
}
.badge-lscgid {
background: #fef3c7;
color: #92400e;
}
.action-buttons {
display: flex;
gap: 1rem;
margin-top: 1.5rem;
}
.btn {
padding: 0.75rem 1.5rem;
border-radius: 8px;
font-weight: 500;
font-size: 0.875rem;
cursor: pointer;
transition: all 0.3s ease;
border: none;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.btn-primary {
background: #667eea;
color: white;
}
.btn-primary:hover {
background: #764ba2;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-danger {
background: #dc2626;
color: white;
}
.btn-danger:hover {
background: #b91c1c;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.btn:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none !important;
}
.version-info {
background: #f8f9ff;
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 1rem;
}
.version-header {
font-size: 1.125rem;
font-weight: 600;
color: #1e293b;
margin-bottom: 1rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.module-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 0.5rem;
}
.module-item {
background: white;
padding: 0.5rem 1rem;
border-radius: 6px;
border: 1px solid #e8e9ff;
font-size: 0.875rem;
color: #475569;
transition: all 0.2s ease;
}
.module-item:hover {
background: #667eea;
color: white;
border-color: #667eea;
}
.alert {
padding: 1rem 1.5rem;
border-radius: 8px;
display: flex;
align-items: center;
gap: 0.75rem;
margin-top: 1rem;
animation: slideIn 0.3s ease-out;
}
.alert-icon {
font-size: 1.25rem;
flex-shrink: 0;
}
.alert-content {
flex: 1;
}
.alert-title {
font-weight: 600;
margin-bottom: 0.25rem;
}
.alert-message {
font-size: 0.875rem;
color: #475569;
}
.alert-success {
background: #d1fae5;
border: 1px solid #a7f3d0;
color: #065f46;
}
.alert-error {
background: #fee2e2;
border: 1px solid #fecaca;
color: #991b1b;
}
.alert-warning {
background: #fef3c7;
border: 1px solid #fde68a;
color: #92400e;
}
.alert-info {
background: #dbeafe;
border: 1px solid #bfdbfe;
color: #1e40af;
}
.license-panel {
background: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
overflow: hidden;
animation: fadeInUp 0.5s ease-out 0.2s;
animation-fill-mode: both;
}
.license-options {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
padding: 2rem;
}
.license-option {
text-align: center;
padding: 1.5rem;
border-radius: 12px;
border: 2px solid transparent;
transition: all 0.3s ease;
cursor: pointer;
}
.license-option:hover {
border-color: #667eea;
background: #f3e8ff;
}
.license-icon {
width: 60px;
height: 60px;
background: #f3e8ff;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1rem;
color: #667eea;
font-size: 1.5rem;
}
.license-label {
font-weight: 600;
color: #1e293b;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-label {
display: block;
font-weight: 500;
color: #475569;
font-size: 0.875rem;
margin-bottom: 0.5rem;
}
.form-control {
width: 100%;
padding: 0.75rem 1rem;
border: 1px solid #e8e9ff;
border-radius: 8px;
font-size: 0.875rem;
transition: all 0.3s ease;
background: #fff;
}
.form-control:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.loading-spinner {
width: 20px;
height: 20px;
border: 2px solid #f3f3f3;
border-top: 2px solid #667eea;
border-radius: 50%;
animation: spin 1s linear infinite;
display: inline-block;
margin-left: 0.5rem;
}
.console-output {
background: #1e293b;
color: #10b981;
font-family: 'Monaco', 'Consolas', monospace;
font-size: 0.875rem;
padding: 1.5rem;
border-radius: 8px;
height: 400px;
overflow-y: auto;
white-space: pre-wrap;
word-wrap: break-word;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@media (max-width: 768px) {
.license-options {
grid-template-columns: 1fr;
}
.page-title {
font-size: 2rem;
}
.info-grid {
grid-template-columns: 1fr;
}
}
</style>
<div class="modern-container">
<div class="page-header">
<div class="header-content">
<h1 class="page-title">
<div class="server-icon">
<img src="{% static 'images/lsON.png' %}" style="width: 35px; filter: brightness(0) invert(1);">
</div>
{% trans "LiteSpeed Server Status" %}
</h1>
<p class="page-subtitle">
{% trans "Monitor and manage your LiteSpeed web server processes, license status, and server configuration" %}
</p>
{% if processList %}
<div class="status-indicator">
<span class="status-dot"></span>
{% trans "LiteSpeed is Running" %}
</div>
{% endif %}
</div>
</div>
<!-- License Warnings -->
{% if message != 0 %}
{% if message == 2 %}
<div class="alert alert-warning">
<i class="fas fa-exclamation-triangle alert-icon"></i>
<div class="alert-content">
<div class="alert-title">{% trans "License Bundle Required" %}</div>
<div class="alert-message">
{% trans "Your license does not include the CyberPanel bundle." %}
<a href="https://cyberpanel.net/cyberpanel-enterprise/" style="color: inherit; font-weight: 600;">
{% trans "Click here to upgrade" %}
</a>
</div>
</div>
</div>
{% else %}
<div class="alert alert-error">
<i class="fas fa-times-circle alert-icon"></i>
<div class="alert-content">
<div class="alert-title">{% trans "License Expired" %}</div>
<div class="alert-message">{% trans "Your license has expired. Please renew your license to continue using LiteSpeed." %}</div>
</div>
</div>
{% endif %}
{% endif %}
<div class="info-grid">
<!-- Process Information -->
{% if processList %}
<div class="info-card" ng-controller="litespeedStatus">
<div class="card-header">
<h3 class="card-title">
<div class="card-icon">
<i class="fas fa-microchip"></i>
</div>
{% trans "LiteSpeed Processes" %}
</h3>
<span style="background: rgba(255,255,255,0.3); padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.875rem;">
{{ processList|length }} {% trans "Active" %}
</span>
</div>
<div class="card-content">
<table class="process-table">
<thead>
<tr>
<th>#</th>
<th>{% trans "Process ID" %}</th>
<th>{% trans "Type" %}</th>
</tr>
</thead>
<tbody>
{% for item in processList %}
<tr>
<td>{{ forloop.counter }}</td>
<td><span class="process-id">{{ item }}</span></td>
<td>
{% if forloop.counter == 1 %}
<span class="process-badge badge-main">{% trans "Main Process" %}</span>
{% elif forloop.counter == 2 %}
<span class="process-badge badge-lscgid">{% trans "lscgid Process" %}</span>
{% else %}
<span class="process-badge badge-worker">{% trans "Worker Process" %}</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="action-buttons">
<button ng-click="restartLitespeed()" ng-disabled="disableReboot" class="btn btn-primary">
<i class="fas fa-sync-alt"></i>
{% trans "Restart LiteSpeed" %}
<span ng-hide="restartorStopLoading" class="loading-spinner"></span>
</button>
<button ng-click="stopLitespeed()" ng-disabled="disableStop" class="btn btn-danger">
<i class="fas fa-stop"></i>
{% trans "Stop LiteSpeed" %}
</button>
</div>
<!-- Action Results -->
<div ng-hide="actionResult" class="alert alert-success">
<i class="fas fa-check-circle alert-icon"></i>
<div class="alert-content">
<div class="alert-message">{% trans "Action completed successfully." %}</div>
</div>
</div>
<div ng-hide="actionResultBad" class="alert alert-error">
<i class="fas fa-times-circle alert-icon"></i>
<div class="alert-content">
<div class="alert-message">{% trans "Error occurred. Please check the CyberPanel main log file." %}</div>
</div>
</div>
<div ng-hide="serverStatusCouldNotConnect" class="alert alert-error">
<i class="fas fa-exclamation-circle alert-icon"></i>
<div class="alert-content">
<div class="alert-message">{% trans "Could not connect to server." %}</div>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Version & Modules -->
<div class="info-card">
<div class="card-header">
<h3 class="card-title">
<div class="card-icon">
<i class="fas fa-info-circle"></i>
</div>
{% trans "Server Information" %}
</h3>
</div>
<div class="card-content">
<div class="version-info">
<div class="version-header">
<i class="fas fa-code-branch"></i>
{% trans "Version" %}: {{ lsversion }}
</div>
</div>
<h4 style="font-size: 0.875rem; font-weight: 600; color: #475569; margin: 1.5rem 0 1rem 0; text-transform: uppercase; letter-spacing: 0.05em;">
{{ modules }}
</h4>
<div class="module-list">
{% for item in loadedModules %}
<div class="module-item">{{ item }}</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% if not OLS %}
<!-- License Manager for Enterprise -->
<div class="license-panel" ng-controller="litespeedStatus">
<div class="card-header">
<h3 class="card-title">
<div class="card-icon">
<i class="fas fa-key"></i>
</div>
{% trans "License Manager" %}
</h3>
<span ng-hide="cpLoading" class="loading-spinner"></span>
</div>
<div class="license-options">
<div class="license-option" ng-click="licenseStatus(1)">
<div class="license-icon">
<i class="fas fa-check-circle"></i>
</div>
<div class="license-label">{% trans "License Status" %}</div>
</div>
<div class="license-option" ng-click="showSerialBox()">
<div class="license-icon">
<i class="fas fa-exchange-alt"></i>
</div>
<div class="license-label">{% trans "Change License" %}</div>
</div>
<div class="license-option" ng-click="refreshLicense()">
<div class="license-icon">
<i class="fas fa-sync"></i>
</div>
<div class="license-label">{% trans "Refresh License" %}</div>
</div>
</div>
<!-- License Status Display -->
<div ng-hide="fetchedData" style="padding: 0 2rem 2rem 2rem;">
<div class="alert alert-success">
<i class="fas fa-check-circle alert-icon"></i>
<div class="alert-content">
<div class="alert-title">{$ lsSerial $}</div>
<div class="alert-message">{$ lsexpiration $}</div>
</div>
</div>
</div>
<!-- Change License Form -->
<div ng-hide="changeSerialBox" style="padding: 0 2rem 2rem 2rem;">
<form>
<div class="form-group">
<label class="form-label">{% trans "New License Key" %}</label>
<input type="text" class="form-control" ng-model="newKey" placeholder="{% trans 'Enter your new license key' %}" required>
</div>
<button type="button" ng-click="changeLicense()" class="btn btn-primary">
<i class="fas fa-save"></i>
{% trans "Update License Key" %}
</button>
</form>
</div>
</div>
{% endif %}
{% if OLS %}
<!-- Switch to Enterprise for OLS -->
<div class="license-panel" ng-controller="lswsSwitch">
<div class="card-header">
<h3 class="card-title">
<div class="card-icon">
<i class="fas fa-rocket"></i>
</div>
{% trans "Upgrade to LiteSpeed Enterprise" %}
</h3>
<span ng-hide="cyberPanelLoading" class="loading-spinner"></span>
</div>
<div class="card-content">
<div ng-show="installBoxGen">
<form>
<div class="form-group">
<label class="form-label">{% trans "LiteSpeed License Key (Optional for Trial)" %}</label>
<input type="text" class="form-control" ng-model="licenseKey"
placeholder="{% trans 'Enter license key or leave empty for 15-day trial' %}">
</div>
<div class="action-buttons">
<button type="button" ng-click="switchTOLSWS()" class="btn btn-primary">
<i class="fas fa-exchange-alt"></i>
{% trans "Switch to Enterprise" %}
</button>
<button type="button" ng-click="confrimtril()" class="btn btn-primary" style="background: #8b5cf6;">
<i class="fas fa-clock"></i>
{% trans "Get 15 Days Trial" %}
</button>
</div>
<div id="confrimtril" style="display: none; margin-top: 1rem;">
<div class="alert alert-info">
<i class="fas fa-question-circle alert-icon"></i>
<div class="alert-content">
<div class="alert-title">{% trans "Confirm Trial Activation" %}</div>
<div class="alert-message">{% trans "Are you sure you want to activate the 15-day trial?" %}</div>
</div>
</div>
<button type="button" ng-click="switchTOLSWS()" class="btn btn-primary">
<i class="fas fa-check"></i>
{% trans "Yes, Activate Trial" %}
</button>
</div>
</form>
<div style="margin-top: 2rem;">
<div class="alert alert-info">
<i class="fas fa-info-circle alert-icon"></i>
<div class="alert-content">
<div class="alert-message">
{% trans "Note: If you select 15 days trial, there is no need to enter a license key. CyberPanel will automatically fetch a 15-day trial key for you. Make sure this server has not used a trial already." %}
</div>
</div>
</div>
<div class="alert alert-warning">
<i class="fas fa-exclamation-triangle alert-icon"></i>
<div class="alert-content">
<div class="alert-title" style="color: #dc2626;">{% trans "Important Warning" %}</div>
<div class="alert-message">
{% trans "You cannot revert back to OpenLiteSpeed if you choose not to purchase a LiteSpeed Enterprise license after the 15 day trial period. We recommend you test the Enterprise trial on a separate server." %}
</div>
</div>
</div>
</div>
</div>
<!-- Installation Progress -->
<div ng-hide="installBoxGen">
<h3 style="text-align: center; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center; gap: 1rem;">
<img style="width: 50px" src="{% static 'images/litespeed-logo.png' %}">
{% trans "Installation Progress" %}
<span ng-hide="cyberPanelLoading" class="loading-spinner"></span>
</h3>
<div class="console-output" ng-bind="requestData"></div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}
{% block footer_scripts %}
<script src="{% static 'serverStatus/serverStatus.js' %}"></script>
{% endblock %}

View File

@@ -0,0 +1,911 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Package Manager - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<style>
.modern-container {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
}
.page-header {
text-align: center;
margin-bottom: 3rem;
padding: 3rem 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
animation: fadeInDown 0.5s ease-out;
position: relative;
overflow: hidden;
color: white;
}
.page-header::before {
content: '';
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
animation: rotate 30s linear infinite;
}
.header-content {
position: relative;
z-index: 1;
}
.page-title {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.package-icon {
width: 60px;
height: 60px;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.page-subtitle {
font-size: 1.125rem;
color: rgba(255, 255, 255, 0.9);
max-width: 600px;
margin: 0 auto;
}
.stats-bar {
display: flex;
gap: 1rem;
justify-content: center;
margin-top: 2rem;
flex-wrap: wrap;
}
.stat-badge {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
padding: 0.5rem 1.5rem;
border-radius: 20px;
font-size: 0.875rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.stat-value {
font-weight: 700;
}
.tabs-container {
background: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
overflow: hidden;
animation: fadeInUp 0.5s ease-out;
}
.modern-tabs {
display: flex;
background: #f8f9ff;
border-bottom: 1px solid #e8e9ff;
overflow-x: auto;
}
.tab-item {
padding: 1.25rem 2rem;
cursor: pointer;
border: none;
background: none;
font-weight: 500;
color: #64748b;
position: relative;
white-space: nowrap;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 0.5rem;
}
.tab-item:hover {
color: #667eea;
background: rgba(102, 126, 234, 0.05);
}
.tab-item.active {
color: #667eea;
background: white;
}
.tab-item.active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}
.tab-icon {
font-size: 1.125rem;
}
.tab-content {
padding: 2rem;
}
.controls-bar {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
.search-box {
flex: 1;
min-width: 300px;
position: relative;
}
.search-input {
width: 100%;
padding: 0.75rem 1rem 0.75rem 2.5rem;
border: 1px solid #e8e9ff;
border-radius: 8px;
font-size: 0.875rem;
transition: all 0.3s ease;
}
.search-input:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.search-icon {
position: absolute;
left: 0.75rem;
top: 50%;
transform: translateY(-50%);
color: #94a3b8;
}
.control-group {
display: flex;
gap: 1rem;
align-items: center;
}
.select-control {
padding: 0.75rem 2.5rem 0.75rem 1rem;
border: 1px solid #e8e9ff;
border-radius: 8px;
font-size: 0.875rem;
background: white;
appearance: none;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 0.5rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
cursor: pointer;
}
.btn {
padding: 0.75rem 1.5rem;
border-radius: 8px;
font-weight: 500;
font-size: 0.875rem;
cursor: pointer;
transition: all 0.3s ease;
border: none;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.btn-primary {
background: #667eea;
color: white;
}
.btn-primary:hover {
background: #764ba2;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-success {
background: #10b981;
color: white;
}
.btn-success:hover {
background: #059669;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-info {
background: #3b82f6;
color: white;
}
.btn-info:hover {
background: #2563eb;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-secondary {
background: white;
color: #64748b;
border: 1px solid #e8e9ff;
}
.btn-secondary:hover {
background: #f8f9ff;
border-color: #cbd5e1;
}
.package-table {
width: 100%;
border-collapse: collapse;
background: white;
}
.package-table thead {
background: #f8f9ff;
position: sticky;
top: 0;
z-index: 10;
}
.package-table th {
padding: 1rem;
text-align: left;
font-weight: 600;
color: #475569;
font-size: 0.875rem;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 2px solid #e8e9ff;
}
.package-table td {
padding: 1rem;
font-size: 0.875rem;
color: #1e293b;
border-bottom: 1px solid #f1f5f9;
}
.package-table tbody tr {
transition: all 0.2s ease;
}
.package-table tbody tr:hover {
background: #f8f9ff;
}
.package-name {
font-weight: 600;
color: #1e293b;
display: flex;
align-items: center;
gap: 0.5rem;
}
.package-type {
font-size: 0.625rem;
padding: 0.125rem 0.5rem;
border-radius: 4px;
background: #f3e8ff;
color: #667eea;
font-weight: 500;
}
.version-badge {
font-family: 'Monaco', 'Consolas', monospace;
font-size: 0.875rem;
background: #f3f4f6;
padding: 0.25rem 0.75rem;
border-radius: 6px;
display: inline-block;
}
.upgrade-badge {
background: #d1fae5;
color: #065f46;
padding: 0.25rem 0.75rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 500;
display: inline-flex;
align-items: center;
gap: 0.25rem;
}
.lock-toggle {
cursor: pointer;
font-size: 1.125rem;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 6px;
}
.lock-toggle:hover {
background: #f3f4f6;
}
.lock-toggle.locked {
color: #dc2626;
}
.lock-toggle.unlocked {
color: #10b981;
}
.action-buttons {
display: flex;
gap: 0.5rem;
}
.btn-sm {
padding: 0.5rem 1rem;
font-size: 0.75rem;
}
.loading-spinner {
width: 20px;
height: 20px;
border: 2px solid #f3f3f3;
border-top: 2px solid #667eea;
border-radius: 50%;
animation: spin 1s linear infinite;
display: inline-block;
}
.pagination-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid #e8e9ff;
}
.pagination-info {
font-size: 0.875rem;
color: #64748b;
}
.pagination-controls {
display: flex;
gap: 0.5rem;
align-items: center;
}
.page-select {
padding: 0.5rem 1rem;
border: 1px solid #e8e9ff;
border-radius: 6px;
font-size: 0.875rem;
}
/* Modal Styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
backdrop-filter: blur(4px);
}
.modal-content {
background: white;
border-radius: 16px;
max-width: 800px;
width: 90%;
max-height: 90vh;
overflow: hidden;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
animation: modalSlideIn 0.3s ease-out;
}
.modal-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1.5rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.modal-title {
font-size: 1.25rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.75rem;
}
.modal-close {
background: none;
border: none;
color: white;
font-size: 1.5rem;
cursor: pointer;
padding: 0;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
transition: all 0.2s ease;
}
.modal-close:hover {
background: rgba(255, 255, 255, 0.2);
}
.modal-body {
padding: 2rem;
max-height: calc(90vh - 140px);
overflow-y: auto;
}
.console-output {
background: #1e293b;
color: #10b981;
font-family: 'Monaco', 'Consolas', monospace;
font-size: 0.875rem;
padding: 1.5rem;
border-radius: 8px;
height: 400px;
overflow-y: auto;
white-space: pre-wrap;
word-wrap: break-word;
}
.detail-output {
background: #f8f9ff;
border: 1px solid #e8e9ff;
border-radius: 8px;
padding: 1.5rem;
font-family: 'Monaco', 'Consolas', monospace;
font-size: 0.875rem;
max-height: 400px;
overflow-y: auto;
white-space: pre-wrap;
}
.empty-state {
text-align: center;
padding: 4rem 2rem;
color: #64748b;
}
.empty-icon {
width: 80px;
height: 80px;
background: #f3f4f6;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1rem;
font-size: 2rem;
color: #94a3b8;
}
.alert {
padding: 1rem 1.5rem;
border-radius: 8px;
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1rem;
animation: slideIn 0.3s ease-out;
}
.alert-info {
background: #dbeafe;
border: 1px solid #bfdbfe;
color: #1e40af;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes modalSlideIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
@media (max-width: 768px) {
.controls-bar {
flex-direction: column;
align-items: stretch;
}
.search-box {
min-width: auto;
}
.control-group {
justify-content: space-between;
}
.package-table {
font-size: 0.75rem;
}
.action-buttons {
flex-direction: column;
}
}
</style>
<div class="modern-container" ng-controller="listOSPackages">
<div class="page-header">
<div class="header-content">
<h1 class="page-title">
<div class="package-icon">
<i class="fas fa-cube" style="font-size: 1.75rem;"></i>
</div>
{% trans "System Package Manager" %}
</h1>
<p class="page-subtitle">
{% trans "Manage system packages, updates, and dependencies using your system's package manager (apt/yum)" %}
</p>
<div class="stats-bar">
<div class="stat-badge">
<i class="fas fa-boxes"></i>
<span>{% trans "Total Packages:" %} <span class="stat-value">{$ totalPackages || 0 $}</span></span>
</div>
<div class="stat-badge">
<i class="fas fa-eye"></i>
<span>{% trans "Showing:" %} <span class="stat-value">{$ fetchedPackages || 0 $}</span></span>
</div>
<div class="stat-badge" ng-hide="cyberpanelLoading">
<span class="loading-spinner"></span>
</div>
</div>
</div>
</div>
<div class="tabs-container">
<!-- Tab Navigation -->
<div class="modern-tabs">
<button class="tab-item active" ng-click="fetchPackages('upgrade')" data-tab="updates">
<i class="fas fa-sync-alt tab-icon"></i>
{% trans "Available Updates" %}
</button>
<button class="tab-item" ng-click="fetchPackages()" data-tab="all">
<i class="fas fa-list tab-icon"></i>
{% trans "All Packages" %}
</button>
<button class="tab-item" ng-click="fetchPackages('CyberPanel')" data-tab="cyberpanel">
<i class="fas fa-shield-alt tab-icon"></i>
{% trans "CyberPanel Packages" %}
</button>
</div>
<!-- Tab Content -->
<div class="tab-content">
<!-- Controls Bar -->
<div class="controls-bar">
<div class="search-box">
<i class="fas fa-search search-icon"></i>
<input type="text" class="search-input" placeholder="{% trans 'Search packages...' %}"
ng-model="packSearch">
</div>
<div class="control-group">
<select ng-model="recordsToShow" class="select-control"
ng-change="fetchPackages(currentTab)">
<option value="10">10 {% trans "per page" %}</option>
<option value="50">50 {% trans "per page" %}</option>
<option value="100">100 {% trans "per page" %}</option>
<option value="500">500 {% trans "per page" %}</option>
</select>
<button class="btn btn-success" ng-click="updatePackage('all')"
ng-show="currentTab === 'upgrade'">
<i class="fas fa-download"></i>
{% trans "Update All" %}
</button>
</div>
</div>
<!-- Alert for important info -->
<div class="alert alert-info" ng-show="currentTab === 'upgrade' && totalPackages > 0">
<i class="fas fa-info-circle"></i>
<span>{% trans "Important: Always backup your system before performing major updates. Some updates may require system restart." %}</span>
</div>
<!-- Package Table -->
<div class="table-container" ng-show="allPackages.length > 0">
<table class="package-table">
<thead>
<tr>
<th>{% trans "Package" %}</th>
<th>{% trans "Current Version" %}</th>
<th ng-show="currentTab === 'upgrade'">{% trans "New Version" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="package in allPackages | filter:packSearch">
<td>
<div class="package-name">
<span>{$ package.package $}</span>
<span class="package-type" ng-if="package.type">
{$ package.type $}
</span>
</div>
</td>
<td>
<span class="version-badge">{$ package.version $}</span>
</td>
<td ng-show="currentTab === 'upgrade'">
<span class="upgrade-badge">
<i class="fas fa-arrow-up"></i>
{$ package.upgrade || '-' $}
</span>
</td>
<td>
<a class="lock-toggle"
ng-class="{'locked': package.lock == 1, 'unlocked': package.lock == 0}"
ng-click="lockStatus(package.package, package.lock == 1 ? 1 : 0)"
title="{$ package.lock == 1 ? 'Package is locked' : 'Package is unlocked' $}">
<i class="fas"
ng-class="{'fa-lock': package.lock == 1, 'fa-lock-open': package.lock == 0}"></i>
</a>
</td>
<td>
<div class="action-buttons">
<button class="btn btn-info btn-sm"
ng-click="showPackageDetails(package.package)">
<i class="fas fa-info-circle"></i>
{% trans "Details" %}
</button>
<button class="btn btn-primary btn-sm"
ng-click="showUpdateModal(package.package)"
ng-show="currentTab === 'upgrade' || currentTab === 'cyberpanel'">
<i class="fas fa-download"></i>
{% trans "Update" %}
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Empty State -->
<div class="empty-state" ng-show="allPackages.length === 0 && cyberpanelLoading">
<div class="empty-icon">
<i class="fas fa-cube"></i>
</div>
<h3>{% trans "No packages found" %}</h3>
<p>{% trans "Try adjusting your search criteria or check your connection" %}</p>
</div>
<!-- Pagination -->
<div class="pagination-bar" ng-show="allPackages.length > 0">
<div class="pagination-info">
{% trans "Showing" %} {$ ((currentPage - 1) * recordsToShow) + 1 $} -
{$ Math.min(currentPage * recordsToShow, totalPackages) $}
{% trans "of" %} {$ totalPackages $} {% trans "packages" %}
</div>
<div class="pagination-controls">
<span>{% trans "Page:" %}</span>
<select ng-model="currentPage" class="page-select"
ng-change="fetchPackages(currentTab)">
<option ng-repeat="page in pagination" value="{$ $index + 1 $}">
{$ $index + 1 $}
</option>
</select>
<span>{% trans "of" %} {$ pagination.length $}</span>
</div>
</div>
</div>
</div>
<!-- Package Details Modal -->
<div class="modal-overlay" ng-show="showDetails" ng-click="closeModal($event)">
<div class="modal-content" ng-click="$event.stopPropagation()">
<div class="modal-header">
<h3 class="modal-title">
<i class="fas fa-info-circle"></i>
{% trans "Package Details:" %} {$ selectedPackage $}
</h3>
<button class="modal-close" ng-click="closeDetails()">
<i class="fas fa-times"></i>
</button>
</div>
<div class="modal-body">
<div class="detail-output" ng-bind="packageDetails"></div>
</div>
</div>
</div>
<!-- Update Progress Modal -->
<div class="modal-overlay" ng-show="showUpdate" ng-click="closeModal($event)">
<div class="modal-content" ng-click="$event.stopPropagation()">
<div class="modal-header">
<h3 class="modal-title">
<i class="fas fa-download"></i>
{% trans "Updating Package:" %} {$ updatingPackage $}
<span ng-hide="cyberpanelLoading" class="loading-spinner" style="margin-left: 1rem;"></span>
</h3>
<button class="modal-close" ng-click="closeUpdate()" ng-disabled="!updateComplete">
<i class="fas fa-times"></i>
</button>
</div>
<div class="modal-body">
<div class="console-output" ng-bind="requestData"></div>
</div>
</div>
</div>
</div>
<script>
// Tab switching functionality
document.addEventListener('DOMContentLoaded', function() {
const tabButtons = document.querySelectorAll('.tab-item');
tabButtons.forEach(button => {
button.addEventListener('click', function() {
// Remove active class from all tabs
tabButtons.forEach(btn => btn.classList.remove('active'));
// Add active class to clicked tab
this.classList.add('active');
});
});
});
// Add to the Angular controller
app.controller('listOSPackages', function($scope, $http, $timeout) {
// ... existing controller code ...
// Initialize current tab
$scope.currentTab = 'upgrade';
// Show/hide modals
$scope.showDetails = false;
$scope.showUpdate = false;
$scope.selectedPackage = '';
$scope.updatingPackage = '';
$scope.updateComplete = false;
$scope.showPackageDetails = function(packageName) {
$scope.selectedPackage = packageName;
$scope.showDetails = true;
$scope.fetchPackageDetails(packageName);
};
$scope.closeDetails = function() {
$scope.showDetails = false;
$scope.selectedPackage = '';
$scope.packageDetails = '';
};
$scope.showUpdateModal = function(packageName) {
$scope.updatingPackage = packageName;
$scope.showUpdate = true;
$scope.updateComplete = false;
$scope.updatePackage(packageName);
};
$scope.closeUpdate = function() {
$scope.showUpdate = false;
$scope.updatingPackage = '';
$scope.requestData = '';
};
$scope.closeModal = function(event) {
if (event.target.classList.contains('modal-overlay')) {
if ($scope.showDetails) $scope.closeDetails();
if ($scope.showUpdate && $scope.updateComplete) $scope.closeUpdate();
}
};
// Override fetchPackages to set current tab
var originalFetchPackages = $scope.fetchPackages;
$scope.fetchPackages = function(type) {
if (type === 'upgrade') $scope.currentTab = 'upgrade';
else if (type === 'CyberPanel') $scope.currentTab = 'cyberpanel';
else $scope.currentTab = 'all';
if (originalFetchPackages) {
originalFetchPackages(type);
}
};
});
</script>
{% endblock %}
{% block footer_scripts %}
<script src="{% static 'serverStatus/serverStatus.js' %}"></script>
{% endblock %}

View File

@@ -0,0 +1,637 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Services Status - CyberPanel" %}{% endblock %}
{% block header_scripts %}
<style>
/* Services Status Specific Styles */
.services-wrapper {
background: transparent;
padding: 20px;
}
.services-container {
max-width: 1200px;
margin: 0 auto;
}
/* Page Header */
.page-header {
background: white;
border-radius: 12px;
padding: 25px;
margin-bottom: 25px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
}
.page-header h1 {
font-size: 28px;
font-weight: 700;
color: #2f3640;
margin: 0 0 10px 0;
display: flex;
align-items: center;
gap: 15px;
}
.page-header .icon {
width: 48px;
height: 48px;
background: #5856d6;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 24px;
box-shadow: 0 4px 12px rgba(88,86,214,0.3);
}
.page-header p {
font-size: 15px;
color: #64748b;
margin: 0;
}
/* Content Section */
.content-section {
background: white;
border-radius: 12px;
padding: 25px;
margin-bottom: 25px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
}
.section-title {
font-size: 18px;
font-weight: 700;
color: #2f3640;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
}
.section-title::before {
content: '';
width: 4px;
height: 24px;
background: #5856d6;
border-radius: 2px;
}
/* Services Grid */
.services-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 20px;
}
.service-card {
background: white;
border: 1px solid #e8e9ff;
border-radius: 12px;
padding: 25px;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.service-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 24px rgba(0,0,0,0.1);
border-color: #5856d6;
}
.service-card.running {
border-top: 4px solid #10b981;
}
.service-card.stopped {
border-top: 4px solid #ef4444;
}
.service-icon {
width: 80px;
height: 80px;
margin: 0 auto 20px;
display: flex;
align-items: center;
justify-content: center;
background: #f8f9ff;
border-radius: 16px;
padding: 15px;
}
.service-icon img {
width: 100%;
height: 100%;
object-fit: contain;
}
.service-info {
text-align: center;
margin-bottom: 20px;
}
.service-name {
font-size: 20px;
font-weight: 700;
color: #2f3640;
margin-bottom: 8px;
}
.service-status {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 16px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
}
.service-status.running {
background: #d1fae5;
color: #065f46;
}
.service-status.running i {
color: #10b981;
animation: pulse 2s infinite;
}
.service-status.stopped {
background: #fee2e2;
color: #991b1b;
}
.service-status.stopped i {
color: #ef4444;
}
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.5; }
100% { opacity: 1; }
}
.service-stats {
text-align: center;
margin: 15px 0;
min-height: 24px;
}
.service-stats p {
font-size: 14px;
color: #64748b;
margin: 0;
}
.service-stats strong {
color: #5856d6;
font-weight: 600;
}
.service-actions {
display: flex;
gap: 10px;
justify-content: center;
}
.action-btn {
padding: 8px 16px;
border-radius: 8px;
font-weight: 600;
font-size: 13px;
cursor: pointer;
transition: all 0.3s ease;
border: none;
display: inline-flex;
align-items: center;
gap: 6px;
}
.action-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.action-btn.start {
background: #10b981;
color: white;
}
.action-btn.start:hover:not(:disabled) {
background: #059669;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.action-btn.stop {
background: #f59e0b;
color: white;
}
.action-btn.stop:hover:not(:disabled) {
background: #d97706;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}
.action-btn.restart {
background: #6b7280;
color: white;
}
.action-btn.restart:hover:not(:disabled) {
background: #4b5563;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(107,114,128,0.3);
}
/* Alert Messages */
.alerts-container {
margin-top: 20px;
}
.alert {
padding: 15px 20px;
border-radius: 8px;
margin-bottom: 15px;
display: flex;
align-items: center;
gap: 12px;
font-size: 14px;
}
.alert-icon {
font-size: 20px;
flex-shrink: 0;
}
.alert-success {
background: #d1fae5;
color: #065f46;
border: 1px solid #a7f3d0;
}
.alert-success .alert-icon {
color: #10b981;
}
.alert-danger {
background: #fee2e2;
color: #991b1b;
border: 1px solid #fecaca;
}
.alert-danger .alert-icon {
color: #ef4444;
}
/* Loading Spinner */
.loading-spinner {
width: 24px;
height: 24px;
border: 3px solid #e8e9ff;
border-top-color: #5856d6;
border-radius: 50%;
animation: spin 1s linear infinite;
display: inline-block;
margin-left: 10px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* System Overview */
.system-overview {
background: #f8f9ff;
border-radius: 12px;
padding: 20px;
margin-bottom: 20px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
}
.overview-item {
text-align: center;
}
.overview-label {
font-size: 13px;
color: #64748b;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 5px;
}
.overview-value {
font-size: 24px;
font-weight: 700;
color: #5856d6;
}
/* Responsive */
@media (max-width: 768px) {
.services-wrapper {
padding: 15px;
}
.page-header h1 {
font-size: 24px;
flex-direction: column;
text-align: center;
}
.content-section {
padding: 20px;
}
.services-grid {
grid-template-columns: 1fr;
}
.system-overview {
grid-template-columns: 1fr;
}
}
</style>
{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<div class="services-wrapper">
<div class="services-container" ng-controller="servicesManager">
<!-- Page Header -->
<div class="page-header">
<h1>
<div class="icon">
<i class="fas fa-server"></i>
</div>
{% trans "Services Status" %}
<span ng-show="actionLoader" class="loading-spinner"></span>
</h1>
<p>{% trans "Monitor and manage system services" %}</p>
</div>
<!-- Services Section -->
<div class="content-section">
<h2 class="section-title">{% trans "System Services" %}</h2>
<div class="services-grid">
<!-- LiteSpeed/OpenLiteSpeed -->
<div class="service-card" ng-class="{'running': olsStatus === 'Running', 'stopped': olsStatus === 'Stopped'}">
<div class="service-icon">
<img src="{% static 'images/litespeed.png' %}" alt="{{ serverName }}">
</div>
<div class="service-info">
<h3 class="service-name">{{ serverName }}</h3>
<span class="service-status" ng-class="{'running': olsStatus === 'Running', 'stopped': olsStatus === 'Stopped'}">
<i class="fas fa-circle"></i>
<span ng-bind="olsStatus">{% trans "Stopped" %}</span>
</span>
</div>
<div class="service-stats">
<p ng-show="olsStats">{% trans "Memory Usage:" %} <strong ng-bind="olsMem"></strong></p>
</div>
<div class="service-actions">
<button type="button"
class="action-btn start"
ng-disabled="btnDisable"
ng-show="olsStart"
ng-click="serviceAction('lsws','start')"
title="{% trans 'Start' %}">
<i class="fas fa-play"></i>
{% trans "Start" %}
</button>
<button type="button"
class="action-btn stop"
ng-disabled="btnDisable"
ng-show="olsStop"
ng-click="serviceAction('lsws','stop')"
title="{% trans 'Stop' %}">
<i class="fas fa-pause"></i>
{% trans "Stop" %}
</button>
<button type="button"
class="action-btn restart"
ng-disabled="btnDisable"
ng-click="serviceAction('lsws','restart')"
title="{% trans 'Restart' %}">
<i class="fas fa-sync-alt"></i>
{% trans "Restart" %}
</button>
</div>
</div>
<!-- MariaDB -->
<div class="service-card" ng-class="{'running': sqlStatus === 'Running', 'stopped': sqlStatus === 'Stopped'}">
<div class="service-icon">
<img src="{% static 'images/mariadb.png' %}" alt="MariaDB">
</div>
<div class="service-info">
<h3 class="service-name">MariaDB</h3>
<span class="service-status" ng-class="{'running': sqlStatus === 'Running', 'stopped': sqlStatus === 'Stopped'}">
<i class="fas fa-circle"></i>
<span ng-bind="sqlStatus">{% trans "Stopped" %}</span>
</span>
</div>
<div class="service-stats">
<p ng-show="sqlStats">{% trans "Memory Usage:" %} <strong ng-bind="sqlMem"></strong></p>
</div>
<div class="service-actions">
<button type="button"
class="action-btn start"
ng-disabled="btnDisable"
ng-show="sqlStart"
ng-click="serviceAction('mysql','start')"
title="{% trans 'Start' %}">
<i class="fas fa-play"></i>
{% trans "Start" %}
</button>
<button type="button"
class="action-btn stop"
ng-disabled="btnDisable"
ng-show="sqlStop"
ng-click="serviceAction('mysql','stop')"
title="{% trans 'Stop' %}">
<i class="fas fa-pause"></i>
{% trans "Stop" %}
</button>
<button type="button"
class="action-btn restart"
ng-disabled="btnDisable"
ng-click="serviceAction('mysql','restart')"
title="{% trans 'Restart' %}">
<i class="fas fa-sync-alt"></i>
{% trans "Restart" %}
</button>
</div>
</div>
<!-- PowerDNS -->
<div class="service-card" ng-class="{'running': dnsStatus === 'Running', 'stopped': dnsStatus === 'Stopped'}">
<div class="service-icon">
<img src="{% static 'images/powerdns.png' %}" alt="PowerDNS">
</div>
<div class="service-info">
<h3 class="service-name">PowerDNS</h3>
<span class="service-status" ng-class="{'running': dnsStatus === 'Running', 'stopped': dnsStatus === 'Stopped'}">
<i class="fas fa-circle"></i>
<span ng-bind="dnsStatus">{% trans "Stopped" %}</span>
</span>
</div>
<div class="service-stats">
<p ng-show="dnsStats">{% trans "Memory Usage:" %} <strong ng-bind="dnsMem"></strong></p>
</div>
<div class="service-actions">
<button type="button"
class="action-btn start"
ng-disabled="btnDisable"
ng-show="dnsStart"
ng-click="serviceAction('pdns','start')"
title="{% trans 'Start' %}">
<i class="fas fa-play"></i>
{% trans "Start" %}
</button>
<button type="button"
class="action-btn stop"
ng-disabled="btnDisable"
ng-show="dnsStop"
ng-click="serviceAction('pdns','stop')"
title="{% trans 'Stop' %}">
<i class="fas fa-pause"></i>
{% trans "Stop" %}
</button>
<button type="button"
class="action-btn restart"
ng-disabled="btnDisable"
ng-click="serviceAction('pdns','restart')"
title="{% trans 'Restart' %}">
<i class="fas fa-sync-alt"></i>
{% trans "Restart" %}
</button>
</div>
</div>
<!-- PureFTPd -->
<div class="service-card" ng-class="{'running': ftpStatus === 'Running', 'stopped': ftpStatus === 'Stopped'}">
<div class="service-icon">
<img src="{% static 'images/pureftpd.png' %}" alt="PureFTPd">
</div>
<div class="service-info">
<h3 class="service-name">PureFTPd</h3>
<span class="service-status" ng-class="{'running': ftpStatus === 'Running', 'stopped': ftpStatus === 'Stopped'}">
<i class="fas fa-circle"></i>
<span ng-bind="ftpStatus">{% trans "Stopped" %}</span>
</span>
</div>
<div class="service-stats">
<p ng-show="ftpStats">{% trans "Memory Usage:" %} <strong ng-bind="ftpMem"></strong></p>
</div>
<div class="service-actions">
<button type="button"
class="action-btn start"
ng-disabled="btnDisable"
ng-show="ftpStart"
ng-click="serviceAction('pure-ftpd','start')"
title="{% trans 'Start' %}">
<i class="fas fa-play"></i>
{% trans "Start" %}
</button>
<button type="button"
class="action-btn stop"
ng-disabled="btnDisable"
ng-show="ftpStop"
ng-click="serviceAction('pure-ftpd','stop')"
title="{% trans 'Stop' %}">
<i class="fas fa-pause"></i>
{% trans "Stop" %}
</button>
<button type="button"
class="action-btn restart"
ng-disabled="btnDisable"
ng-click="serviceAction('pure-ftpd','restart')"
title="{% trans 'Restart' %}">
<i class="fas fa-sync-alt"></i>
{% trans "Restart" %}
</button>
</div>
</div>
<!-- Docker (if available) -->
{% if isDocker %}
<div class="service-card" ng-class="{'running': dockerStatus === 'Running', 'stopped': dockerStatus === 'Stopped'}">
<div class="service-icon">
<img src="{% static 'images/docker.png' %}" alt="Docker">
</div>
<div class="service-info">
<h3 class="service-name">Docker</h3>
<span class="service-status" ng-class="{'running': dockerStatus === 'Running', 'stopped': dockerStatus === 'Stopped'}">
<i class="fas fa-circle"></i>
<span ng-bind="dockerStatus">{% trans "Stopped" %}</span>
</span>
</div>
<div class="service-stats">
<!-- Docker stats could be added here -->
</div>
<div class="service-actions">
<button type="button"
class="action-btn start"
ng-disabled="btnDisable"
ng-show="dockerStart"
ng-click="serviceAction('docker','start')"
title="{% trans 'Start' %}">
<i class="fas fa-play"></i>
{% trans "Start" %}
</button>
<button type="button"
class="action-btn stop"
ng-disabled="btnDisable"
ng-show="dockerStop"
ng-click="serviceAction('docker','stop')"
title="{% trans 'Stop' %}">
<i class="fas fa-pause"></i>
{% trans "Stop" %}
</button>
<button type="button"
class="action-btn restart"
ng-disabled="btnDisable"
ng-click="serviceAction('docker','restart')"
title="{% trans 'Restart' %}">
<i class="fas fa-sync-alt"></i>
{% trans "Restart" %}
</button>
</div>
</div>
{% endif %}
</div>
<!-- Alert Messages -->
<div class="alerts-container">
<div ng-show="ActionFailed" class="alert alert-danger">
<i class="fas fa-exclamation-circle alert-icon"></i>
<span>{% trans "Action Failed" %}</span>
</div>
<div ng-show="ActionSuccessfull" class="alert alert-success">
<i class="fas fa-check-circle alert-icon"></i>
<span>{% trans "Action Completed Successfully" %}</span>
</div>
<div ng-show="couldNotConnect" class="alert alert-danger">
<i class="fas fa-wifi alert-icon"></i>
<span>{% trans "Could not connect to server. Please refresh this page." %}</span>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,806 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Top Processes - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<style>
.modern-container {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
}
.page-header {
text-align: center;
margin-bottom: 3rem;
padding: 3rem 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
animation: fadeInDown 0.5s ease-out;
position: relative;
overflow: hidden;
color: white;
}
.page-header::before {
content: '';
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
animation: rotate 30s linear infinite;
}
.header-content {
position: relative;
z-index: 1;
}
.page-title {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.process-icon {
width: 60px;
height: 60px;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.page-subtitle {
font-size: 1.125rem;
color: rgba(255, 255, 255, 0.9);
max-width: 600px;
margin: 0 auto;
}
.auto-refresh-indicator {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: rgba(255, 255, 255, 0.2);
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.875rem;
margin-top: 1rem;
}
.refresh-dot {
width: 8px;
height: 8px;
background: #4ade80;
border-radius: 50%;
animation: pulse 1.5s infinite;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.stat-card {
background: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
padding: 1.5rem;
transition: all 0.3s ease;
animation: fadeInUp 0.5s ease-out;
position: relative;
overflow: hidden;
}
.stat-card:hover {
transform: translateY(-5px);
box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 20px 60px rgba(0,0,0,0.1);
}
.stat-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}
.stat-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
}
.stat-title {
font-size: 0.875rem;
color: #64748b;
font-weight: 500;
display: flex;
align-items: center;
gap: 0.5rem;
}
.stat-icon {
width: 32px;
height: 32px;
background: #f3e8ff;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #667eea;
font-size: 1rem;
}
.stat-content {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}
.stat-item {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.stat-value {
font-size: 1.25rem;
font-weight: 700;
color: #1e293b;
}
.stat-label {
font-size: 0.75rem;
color: #94a3b8;
}
.processes-panel {
background: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
overflow: hidden;
animation: fadeInUp 0.5s ease-out 0.2s;
animation-fill-mode: both;
}
.panel-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1.5rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.panel-title {
font-size: 1.25rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.75rem;
}
.search-box {
position: relative;
width: 300px;
}
.search-input {
width: 100%;
padding: 0.5rem 1rem 0.5rem 2.5rem;
border: none;
border-radius: 8px;
font-size: 0.875rem;
background: rgba(255, 255, 255, 0.2);
color: white;
placeholder-color: rgba(255, 255, 255, 0.7);
transition: all 0.3s ease;
}
.search-input::placeholder {
color: rgba(255, 255, 255, 0.7);
}
.search-input:focus {
outline: none;
background: rgba(255, 255, 255, 0.3);
}
.search-icon {
position: absolute;
left: 0.75rem;
top: 50%;
transform: translateY(-50%);
color: rgba(255, 255, 255, 0.7);
}
.table-container {
overflow-x: auto;
max-height: 600px;
overflow-y: auto;
}
.modern-table {
width: 100%;
border-collapse: collapse;
}
.modern-table thead {
position: sticky;
top: 0;
background: #f8f9ff;
z-index: 10;
}
.modern-table th {
padding: 1rem;
text-align: left;
font-weight: 600;
color: #475569;
font-size: 0.875rem;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid #e8e9ff;
}
.modern-table td {
padding: 1rem;
font-size: 0.875rem;
color: #1e293b;
border-bottom: 1px solid #f1f5f9;
}
.modern-table tbody tr {
transition: all 0.2s ease;
}
.modern-table tbody tr:hover {
background: #f8f9ff;
}
.process-user {
display: flex;
align-items: center;
gap: 0.5rem;
}
.user-avatar {
width: 28px;
height: 28px;
background: #e8e9ff;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
font-weight: 600;
color: #667eea;
}
.process-state {
display: inline-flex;
padding: 0.25rem 0.75rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 500;
}
.state-running {
background: #d1fae5;
color: #065f46;
}
.state-sleeping {
background: #dbeafe;
color: #1e40af;
}
.state-stopped {
background: #fef3c7;
color: #92400e;
}
.state-zombie {
background: #fee2e2;
color: #991b1b;
}
.cpu-usage {
display: flex;
align-items: center;
gap: 0.5rem;
}
.usage-bar {
width: 60px;
height: 6px;
background: #e5e7eb;
border-radius: 3px;
overflow: hidden;
position: relative;
}
.usage-fill {
height: 100%;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
transition: width 0.3s ease;
}
.command-text {
font-family: 'Monaco', 'Consolas', monospace;
font-size: 0.75rem;
background: #f3f4f6;
padding: 0.25rem 0.5rem;
border-radius: 4px;
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.kill-button {
padding: 0.5rem 1rem;
border-radius: 6px;
background: #dc2626;
color: white;
border: none;
font-size: 0.75rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.kill-button:hover {
background: #b91c1c;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.9);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.loading-spinner {
width: 40px;
height: 40px;
border: 3px solid #f3f3f3;
border-top: 3px solid #667eea;
border-radius: 50%;
animation: spin 1s linear infinite;
}
.metric-badge {
display: inline-flex;
align-items: center;
padding: 0.25rem 0.5rem;
background: #f3f4f6;
border-radius: 4px;
font-size: 0.75rem;
gap: 0.25rem;
}
.metric-high {
background: #fee2e2;
color: #991b1b;
}
.metric-medium {
background: #fef3c7;
color: #92400e;
}
.metric-low {
background: #d1fae5;
color: #065f46;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 768px) {
.page-title {
font-size: 2rem;
}
.search-box {
width: 100%;
margin-top: 1rem;
}
.panel-header {
flex-direction: column;
gap: 1rem;
}
.table-container {
font-size: 0.75rem;
}
.command-text {
max-width: 150px;
}
}
</style>
<div class="modern-container" ng-controller="topProcesses">
<div class="page-header">
<div class="header-content">
<h1 class="page-title">
<div class="process-icon">
<i class="fas fa-microchip" style="font-size: 1.75rem;"></i>
</div>
{% trans "System Processes Monitor" %}
</h1>
<p class="page-subtitle">
{% trans "Real-time monitoring of system processes, CPU usage, memory consumption, and resource allocation" %}
</p>
<div class="auto-refresh-indicator">
<span class="refresh-dot"></span>
{% trans "Auto-refresh every 3 seconds" %}
</div>
</div>
</div>
<!-- Loading Overlay -->
<div class="loading-overlay" ng-show="!cyberPanelLoading">
<div class="loading-spinner"></div>
</div>
<!-- CPU & System Stats -->
<div class="stats-grid">
<!-- CPU Info -->
<div class="stat-card">
<div class="stat-header">
<h3 class="stat-title">
<div class="stat-icon">
<i class="fas fa-microchip"></i>
</div>
{% trans "CPU Information" %}
</h3>
</div>
<div class="stat-content">
<div class="stat-item">
<span class="stat-value">{$ cores || '-' $}</span>
<span class="stat-label">{% trans "Cores" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ cpuMHZ || '-' $} MHz</span>
<span class="stat-label">{% trans "Frequency" %}</span>
</div>
</div>
<div style="margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e8e9ff;">
<div style="font-size: 0.75rem; color: #64748b;">
<strong>{% trans "Model:" %}</strong> {$ modelName || '-' $}<br>
<strong>{% trans "Cache:" %}</strong> {$ cacheSize || '-' $}
</div>
</div>
</div>
<!-- Process Stats -->
<div class="stat-card">
<div class="stat-header">
<h3 class="stat-title">
<div class="stat-icon">
<i class="fas fa-tasks"></i>
</div>
{% trans "Process Statistics" %}
</h3>
</div>
<div class="stat-content">
<div class="stat-item">
<span class="stat-value">{$ totalProcesses || '0' $}</span>
<span class="stat-label">{% trans "Total" %}</span>
</div>
<div class="stat-item">
<span class="stat-value" style="color: #10b981;">{$ runningProcesses || '0' $}</span>
<span class="stat-label">{% trans "Running" %}</span>
</div>
<div class="stat-item">
<span class="stat-value" style="color: #3b82f6;">{$ sleepingProcesses || '0' $}</span>
<span class="stat-label">{% trans "Sleeping" %}</span>
</div>
<div class="stat-item">
<span class="stat-value" style="color: #ef4444;">
<span ng-if="zombieProcesses > 0">{$ zombieProcesses $}</span>
<span ng-if="!zombieProcesses || zombieProcesses == 0">0</span>
</span>
<span class="stat-label">{% trans "Zombie" %}</span>
</div>
</div>
</div>
<!-- CPU Load -->
<div class="stat-card">
<div class="stat-header">
<h3 class="stat-title">
<div class="stat-icon">
<i class="fas fa-chart-line"></i>
</div>
{% trans "CPU Load Average" %}
</h3>
</div>
<div class="stat-content">
<div class="stat-item">
<span class="stat-value">{$ cpuOne || '-' $}</span>
<span class="stat-label">{% trans "1 Min" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ cpuFive || '-' $}</span>
<span class="stat-label">{% trans "5 Min" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ cpuFifteen || '-' $}</span>
<span class="stat-label">{% trans "15 Min" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ cpuNow || '-' $}%</span>
<span class="stat-label">{% trans "Current" %}</span>
</div>
</div>
</div>
<!-- Memory Stats -->
<div class="stat-card">
<div class="stat-header">
<h3 class="stat-title">
<div class="stat-icon">
<i class="fas fa-memory"></i>
</div>
{% trans "Memory Usage" %}
</h3>
</div>
<div class="stat-content">
<div class="stat-item">
<span class="stat-value">{$ totalMemory || '-' $}</span>
<span class="stat-label">{% trans "Total" %}</span>
</div>
<div class="stat-item">
<span class="stat-value" style="color: #10b981;">{$ freeMemory || '-' $}</span>
<span class="stat-label">{% trans "Free" %}</span>
</div>
<div class="stat-item">
<span class="stat-value" style="color: #ef4444;">{$ usedMemory || '-' $}</span>
<span class="stat-label">{% trans "Used" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ buffCache || '-' $}</span>
<span class="stat-label">{% trans "Buff/Cache" %}</span>
</div>
</div>
</div>
<!-- Swap Stats -->
<div class="stat-card">
<div class="stat-header">
<h3 class="stat-title">
<div class="stat-icon">
<i class="fas fa-hdd"></i>
</div>
{% trans "Swap Memory" %}
</h3>
</div>
<div class="stat-content">
<div class="stat-item">
<span class="stat-value">{$ swapTotalMemory || '-' $}</span>
<span class="stat-label">{% trans "Total" %}</span>
</div>
<div class="stat-item">
<span class="stat-value" style="color: #10b981;">{$ swapFreeMemory || '-' $}</span>
<span class="stat-label">{% trans "Free" %}</span>
</div>
<div class="stat-item">
<span class="stat-value" style="color: #ef4444;">{$ swapUsedMemory || '-' $}</span>
<span class="stat-label">{% trans "Used" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ swapBuffCache || '-' $}</span>
<span class="stat-label">{% trans "Available" %}</span>
</div>
</div>
</div>
<!-- CPU Time Stats -->
<div class="stat-card">
<div class="stat-header">
<h3 class="stat-title">
<div class="stat-icon">
<i class="fas fa-clock"></i>
</div>
{% trans "CPU Time Distribution" %}
</h3>
</div>
<div class="stat-content">
<div class="stat-item">
<span class="stat-value">{$ ioWait || '-' $}%</span>
<span class="stat-label">{% trans "I/O Wait" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ idleTime || '-' $}%</span>
<span class="stat-label">{% trans "Idle Time" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ hwInterrupts || '-' $}%</span>
<span class="stat-label">{% trans "HW Interrupts" %}</span>
</div>
<div class="stat-item">
<span class="stat-value">{$ Softirqs || '-' $}%</span>
<span class="stat-label">{% trans "Soft IRQs" %}</span>
</div>
</div>
</div>
</div>
<!-- Process List -->
<div class="processes-panel">
<div class="panel-header">
<h2 class="panel-title">
<i class="fas fa-list"></i>
{% trans "Running Processes" %}
</h2>
<div class="search-box">
<i class="fas fa-search search-icon"></i>
<input type="text" class="search-input" placeholder="{% trans 'Search processes...' %}" ng-model="search">
</div>
</div>
<div class="table-container">
<table class="modern-table">
<thead>
<tr>
<th>{% trans "PID" %}</th>
<th>{% trans "User" %}</th>
<th>{% trans "State" %}</th>
<th>{% trans "CPU %" %}</th>
<th>{% trans "Memory %" %}</th>
<th>{% trans "VIRT" %}</th>
<th>{% trans "RES" %}</th>
<th>{% trans "Time" %}</th>
<th>{% trans "Command" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="process in processes | filter:search">
<td>
<span style="font-weight: 600; color: #667eea;">{$ process.PID $}</span>
</td>
<td>
<div class="process-user">
<div class="user-avatar">{$ process.User.charAt(0).toUpperCase() $}</div>
<span>{$ process.User $}</span>
</div>
</td>
<td>
<span class="process-state"
ng-class="{'state-running': process.S == 'R',
'state-sleeping': process.S == 'S',
'state-stopped': process.S == 'T',
'state-zombie': process.S == 'Z'}">
<span ng-if="process.S == 'R'">Running</span>
<span ng-if="process.S == 'S'">Sleeping</span>
<span ng-if="process.S == 'T'">Stopped</span>
<span ng-if="process.S == 'Z'">Zombie</span>
<span ng-if="process.S != 'R' && process.S != 'S' && process.S != 'T' && process.S != 'Z'">{$ process.S $}</span>
</span>
</td>
<td>
<div class="cpu-usage">
<div class="usage-bar">
<div class="usage-fill" ng-style="{'width': process.CPU + '%'}"></div>
</div>
<span class="metric-badge"
ng-class="{'metric-high': process.CPU > 80,
'metric-medium': process.CPU > 50 && process.CPU <= 80,
'metric-low': process.CPU <= 50}">
{$ process.CPU $}%
</span>
</div>
</td>
<td>
<span class="metric-badge"
ng-class="{'metric-high': process.MEM > 20,
'metric-medium': process.MEM > 10 && process.MEM <= 20,
'metric-low': process.MEM <= 10}">
{$ process.MEM $}%
</span>
</td>
<td>
<span style="font-family: monospace; font-size: 0.875rem;">{$ process.VIRT $}</span>
</td>
<td>
<span style="font-family: monospace; font-size: 0.875rem;">{$ process.RES $}</span>
</td>
<td>
<span style="font-family: monospace; font-size: 0.875rem;">{$ process.Time $}</span>
</td>
<td>
<div class="command-text" title="{$ process.Command $}">
{$ process.Command $}
</div>
</td>
<td>
<button ng-click="killProcess(process.PID)" class="kill-button">
<i class="fas fa-times"></i>
{% trans "Kill" %}
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
{% block footer_scripts %}
<script src="{% static 'serverStatus/serverStatus.js' %}"></script>
{% endblock %}

6
serverStatus/tests.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from django.test import TestCase
# Create your tests here.

32
serverStatus/urls.py Normal file
View File

@@ -0,0 +1,32 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.serverStatusHome, name='serverStatusHome'),
path('litespeedStatus', views.litespeedStatus, name='litespeedStatus'),
path('startorstopLitespeed', views.stopOrRestartLitespeed, name='startorstopLitespeed'),
path('cyberCPMainLogFile', views.cyberCPMainLogFile, name='cyberCPMainLogFile'),
path('getFurtherDataFromLogFile', views.getFurtherDataFromLogFile, name='getFurtherDataFromLogFile'),
path('servicesStatus', views.servicesStatus, name='servicesStatus'),
path('servicesAction', views.servicesAction, name='servicesAction'),
path('services', views.services, name='services'),
path('switchTOLSWS', views.switchTOLSWS, name='switchTOLSWS'),
path('switchTOLSWSStatus', views.switchTOLSWSStatus, name='switchTOLSWSStatus'),
path('licenseStatus', views.licenseStatus, name='licenseStatus'),
path('changeLicense', views.changeLicense, name='changeLicense'),
path('refreshLicense', views.refreshLicense, name='refreshLicense'),
path('topProcesses', views.topProcesses, name='topProcesses'),
path('topProcessesStatus', views.topProcessesStatus, name='topProcessesStatus'),
path('killProcess', views.killProcess, name='killProcess'),
path('packageManager', views.packageManager, name='packageManager'),
path('fetchPackages', views.fetchPackages, name='fetchPackages'),
path('fetchPackageDetails', views.fetchPackageDetails, name='fetchPackageDetails'),
path('updatePackage', views.updatePackage, name='updatePackage'),
path('lockStatus', views.lockStatus, name='lockStatus'),
path('CyberPanelPort', views.CyberPanelPort, name='CyberPanelPort'),
path('submitPortChange', views.submitPortChange, name='submitPortChange'),
path('Switchoffsecurity', views.Switchoffsecurity, name='Switchoffsecurity'),
path('securityruleUpdate', views.securityruleUpdate, name='securityruleUpdate'),
]

1241
serverStatus/views.py Normal file

File diff suppressed because it is too large Load Diff