Skip to content

Commit

Permalink
Make GITEA__server__SSH_PORT configurable and default it to a sane value
Browse files Browse the repository at this point in the history
  • Loading branch information
spantaleev committed Jan 18, 2025
1 parent 1898170 commit c33ea8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ gitea_config_mailer_passwd: ''

gitea_config_root_url: "{{ gitea_scheme }}://{{ gitea_hostname }}{{ gitea_path_prefix }}"

# Controls the `GITEA__server__SSH_PORT` environment variable.
gitea_config_server_ssh_port: "{{ gitea_ssh_port }}"

# Controls the `GITEA__server__SSH_LISTEN_PORT` environment variable.
gitea_config_server_ssh_listen_port: 2222

# Controls the RUN_USER configuration setting (`GITEA____RUN_USER` environment variable).
#
# This defaults to `git` in the upstream configuration.
Expand Down
3 changes: 2 additions & 1 deletion templates/env.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GITEA__server__ROOT_URL={{ gitea_config_root_url }}

GITEA__server__SSH_LISTEN_PORT=2222
GITEA__server__SSH_PORT={{ gitea_config_server_ssh_port }}
GITEA__server__SSH_LISTEN_PORT={{ gitea_config_server_ssh_listen_port }}

GITEA__database__DB_TYPE={{ gitea_config_database_type }}
GITEA__database__HOST={{ gitea_config_database_hostname }}:{{ gitea_config_database_port }}
Expand Down
2 changes: 1 addition & 1 deletion templates/gitea.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
-p {{ gitea_http_bind_port }}:3000 \
{% endif %}
{% if gitea_ssh_bind_port != '' %}
-p {{ gitea_ssh_bind_port }}:2222 \
-p {{ gitea_ssh_bind_port }}:{{ gitea_config_server_ssh_listen_port }} \
{% endif %}
--env-file={{ gitea_base_path }}/env \
--label-file={{ gitea_base_path }}/labels \
Expand Down

0 comments on commit c33ea8e

Please sign in to comment.