如何在rstudio.cloud这样的LearnR中设置安全的代码评估器?

发布于 2025-02-08 16:07:12 字数 1210 浏览 1 评论 0 原文

当我们在shinyapps.io中使用Learn R或托管版本的自托版本时,用户可以使用代码评估器打印包含教程源代码的变量。

例如,在 .server_context 以获取当前RMD的源代码:

“在此处输入图像说明”

(更新)示例2:

通过运行 cat(系统(“ cat/srv/connect/apps/ex-data-filter/ex-data-filter.rmd”,intern = true),sep ='\ n')可以获取源当前RMD的代码也:

但有趣的是,在 rstudio.cloud.cloud.cloud 托管版本,代码评估器似乎是沙箱的,所有“敏感”变量无法通过评估器运行。

我可以就如何实现这种安全的代码评估器获得一些建议吗?

谢谢!

When we use the self-hosted version of Learn R or hosted version in shinyapps.io, the user can print out variables that contain the tutorial source code using the code evaluator.

For example in shinyapps hosted version, the user can run .server_context to get the source code of the current rmd:

enter image description here

(UPDATED) Example 2:

By running cat(system("cat /srv/connect/apps/ex-data-filter/ex-data-filter.Rmd", intern = TRUE), sep = '\n') can to get the source code of the current rmd too:
enter image description here

But interestingly in rstudio.cloud hosted version, the code evaluator seems to be sandboxed, and all "sensitive" variables cannot be run through the evaluator.

enter image description here

Can I get some advice on how to implement such a secure code evaluator?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文