定制 samdark/yii2-webshell 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

samdark/yii2-webshell

最新稳定版本:2.0.0

Composer 安装命令:

composer require samdark/yii2-webshell

包简介

A web shell that allows to run yii console commands and create your own commands.

README 文档

README

Web shell allows to run yii console commands using a browser.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist samdark/yii2-webshell "~2.0"

or add

"samdark/yii2-webshell": "~2.0"

to the require section of your composer.json file.

Configuration

To use web shell, include it as a module in the application configuration like the following:

return [
    'modules' => [
        'webshell' => [
            'class' => 'samdark\webshell\Module',
            // 'yiiScript' => Yii::getAlias('@root'). '/yii', // adjust path to point to your ./yii script
        ],
    ],

    // ... other application configuration
]

With the above configuration, you will be able to access web shell in your browser using the URL http://localhost/path/to/index.php?r=webshell

Access control

By default access is restricted to local IPs. It could be changed via allowedIPs property. Additionally, checkAccessCallback is available to be able to introduce custom access control:

return [
    'modules' => [
        'webshell' => [
            'class' => 'samdark\webshell\Module',
            // 'yiiScript' => Yii::getAlias('@root'). '/yii', // adjust path to point to your ./yii script
            'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.2'],
            'checkAccessCallback' => function (\yii\base\Action $action) {
                // return true if access is granted or false otherwise
                return true;
            }
        ],
    ],

    // ... other application configuration
]

Limitations

Web shell is unable to work interactively because of request-response nature of web. Therefore you should disable interactive mode for commands.

统计信息

  • 总下载量: 78.6k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 229
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 226
  • Watchers: 31
  • Forks: 36
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-08-05