ability to add additional themes? #301

Closed
opened 2022-03-04 12:58:19 +00:00 by portno12 · 9 comments
portno12 commented 2022-03-04 12:58:19 +00:00 (Migrated from gitea.com)

is there a way with this chart to add additional themes to gitea? it looks like no initially but not 100% on this.

is there a way with this chart to add additional themes to gitea? it looks like no initially but not 100% on this.
justusbunsi commented 2022-03-04 13:46:37 +00:00 (Migrated from gitea.com)

This is currently not integrated. You would need to store the css file manually in the correct directory (see https://docs.gitea.io/en-us/customizing-gitea/#customizing-the-look-of-gitea).

Adding the theme to the app.ini via configuration is possible though.

This is currently not integrated. You would need to store the css file manually in the correct directory (see https://docs.gitea.io/en-us/customizing-gitea/#customizing-the-look-of-gitea). Adding the theme to the app.ini via configuration is possible though.
portno12 commented 2022-03-04 14:17:25 +00:00 (Migrated from gitea.com)

sounds like i just need to inject the file manually into the container then after each upgrade in order for it to be available. does that sound right based on those docs?

sounds like i just need to inject the file manually into the container then after each upgrade in order for it to be available. does that sound right based on those docs?
justusbunsi commented 2022-03-04 16:12:56 +00:00 (Migrated from gitea.com)

I don't think that you need to do this more than once. The Gitea data folder is persistent. So you would just place the file there.

I don't think that you need to do this more than once. The Gitea data folder is persistent. So you would just place the file there.
justusbunsi commented 2022-03-04 16:19:59 +00:00 (Migrated from gitea.com)

But I agree. That should be enough. ?

But I agree. That should be enough. ?
portno12 commented 2022-03-04 16:43:04 +00:00 (Migrated from gitea.com)

thanks for the info and confirming. i am fine with this being closed. perhaps a note could be added somewhere in the readme about this though for the next person?

thanks for the info and confirming. i am fine with this being closed. perhaps a note could be added somewhere in the readme about this though for the next person?
pat-s commented 2022-03-04 18:51:24 +00:00 (Migrated from gitea.com)

FWIW, here's a Terraform snippet we use to make additional themes available

resource "kubernetes_secret" "gitea-themes" {
  metadata {
    name      = "gitea-themes"
    namespace = "gitea"
  }

  data = {
    "theme-github.css"      = "${file("files/gitea/gitea-github-theme-light.css")}"
    "theme-github-dark.css" = "${file("files/gitea/gitea-github-theme-dark.css")}"
  }

  type = "Opaque"

  depends_on = [kubernetes_namespace.gitea]
}

values.yml

extraVolumes:
  - name: gitea-themes
    secret:
      secretName: gitea-themes

extraVolumeMounts:
  - name: gitea-themes
    readOnly: true
    mountPath: "/data/gitea/public/css"
FWIW, here's a Terraform snippet we use to make additional themes available ```yml resource "kubernetes_secret" "gitea-themes" { metadata { name = "gitea-themes" namespace = "gitea" } data = { "theme-github.css" = "${file("files/gitea/gitea-github-theme-light.css")}" "theme-github-dark.css" = "${file("files/gitea/gitea-github-theme-dark.css")}" } type = "Opaque" depends_on = [kubernetes_namespace.gitea] } ``` `values.yml` ```yml extraVolumes: - name: gitea-themes secret: secretName: gitea-themes extraVolumeMounts: - name: gitea-themes readOnly: true mountPath: "/data/gitea/public/css" ```
justusbunsi commented 2022-03-04 19:28:51 +00:00 (Migrated from gitea.com)

Ah. Awesome @pat-s. Thanks for sharing. Wasn't sure if there would be a conflict with mounting to that path. ?

Ah. Awesome @pat-s. Thanks for sharing. Wasn't sure if there would be a conflict with mounting to that path. ?
pat-s commented 2022-03-04 20:11:04 +00:00 (Migrated from gitea.com)

Not after the first deployment, for more info see https://gitea.com/gitea/helm-chart/issues/296.

Probably worth documenting :)

Not after the first deployment, for more info see https://gitea.com/gitea/helm-chart/issues/296. Probably worth documenting :)
pkeech commented 2023-06-08 21:16:56 +00:00 (Migrated from gitea.com)

For anyone directed to this issue from Google, I've tested this on Gitea 1.19.3 and the answer provided by @pat-s works.

You can remove the need of Terraform by manually creating the secrets within your kubernetes cluster. An example secret:

kubectl create secret generic gitea-themes --from-file={{FULL-PATH-TO-CSS}} --namespace gitea
For anyone directed to this issue from Google, I've tested this on Gitea 1.19.3 and the answer provided by @pat-s works. You can remove the need of Terraform by manually creating the secrets within your kubernetes cluster. An example secret: ``` bash kubectl create secret generic gitea-themes --from-file={{FULL-PATH-TO-CSS}} --namespace gitea ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lunny/helm-chart#301
No description provided.