Skip to content

favstats/rmdprotectr

Repository files navigation

rmdprotectr

The goal of rmdprotectr is to password protect Rmarkdown HTML documents.

This package implements very simple password protection for static pages or whole websites with no server configuration required: you can use Dropbox, Amazon S3 or any generic hosting service to host a private, password protected site.

READ THIS BEFORE USING:

  • If your hosting service offers directory listing, a visitor can bypass the protection.
  • there’s no protection against brute force attack. Pick a very long and hard to guess password.
  • Pasting the link directly to someone will bypass the login so this is not a very secure way to password protect your documents. If you want something stronger check section at the end or other alternatives. The use-case for this package is to share a low-risk document with someone that should be accessible via the internet but not to everyone immediately.

Installation

You can install the development version of rmdprotectr from GitHub with:

## you need to specify the main branch
remotes::install_github("favstats/rmdprotectr", ref = "main")

How to Use

library(rmdprotectr)

## provide a path to your .Rmd and it will be rendered in the correct folder
protect_rmd("test.Rmd", pw = "somefancypw")

## make sure your Rmd is set to knit to HTML!

You are set! Push to private GitHub repo and activate GitHub pages or use whatever hosting service you prefer!

You can also use this set up with any other HTML. Just put an index.html that you want to host into the folder generated by protect_rmd.

Example

Check this repo for an example implementation.

You can also test the password protection by going to this GitHub pages site. The password is: password.

Other ways to password protect your Rmd

If you are looking for a more secure encryption method for your Rmarkdowns you may want to take a look at {encryptRmd}.

You can also check out this StackOverflow question for an interesting solution that works with Rmarkdown parameters. You can also probably expand this to work with query parameters which is at least as secure as the solution presented here (not a whole lot).

Credit

Credit to matteobrusa and scottishstoater for coding most of the custom HTML required for this to work.

About

Very simple implementation of a password protected RMarkdown document.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published