From 868c029e4dc7ba3533d065516a1afbabc6791010 Mon Sep 17 00:00:00 2001 From: pat-s Date: Wed, 28 Jun 2023 06:57:19 +0000 Subject: [PATCH] Document how to add custom themes (#460) ### Description of the change Add documentation how to add custom themes ### Benefits ### Possible drawbacks ### Applicable issues - fixes #301 ### Additional information ### Checklist - [x] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm) - [x] Breaking changes are documented in the `README.md` - [x] Templating unittests are added Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/460 Co-authored-by: pat-s Co-committed-by: pat-s --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index 766f04f..cbe9708 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ - [Configure commit signing](#configure-commit-signing) - [Metrics and profiling](#metrics-and-profiling) - [Pod annotations](#pod-annotations) +- [Themes](#themes) - [Parameters](#parameters) - [Global](#global) - [Image](#image) @@ -606,6 +607,48 @@ gitea: podAnnotations: {} ``` +## Themes + +Custom themes can be added via k8s secrets and referencing them in `values.yaml`. + +```yaml +extraVolumes: + - name: gitea-themes + secret: + secretName: gitea-themes + +extraVolumeMounts: + - name: gitea-themes + readOnly: true + mountPath: "/data/gitea/public/css" +``` + +The secret can be created via `terraform`: + +```hcl +resource "kubernetes_secret" "gitea-themes" { + metadata { + name = "gitea-themes" + namespace = "gitea" + } + + data = { + "theme-custom.css" = "${file("FULL-PATH-TO-CSS")}" + "theme-custom-dark.css" = "${file("FULL-PATH-TO-CSS")}" + } + + type = "Opaque" + + depends_on = [kubernetes_namespace.gitea] +} +``` + +or natively via `kubectl`: + +```bash +kubectl create secret generic gitea-themes --from-file={{FULL-PATH-TO-CSS}} --namespace gitea +``` + ## Parameters ### Global