From c451fefe58070019a5df26272b2283fda7c5bef7 Mon Sep 17 00:00:00 2001 From: pat-s Date: Thu, 20 Jul 2023 09:48:37 +0200 Subject: [PATCH] update terraform instructions --- README.md | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cfeaf93..afa414c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ **Opinionated** GitHub-based light and dark themes for Gitea including an automatic theme switch option. -Created and tested with Gitea v1.15 - 1.17. -The theme might work with future versions though Gitea devs might change some CSS classes in the meantime and things might potentially look odd - just try yourself :) +Tested with Gitea v1.20. +Older Gitea versions can use previous releases from this repo. I might update the theme over time to fix oversights and other issues - no guarantee though. @@ -37,7 +37,8 @@ If this is somehow possible and I did not managed to get it configured, please l To use custom themes with the [Gitea helm chart](https://gitea.com/gitea/helm-chart): -1. Create a secret containing the CSS files (here's an example via `terraform`, plain k8s secrets will also work) +1. Configure the [http](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) provider +2. Create a secret containing the CSS files (here's an example via `terraform`, plain k8s secrets will also work) ```hcl resource "kubernetes_secret" "gitea-themes" { @@ -47,16 +48,42 @@ resource "kubernetes_secret" "gitea-themes" { } data = { - "theme-github.css" = "${file("files/gitea/gitea-github-theme-light.css")}" - "theme-github-dark.css" = "${file("files/gitea/gitea-github-theme-dark.css")}" - "theme-github-auto.css" = "${file("files/gitea/gitea-github-theme-auto.css")}" + "theme-github.css" = data.http.gitea-theme-light.body + "theme-github-dark.css" = data.http.gitea-theme-dark.body + "theme-github-auto.css" = data.http.gitea-theme-auto.body } type = "Opaque" } + + +data "http" "gitea-theme-light" { + url = "https://codeberg.org/pat-s/gitea-github-theme/raw/branch/main/theme-github.css" + + request_headers = { + Accept = "application/json" + } +} + +data "http" "gitea-theme-dark" { + url = "https://codeberg.org/pat-s/gitea-github-theme/raw/branch/main/theme-github-dark.css" + + request_headers = { + Accept = "application/json" + } +} + +data "http" "gitea-theme-auto" { + url = "https://codeberg.org/pat-s/gitea-github-theme/raw/branch/main/theme-github-auto.css" + + request_headers = { + Accept = "application/json" + } +} + ``` -2. Mount the secret via `extraVolumes` in `values.yaml`: +3. Mount the secret via `extraVolumes` in `values.yaml`: ```yml extraVolumes: @@ -65,7 +92,7 @@ extraVolumes: secretName: gitea-themes ``` -3. Add the theme options into the config in `values.yaml`: +4. Add the theme options into the config in `values.yaml`: ```yml gitea: