Commit Graph

179 Commits

Author SHA1 Message Date
Jinn Koriech
8b944f3ac9 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.
2018-04-13 13:31:53 -04:00
Tom Limoncelli
60cfa8a8e7 .gitattributes not created in some situations
Replaces https://github.com/StackExchange/blackbox/pull/146
2018-04-13 13:31:53 -04:00
Jon Bardin
9b5e91c57c 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
2018-04-13 13:31:53 -04:00
Aymeric Beaumet
0386308e4e Store keys in .blackbox directory (#218) 2018-04-13 13:31:53 -04:00
James Gregory
9165a77d15 Fixed Alpine compatibility (chmod) (#212) 2018-04-13 13:31:53 -04:00
Patrick Sanders
25bc3e64b7 direct repobase message to stderr (#204) 2018-04-13 13:31:53 -04:00
Jinn Koriech
620f77fbe9 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.
2018-04-13 13:31:53 -04:00
Tom Limoncelli
e1f03e4a74 Blackbox should work with Windows better WRT crlf. 2018-04-13 13:31:53 -04:00
Tom Limoncelli
9ee69f7f5a "gpg --export" should export LANG=C.UTF-8 to be safe. 2018-04-13 13:31:53 -04:00
Robert Taylor
3e60c0c80e Fixing physical_directory_of function for cases when target directory lives in root. (#194) 2018-04-13 13:31:53 -04:00
Tom Limoncelli
d81cc6653f Fix https://github.com/StackExchange/blackbox/issues/193
Add unit tests to tools/confidence_test.sh to verify admin operations work.
2018-04-13 13:31:52 -04:00
tlimoncelli@stackoverflow.com
3b0f0194a0 tools/confidence_test.sh: now works with gnupg-2.0 and gnupg-2.1 2018-04-13 13:31:52 -04:00
tlimoncelli@stackoverflow.com
ca1d10ba80 tools/confidence_test.sh: now works with gnupg-2.0 again 2018-04-13 13:31:52 -04:00
tlimoncelli@stackoverflow.com
836657ebdf blackbox_shred_all_files: BUGFIX: Does not shred files with spaces. 2018-04-13 13:31:52 -04:00
tlimoncelli@stackoverflow.com
5767f22445 blackbox_removeadmin: Disable gpg's confirmation. 2018-04-13 13:31:52 -04:00
Matthew
415f7664b5 shred_file() outputs warning message to stderr. (#192) 2018-04-13 13:31:52 -04:00
Simon Gate
5a05be06c7 Don't complain about GPG_AGENT_INFO if using newer gpg-agent (#189) 2018-04-13 13:31:52 -04:00
Graham Lyons
bb9f8584c3 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.
2018-04-13 13:31:52 -04:00
Tom Limoncelli
c89951c3db make_tempdir must create shorter paths. 2018-04-13 13:31:52 -04:00
Tino Breddin
653cfb618e [FreeBSD] Fix use of chmod (#180)
LGTM

Thanks for the fix!
2018-04-13 13:31:52 -04:00
Ben Watson
d7ed89da4c 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
2018-04-13 13:31:52 -04:00
Joseph Herlant
7e3eb624f5 Remove the key from the keyring when removing an admin (#173)
Thanks for the submission!
2018-04-13 13:31:52 -04:00
Tino Breddin
d4e8acd5ef Add FreeBSD support (#172) 2018-04-13 13:31:52 -04:00
Jason Price
7ca433361e 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
2018-04-13 13:31:52 -04:00
Dave Jachimiak
2f3dc405f1 ignore backup files and secring.gpg in $BLACKBOXDATA (#169) 2018-04-13 13:31:52 -04:00
Tom Limoncelli
ad0673841e merged 2018-04-13 13:31:24 -04:00
Jose Diaz-Gonzalez
05c87ad601 Check return value contents
Closes #156
2018-04-13 13:30:16 -04:00
jonathan vanasco
689952582d added blackbox_listadmins, which just displays active admins via cat "$BB_ADMINS" 2018-04-13 13:30:16 -04:00
tlimoncelli@stackexchange.com
180ee4076e Random 2016-05-17 12:58:13 -04:00
jonathan vanasco
f8c1653e09 some updates for subversion 2016-04-22 17:30:28 -04:00
Dan Slimmon
fc63e24dcf Warn user if there isn't a secure deletion utility
Otherwise, somebody with neither shred nor srm installed could blithely
go on using Blackbox assuming that their working copies are getting
securely deleted.
2016-03-14 18:53:29 +00:00
tlimoncelli@stackoverflow.com
a9dc14c7b0 _stack_lib.sh: Take upstream changes. 2016-02-29 17:22:12 +00:00
Tom Limoncelli
88e9e99f57 Merge pull request #132 from StackExchange/tlim_gitignore
When updating .gitignore, "git add" it.
2016-01-06 12:10:07 -05:00
tlimoncelli@stackoverflow.com
c394b964e8 When updating .gitignore, "git add" it. 2015-12-30 14:41:22 +00:00
Chandler Melton
4ea164fbd3 remove unencrypted file from .gitignore when deregistering 2015-12-16 15:54:28 -06:00
Espen Riskedal
372a35036f Add support for Git for Windows / MINGW users
If you install Git for Windows (https://git-for-windows.github.io/) you get a console
,either CMD or MINTT, which returns MINGW* for uname -s. So if you run blackbox_addadmin
or the other commands, you'll get: "ERROR: Unknown OS. Exiting."

I've simply added MINGW* to the Linux and CYGWIN checks and it seems to work fine.

NOTE: I didn't touch tools/test_functions.sh allthough it should probably be updated as well.
2015-10-29 12:10:58 +01:00
LE Manh Cuong
65ae375828 Fix some minor issues:
- Missing double quote
 - Replace `echo -n` with `printf "%s"` for more
 portability and reliability
2015-10-19 16:52:26 +07:00
LE Manh Cuong
0355095a59 Fix missing quote 2015-10-17 08:49:29 +07:00
David Reuss
ece750b710 Be consistent when creating tmpfiles in stacklib
Use same naming scheme as elsewhere when creating tempfiles.

This fixes deregistering files, when seeing:

```
mktemp: too few X's in template ‘_stacklib_’
```
2015-10-16 14:59:15 +02:00
Tor Arvid Lund
ca2cc76bcd Support having an $EDITOR value with arguments
If a user has $EDITOR set to e.g "subl --wait", then "$EDITOR" (with
quotes) will fail with error "command not found: subl --wait". In other
words, it looks for an executable containing the space and the --wait in
it.

Simply removing the quotes seems to work fine.
2015-08-26 16:15:29 +02:00
Nextraztus
fd78fb5ed3 replace vcs_relative_path with non-python, fixes #115 2015-08-07 08:22:18 -06:00
tal@whatexit.org
7c73009461 Improve Cygwin compatibility. 2015-08-04 11:53:25 -04:00
tlimoncelli@stackexchange.com
343b85a34c Fix issue on OS X when creating a temporary file
This prevents the "mktemp: too few X's in template
_stacklib_" error message from appearing when
adding another admin to blackbox and allows the command to successfully
execute.

    Related:
    rtomayko/shocco#5
    http://unix.stackexchange.com/q/87638/63283
2015-07-28 08:21:52 -04:00
tlimoncelli@stackexchange.com
1f2d99436d Fixed #83 blackbox_edit* scripts should accept multiple filenames 2015-07-24 09:57:34 -04:00
tlimoncelli@stackexchange.com
5ae47a69ea Clean up after cp_permission test 2015-07-24 13:13:51 +00:00
tlimoncelli@stackexchange.com
59685d580b Improve comments. 2015-07-24 13:04:23 +00:00
tlimoncelli@stackexchange.com
aee22fc99d Reorganize tests
* Split out test helper functions into tools/test_functions.sh
  * bin/_blackbox_common_test.sh: Unit-tests for functions.
  * blackbox_postdeploy: Use cp_permissions instead of chmod --reference
2015-07-24 09:01:00 -04:00
Maxime Poulin
649a75e459 File permissions now persits 2015-07-23 10:14:39 -04:00
Bob Example
1d6d65af13 resolution to past zeal with double quotes. 2015-07-10 21:16:12 -04:00
Dan OBoyle
1d4edfaa10 Fix change_to_vcs_root in issue #105 2015-07-10 18:34:37 -04:00