Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/windowsrefund/safe
https://github.com/windowsrefund/safe
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/windowsrefund/safe
- Owner: windowsrefund
- License: gpl-3.0
- Created: 2015-01-05T04:30:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-11T17:22:33.000Z (almost 5 years ago)
- Last Synced: 2024-01-27T17:01:43.789Z (5 months ago)
- Language: Shell
- Size: 23.4 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- cli-apps - safe.sh - Pure Bash script to manage secure archives; simple and clean; uses [gnugpg](https://gnupg.org/) for encryption/decryption, thus can leverage tools like [GPG Agent](https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html). (<a name="password-manager"></a>Password managers)
- awesome-cli-apps - safe.sh - Pure Bash script to manage secure archives; simple and clean; uses [gnugpg](https://gnupg.org/) for encryption/decryption, thus can leverage tools like [GPG Agent](https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html). (<a name="password-manager"></a>Password managers)
README
##### Overview
A wrapper to act as a safe. By default, the safe will look for a ~/safe
directory and produce ~/safe.tar.gz.asc##### Assumptions
* Your [GnuPG](http://gnupg.org) config is sane
##### Usage
./safe.sh -h
##### Configuration
The following variables are supported. These can be maintained in ~/.saferc or
any usual environment file such as ~/.bashrcIf you want to create a safe of /my/stuff, create a ~/.saferc with:
SOURCE_DIR - This directory will be encrypted into a safe. For example, setting this to /my/stuff will result in /my/stuff.tar.gz.asc being created.
When not defined, SOURCE_DIR will default to ~/safe
MY_GPG_KEY - The gpg key ID used for encryption
When not set, the script will fall back to using `whoami`. This assumes your
key can be identified using the id you are logged in with.SAFE_BACKUP_HOST - A host to scp backups to. It is always best to maintain a
a definition of this host in your ~/.ssh/config in order to specify details
such as a non-standard port, etc.SAFE_AUTO_BACKUP - Setting this to 1 will trigger a backup any time the
contents of the safe are modified##### Examples (using default configuration and my cat's account)
$ pwd
/home/evil
$ ls safe*
ls: cannot access safe*: No such file or directory
$ mkdir safe
$ for i in $(seq 3); do echo "secret number $i" > safe/file$i; done
$ safe.sh -C
$ ls safe*
safe.tar.gz.asc
$ safe.sh -l
safe/
safe/file1
safe/file2
safe/file3
$ safe.sh -o file3
secret number 3
$ safe.sh -r file1
$ safe.sh -l
safe/
safe/file2
safe/file3
$ > /tmp/foobar
$ safe.sh -a /tmp/foobar
$ test -f /tmp/foobar || echo gone
gone
$ safe.sh -l
safe/
safe/file2
safe/file3
safe/foobar
$ > ~/please_do_not_shred_me
$ safe.sh -A ~/please_do_not_shred_me
$ safe.sh -l
safe/
safe/file2
safe/file3
safe/foobar
safe/please_do_not_shred_me
$ test -f ~/please_do_not_shred_me && echo still here
still hereSee -h for other features like editing, backups, and comparing timestamps