Certain custom configurations don't take effect #612

Closed
opened 2024-02-15 05:51:05 +00:00 by lo_p_ez · 3 comments
lo_p_ez commented 2024-02-15 05:51:05 +00:00 (Migrated from gitea.com)

I installed the helm chart for Gitea and set up connections to my redis and mariadb external sources via additionalConfigFromEnvs. These seem to work fine. However, others don't seem to take effect like, for instance, SHOW_REGISTRATION_BUTTON.

From my values.yaml

additionalConfigFromEnvs:
  - name: GITEA__SERVER__SHOW_REGISTRATION_BUTTON
    value: "false"
  - name: GITEA__DATABASE__DB_TYPE
    value: "mysql"
  - name: GITEA__DATABASE__HOST
    value: "mariadb.default.svc.cluster.local:3306"
  - name: GITEA__DATABASE__NAME
    value: "mariadb"
  - name: GITEA__DATABASE__USER
    value: "giteauser"
  - name: GITEA__DATABASE__PASSWD
    valueFrom:
      secretKeyRef:
        name: gitea-db-secrets
        key: mariadb-password

What I see in /data/gitea/conf/app.ini

[server]
...
SHOW_REGISTRATION_BUTTON = false

[database]
NAME = mariadb
DB_TYPE = mysql
HOST = mariadb.default.svc.cluster.local:3306
USER = giteauser
PASSWD = *****

However, when I visit gitea's webservice I do see the registration button showing up
image

I installed the helm chart for Gitea and set up connections to my redis and mariadb external sources via `additionalConfigFromEnvs`. These seem to work fine. However, others don't seem to take effect like, for instance, `SHOW_REGISTRATION_BUTTON`. From my `values.yaml` ```yaml additionalConfigFromEnvs: - name: GITEA__SERVER__SHOW_REGISTRATION_BUTTON value: "false" - name: GITEA__DATABASE__DB_TYPE value: "mysql" - name: GITEA__DATABASE__HOST value: "mariadb.default.svc.cluster.local:3306" - name: GITEA__DATABASE__NAME value: "mariadb" - name: GITEA__DATABASE__USER value: "giteauser" - name: GITEA__DATABASE__PASSWD valueFrom: secretKeyRef: name: gitea-db-secrets key: mariadb-password ``` What I see in `/data/gitea/conf/app.ini` ```txt [server] ... SHOW_REGISTRATION_BUTTON = false [database] NAME = mariadb DB_TYPE = mysql HOST = mariadb.default.svc.cluster.local:3306 USER = giteauser PASSWD = ***** ``` However, when I visit gitea's webservice I do see the registration button showing up ![image](/attachments/f4529d1d-741a-4083-85c7-65ec1d6e2441)
justusbunsi commented 2024-02-15 06:01:25 +00:00 (Migrated from gitea.com)

Hi. Thanks for reaching out. From what I see, the SHOW_REGISTRATION_BUTTON lives inside the services section, not server. That's most likely the issue. f3eb835886/custom/conf/app.example.ini (L877)

Hi. Thanks for reaching out. From what I see, the `SHOW_REGISTRATION_BUTTON` lives inside the `services` section, not `server`. That's most likely the issue. https://github.com/go-gitea/gitea/blob/f3eb835886031df7a562abc123c3f6011c81eca8/custom/conf/app.example.ini#L877
justusbunsi commented 2024-02-15 06:02:52 +00:00 (Migrated from gitea.com)

Ah. Dang it autocompletion 😆. I mean service

Ah. Dang it autocompletion 😆. I mean `service`
lo_p_ez commented 2024-02-15 14:20:33 +00:00 (Migrated from gitea.com)

Ah thanks so much @justusbunsi . Appreciate it the quick response. It's fixed now 🙏

I wonder if it'd be a good idea to throw an error if some GITEA_ env var or other config is provided but doesn't exist for the possibilities of a given section (e.g. server and SHOW_REGISTRATION_BUTTON). If I had seen an error it would have made me thought I did something wrong instead of just looking at the config and assuming it's perfect 😅

Ah thanks so much @justusbunsi . Appreciate it the quick response. It's fixed now 🙏 I wonder if it'd be a good idea to throw an error if some `GITEA_` env var or other config is provided but doesn't exist for the possibilities of a given section (e.g. `server` and `SHOW_REGISTRATION_BUTTON`). If I had seen an error it would have made me thought I did something wrong instead of just looking at the config and assuming it's perfect 😅
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#612
No description provided.