Determine where to store repository keys.
(*, legacy=False, create=True)
| 75 | |
| 76 | |
| 77 | def get_keys_dir(*, legacy=False, create=True): |
| 78 | """Determine where to store repository keys.""" |
| 79 | keys_dir = os.environ.get("BORG_KEYS_DIR") |
| 80 | if keys_dir is None: |
| 81 | # note: do not just give this as default to the environment.get(), see issue #5979. |
| 82 | keys_dir = str(Path(get_config_dir(legacy=legacy)) / "keys") |
| 83 | if create: |
| 84 | ensure_dir(keys_dir) |
| 85 | return keys_dir |
| 86 | |
| 87 | |
| 88 | def get_security_dir(repository_id=None, *, legacy=False, create=True): |