ACIL FM
Dark
Refresh
Current DIR:
/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/simple_rpc
/
opt
imunify360
venv
lib
python3.11
site-packages
defence360agent
simple_rpc
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
schema
-
chmod
Open
Rename
Delete
schema_responses
-
chmod
Open
Rename
Delete
__pycache__
-
chmod
Open
Rename
Delete
advisor.py
1.49 MB
chmod
View
DL
Edit
Rename
Delete
analyst_cleanup.py
7.07 MB
chmod
View
DL
Edit
Rename
Delete
endpoints.py
10.87 MB
chmod
View
DL
Edit
Rename
Delete
hooks.py
2.82 MB
chmod
View
DL
Edit
Rename
Delete
hosting_panel.py
1.47 MB
chmod
View
DL
Edit
Rename
Delete
myimunify.py
2.7 MB
chmod
View
DL
Edit
Rename
Delete
permissions.py
317 B
chmod
View
DL
Edit
Rename
Delete
plesk_stats.py
4.32 MB
chmod
View
DL
Edit
Rename
Delete
reputation_management.py
1.95 MB
chmod
View
DL
Edit
Rename
Delete
schema.py
6.82 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
15.48 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/simple_rpc/myimunify.py
import urllib.parse from typing import List, Optional import defence360agent.subsys.panels.hosting_panel as hp from defence360agent.contracts.config import ( MyImunifyConfig, is_mi_freemium_license, ) from defence360agent.myimunify.model import ( MyImunify, set_protection_status_for_all_users, update_users_protection, ) from defence360agent.rpc_tools import lookup from defence360agent.utils import Scope class MyImunifyEndpoints(lookup.RootEndpoints): SCOPE = Scope.IM360 @lookup.bind("myimunify", "update") async def update(self, items: List[str], protection: str): await update_users_protection( self._sink, items, protection == "enabled" ) return {} @lookup.bind("myimunify", "enable-all") async def enable_all(self): await set_protection_status_for_all_users(self._sink, True) @lookup.bind("myimunify", "disable-all") async def disable_all(self): await set_protection_status_for_all_users(self._sink, False) class MyImunifyCommonEndpoints(lookup.CommonEndpoints): SCOPE = Scope.IM360 @lookup.bind("myimunify", "status") async def status(self, items: List[str], user: Optional[str] = None): purchase_url = MyImunifyConfig.PURCHASE_PAGE_URL panel_manager = hp.HostingPanel() if user is not None: items = [user] # if MY_IMNUNIFY is disabled, we don't need to generate purchase # url with domain and ip [because it will not been shown to user] if MyImunifyConfig.ENABLED: user_domains = ( await panel_manager.get_domains_per_user() ).get(user, []) domain = next(iter(user_domains), None) purchase_url = ( MyImunifyConfig.PURCHASE_PAGE_URL + "/?" + urllib.parse.urlencode( { "m": "cloudlinux_advantage", "action": "provisioning", "suite": "my_imunify_account_protection", "username": user, "domain": domain, "server_ip": panel_manager.get_server_ip(), } ) ) response = MyImunify.select().where(MyImunify.user.in_(items)).dicts() return { "myimunify_enabled": MyImunifyConfig.ENABLED, "purchase_page_url": purchase_url, "is_freemium": is_mi_freemium_license(), "items": [ {"username": item["user"], "protection": item["protection"]} for item in response ], }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply