Giter Site home page Giter Site logo

yii2-webshell's People

Contributors

cebe avatar samdark avatar unasoft avatar yaroslavshapoval avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-webshell's Issues

PHP Warning", message: "json_encode(): Invalid UTF-8 sequence in argument"

And no error output in window - is this by design?

111111111111111

Another problem - Invalid UTF-8 sequence in argument was caused by stacktrace of exception happened earlier (because of invalid config) and passed to json_encode() - so stacktrace returned in output is actually useless

0: "#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'json_encode(): ...', 'D:\\WebServers\\O...', 39, Array)"
1: "#1 ...\vendor\yiisoft\yii2\helpers\BaseJson.php(39): json_encode(Array, 320)"
2: "#2 ...\vendor\yiisoft\yii2\web\JsonResponseFormatter.php(53): yii\helpers\BaseJson::encode(Array)"
3: "#3 ...\vendor\yiisoft\yii2\web\JsonResponseFormatter.php(41): yii\web\JsonResponseFormatter->formatJson(Object(yii\web\Response))"
4: "#4 ...\vendor\yiisoft\yii2\web\Response.php(939): yii\web\JsonResponseFormatter->format(Object(yii\web\Response))"
5: "#5 ...\vendor\yiisoft\yii2\web\Response.php(310): yii\web\Response->prepare()"
6: "#6 ...\vendor\yiisoft\yii2\base\Application.php(381): yii\web\Response->send()"
7: "#7 ...\index.php(14): yii\base\Application->run()"
8: "#8 {main}"
type: "yii\base\ErrorException"

Package bower-asset/jquery.terminal not found

I've tried to install the webshell plugin for run some scripts in a project, but i had a problem when i tried to run the command:

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

The error message that i had was:

Problem 1
    - Root composer.json requires samdark/yii2-webshell ~2.0 -> satisfiable by samdark/yii2-webshell[2.0.0].
    - samdark/yii2-webshell 2.0.0 requires bower-asset/jquery.terminal ~0.8.8 -> could not be found in any version, there may be a typo in the package name.

Do you have an idea to solve this? Is there another package that can replace the missing?

Nothing happen about commands

Приветствую!
Я недавно подсел на Yii2 и есть вопрос с консолькой.
Нет доступа к по ssh к серверу, поэтому нашел Ваше решение.
У меня установлен yii2-advanced template
Если я правильно понимаю, то сам модуль ссылается на скриптовой файл yii
Этот скрипт лежит в корне директории.
В конфиге прописал:
'modules' => [
'webshell' => [
'class' => 'samdark\webshell\Module',
'allowedIPs' => ['*'],
'yiiScript' => '@root',
],
],
Все подключилось, но при выполнении команд ничего не происходит:
image

Problem updating/installing (issue #20 doesn't seem to be resolved

Problem 1
- Root composer.json requires bower-asset/jquery.terminal, it could not be found in any version, there may be a typo in the package name.
Problem 2
- Root composer.json requires samdark/yii2-webshell ~2.0 -> satisfiable by samdark/yii2-webshell[2.0.0].
- samdark/yii2-webshell 2.0.0 requires bower-asset/jquery.terminal ~0.8.8 -> could not be found in any version, there may be a typo in the package name.

On April 19 this issue was closed, however it reappears.

Configure with Yii Starter Kit

Hello,

I am trying to use trntv/yii2-starter-kit with Webshell, but I can't configure it.

When I type yii help I get no message

I am trying to configure yiiScript with

'yiiScript' => Yii::getAlias('@common'). '/yii',
'yiiScript' => Yii::getAlias('@backend'). '/yii',

But with no success

Не работает на advanced версии

WebShell не работает на advanced версии yii2, на basic работает. Там ошибка с алиасом @app, для advanced это не корень сайта, а backend или frontend. Если в модуле (Module.php) заменить $yiiScript @app на свой алиас, который который будет вести на корень (где лежит файл yii) все начинает работать.

Getting "Content-Type: application/json; charset=UTF-8" output

I could not get this module to reply something useful. All I get is Content-Type: application/json; charset=UTF-8 response.

At first, I was not providing correct yiiScript value, but afterwards I changed it to correct one (tested it via ssh), but still, I'm getting strange result and I don't know what is the cause.

To debug this issue, I did a little rewrite of DefaultController::runConsole() command (using code from AssetConverter::runCommand()) and made it into:

    protected function runConsole($command)
    {
        $command = Yii::getAlias($this->module->yiiScript) . ' ' . $command;
        $descriptor = [
            1 => ['pipe', 'w'],
            2 => ['pipe', 'w'],
        ];
        $pipes = [];
        $proc = proc_open($command, $descriptor, $pipes, $basePath);
        $stdout = stream_get_contents($pipes[1]);
        $stderr = stream_get_contents($pipes[2]);
        foreach ($pipes as $pipe) {
            fclose($pipe);
        }
        $status = proc_close($proc);

        $command_d = \yii\helpers\VarDumper::dumpAsString($command);
        $stdout_d = \yii\helpers\VarDumper::dumpAsString($stdout);
        $stderr_d = \yii\helpers\VarDumper::dumpAsString($stderr);
        if ($status === 0) {
            Yii::trace("Command $command_d ran successfully:\nSTDOUT:\n$stdout_d\nSTDERR:\n$stderr_d", __METHOD__);
        } elseif (YII_DEBUG) {
            throw new \yii\base\Exception("Command '$command_d' failed with exit code $status:\nSTDOUT:\n$stdout_d\nSTDERR:\n$stderr_d");
        } else {
            Yii::error("Command '$command_d' failed with exit code $status:\nSTDOUT:\n$stdout_d\nSTDERR:\n$stderr_d", __METHOD__);
        }

        return [$status, $stdout];
    }

And I got this output in debug console:

Command 'php -c php.ini -f ../yii ' ran successfully:
STDOUT:
'Content-Type: application/json; charset=UTF-8

'
STDERR:
''

Can't install package because of bower-asset dependency issue

The package was install earlier but suddenly when ran composer update then below dependencies problems are there :

  Problem 1
    - Root composer.json requires samdark/yii2-webshell ~2.0 -> satisfiable by samdark/yii2-webshell[2.0.0].
    - samdark/yii2-webshell 2.0.0 requires bower-asset/jquery.terminal ~0.8.8 -> found bower-asset/jquery.terminal[dev-master, 2.23.1, ..., 2.35.3] but it does not match the constraint.

Also tried installing this package with composer require but same output
Ref 1 : https://prnt.sc/qIlVdaRtX11K
Ref 2 : https://prnt.sc/Eop72TyyX9-J

Is there any additional config require?

Не работает подтверждение операции.

При попытке создать/провести миграцию идет запрос на подтверждение.
Если ответить на запрос, выдает Unknown command.
$ yii migrate
Yii Migration Tool (based on Yii v2.0.6)

Total 1 new migration to be applied:
m150826_060922_test

Apply the above migration? (yes|no) [no]:
$ yes
Unknown command.

курсор автоматически переносит.

Проверка доступа

Может добавить allowedCallback какой нибудь? чтоб проверял до allowedIPs, например, если админ. IP все же неудобная фигня :(

yii migrate causes "unknown command" after "Apply? = yes" prompt

Did you test webshell with the migrate command?
I always get an "Unknown command." error after the "yes" prompt.

Yii 2.0 web shell
$ yii migrate
Yii Migration Tool (based on Yii v2.0.7)

Total 1 new migration to be applied:
    m160329_110000_create_modelhistory

Apply the above migration? (yes|no) [no]:
$ y
Unknown command.

Running the "yii migrate" command in linux shell works without problems,
so there must be something wrong with webshell or my config:

    'webshell' => [
        'class' => 'samdark\webshell\Module',
        'yiiScript' => '/var/www/html/myprojectfolder/yii'
   ]

The yiiScript is executable and works fine when run with one of the following commands:

   php yii
   ./yii

Webshell works fine as long as there is no prompt.
I don't know where to start debugging...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.