mallka/yii2-webshell 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mallka/yii2-webshell

Composer 安装命令:

composer require mallka/yii2-webshell

包简介

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

README 文档

README

Notice:the package forked from samdark/yii2-webshell

What we change

  1. allow to run other console command
  2. move the jquery.terminal into asset folder due to bower floder is different(since some date)
  3. changed sourcepath of Asset Class, then I don't need to set Alias config anymore.

Yii 2.0 web shell

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 mallka/yii2-webshell "dev-master"

or add

"mallka/yii2-webshell": "dev-master"

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' => 'mallka\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' => 'mallka\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;
            },
            
            //allow to run other commands,default is true,
            'unlimit'=>false,
            
            //unsupport command
            'unsupportCommands'=>['top','ping'],
        ],
    ],

    // ... 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.

统计信息

  • 总下载量: 61
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 36
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-05-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固