yii2-webshell

Web shell allows to run yii console commands using a browser

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者samdark/yii2-webshell
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證BSD 3-Clause "New" or "Revised" License
所有者活动
創建於2014-04-15 18:22:31
推送於2019-05-23 23:45:40
最后一次提交2019-05-23 23:45:39
發布數3
最新版本名稱2.0.0 (發布於 )
第一版名稱1.0.0 (發布於 )
用户参与
星數226
關注者數31
派生數36
提交數15
已啟用問題?
問題數15
打開的問題數3
拉請求數4
打開的拉請求數2
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?