From 6d59d6774bdb2dfa2b9b1771db724840326a19e4 Mon Sep 17 00:00:00 2001 From: Mayne0213 Date: Wed, 7 Jan 2026 13:28:09 +0900 Subject: [PATCH] CHORE(gitea): temporarily redirect to GitHub - Replace Gitea deployment with GitHub redirect - Use Traefik Middleware for 301 redirect to github.com/mayne0213 - Keep TLS certificate for gitea0213.kro.kr --- gitea/argocd.yaml | 16 ++------- gitea/kustomization.yaml | 5 +-- gitea/redirect.yaml | 70 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 16 deletions(-) create mode 100644 gitea/redirect.yaml diff --git a/gitea/argocd.yaml b/gitea/argocd.yaml index 580378b..76422b5 100644 --- a/gitea/argocd.yaml +++ b/gitea/argocd.yaml @@ -7,17 +7,8 @@ metadata: - resources-finalizer.argocd.argoproj.io spec: project: default - sources: - - repoURL: https://dl.gitea.com/charts/ - chart: gitea - targetRevision: 12.4.0 - helm: - valueFiles: - - $values/gitea/helm-values.yaml - - repoURL: https://github.com/K3S-HOME/applications.git - targetRevision: main - ref: values - - repoURL: https://github.com/K3S-HOME/applications.git + source: + repoURL: https://github.com/K3S-HOME/applications.git targetRevision: main path: gitea destination: @@ -38,7 +29,4 @@ spec: duration: 5s factor: 2 maxDuration: 3m - managedNamespaceMetadata: - labels: - goldilocks.fairwinds.com/enabled: 'true' revisionHistoryLimit: 10 diff --git a/gitea/kustomization.yaml b/gitea/kustomization.yaml index 7393c43..40722a9 100644 --- a/gitea/kustomization.yaml +++ b/gitea/kustomization.yaml @@ -1,4 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -# Secret is created manually via kubectl -resources: [] +resources: +- redirect.yaml +namespace: gitea diff --git a/gitea/redirect.yaml b/gitea/redirect.yaml new file mode 100644 index 0000000..b9b5a8b --- /dev/null +++ b/gitea/redirect.yaml @@ -0,0 +1,70 @@ +# Traefik Middleware for GitHub redirect +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: redirect-to-github + namespace: gitea +spec: + redirectRegex: + regex: ".*" + replacement: "https://github.com/mayne0213" + permanent: true +--- +# IngressRoute for HTTPS +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: gitea-redirect-https + namespace: gitea + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod +spec: + entryPoints: + - websecure + routes: + - match: Host(`gitea0213.kro.kr`) || Host(`www.gitea0213.kro.kr`) + kind: Rule + middlewares: + - name: redirect-to-github + services: + - name: noop@internal + kind: TraefikService + tls: + secretName: gitea-tls + domains: + - main: gitea0213.kro.kr + sans: + - www.gitea0213.kro.kr +--- +# IngressRoute for HTTP (redirect to HTTPS first, then to GitHub) +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: gitea-redirect-http + namespace: gitea +spec: + entryPoints: + - web + routes: + - match: Host(`gitea0213.kro.kr`) || Host(`www.gitea0213.kro.kr`) + kind: Rule + middlewares: + - name: redirect-to-github + services: + - name: noop@internal + kind: TraefikService +--- +# Certificate for TLS +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: gitea-certificate + namespace: gitea +spec: + secretName: gitea-tls + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer + dnsNames: + - gitea0213.kro.kr + - www.gitea0213.kro.kr