diff --git a/.gitea/PULL_REQUEST_TEMPLATE.md b/.gitea/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..431237e --- /dev/null +++ b/.gitea/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +--- +name: "Parasol static site pull request template" +about: "Parasol static site request template" +--- + + + +* [ ] I have deployed and tested my changes +* [ ] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash) +* [ ] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes) +* [ ] I ran `abra recipe lint parasol-static-site --chaos` on the PR's branch and fixed the warnings. +* [ ] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes) diff --git a/README.md b/README.md index 7e0992b..ee608dd 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,22 @@ # Parasol Static Site :open_umbrella: :spider_web: +[![Build Status](https://build.coopcloud.tech/api/badges/coop-cloud/parasol-static-site/status.svg)](https://build.coopcloud.tech/coop-cloud/parasol-static-site) + A recipe for generating static websites with [Hugo](https://gohugo.io) and a listener service which triggers git pulls and builds via [webhookd](https://github.com/ncarlier/webhookd) + + +* **Maintainer**: [@stevensting](https://git.coopcloud.tech/stevensting) * **Category**: Development -* **Status**: 0, dev -* **Image**: [site-badger](https://codeberg.org/eotl/site-badger) -* **Healthcheck**: {{ .Healthcheck }} -* **Backups**: No -* **Email**: No +* **Status**: 3, stable +* **Image**: [site-badger](https://git.coopcloud.tech/toolshed/site-badger) +* **Healthcheck**: yes +* **Backups**: not necessary +* **Email**: not necessary * **Tests**: No -* **SSO**: No +* **SSO**: not necessary + + ## Quick start @@ -17,13 +24,11 @@ A recipe for generating static websites with [Hugo](https://gohugo.io) and a lis * `abra app config ` * `abra app deploy ` -This will deploys a public website built from a Hugo site stored in a **public -git repository.** If you need various private modes, there are four different -deployment scenarios supported: +This will deploy a **public website** built from a Hugo site stored in a **git repository.** If you need various private modes, there are different deployment options supported: -- Public Site & Public Repo -- HTTP Basic Auth & Public Repo -- Public Site & Private Repo +- Public Git Repo +- Private Git Repo with deploy key +- /deploy endpoint protected with HTTP Basic Auth - HTTP Basic Auth & Private Repo ### Public Site & Public Repo @@ -31,12 +36,12 @@ deployment scenarios supported: The default deployment is a **fully public** site and **public git repository.** * `/`: the Hugo site is served -* `/deploy`: triggers `webhookd` to re-build the site, **includes publicly viewable build logs** +* `/deploy`: triggers `webhookd` to re-build the site, includes publicly viewable build logs. ⚠️ **Be aware that misuse could lead to constant CPU usage on your server, as /deploy is not rate limited. This mode is not recommended** -### HTTP Basic Auth +### Use HTTP Basic Auth for `/deploy` endpoint -To enable a password protected site built from a public git repo, uncomment the +To enable a password protected /deploy endpoint, uncomment the following lines in your `.env` file: ``` @@ -48,13 +53,19 @@ SECRET_AUTH_PASSWORD_VERSION=v1 Then run `abra app secret generate -a ` command. -When you deploy: +### Use automatic deployment with your GIT instance -* `/`: the Hugo site is served -* `/deploy`: the webhook is behind HTTP Basic Auth +Depending on which git platform you use, adding the auth information might be a little different. This is how it works with Forgejo/Codeberg. +Generate a bas64 coded token for the protected endpoint: +``` +echo -n ':' | base64 +``` +Create a webhook which triggers the endpoint /deploy on push events for your git branch and add the following to the field authentication header: +``` +Basic +``` - -### Private Repository +### Us a Private Repository If you enable the following lines in your `.env` file: @@ -67,18 +78,16 @@ SECRET_DEPLOY_KEY_VERSION=v1 Then you need to generate a SSH key: ``` -$ ssh-keygen -a 100 -t ed25519 +$ ssh-keygen -a 100 -t ed25519 -C ``` Then, insert the secret: ``` -$ abra secret insert deploy_key v1 -f -t +$ abra secret insert deploy_key v1 -f -t ``` -You now need to upload the Public SSH key to the Git repository settings -as a `Deploy Key` at which forge website you use. This is usually -located in some web UI flow like: +You now need to upload the Public SSH key to the Git repository settings as a `Deploy Key` at the forge website you use. This is usually located in some web UI flow like: ``` Repository -> Settings > Deploy keys @@ -95,22 +104,12 @@ https://codeberg.org/user/website-repo/settings/keys ``` You can then deploy the abra recipe and the deploy key will be loaded before cloning the -private repository and all should nicely. +private repository and all should work nicely. ``` $ abra app deploy example.org ``` - -### HTTP Basic Auth & Private Repository - -You need to edit the `COMPOSE_FILE=` line to include the following `.yml` files: - -``` -COMPOSE_FILE="compose.yml:compose.auth.yml:compose.private.yml" -``` - - ## Usage To trigger the deploy webhook with normal HTTP request diff --git a/compose.yml b/compose.yml index f07f4e0..eb60db7 100644 --- a/compose.yml +++ b/compose.yml @@ -27,6 +27,12 @@ services: - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" - "coop-cloud.${STACK_NAME}.version=v0.6.0+1.29.7-alpine" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost"] + interval: 30s + timeout: 10s + retries: 30 + start_period: 30s badger: image: git.coopcloud.tech/toolshed/site-badger:0.3.0 diff --git a/renovate.json b/renovate.json index 5db72dd..d706fd8 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,8 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:recommended" + ], + "reviewers": [ + "stevensting" ] -} +} \ No newline at end of file