0
0
Fork 0
mirror of https://codeberg.org/forgejo/docs.git synced 2024-12-24 22:32:43 -05:00
forgejo-docs/docs/developer/SECRETS.md

71 lines
1.8 KiB
Markdown
Raw Normal View History

---
title: Secrets
license: 'CC-BY-SA-4.0'
---
All Forgejo credentials are shared among the [secret keepers](https://codeberg.org/forgejo/meta/src/branch/readme/TEAMS.md#secrets-keeper) teams in a private repository with encrypted content.
## Get started
1. Make sure you have a GPG Key, or [create one](https://github.com/NicoHood/gpgit#12-key-generation)
2. Send someone else your public key and ask this person to add yourself as a recipient
2023-05-02 14:26:08 -04:00
```
# Commands for the other person
$ gpg --import public_key.asc
2023-05-02 14:26:08 -04:00
# The following command will open a prompt, with the available public keys.
# Choose the one you just added and all secrets will be re-encrypted with this new key.
$ gopass recipients add
```
2023-05-02 14:26:08 -04:00
3. [Install gopass](https://www.gopass.pw/#install)
2023-05-02 14:26:08 -04:00
> :warning: When installing on Ubuntu or Debian you can either download the deb package, install manually or build from source or use our APT repository ([github comment](https://github.com/gopasspw/gopass/issues/1849#issuecomment-802789285) with more information).
4. Clone this repo using `gopass` (the name and email are for `git config`)
2023-05-02 14:26:08 -04:00
```
$ gopass clone git@codeberg.org:forgejo/gopass.git
```
2023-05-02 14:26:08 -04:00
5. Check the consistency of the gopass storage
2023-05-02 14:26:08 -04:00
```
$ gopass fsck
```
## Get a secret
Show the whole secret file:
2023-05-02 14:26:08 -04:00
```
$ gopass show ovh.com/manager
```
Copy the password in the clipboard:
2023-05-02 14:26:08 -04:00
```
$ gopass show -c ovh.com/manager
```
Copy the `user` part of the secret in the clipboard:
2023-05-02 14:26:08 -04:00
```
$ gopass show -c ovh.com/manager user
```
## Insert or edit a secret
2023-05-02 14:26:08 -04:00
```
$ gopass edit ovh.com/manager
```
2023-05-02 14:26:08 -04:00
In the editor, insert the password on the first line.
You may then add lines with a `key: value` syntax (`user: username` for instance).
## Debugging and manual git operations
The following command will show the location and status of the git repo (all git commands are available).
2023-05-02 14:26:08 -04:00
```
$ gopass git status
```