200 Commits

Author SHA1 Message Date
Joe Block
d84e904973 Add .gitattributes during repo initialization (#352)
Make `blackbox_initialize` include `.blackbox/.gitattributes` when
creating a new repository.

Closes #351

Signed-off-by: Joe Block <jpb@unixorn.net>
2022-03-31 15:34:00 -04:00
Jesus Galvan
dc01038efe Fix 'chmod' for macOS Monterey 12.3 (#347) 2022-03-16 13:15:18 -04:00
Tom Limoncelli
5ce3c9370f Revert "[wip] Fix how vcs_relative_path first resolves an absolute path"
This reverts commit a7fd514569.

Sadly this doesn't work in all cases (if the file doesn't exist) and
fails on MacOS (I think).
2020-05-27 08:03:12 -04:00
James Ottaway
a7fd514569 [wip] Fix how vcs_relative_path first resolves an absolute path 2020-05-14 09:49:49 -04:00
James Ottaway
72253818be Call vcs_ignore bwfore the file is shredded 2020-05-14 09:49:49 -04:00
Tom Limoncelli
6c83f606da Revert "Fix how vcs_relative_path first resolves an absolute path (#304)"
This reverts commit 87b7cd0eae.
2020-04-29 19:46:13 -04:00
James Ottaway
87b7cd0eae Fix how vcs_relative_path first resolves an absolute path (#304) 2020-04-27 08:51:24 -04:00
Joshua B
02c3edb9e6 Add better support for Windows (#291) 2019-10-02 09:01:32 -04:00
Pierre Gordon
f67d15638f BUG: blackbox_initialize output uses keyrings instead of $BLACKBOXDATA (#284) 2019-03-22 08:59:19 -04:00
Johannes Liebermann
226a84ba3c Commit changes to gitignore when deregistering (#282) 2019-01-09 10:43:24 -05:00
Travis Paul
f681872c4d Remove -n 1 argument from the xargs invocation in blackbox_shred_all_files.
The -I and -n options are mutually-exclusive, don't work as
expected with xargs from SunOS, and appear to be unecessary anyway.
2018-11-30 13:51:01 +08:00
Travis Paul
3594a3124e Bash from pkgsrc has a flag to disable importing functions unless explicitly enabled.
The patch was created in response to ShellShock and still remains:
https://www.mail-archive.com/smartos-discuss@lists.smartos.org/msg01247.html
https://github.com/NetBSD/pkgsrc/blob/trunk/shells/bash/patches/patch-shell.c
2018-11-30 13:49:15 +08:00
Travis Paul
3a491aad01 Add NetBSD and SunOS (SmartOS) support to _stack_lib.sh. 2018-11-29 14:01:54 +08:00
Travis Paul
b3b0604be7 Add NetBSD and SunOS support to cp_permissions.
Note that this likely won't work on Solaris without Coreutils as
Solaris lacks stat(1). SmartOS has stat from Coreutils in base
and the chmod(1) from it's OpenSolaris heritage. Using the chmod
from either Coreutils or Solaris will work the same (in this case)
on SmartOS.
2018-11-29 13:31:47 +08:00
Travis Paul
6408b622bf Add NetBSD and SunOS support to md5sum_file. 2018-11-29 12:47:37 +08:00
Kamil Wilczek
17ce90125b .blackbox is now the default config directory for new repos. (#272)
- _blackbox_common.sh sets the default Blackbox directory
  for the new repositories using the first entry of the
  BLACKBOX_CANDIDATES array. This small change sets the
  first entry to the new .blackbox dir (instead of the keyring/live)
2018-10-03 09:09:11 -04:00
Tobias Dubois
9d305233ca Add blackbox_decrypt_file (#270)
Add a command for decrypting single files. It is currently just an alias
for blackbox_edit_start.
It is meant to be a more obvious command for decrypting a single file
without editing it.

Fixes #268
2018-09-27 07:31:03 -04:00
r-savu
dc9fa326f4 Improved compatibility: change"/bin/[x]" to "/usr/bin/env [x]" (#265)
changed paths of the form "/bin/[x]" into "/usr/bin/env [x]" (#265)
2018-08-13 10:39:15 -04:00
winter0mute
74de17a4f6 Add blackbox_less. (#263)
* Add blackbox_view and use PAGER (default to less)
2018-07-26 10:24:32 -04:00
Ben Tullis
7cebec9450 Ensure that git commits the changes to pubring.gpg when running blackbox_removeadmin
This relates to https://github.com/StackExchange/blackbox/issues/247 where it has been observed that the blackbox_removeadmin script prompts the user to run an incorrect command after running blackbox_removeadmin. This commit simply adds pubring.gpg to the list of files to be committed.
2018-04-11 11:06:14 +01:00
Pim Snel
0c4cdace10 Fix problems when gpg2 is installed next to gpg (#237)
* implement fixes from https://stackoverflow.com/questions/44247308/blackbox-gpg-decrypt-fails-dont-know-ctb-00
* fix problems when working with gpg2 next to gpg. Add's readme section
* fix anchor
2018-01-05 08:05:57 -05:00
Jinn Koriech
3fda14fd23 Exclude our default keyring from import
By default GPG will continue to perform actions against our default keyring.

During the keychain import stage this results in the export of both the
keyring for the repository we're working on, plus our own default keyring.
The import phase then continues to import all these exported keys, which
include the entries from our default keyring, for which all those entries
already exist.  If you have a lot of keys in your default keyring this takes a
long time, and can be noisy due to validation, yet offers absolutely no value.

To avoid all this overhead we only need to pass the `--no-default-keyring`
option to GPG during this export phase.  The result will still be what we're
expecting - i.e. that all entries from the repository pubring are imported
into our default keyring.
2017-11-11 09:34:59 +00:00
Tom Limoncelli
9ff5892ddf .gitattributes not created in some situations
Replaces https://github.com/StackExchange/blackbox/pull/146
2017-11-07 10:57:08 -05:00
Jon Bardin
043b66dc50 Fixes issue were .gitignore is not included in the commit when you register new file (#206)
* this should fix the .gitignore not be including in the commit when registering a new file
2017-11-07 07:52:34 -08:00
Aymeric Beaumet
60e782a09e Store keys in .blackbox directory (#218) 2017-09-17 18:13:36 -04:00
James Gregory
0626efa7e8 Fixed Alpine compatibility (chmod) (#212) 2017-09-01 05:01:20 -07:00
Patrick Sanders
b483f65c0b direct repobase message to stderr (#204) 2017-08-17 08:57:04 -07:00
Jinn Koriech
c91b29be12 Silence 'not changed' output during keychain import (#200)
Previously the keychain import appears to have redirected stderr to stdout,
silenced lines that indicate a key has 'not changed' then send the output back
to stdout.  This behaviour has been carried over to the new GnuPG-2.1
compatible implementation.
2017-07-04 10:32:48 -04:00
Tom Limoncelli
9966283368 Blackbox should work with Windows better WRT crlf. 2017-06-16 08:16:07 -04:00
Tom Limoncelli
800fe098a6 "gpg --export" should export LANG=C.UTF-8 to be safe. 2017-05-29 19:39:01 -04:00
Robert Taylor
09a62cb1d2 Fixing physical_directory_of function for cases when target directory lives in root. (#194) 2017-05-29 18:00:06 -04:00
Tom Limoncelli
7649c9f00b Fix https://github.com/StackExchange/blackbox/issues/193
Add unit tests to tools/confidence_test.sh to verify admin operations work.
2017-05-15 11:10:01 -04:00
tlimoncelli@stackoverflow.com
4bc97049ab tools/confidence_test.sh: now works with gnupg-2.0 and gnupg-2.1 2017-05-14 18:48:59 -04:00
tlimoncelli@stackoverflow.com
50ac1697c3 tools/confidence_test.sh: now works with gnupg-2.0 again 2017-05-14 17:52:27 -04:00
tlimoncelli@stackoverflow.com
9c6f13fb80 blackbox_shred_all_files: BUGFIX: Does not shred files with spaces. 2017-05-13 11:12:05 -04:00
tlimoncelli@stackoverflow.com
849ec3138b blackbox_removeadmin: Disable gpg's confirmation. 2017-05-13 11:11:39 -04:00
Matthew
be425ed76c shred_file() outputs warning message to stderr. (#192) 2017-05-02 06:33:07 -04:00
Simon Gate
8728290122 Don't complain about GPG_AGENT_INFO if using newer gpg-agent (#189) 2017-04-26 08:34:20 -04:00
Graham Lyons
44c9934293 Use the rm command with -P as a shred fallback (#179)
* Use the `rm` command with `-P` as a shred fallback

The newer versions of OSX (Sierra) have neither `shred` nor `srm`.
They do have `rm` with the `-P` option, so we can fall back to that
before resorting to plain old `rm`.

* Add double-quotes and braces to the shell variable.

We should treat the variable as a string, and we should also be safe
when interpolating it.
2017-03-10 08:20:43 -05:00
Tom Limoncelli
5df0d21be6 make_tempdir must create shorter paths. 2017-02-20 12:15:05 -05:00
Tino Breddin
bd0fcd181c [FreeBSD] Fix use of chmod (#180)
LGTM

Thanks for the fix!
2017-01-20 17:12:57 -05:00
Ben Watson
818db98506 Requiring a file to be entered to finish editing (#175)
* Requiring a file to be entered to finish editing

Running blackbox_edit_end without an argument doesn't currently print out a warning that no files are being changed. A developer in my team who was new to Blackbox committed a decrypted file (and made no changes to the GPG file) as they didn't realise the command hadn't worked.

The check I've added should help to avoid these errors.

* Adding argument check to start editing
2016-12-12 14:07:33 +00:00
Joseph Herlant
1b7c8c880b Remove the key from the keyring when removing an admin (#173)
Thanks for the submission!
2016-11-22 13:43:08 -05:00
Tino Breddin
fba77f092a Add FreeBSD support (#172) 2016-11-08 13:49:42 -05:00
tlimoncelli@stackexchange.com
57dc69a928 Merge branch 'feature-listadmins' of https://github.com/jvanasco/blackbox into jvanasco-feature-listadmins 2016-10-07 16:19:13 -04:00
Jason Price
598896ef48 Add list admins commandline tool. (#170)
* adding a list_admins command

* updating README and V2 ideas to include list_admins

* fix documentation misses

* add list_admins to the toolchain
2016-10-06 11:26:43 -04:00
Dave Jachimiak
31cf506684 ignore backup files and secring.gpg in $BLACKBOXDATA (#169) 2016-09-23 09:26:22 -04:00
Jon Bardin
4fe27a04c9 Allow parallel shredding of files (#167)
* to log which files were shredded
* allow parallel shredding of files ot lower time to shred
2016-08-31 09:29:54 -04:00
Jose Diaz-Gonzalez
21c0b68213 Check return value contents
Closes #156
2016-05-26 11:54:14 -04:00
jonathan vanasco
435a3c073f added blackbox_listadmins, which just displays active admins via cat "$BB_ADMINS" 2016-04-25 12:53:36 -04:00