From 5a6e51463a88100cf7f70962cb16dc87fce9d72b Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Fri, 12 Jul 2024 13:04:33 +0200 Subject: [PATCH] add docs to repo --- .woodpecker/deploy-docs.yml | 38 ++++++++++ docs/.gitignore | 13 ++++ docs/LICENSE | 9 +++ docs/README.md | 1 + docs/archetypes/default.md | 5 ++ docs/config.toml | 18 +++++ docs/content/_index.md | 89 +++++++++++++++++++++++ docs/content/docs/configuration/_index.md | 0 docs/content/docs/introduction/_index.md | 29 ++++++++ docs/content/menu/index.md | 22 ++++++ docs/go.mod | 5 ++ docs/go.sum | 2 + 12 files changed, 231 insertions(+) create mode 100644 .woodpecker/deploy-docs.yml create mode 100644 docs/.gitignore create mode 100644 docs/LICENSE create mode 100644 docs/README.md create mode 100644 docs/archetypes/default.md create mode 100644 docs/config.toml create mode 100644 docs/content/_index.md create mode 100644 docs/content/docs/configuration/_index.md create mode 100644 docs/content/docs/introduction/_index.md create mode 100644 docs/content/menu/index.md create mode 100644 docs/go.mod create mode 100644 docs/go.sum diff --git a/.woodpecker/deploy-docs.yml b/.woodpecker/deploy-docs.yml new file mode 100644 index 0000000..7cec819 --- /dev/null +++ b/.woodpecker/deploy-docs.yml @@ -0,0 +1,38 @@ +when: + - event: push + branch: main + path: + include: + - 'docs/**' + - '.woodpecker/deploy-docs.yml' + ignore_message: '[ALL]' + +steps: + build: + image: golang:1.22-bookworm + environment: + - HUGO_VERSION=0.128.1 + - TZ=Europe/Berlin + + commands: + - cd docs/ + - wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb + - hugo --minify --destination ./public + + upload: + image: alpine:latest + secrets: + - RSYNC_SSHKEY + - RSYNC_TARGET_SERVER + - RSYNC_TARGET_USER + environment: + - TARGET_PATH=/webroot/certwarden-deploy.adora.codes + - RSYNC_TARGET_PORT=2003 + commands: + - cd docs/ + - apk add --update --no-cache openssh rsync git + - mkdir -p $HOME/.ssh + - echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519 + - chmod 0600 $HOME/.ssh/id_ed25519 + - ssh-keyscan -t ed25519 -p $RSYNC_TARGET_PORT $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts + - rsync -avh -e "ssh -p $RSYNC_TARGET_PORT" --delete ./public/ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..86c95ef --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,13 @@ +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock diff --git a/docs/LICENSE b/docs/LICENSE new file mode 100644 index 0000000..cd47852 --- /dev/null +++ b/docs/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright 2024 Adora Laura Kalb + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..8a0db64 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +# certwarden-deploy Documentation diff --git a/docs/archetypes/default.md b/docs/archetypes/default.md new file mode 100644 index 0000000..c6f3fce --- /dev/null +++ b/docs/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title = '{{ replace .File.ContentBaseName "-" " " | title }}' +date = {{ .Date }} +draft = true ++++ diff --git a/docs/config.toml b/docs/config.toml new file mode 100644 index 0000000..53adace --- /dev/null +++ b/docs/config.toml @@ -0,0 +1,18 @@ +baseURL = 'https://certwarden-deploy.adora.codes/' +languageCode = 'en-us' +title = 'certwarden-deploy' + +theme = "code.lila.network/adoralaura/hugo-book-theme" + + + +[params] + # (Optional, default light) Sets color theme: light, dark or auto. + # Theme 'auto' switches between dark and light modes based on browser/os preferences + BookTheme = 'auto' + BookRepo = 'https://code.lila.network/adoralaura/certwarden-deploy' + + +[module] + [[module.imports]] + path = "code.lila.network/adoralaura/hugo-book-theme" diff --git a/docs/content/_index.md b/docs/content/_index.md new file mode 100644 index 0000000..1a0c6ae --- /dev/null +++ b/docs/content/_index.md @@ -0,0 +1,89 @@ +--- +title: Introduction +type: docs +--- + +## CertWarden + +[CertWarden](https://www.certwarden.com/) is a self-hosted Centralized ACME Certificate Management platform. With it you can manage and aquire Let's Encrypt certificates. + +However, to deploy them to your hosts, for now there only was a docker client, and that was too bloated for me. + +So I built `certwarden-deploy`, a dependency-less binary that can run via crontab/systemd timers and that can fetch new certificates and run actions after new certificates got rolled out. + +## Quick Start + +Installation of the required CertWarden instance is out of scope of this documentation. For detailed instructions regarding CertWarden, please visit [it's documentation](https://www.certwarden.com/docs/introduction/) + + +To quickly get started with `certwarden-deploy`, just download the binary... + +```shell +# this downloads certwarden-deploy version 0.1.1 +# to /usr/local/bin/certwarden-deploy +sudo wget https://code.lila.network/adoralaura/certwarden-deploy/releases/download/0.1.1/certwarden-deploy-0.1.1-linux-amd64 -O /usr/local/bin/certwarden-deploy + +sudo chmod +x /usr/local/bin/certwarden-deploy +``` + +... fill out the config file... +```shell +vi /etc/certwarden-deploy/config.yaml +``` +```yaml +# Base URL of the CertWarden instance +# required +base_url: "https://certwarden.example.com" + +# Set this to true if your CertWarden instance does not have a publicly trusted +# TLS certificate (e.g. it has a self signed one) +# default is false +disable_certificate_validation: false + +# define all managed certificates here +certificates: + + # name is a unique identifier that must start and end with an alphanumeric character, + # and can contain the following characters: a-zA-Z0-9._- + # required + - name: test-certificate.example.com + + # Contains the API-Key to fetch the certificate from the server + # required + + api_key: examplekey_notvalid_hrzjGDDw8z + + # action to run when certificate was updated or --force is on + action: "/usr/bin/systemd reload caddy" + + # path where to save the certificate + # required + file_path: "/path/to/test-certificate.example.com-cert.pem" +``` + +... and run it! +```shell +certwarden-deploy -v +``` +## Contributing + +I use my own [Forgejo Instance](https://code.lila.network) to manage issues and pull requests. + +* If you have a trivial fix or improvement, go ahead and create a pull request, + addressing (with `@...`) the maintainer of this repository (see + [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. + +* If you plan to do something more involved, first please [send me a mail]( mailto:adora@lila.network?subject=%5Bcertwarden-deploy%5D). + +### What to contribute + +The best way to help without speaking a lot of Go would be to share your +configuration, alerts, dashboards, and recording rules. If you have something +that works and is not in the repository, please pay it forward and +share what works. + +## Changelog +You can find the Changelog here: [Changelog](https://code.lila.network/adoralaura/certwarden-deploy/src/branch/main/CHANGELOG.md) + +## License +`certwarden-deploy` is available under the MIT license. See the [LICENSE](https://code.lila.network/adoralaura/certwarden-deploy/src/branch/main/LICENSE) file for more info. diff --git a/docs/content/docs/configuration/_index.md b/docs/content/docs/configuration/_index.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/content/docs/introduction/_index.md b/docs/content/docs/introduction/_index.md new file mode 100644 index 0000000..13114a5 --- /dev/null +++ b/docs/content/docs/introduction/_index.md @@ -0,0 +1,29 @@ +--- +title: Introduction +type: docs +--- + +# Introduction + +## CertWarden + +[CertWarden](https://www.certwarden.com/) is a self-hosted Centralized ACME Certificate Management platform. With it you can manage and aquire Let's Encrypt certificates. + +However, to deploy them to your hosts, for now there only was a docker client, and that was too bloated for me. + +So I built `certwarden-deploy`, a dependency-less binary that can run via crontab/systemd timers and that can fetch new certificates and run actions after new certificates got rolled out. + +## Quick Start + +Installation of the required CertWarden instance is out of scope of this documentation. For detailed instructions regarding CertWarden, please visit [it's documentation](https://www.certwarden.com/docs/introduction/) + + +To quickly get started with `certwarden-deploy`, just download the binary and run it. + +```shell +# this downloads certwarden-deploy version 0.1.1 +# to /usr/local/bin/certwarden-deploy +sudo wget https://code.lila.network/adoralaura/certwarden-deploy/releases/download/0.1.1/certwarden-deploy-0.1.1-linux-amd64 -O /usr/local/bin/certwarden-deploy + +sudo chmod +x /usr/local/bin/certwarden-deploy +``` diff --git a/docs/content/menu/index.md b/docs/content/menu/index.md new file mode 100644 index 0000000..ed418fe --- /dev/null +++ b/docs/content/menu/index.md @@ -0,0 +1,22 @@ +--- +headless: true +--- + +- [**Example Site**]({{< relref "/docs/example" >}}) +- [Table of Contents]({{< relref "/docs/example/table-of-contents" >}}) + - [With ToC]({{< relref "/docs/example/table-of-contents/with-toc" >}}) + - [Without ToC]({{< relref "/docs/example/table-of-contents/without-toc" >}}) +- [Collapsed]({{< relref "/docs/example/collapsed" >}}) + - [3rd]({{< relref "/docs/example/collapsed/3rd-level" >}}) + - [4th]({{< relref "/docs/example/collapsed/3rd-level/4th-level" >}}) +
+ +- **Shortcodes** +- [Buttons]({{< relref "/docs/shortcodes/buttons" >}}) +- [Columns]({{< relref "/docs/shortcodes/columns" >}}) +- [Expand]({{< relref "/docs/shortcodes/expand" >}}) +- [Hints]({{< relref "/docs/shortcodes/hints" >}}) +- [KaTeX]({{< relref "/docs/shortcodes/katex" >}}) +- [Mermaid]({{< relref "/docs/shortcodes/mermaid" >}}) +- [Tabs]({{< relref "/docs/shortcodes/tabs" >}}) +
diff --git a/docs/go.mod b/docs/go.mod new file mode 100644 index 0000000..a038a0f --- /dev/null +++ b/docs/go.mod @@ -0,0 +1,5 @@ +module code.lila.network/adoralaura/certwarden-deploy-docs + +go 1.22.2 + +require code.lila.network/adoralaura/hugo-book-theme v0.0.0-20240712103017-55b1193ecd34 // indirect diff --git a/docs/go.sum b/docs/go.sum new file mode 100644 index 0000000..8829714 --- /dev/null +++ b/docs/go.sum @@ -0,0 +1,2 @@ +code.lila.network/adoralaura/hugo-book-theme v0.0.0-20240712103017-55b1193ecd34 h1:jgwSyEijB5R4TxGxsO6Lugm1+bcaw7Tz5rCxptmc92A= +code.lila.network/adoralaura/hugo-book-theme v0.0.0-20240712103017-55b1193ecd34/go.mod h1:MBe0adh4WF9iMJ51BCRAeKkPUda/JB9RlGUQwmk5qc0=