Skip to content

Commit

Permalink
Expose the gitea ssh port on 32222
Browse files Browse the repository at this point in the history
Sets up gitea ssh to be exposed at 32222 on the host network, docker
container, and cluster service layers.

Signed-off-by: Caleb Boylan <[email protected]>
  • Loading branch information
squidboylan committed Jan 25, 2025
1 parent 765404b commit 3fdb3a1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions hack/gitea/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ gitea:
server:
DOMAIN: '{{- if .UsePathRouting -}} {{ .Host }} {{- else -}} gitea.{{- .Host }} {{- end }}'
ROOT_URL: '{{- if .UsePathRouting }} {{- .Protocol }}://{{ .Host }}:{{ .Port }}/gitea {{- else }} {{- .Protocol }}://gitea.{{ .Host }}:{{ .Port }} {{- end }}'
SSH_PORT: 32222
SSH_LISTEN_PORT: 2222
webhook:
ALLOWED_HOST_LIST: private
SKIP_TLS_VERIFY: true

service:
ssh:
type: NodePort
port: 32222
nodePort: 32222
externalTrafficPolicy: Local

Expand Down
8 changes: 4 additions & 4 deletions pkg/controllers/localbuild/resources/gitea/k8s/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ stringData:
ROOT_URL={{- if .UsePathRouting }} {{- .Protocol }}://{{ .Host }}:{{ .Port }}/gitea {{- else }} {{- .Protocol }}://gitea.{{ .Host }}:{{ .Port }} {{- end }}
SSH_DOMAIN={{- if .UsePathRouting -}} {{ .Host }} {{- else -}} gitea.{{- .Host }} {{- end }}
SSH_LISTEN_PORT=2222
SSH_PORT=22
SSH_PORT=32222
START_SSH_SERVER=true
session: |-
PROVIDER=memory
Expand Down Expand Up @@ -381,7 +381,7 @@ spec:
externalTrafficPolicy: Local
ports:
- name: ssh
port: 22
port: 32222
targetPort: 2222
protocol: TCP
nodePort: 32222
Expand Down Expand Up @@ -417,7 +417,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 94b0102e29e8bd17652180743c848722b184530813c36ad9fe0705edc22cc716
checksum/config: 9472556301411a93ff19830db2ba46ea781c96364243b2f06ab8e33fb785c25d
labels:
helm.sh/chart: gitea-10.1.4
app: gitea
Expand Down Expand Up @@ -539,7 +539,7 @@ spec:
- name: SSH_LISTEN_PORT
value: "2222"
- name: SSH_PORT
value: "22"
value: "32222"
- name: GITEA_APP_INI
value: /data/gitea/conf/app.ini
- name: GITEA_CUSTOM
Expand Down
9 changes: 9 additions & 0 deletions pkg/kind/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ nodes:
- containerPort: 443
hostPort: 8443
protocol: TCP
- containerPort: 32222
hostPort: 32222
protocol: TCP
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."gitea.cnoe.localtest.me:8443"]
Expand All @@ -65,6 +68,9 @@ nodes:
- containerPort: 443
hostPort: 8443
protocol: TCP
- containerPort: 32222
hostPort: 32222
protocol: TCP
containerdConfigPatches:
- |-
Expand Down Expand Up @@ -117,6 +123,9 @@ nodes:
- containerPort: 443
hostPort: 8443
protocol: TCP
- containerPort: 32222
hostPort: 32222
protocol: TCP
- containerPort: 32222
hostPort: 22
protocol: TCP
Expand Down
3 changes: 3 additions & 0 deletions pkg/kind/resources/kind.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ nodes:
- containerPort: {{ if (eq .Protocol "http") -}} 80 {{- else -}} 443 {{- end }}
hostPort: {{ .Port }}
protocol: TCP
- containerPort: 32222
hostPort: 32222
protocol: TCP
{{ range .ExtraPortsMapping -}}
- containerPort: {{ .ContainerPort }}
hostPort: {{ .HostPort }}
Expand Down

0 comments on commit 3fdb3a1

Please sign in to comment.