From 5c80f886086327be0effd0ca08945e878c184fb5 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Sun, 28 Jul 2024 17:58:52 +0200 Subject: [PATCH 1/8] change to relearn theme --- docs/config.toml | 49 +++++++++++++++++++++++++++++------ docs/content/_index.md | 4 +-- docs/content/configuration.md | 5 ++++ docs/content/installation.md | 5 ++++ docs/content/license.md | 33 +++++++++++++++++++++++ docs/content/menu/index.md | 22 ---------------- docs/go.mod | 2 +- docs/go.sum | 4 +-- 8 files changed, 88 insertions(+), 36 deletions(-) create mode 100644 docs/content/configuration.md create mode 100644 docs/content/installation.md create mode 100644 docs/content/license.md delete mode 100644 docs/content/menu/index.md diff --git a/docs/config.toml b/docs/config.toml index 53adace..1b3ea38 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -1,18 +1,51 @@ baseURL = 'https://certwarden-deploy.adora.codes/' languageCode = 'en-us' title = 'certwarden-deploy' +author = "" -theme = "code.lila.network/adoralaura/hugo-book-theme" +theme = "github.com/McShelby/hugo-theme-relearn" +repo = "https://code.lila.network/adoralaura/certwarden-deploy" +enableGitInfo = true +enableRobotsTXT = true +uniqueHomePage = false # change to false to add sidebar to homepage [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' + disableLandingPageButton = false + disableLanguageSwitchingButton = false + editURL = "https://code.lila.network/adoralaura/certwarden-deploy/_edit/main/docs/content/${FilePath}" + externalLinkTarget = "_blank" -[module] - [[module.imports]] - path = "code.lila.network/adoralaura/hugo-book-theme" + [params.author] + name = 'Adora Laura Kalb' + + +[menu] + [[menu.shortcuts]] + identifier = 'ds' + name = " Git repo" + url = 'https://code.lila.network/adoralaura/certwarden-deploy' + weight = 10 + + [[menu.shortcuts]] + name = " Showcases" + url = 'showcase/' + weight = 11 + + [[menu.shortcuts]] + identifier = 'hugodoc' + name = " Hugo Documentation" + url = 'https://gohugo.io/' + weight = 20 + + [[menu.shortcuts]] + name = " Credits" + url = 'more/credits/' + weight = 30 + + [[menu.shortcuts]] + name = " Tags" + url = 'tags/' + weight = 40 diff --git a/docs/content/_index.md b/docs/content/_index.md index d7089b9..7222030 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -1,10 +1,8 @@ --- -title: Introduction +title: CertWarden-Deploy 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. diff --git a/docs/content/configuration.md b/docs/content/configuration.md new file mode 100644 index 0000000..0d4a11d --- /dev/null +++ b/docs/content/configuration.md @@ -0,0 +1,5 @@ +--- +title: Configuration +weight: 20 +--- + diff --git a/docs/content/installation.md b/docs/content/installation.md new file mode 100644 index 0000000..6369d75 --- /dev/null +++ b/docs/content/installation.md @@ -0,0 +1,5 @@ +--- +title: Installation +weight: 10 +--- + diff --git a/docs/content/license.md b/docs/content/license.md new file mode 100644 index 0000000..d655ba4 --- /dev/null +++ b/docs/content/license.md @@ -0,0 +1,33 @@ +--- +title: License +weight: 99 +--- + +## Documentation +This documentation is available under the [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) + +## Source Code +The source code of `certwarden-deploy` is available under the MIT license: + +```plaintext +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/content/menu/index.md b/docs/content/menu/index.md deleted file mode 100644 index ed418fe..0000000 --- a/docs/content/menu/index.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -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 index a038a0f..68b6770 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -2,4 +2,4 @@ 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 +require github.com/McShelby/hugo-theme-relearn v0.0.0-20240721222908-7aec99b38dc2 // indirect diff --git a/docs/go.sum b/docs/go.sum index 8829714..ea0937d 100644 --- a/docs/go.sum +++ b/docs/go.sum @@ -1,2 +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= +github.com/McShelby/hugo-theme-relearn v0.0.0-20240721222908-7aec99b38dc2 h1:022HGVq2CBuTftLgNRiU3rxqh+w3M3ZcschnXbjgomc= +github.com/McShelby/hugo-theme-relearn v0.0.0-20240721222908-7aec99b38dc2/go.mod h1:mKQQdxZNIlLvAj8X3tMq+RzntIJSr9z7XdzuMomt0IM= From dd104386a73e7e1bdb27841c8eec0d72829285a8 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Mon, 29 Jul 2024 12:46:57 +0200 Subject: [PATCH 2/8] add sidbar items --- docs/config.toml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/config.toml b/docs/config.toml index 1b3ea38..4676ced 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -25,27 +25,27 @@ uniqueHomePage = false # change to false to add sidebar to homepage [menu] [[menu.shortcuts]] identifier = 'ds' - name = " Git repo" + name = " certwarden-deploy Git Repository" url = 'https://code.lila.network/adoralaura/certwarden-deploy' weight = 10 [[menu.shortcuts]] - name = " Showcases" + name = " CertWarden GitHub" url = 'showcase/' weight = 11 [[menu.shortcuts]] identifier = 'hugodoc' - name = " Hugo Documentation" + name = " CertWarden Website" url = 'https://gohugo.io/' weight = 20 - [[menu.shortcuts]] - name = " Credits" - url = 'more/credits/' - weight = 30 - - [[menu.shortcuts]] - name = " Tags" - url = 'tags/' - weight = 40 +# [[menu.shortcuts]] +# name = " Credits" +# url = 'more/credits/' +# weight = 30 +# +# [[menu.shortcuts]] +# name = " Tags" +# url = 'tags/' +# weight = 40 From 74c32b87b98c7d47713f9de70960fcc19c74f57b Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Mon, 29 Jul 2024 12:47:08 +0200 Subject: [PATCH 3/8] begin installation page --- docs/content/installation.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/content/installation.md b/docs/content/installation.md index 6369d75..a4792cd 100644 --- a/docs/content/installation.md +++ b/docs/content/installation.md @@ -3,3 +3,19 @@ title: Installation weight: 10 --- +## Prerequisites + +Before building the project, ensure you have the following installed: +- make: A build automation tool +- Go: Version 1.22 or later + +## Building the Project from source + +To build the project, first clone the projects git repository, then navigate to the project's root directory and run the following command: +```shell +make build +``` +This command will generate the `certwarden-deploy` binary in the `bin/` folder. + +## Installation + From fcdc147dd2bb287fc28a92982b84aa8dbb0697bd Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Mon, 29 Jul 2024 20:30:09 +0200 Subject: [PATCH 4/8] small wording changes --- docs/content/_index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/content/_index.md b/docs/content/_index.md index 7222030..0489d0c 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -25,9 +25,9 @@ sudo chmod +x /usr/local/bin/certwarden-deploy ``` ... fill out the config file... -```shell -vi /etc/certwarden-deploy/config.yaml -``` + + +`vi /etc/certwarden-deploy/config.yaml` ```yaml # Base URL of the CertWarden instance # required @@ -77,7 +77,7 @@ I use my own [Forgejo](https://forgejo.org/) Instance [code.lila.network](https: * If you have a trivial fix or improvement, go ahead and send a diff to the maintainer(s) of this repository (see [MAINTAINERS.md](https://code.lila.network/adoralaura/certwarden-deploy/src/branch/main/MAINTAINERS.md)). -* If you plan to do something more involved, first please [send me a mail]( mailto:dev@lauka.net?subject=%5Bcertwarden-deploy%5D)mso I can create an account for you. +* If you plan to do something more involved, first please [send me a mail](mailto:dev@lauka.net?subject=%5Bcertwarden-deploy%5D) so I can create an account for you. ### Non-development Contibutions @@ -90,4 +90,4 @@ share what works. 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. +`certwarden-deploy` is available under the MIT license. See the [License page](/license/) for more info. From f40bdd5cbfbd7e0a83110ba5c442e3d862a04d0f Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Mon, 29 Jul 2024 20:30:42 +0200 Subject: [PATCH 5/8] describe installation process --- docs/content/installation.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/content/installation.md b/docs/content/installation.md index a4792cd..d0c504f 100644 --- a/docs/content/installation.md +++ b/docs/content/installation.md @@ -9,7 +9,7 @@ Before building the project, ensure you have the following installed: - make: A build automation tool - Go: Version 1.22 or later -## Building the Project from source +## Building the Project from Source To build the project, first clone the projects git repository, then navigate to the project's root directory and run the following command: ```shell @@ -17,5 +17,14 @@ make build ``` This command will generate the `certwarden-deploy` binary in the `bin/` folder. -## Installation +## Getting pre-built Binaries +You can also get pre-built binaries from the [releases page](https://code.lila.network/adoralaura/certwarden-deploy/releases). Make sure you get the binaries fitting your architecture! +## Setting up automatic Certificate Renewals +Although not required for `certwarden-deploy` to work, it's highly rrecommended to set up automatic renewals for `certwarden-deploy`, so that you don't need to worry about rolling out your certificates every time they get renewed by CertWarden. + +To do that, there are example `systemd` Service and Timer files included in the `examples/` directory of the `certwarden-deploy` repository. + +Please make sure to customize them to your requirements (path to `certwarden-deploy` binary, user and group, execution interval...) and then drop them into the `/etc/systemd/system/` directory, then enable the timer with `systemctl enable --now certwarden-deploy.timer` + +If you kept the example schedule, `certwarden-deploy` will run every saturday at ~4am. From 2fe2b980be68253baf341ea3e1aa71d9f685d63d Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Mon, 29 Jul 2024 20:30:56 +0200 Subject: [PATCH 6/8] enable search feature --- docs/config.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/config.toml b/docs/config.toml index 4676ced..47dc75e 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -18,9 +18,11 @@ uniqueHomePage = false # change to false to add sidebar to homepage externalLinkTarget = "_blank" - [params.author] - name = 'Adora Laura Kalb' +[params.author] + name = 'Adora Laura Kalb' +[outputs] + home = ['html', 'rss', 'search'] [menu] [[menu.shortcuts]] From abc1ef0a7995eeecd49a207a840003e635d74f13 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Tue, 30 Jul 2024 08:11:08 +0200 Subject: [PATCH 7/8] describe configuration options --- docs/content/configuration.md | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/docs/content/configuration.md b/docs/content/configuration.md index 0d4a11d..493cfd4 100644 --- a/docs/content/configuration.md +++ b/docs/content/configuration.md @@ -3,3 +3,83 @@ title: Configuration weight: 20 --- + +This document describes how to configure `certwarden-deploy` and which certificates should be managed by it. The configuration file uses the [YAML format](https://yaml.org/) for a human-readable and easy-to-maintain structure. + +## certwarden-deploy CLI Options +```plaintext +$ ./certwarden-deploy --help +certwarden-deploy is a CLI utility to deploy certificates managed by CertWarden. +Configuration is handled by a single YAML file, so you can get started quickly. + +For more information on how to configure this tool, visit the docs at https://certwarden-deploy.adora.codes + +Usage: + certwarden-deploy [flags] + +Flags: + -c, --config string Path to config file (default is /etc/certwarden-deploy/config.yaml) (default "/etc/certwarden-deploy/config.yaml") + -d, --dry-run Just show the would-be changes without changing the file system (turns on verbose logging) + -f, --force Force overwriting and execution action to occur, regardless if certificate already exists + -h, --help help for certwarden-deploy + -q, --quiet Disable any logging (if both -q and -v are set, quiet wins) + -v, --verbose Enable verbose logging + --version version for certwarden-deploy +``` + +## Configuration File Options + +`base_url` (required): +This string specifies the base URL of your CertWarden instance. + +`disable_certificate_validation` (optional, default: false): + This boolean flag indicates whether to disable certificate validation for the CertWarden instance. Set this to true only if your CertWarden instance uses a self-signed certificate and you trust it explicitly. **Disabling validation weakens security, so use it with caution.** + +`certificates:` (required): + This is a list that defines each certificate to be managed. + Each certificate definition is a nested YAML block with the following properties: + +Each certificate configuration consists of: + +`name` (required): +This string is a unique identifier for the certificate and must be the same as in you CertWarden instance. +It must start and end with an alphanumeric character and can contain letters (a-zA-Z), numbers (0-9), underscore (_), hyphen (-), and period (.). + +`cert_secret` (required): +This string holds the API key used to fetch the certificate data from the CertWarden server. + +`cert_path` (required): +This string defines the file path where the downloaded certificate will be saved. + +`key_secret` (required): +This string holds the API key used to fetch the private key data from the CertWarden server. + +`key_path` (required): +This string defines the file path where the downloaded private key will be saved. + +`action` (optional): +This string specifies a command to run after a certificate is updated or when the --force flag is used during execution. +The example uses a systemd reload command for the popular reverse named "caddy". + +Example Configuration: +```yaml +# Base URL of the CertWarden instance +base_url: "https://certwarden.example.com" + +# Disable certificate validation (not recommended for production) +disable_certificate_validation: false + +# Define all managed certificates here +certificates: + - name: test-certificate.example.com + cert_secret: examplekey_notvalid_hrzjGDDw8z # Replace with your actual key + cert_path: "/path/to/test-certificate.example.com-cert.pem" + key_secret: examplekey_notvalid_hrzbbDDw8z # Replace with your actual key + key_path: "/path/to/test-certificate.example.com-key.pem" + action: "/usr/bin/systemctl reload caddy" +``` +Use code with caution. + +## Notes +- This documentation assumes you have a basic understanding of YAML syntax. Resources for learning YAML are readily available online. +- Replace placeholder values like examplekey_notvalid_hrzjGDDw8z with your actual API keys. From eb367df0f90589a982d1f1607a995e31a3aa7154 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Tue, 30 Jul 2024 08:27:49 +0200 Subject: [PATCH 8/8] add favicon and page logo --- docs/layouts/partials/logo.html | 1 + docs/static/images/favicon.ico | Bin 0 -> 15406 bytes docs/static/images/logo.svg | 1 + 3 files changed, 2 insertions(+) create mode 100644 docs/layouts/partials/logo.html create mode 100644 docs/static/images/favicon.ico create mode 100644 docs/static/images/logo.svg diff --git a/docs/layouts/partials/logo.html b/docs/layouts/partials/logo.html new file mode 100644 index 0000000..448e87b --- /dev/null +++ b/docs/layouts/partials/logo.html @@ -0,0 +1 @@ + diff --git a/docs/static/images/favicon.ico b/docs/static/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2ff2c4a37fdfdb9f7102f61a7e2edcb955e4d96e GIT binary patch literal 15406 zcmeHOS#Vp`8NQt|(^vYydmcJ1(ay?EHAPYTL#N(Y{$0j$XjgLmbKWY|98Z>KDxSBy0YYmOnqjq z?sCq*od5i1`4=h5my|CnH{Yz#eTB0ACPi7PD9VZz@%LN5swfBO+ikafUjKDPao(aR zw^ADdA&B^Qy6F~2k!8KD*b=l`*RYH(f{DYfnal`IqGLq2X6N@}`Ti^dD=dJTU+md*L zECRm&vd}d@Zv$CDW_D|V+IGl$me(~Ods+P^`i48kBo>+BZNgJytbWfUGTuZRESHIJ@~%RkWJsZ{|1v;~-ewMInQaSZ7wybr)S&pHda-ccIN{@!E?m zF*U!4$53||eFq?}-SkvJbv*UsGx#6}dL%N{t z_ncB`RBye91qWNz_L1pp%(eHYYJH}15PO$EI6pr}vZ&y)hFti5N$YtWFY)TD6iwCp z^l&%r+4p74gLC@>EIK=-;+cy@S<5Nob3(7WF-(P=Rkkq|njrE=What`$vQOpGajwL$tybRr zo%XWP&Kem-!ZU0JT{!Fkr(a<>hlmml1>?3V)fvI)eaBvjanqJS%Xz{Rx4j%>FJZ68 z1-t0#r{|LPpRP}KWJFiy1!o4F9YmS*`&jjsyH$LHjb}JLqdgC6px{-;o5?fIPB=pe zUx9#yt)1#D20P!e`A(Hr0k@cY+u4om(%a9dxEc>VpD@NkKDY<3cCgP*{8??g7ajH9Mz6b?%yp@ zvb~$^)bCV2f&Z5}_({k`tE{6dou8!QrLTR(UR>}kTal%V=FK3DSswfrsrM4%Yo2@> zgAS{u+*Y(|6?mquDU}=UyotvBSzGZP1G(3!)I2Soo+aQQp3#T%8&-ak=0||{FT?$G z@$|FnSDaT%pz5{ND``wh^TkKDbV<+4iT}QA@#G7hbly*6@r9eK=H-!F-f=dnef^j$1}d6E?4I#^L;ci*EX*uf7%QD+%wkg;^#t~4{-*?CC-Y7PxVlo zsD@$;iS!Ft?XDjg+AfK0P4JV!I@D157#rzuuxMzKc%74vjY-d_A8?=KXM35aT8fuV z^f!|a%-H^s+vnt&>Vn1F+COxsR|$;ET)2d}co%!D9maF6Rg zKoc*Z3%>&FN%)o<-g=zb zVXKjz@wl!OTLjKe-}_U74_HPBTz(JD6Ui>s^0C(!=I{tzu6vRn$%tp|_ux=F&8J^v)rZD+p6Bs(88_lC$bpdgG0IsGma5Vy6^7&zf^M|1YWGC?Kz4s z%JiY*vfmZ-kmHg~eD!+r-(FEn`5qx5CVofWM>cwSefhU8^RGGAF3W%6JSERny=Ux$ z%le-vuVwv7l!u<)h;P?({X}d-(9P97&i_LE4;w(X>%ZsVI&Ry@n+oy)VISp+Z-Hki z_(%R}czR4`pT|f)JMovS_=k4O2P@d z6lXRex5eCD`yS(VV1i&wyv)x#O!D7UZ@ZWK3XyA#{P-ElmB$*Ohbu_FIoF$yYVerfpHlS)xgW?` zlXD=@7w~eqa!-;^8MY?!x51|#uUa`oX0D~o|4YT2**f_2f> zIY&bU)I5aAhU+-DB}oQm`O2i7d;gQF-*A+C&d3pw;az(ljjy`~x+b%Z{!ft~sOj); zO!sg|@`|4IDqUQ~Z=-@4FZJlbikGdf}t^b(!PU+rNR_ zhj>i>#^4{k(*J=5kaJQ=`5SiY>Su1W{0-!s$T=u{9IUI~puS!CLe6QdGn}_O_9Ev5 Pa!3Bma#@x@HWK(BMABhH literal 0 HcmV?d00001 diff --git a/docs/static/images/logo.svg b/docs/static/images/logo.svg new file mode 100644 index 0000000..d2ab951 --- /dev/null +++ b/docs/static/images/logo.svg @@ -0,0 +1 @@ +certwarden-deploy \ No newline at end of file