diff --git a/homelab-services/gitea/flake.nix b/homelab-services/gitea/flake.nix index 7ec9154..3bbe6fe 100644 --- a/homelab-services/gitea/flake.nix +++ b/homelab-services/gitea/flake.nix @@ -64,11 +64,13 @@ echo "Generating templated files" gomplate=${pkgs.gomplate}/bin/gomplate - printf '%s' "${opts.database-hostname}" | $gomplate \ + printf '{"db_hostname"="%s","web_hostname"="%s"}' \ + "${opts.database-hostname}" \ + "${opts.default-nginx.hostname}" | $gomplate \ --input-dir=${k3sDir} \ --output-dir=$kubernetes_config \ --datasource credentials=file://${opts.credentialsFile}?type=application/x-env \ - --datasource dbhostname=stdin: + --datasource config=stdin:?type=application/json echo "Applying k3s config" kubectl=${pkgs.kubectl}/bin/kubectl diff --git a/homelab-services/gitea/k3s/deployment.yaml b/homelab-services/gitea/k3s/deployment.yaml index 3cf1463..148631d 100644 --- a/homelab-services/gitea/k3s/deployment.yaml +++ b/homelab-services/gitea/k3s/deployment.yaml @@ -35,7 +35,7 @@ spec: value: postgres - name: GITEA__database__HOST - value: '{{ (datasource "dbhostname") }}' + value: '{{ (datasource "config").db_hostname }}' - name: GITEA__database__NAME value: '{{ (datasource "credentials").GITEA_DB_NAME }}' @@ -52,6 +52,15 @@ spec: - name: GITEA__server__SSH_PORT value: "30222" + - name: GITEA__server__DOMAIN + value: '{{ (datasource "config").web_hostname }}' + + - name: GITEA__server__SSH_DOMAIN + value: '{{ (datasource "config").web_hostname }}' + + - name: GITEA__server__ROOT_URL + value: 'https://{{ (datasource "config").web_hostname }}/' + - name: GITEA__repository__MAX_CREATION_LIMIT value: "0"