Skip to content

Commit

Permalink
enh: outsource secrets file and document how to use the secrets
Browse files Browse the repository at this point in the history
Resolves: #2.
  • Loading branch information
oesteban committed Aug 17, 2023
1 parent ef81937 commit 150326e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ If you want to keep secrets that are inaccessible to others (even after making t

- [ ] Create a [new repository on GitHub](https://docs.github.com/en/get-started/quickstart/create-a-repo). **Make sure the repository IS PRIVATE**.
- [ ] In the new repository, **ONLY one file should be found** at the root: `secrets.yml`.
That file will look as follows:
``` yaml title="Example of secrets file"
{% include 'examples/mkdocs-secrets.yml' %}
```
That file will look as follows:

``` yaml title="Example of secrets file"
{% include 'examples/mkdocs-secrets.yml' %}
```

- [ ] Copy the URL of the new repository.
This will, typically, take a form like `https://github.com/gh_handle/my-sops-secrets.git`, where `gh_handle` is a GitHub username and `my-sops-secrets` is the name of the repository you set when you started the secrets repositorty.
With the URL, please [add a git submodule](https://github.blog/2016-02-01-working-with-submodules/) to the repo:
Expand All @@ -125,9 +127,9 @@ If you want to keep secrets that are inaccessible to others (even after making t

- [ ] Finally, uncomment the line pointing at `secrets/settings.yml` in *plugins* section of the `/mkdocs.yml` general configuration file:

``` yaml title="Enabling private metadata"
{% include 'examples/mkdocs-secrets.yml' %}
```
``` yaml title="Enabling private metadata"
{% include 'examples/mkdocs-secrets.yml' %}
```

- [ ] From this moment on, you can use these secrets with the following replacement pattern: `{{ '{{ secrets.logins.password_computer1 | default("*****") }}' }}`.
The default filter allows the replacement of unavailable secrets (because in this case the user does not have access to the secret) with redaction symbols.
Expand Down

0 comments on commit 150326e

Please sign in to comment.