1
0
Fork 0

Merge pull request #5 from sergiodj/add-host-woodpecker

Add forgejo_container_add_host_domain_{name,ip_address}
This commit is contained in:
M 2024-02-25 04:35:01 -08:00 committed by GitHub
commit 70fe09fa32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -56,6 +56,21 @@ forgejo_config_root_url: "{{ forgejo_scheme }}://{{ forgejo_hostname }}{{ forgej
# Unsetting this to an empty string makes it match. Unless you forgejo_uid accidentally hits some other user that is part of the container's /etc/passwd file. # Unsetting this to an empty string makes it match. Unless you forgejo_uid accidentally hits some other user that is part of the container's /etc/passwd file.
forgejo_config_run_user: "{{ 'git' if forgejo_uid | string == '1000' else '' }}" forgejo_config_run_user: "{{ 'git' if forgejo_uid | string == '1000' else '' }}"
# When integrating Forgejo with Woodpecker CI, and if Woodpecker is
# served under a subpath (e.g. `https://forgejo.host/ci`), it is
# necessary to use Docker's `--add-host` option to point Forgejo to
# the external host IP, so that webhook calls to Woodpecker can work.
#
# For example:
#
# forgejo_container_add_host_domain_name: "{{ devture_woodpecker_ci_server_hostname }}"
# forgejo_container_add_host_domain_ip_address: "{{ ansible_host }}"
#
# Don't forget to also update `webhook.ALLOWED_HOST_LIST` on Forgejo's
# app.ini config file.
forgejo_container_add_host_domain_name: ''
forgejo_container_add_host_domain_ip_address: ''
# forgejo_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. # forgejo_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
# See `roles/custom/forgejo/templates/labels.j2` for details. # See `roles/custom/forgejo/templates/labels.j2` for details.
# #

View file

@ -27,6 +27,9 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
{% if forgejo_ssh_bind_port != '' %} {% if forgejo_ssh_bind_port != '' %}
-p {{ forgejo_ssh_bind_port }}:2222 \ -p {{ forgejo_ssh_bind_port }}:2222 \
{% endif %} {% endif %}
{% if forgejo_container_add_host_domain_name %}
--add-host {{ forgejo_container_add_host_domain_name }}:{{ forgejo_container_add_host_domain_ip_address }} \
{% endif %}
--env-file={{ forgejo_base_path }}/env \ --env-file={{ forgejo_base_path }}/env \
--label-file={{ forgejo_base_path }}/labels \ --label-file={{ forgejo_base_path }}/labels \
--mount type=bind,src={{ forgejo_data_dir_path }},dst=/var/lib/gitea \ --mount type=bind,src={{ forgejo_data_dir_path }},dst=/var/lib/gitea \