Skip to content

Commit

Permalink
fix(mkdocs): fix mkdocs GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
FalcoSuessgott committed Nov 3, 2024
1 parent 367b5ad commit 90f1e50
Show file tree
Hide file tree
Showing 43 changed files with 207 additions and 191 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ updates:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"
include: "scope"
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
- uses: wagoid/commitlint-github-action@v5
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
version: v1.59.1
args: -c .golang-ci.yml -v --timeout=5m
env:
GO111MODULES: off
GO111MODULES: off
38 changes: 29 additions & 9 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
name: mkdocs
name: mkdocs

on:
push:
branches:
- master
- master
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: make docgen

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
REQUIREMENTS: requirements.txt

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: pip install -r requirements.txt

- run: mkdocs gh-deploy --force
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags:
- '*'
pull_request:

permissions:
contents: write
packages: write
Expand All @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
-
-
uses: actions/setup-go@v5
with:
go-version: '1.21'
Expand Down Expand Up @@ -59,4 +59,4 @@ jobs:
version: latest
args: release --skip=publish --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- uses: actions/checkout@v4

- run: go generate -tags tools tools/tools.go

- uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ coverage.out
.vscode/
manpages/
completions/
dist/
dist/
2 changes: 1 addition & 1 deletion .golang-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ linters:
- tagalign
- copyloopvar
- intrange
- execinquery
- execinquery
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builds:
goarch:
- amd64
- arm64

archives:
-
builds:
Expand Down Expand Up @@ -141,4 +141,4 @@ changelog:
regexp: ^.*?doc(\([[:word:]]+\))??!?:.+$
order: 400
- title: Other work
order: 9999
order: 9999
31 changes: 14 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
repos:
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: go-build-mod
- id: go-test-mod
- id: go-vet-mod
- id: go-staticcheck-mod
- id: go-fmt
- id: go-fumpt
- id: go-imports
- id: go-lint
- id: golangci-lint-mod
args: [-c.golang-ci.yml]

- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-case-conflict
- id: check-symlinks
- id: check-json
- id: mixed-line-ending
args: ["--fix=lf"]
- id: no-commit-to-branch
args: [--branch, main]
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
2 changes: 1 addition & 1 deletion Dockerfile.goreleaser
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ EXPOSE 8080
# preinstall vault for VKV_LOGIN_COMMAND
RUN apk add --no-cache bash vault libcap && setcap -r /usr/sbin/vault

ENTRYPOINT ["/usr/bin/vkv"]
ENTRYPOINT ["/usr/bin/vkv"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ docs: ## build and serve docs
.PHONY: docgen
docgen:
go run main.go docs
find ./docs -name '*.md' -print0 | xargs -0 sed -i 's/```vkv/```go/g'
find ./docs -name '*.md' -print0 | xargs -0 sed -i 's/```vkv/```go/g'
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ secret/ [desc=key/value secret storage] [type=kv2] # engine description & type
├── demo [v=1]
│ └── foo=***
└── sub
├── demo [v=1]
├── demo [v=1]
│ ├── demo=***********
│ ├── password=******
│ └── user=*****
└── sub2
└── demo [v=2] [admin=false key=value]
└── demo [v=2] [admin=false key=value]
├── admin=***
├── foo=***
├── password=********
└── user=****
```
```
2 changes: 1 addition & 1 deletion assets/tapes/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Up
Sleep 2

Down
Sleep 2
Sleep 2
2 changes: 1 addition & 1 deletion assets/tapes/diff.tape
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Set Height 1000
Show
Type "diff -ty <(vkv export -p secret --show-values) <(vkv export -p secret_2 --show-values)"
Enter
Sleep 5s
Sleep 5s
2 changes: 1 addition & 1 deletion assets/tapes/fzf.tape
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Up
Sleep 2

Down
Sleep 2
Sleep 2
2 changes: 1 addition & 1 deletion cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (s *VaultSuite) TestMode() {
expected: `e2e/ [type=kv2]
├── sub [v=1]
│ └── user=********
└── sub2 [v=1]
└── key=*****
`,
Expand Down
2 changes: 1 addition & 1 deletion cmd/testdata/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
}
}
}
}
}
4 changes: 2 additions & 2 deletions docs/authentication.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Authentication

`vkv` supports all of Vaults [environment variables](https://www.vaultproject.io/docs/commands#environment-variables) as well as any configured [Token helpers](https://developer.hashicorp.com/vault/docs/commands/token-helper).
`vkv` supports all of Vaults [environment variables](https://www.vaultproject.io/docs/commands#environment-variables) as well as any configured [Token helpers](https://developer.hashicorp.com/vault/docs/commands/token-helper).

In order to authenticate you will have to set at least one of the `VAULT_ADDR` or `VKV_LOGIN_COMMAND` and `VAULT_TOKEN` env vars.

## MacOS/Linux
```
export VAULT_ADDR="http://127.0.0.1:8200"
export VAULT_TOKEN="hvs.XXX"
export VAULT_TOKEN="hvs.XXX"
vkv export --path <KVv2-path>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/cicd_azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ steps:
eval $(curl http://vkv:8080)
echo $secret
displayName: Read secrets as env vars using vkv
```
```
2 changes: 1 addition & 1 deletion docs/cicd_github.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
run: eval $(curl http://vkv:8080/export)
- name: output secrets now available as env vars
run: echo $secret
```
```
6 changes: 3 additions & 3 deletions docs/cicd_gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ default:
command: ["server"]
alias: vkv
# global before_scripts block
before_script:
# install curl, or wget in your job container
before_script:
# install curl, or wget in your job container
- apk add --no-cache curl

# curl/wget vkv on /export, which will expot all secrets from VKV_SERVER_PATH, eval the output into your shell
Expand All @@ -42,5 +42,5 @@ default:
test:
stage: test
script:
- make test
- make test
```
6 changes: 3 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ example:
```bash
VKV_EXPORT_PATH=secret VKV_MODE=export vkv
secret/
├── v1: admin [key=value]
│ └── sub=********
├── v1: admin [key=value]
│ └── sub=********
├── v1: demo
│ └── foo=***
└── sub/
Expand Down Expand Up @@ -66,4 +66,4 @@ Simply run:

```bash
man vkv
```
```
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ secret/ [desc=key/value secret storage] [type=kv2]
├── foo=***
├── password=********
└── user=****
```
```
2 changes: 1 addition & 1 deletion docs/example_direnv.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export VAULT_TOKEN="$(cat ~/.vault-token)"
eval $(vkv export -p kv/secrets -f export)
```

Now if you go into that directory and run `direnv allow`,
Now if you go into that directory and run `direnv allow`,
you have the secrets under `kv/secrets` exported as env various:

```bash
Expand Down
2 changes: 1 addition & 1 deletion docs/example_fzf.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fzf

using `vault secrets list` and a little bit of `jq`-logic, we can get a list of all KV-engines visible for the token.
using `vault secrets list` and a little bit of `jq`-logic, we can get a list of all KV-engines visible for the token.

If we pipe this into `fzf` we can get a handy little preview-app:

Expand Down
6 changes: 3 additions & 3 deletions docs/example_kubernetes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kubernetes

`vkv` comes in container images, which enable you to run scheduled snapshots in a kubernetes cluster.
`vkv` comes in container images, which enable you to run scheduled snapshots in a kubernetes cluster.

The idea is to schedule a cronjob which snapshots a vault server and writes the snapshot files to a persistent volume.

Expand Down Expand Up @@ -82,7 +82,7 @@ spec:
- name: VAULT_TOKEN
value: hvs.xxxx # change to your token
volumeMounts:
- name: local-persistent-storage
- name: local-persistent-storage
mountPath: /mnt
restartPolicy: OnFailure
volumes:
Expand All @@ -109,4 +109,4 @@ Obviously this approach is just for development purposes. In order to make it pr
* Or obtain the token using Vaults kubernetes auth engine and the [Vault Agent injector](https://developer.hashicorp.com/vault/docs/platform/k8s/injector)
* run the cronjob daily
* update the permission of the volumes
* backup the pv
* backup the pv
8 changes: 4 additions & 4 deletions docs/example_migrate_kvv1_kvv2.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $> vkv export -p kvv1 -f=json | vkv import -p kv
v2
reading secrets from STDIN
parsing secrets from JSON
writing secret "kvv2/dev"
writing secret "kvv2/dev"
successfully imported all secrets

result:
Expand All @@ -37,10 +37,10 @@ kvv2/
You can also move a KV mount within another engine:

```bash
$> vkv export -p kvv1 -f=json | vkv import -p engine/subpath --force
$> vkv export -p kvv1 -f=json | vkv import -p engine/subpath --force
reading secrets from STDIN
parsing secrets from JSON
writing secret "engine/subpath/dev"
writing secret "engine/subpath/dev"
successfully imported all secrets

result:
Expand All @@ -57,4 +57,4 @@ engine/
└── dev [v=1]
├── admin=****
└── password=**
```
```
2 changes: 1 addition & 1 deletion docs/example_sops.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ sops:
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.3
```
```
Loading

0 comments on commit 90f1e50

Please sign in to comment.