简体   繁体   English

基础架构 vue 执行 bash 脚本

[英]Infrastructure vue to exec bash script

Ho guys… I need to build a web app based on vue.js, and I need to execute some bash script located on the client hd.伙计们……我需要基于 vue.js 构建一个 web 应用程序,我需要执行位于客户端 hd 上的一些 bash 脚本。 This software is only for a secure intr.net and I can have all permissions I need!该软件仅用于安全的 intr.net,我可以获得我需要的所有权限!

Do you have some ideas?你有什么想法吗? I don't want install any client app!我不想安装任何客户端应用程序!

It is impossible for a web app (based in VueJS, or any other framework) to execute some script on the client. web 应用程序(基于 VueJS 或任何其他框架)不可能在客户端执行某些脚本。 This is fundamentally in opposition with the security principles of the browser.这从根本上违背了浏览器的安全原则。 If a website could execute some script on your machine, even with permission, that would be a huge security risk.如果一个网站可以在你的机器上执行一些脚本,即使得到许可,那也将是一个巨大的安全风险。

You need some sort of client app if you want full control over executing various scripts on the client.如果你想完全控制在客户端上执行各种脚本,你需要某种客户端应用程序。 NuxtJS or any similar technology like Next don't do anything to help your use-case. NuxtJS 或类似 Next 的任何类似技术对您的用例没有任何帮助。

If it's a simple case, and you only need the user to execute a one-off script, then you can simply tell the user to do so.如果是简单的情况,你只需要用户执行一次性脚本,那么你可以简单地告诉用户这样做。 For example, here is a popular project called NVM that instructs users to install NVM by running a command in their terminal emulator:例如,是一个名为 NVM 的流行项目,它指示用户通过在终端仿真器中运行命令来安装 NVM:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

In your case, you can statically host an install.sh file somewhere on your site, and then have instructions to download it similarly:在您的情况下,您可以在您网站的某处静态托管一个install.sh文件,然后按照说明类似地下载它:

curl -o- https://myintranetsite.example.com/install.sh | bash

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM