英文:
Creating a user/password login for Distill and/or Quarto website in R
问题
我目前正在通过R创建一个distill网站(希望能过渡到Quarto,但仍然使用distill)。目前,R代码与GitHub连接,用于发布网站,这主要是为了我们部门内部使用。如果网站链接泄露出去,会存在公开可访问性的担忧。
我想知道是否有一种方法可以在R代码中构建一种分配给我们人员的用户名和密码的方式,这将在有人访问链接时强制启用登录门户。
我对通过R进行网站开发相当新,所以一个示例将非常有帮助!谢谢!
英文:
I am currently creating a distill website through R (hopefully to transition to Quarto, but still using distill). Currently, the R code is connected with GitHub to publish the website, and this will mainly be for internal use within my department. There is concern with the public availability if the website's link gets out.
I was wondering if there was a way to build into the R code a way to assign usernames and passwords for our personnel, which will force a login portal when someone accesses the link.
I am fairly new to allow of this website development through R, so an example would be very helpful! Thanks!
答案1
得分: 1
为了管理凭据,您需要服务器端代码。GitHub Pages是静态的,所以没有服务器供您运行。
您有几个选择:
- 将网站托管在服务器上,并使用类似于
htaccess
文件 这样的方式管理访问。 - 将 GitHub 页面设置为私有。请注意,您随后需要为需要访问的人提供仓库的读取权限,这意味着他们需要拥有 GitHub 登录。
英文:
To manage credentials, you need server-side code. GitHub Pages is static, so there's no server for you to run it on.
You have a couple of options:
- Host the site on a server and manage access using something like a
htaccess
file - Change the GitHub page to be private. Note that you'd then need to give anyone who needs access read access to the repo, which would mean that they would need to have a GitHub login.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论