[wordpress插件] Centinel APICentinel API

wordpress 插件 文章 2020-03-20 03:30 577 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This package provides API for downloading the application log file, and dumping and downloading the database.

此软件包提供用于下载应用程序日志文件以及转储和下载数据库的API。

It ships with authentication middleware which protects the API routes.

它附带了用于保护API路由的身份验证中间件。

Centinel API is designed to work in combination with Centinel – centralized application management system for off

Centinel API旨在与 Centinel 结合使用–用于关闭的集中式应用程序管理系统

-site database backups and application log checks.

站点数据库备份和应用程序日志检查。

Requirements

要求

    • PHP 5.6+
    • PHP 5.6 +

    • WordPress 4.4+
    • WordPress 4.4 +

    Usage

    用法

    It’s highly recommended to use this plugin only on websites that use HTTPS!

    强烈建议仅在使用HTTPS的网站上使用此插件!

    After installing the plugin, go to Settings > Centinel API Settings in your WordPress Admin zone.

    安装插件后,转到WordPress管理区域中的设置> Centinel API设置

    From there, copy privateKey, encryptionKey and routePrefix to

    从那里,将 privateKey encryptionKey routePrefix 复制到

    Centinel, and you're ready to schedule your application log checks and database backups.

    Centinel ,您就可以安排应用程序日志检查和数据库备份了。

    Settings

    设置

      • Private Key – random string, used for authentication
      • 私钥 –随机字符串,用于身份验证

      • Encryption Key – random string, used for additional security layer
      • 加密密钥 –随机字符串,用于附加安全层

      • Route Prefix – random string, prefixing the API routes
      • Route Prefix –随机字符串,以API路由为前缀

      • Log Routes Enabled – disable if you do not wish to send logs to Centinel
      • 启用日志路由 –如果您不希望将日志发送到Centinel,请禁用

      • Database Routes Enabled – disable if you do not wish to send database dumps to Centinel
      • 已启用数据库路由 –如果您不希望将数据库转储发送到Centinel,请禁用

      • Disable Time Based Authorization – check this option in case of your server's and Centinel's datetime being out of sync which results in Request time mismatch or Too many API

      • 禁用基于时间的授权 –如果服务器和Centinel的日期时间不同步,导致请求时间不匹配 API过多,请选中此选项

        calls error

      • 通话错误

      • Zip Password – password used when zipping the database dump.

      • Zip密码 –压缩数据库转储时使用的密码。

        Make sure to save the Zip Password so you can restore your database in case of server crash

      • 请确保保存邮政编码,以便在服务器崩溃的情况下恢复数据库

      • Dump Folder – folder where the database dumps are going to be created.

      • 转储文件夹 –将在其中创建数据库转储的文件夹。

        All database dumps, along with this folder, are always deleted after being sent to Centinel.

      • 所有数据库转储以及此文件夹在发送到Centinel后始终会被删除。

      • MySQL Settings – various database dump options
      • MySQL设置 –各种数据库转储选项

      All MySQL settings are optional.

      所有MySQL设置都是可选的。

      If you're developing on Windows (WAMP, for example), you may want to set your Dump Binary Path to something like 'C:\Progra~1\wamp\bin\mysql\

      如果您正在Windows上进行开发(例如WAMP),则可能需要将 Dump Binary Path 设置为类似'C:\ Progra〜1 \ wamp \ bin \ mysql \

      mysql5.7.18\bin'.

      mysql5.7.18 \ bin'

      Some MySQL settings will be ignored for PHP 5.6.

      PHP 5.6将忽略某些MySQL设置。

      For more details check Spatie DB Dumper v1.5.1

      有关更多详细信息,请检查 Spatie DB Dumper v1.5.1

      For details on how to use the dump options check the installed version of the package.

      有关如何使用转储选项的详细信息,请检查软件包的已安装版本。

      For PHP 7 that will be Spatie DB Dumper v2.9

      对于PHP 7,它将是 Spatie DB Dumper v2.9

      >

      >

      API Routes

      API路由

        • [POST] /{routePrefix}/create-log
        • [POST] / {routePrefix} / create-log

        • [POST] /{routePrefix}/download-log
        • [POST] / {routePrefix} / download-log

        • [POST] /{routePrefix}/dump-database
        • [POST] / {routePrefix} / dump-database

        • [POST] /{routePrefix}/download-database
        • [POST] / {routePrefix} / download-database

        For more details check /app/Controllers/CentinelApiApiController.php controller.

        有关更多详细信息,请检查 /app/Controllers/CentinelApiApiController.php 控制器。

        Application Logs

        应用程序日志

        By default, WordPress does not write any errors to the log file.

        默认情况下,WordPress不会将任何错误写入日志文件。

        To change this, you can open up wp-config.php and set the following options:
            

        要更改此设置,您可以打开 wp-config.php 并设置以下选项:
            

        define(‘WP_DEBUG’, true);
            

        define('WP_DEBUG',true);
            

        define(‘WP_DEBUG_LOG’, true);
            

        define('WP_DEBUG_LOG',true);
            

        define(‘WP_DEBUG_DISPLAY’, false);

        define('WP_DEBUG_DISPLAY',false);

        You can read more about these options in WordPress documentation

        您可以在 WordPress文档

        >

        >

        Database Backups

        数据库备份

        Spatie DB Dumper is used to make database dumps.

        Spatie DB Dumper 用于进行数据库转储。

        MySQL is supported, and requires mysqldump utility.

        MySQL 受支持,并且需要 mysqldump 实用程序。

        Centinel API will try to zip and password protect database dumps before sending them to Centinel.

        Centinel API在将数据库转储发送到Centinel之前,将尝试使用zip和密码保护数据库转储。

        In case you’re using PHP 7.2+, it will use PHP’s native ZipArchive class to zip and encrypt the database.

        如果您使用的是PHP 7.2或更高版本,它将使用PHP的本机 ZipArchive 类对数据库进行压缩和加密。

        Otherwise, it will look for 7-Zip and Zip libraries to do so.

        否则,它将寻找7-Zip和Zip库来这样做。

        If no option is available, dumps will be sent without being zipped and password protected.

        如果没有可用的选项,则转储文件将被发送而不会被压缩并且没有密码保护。

        Run Check Zip Availability in Centinel API Settings to see which library is available on your server.

        在Centinel API设置中运行检查Zip可用性以查看服务器上可用的库。

        Note that Zip encryption algorithm is much less secure than that of ZipArchive and 7-Zip.

        请注意,Zip加密算法的安全性远低于ZipArchive和7-Zip。

        Ultimately it is up to you to decide which level of security is satisfactory.

        最终由您决定哪个安全级别令人满意。

        You can always opt out of backing up your database by disabling database backups in Centinel, and additionally, unchecking Database Routes Enabled in the settings.

        您始终可以通过在Centinel中禁用数据库备份来选择不备份数据库,并且在设置中取消选中 Database Routes Enabled Enabled(启用数据库路由)

        Authentication

        身份验证

        For details check /app/Middleware/CentinelApiAuthorizeRequest.php middleware.

        有关详细信息,请检查 /app/Middleware/CentinelApiAuthorizeRequest.php 中间件。

        License

        许可证

        WordPress Centinel API is open-sourced software licensed under the MIT license.

        WordPress Centinel API是根据 MIT许可许可的开源软件。

安装步骤

    • upload the plugin files to the /wp-content/plugins/centinel-api directory, or install the plugin through the WordPress plugins screen directly
    • 将插件文件上传到 / wp-content / plugins / centinel-api 目录,或直接通过WordPress插件屏幕安装插件

    • activate the plugin through the ‘Plugins’ screen in WordPress
    • 通过WordPress中的“插件”屏幕激活插件

下载地址
https://downloads.wordpress.org/plugin/centinel-api.1.0.0.zip
-EOF-

AI助手支持GPT4.0