jurassiscripts / velociraptor

The npm-style script runner for Deno

Home Page:https://velociraptor.run

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot run Velociraptor in Deno ^1.13.0

sant123 opened this issue · comments

Native plugins have been removed denoland/deno#10908.

So executing this command will raise an error:

vr

error: Found argument '--allow-plugin' which wasn't expected, or isn't valid in this context
        Did you mean --allow-run?

USAGE:
    deno run <SCRIPT_ARG>... --allow-env=<allow-env> --allow-net=<allow-net> --allow-read=<allow-read> --allow-run=<allow-run> --allow-write=<allow-write>

For more information try --help
commented

@umbopepato @c4spar Will the fix be as simple as removing this line? If yes, I'd be happy to send a PR!

plugin?: boolean;

Hey @sant123, thanks for reporting!

Does one of your scripts use the plugin permission? In that case running the single script would cause the error but the vr command alone should't trigger any deno command with the plugin permission...

@paambaati right, AllowFlags should be aligned to the new flags (remove plugin and add ffi). Your PR would be much appreciated 🙂

Hey @umbopepato, you can execute vr in any place, in any project, in any scripts file. It's totally broken since this update 😢

Edit:
Now I see what's going on. Taking a look at the velociraptor installation page, the command is the following:

deno install -qAn vr https://deno.land/x/velociraptor@1.0.1/cli.ts

So looking at the installer in my $PATH I encountered this:

cat $(which vr)

#!/bin/sh
# generated by deno install
exec deno run --allow-read --allow-write --allow-net --allow-env --allow-run --allow-plugin --allow-hrtime --quiet 'https://deno.land/x/velociraptor@1.0.1/cli.ts' "$@"

So the workaround for everybody having this issue is re-installing velociraptor:

deno install -qfAn vr https://deno.land/x/velociraptor@1.0.1/cli.ts

After that execute vr upgrade.

Now running the cat command you will see the flags being updated

#!/bin/sh
# generated by deno install
exec deno run --allow-read --allow-write --allow-net --allow-env --allow-run --allow-ffi --allow-hrtime --quiet 'https://deno.land/x/velociraptor@1.1.0/cli.ts' "$@"

And velociraptor works again without issue 😁

@umbopepato @c4spar Will the fix be as simple as removing this line? If yes, I'd be happy to send a PR!

plugin?: boolean;

Definitely the plugin flag should be replaced by ffi flag.

commented

@umbopepato 00fd1b1 (#76) replaces the plugin flag with ffi.

Since this issue has been resolved and there's already a pull request to change allow-plugin for allow-ffi. I'm closing this one.

Thank you so much @paambaati and sorry for the delay in merging your PR, your changes are now live in 1.2.0 😊

The change introduced in flags by deno@^1.13.0 breaks Velociraptor installation files so a full re-install is required.
This can be done either manually with the -f flag (see Installation) or by running vr in remote mode:

$ deno run -A https://code.velociraptor.run upgrade