Skip to content

Support encrypting multiple files at once #165

@robinmoisson

Description

@robinmoisson

It would be nice to support encrypting multiple files out of the box. The CLI signature could become staticrypt <filenames> [options], and we could do

staticrypt foo.html -p password
staticrypt foo.html bar.html -p password
staticrypt fooDirectory/ bar.html -p password -r # -r flag for recursive in directory
staticrypt *.html -p password

This would require a way to specify the output and a sensible default. A few ideas:

  1. output next to the files with _encrypted in the name: dir/foo.html => dir/foo_encrypted.html. This might be convenient for one file, not so much for many files since we have mixed encrypted/non-encrypted files, so not easy to push only the encrypted ones

  2. output in separate directory, the value of -o is the name of directory with default encrypted

    foo.html, dir/bar.html
    => encrypted/foo.html, encrypted/dir/bar.html
    
  3. some sort of pattern to support renaming the files, like dir/foo.html => encrypted/dir/foo_encrypted.html or dir/encrypted.html

Solution 2. looks to me like it's the easiest to set up and the most convenient:

  • if you have multiple files: you have a folder of sensitive html files, you encrypt them all into a single folder, and you can upload that folder anywhere
  • if you have a single file: the encrypted file is separated from the sensitive file and has the same name

In the case of multiple files, keeping the same names also allows relative link to work out of the box. If foo.html has a link to dir/bar.html, the encrypted foo.html will point to the encrypted dir/bar.html (whereas currently you have to rename the links so the link in plaintext foo.html points to dir/bar_encrypted.html to support links between encrypted pages).

You can also always use -o . to output the file in the current directory, and maybe do a little command line magic to get back the foo_encrypted.html name if you really want to.

Curious to hear any extra thoughts on the topic.

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions