1 Commits

Author SHA1 Message Date
2b9f6567c1 feat: restore gitea proxy functionality with conditional support
Recupera la funcionalidad de proxy para repositorios git (gitea) que se perdió
al integrar el proxy SSH con stream.conf. Los servicios ahora pueden habilitar
opcionalmente el acceso a gitea agregando el atributo gitea_port.

Cambios:
- Agregado soporte condicional de upstream y servidor gitea en stream.conf
- El puerto gitea se agrega dinámicamente a matrix_ports cuando está definido
- Usa el mismo server_name que SSH, diferenciado solo por puerto
- Respeta la configuración root para dominios raíz

Uso: Agregar gitea_port: 2222 a cualquier servicio en abyayala.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 18:19:49 -03:00
2 changed files with 29 additions and 1 deletions

View File

@ -94,6 +94,14 @@
when: (ma.ports is defined)
loop_control:
loop_var: ma
- name: add gitea port if any service has gitea_port defined
set_fact:
matrix_ports: "{{ matrix_ports | default([]) | union([ma.gitea_port]) }}"
with_items: "{{ matrix }}"
when: (ma.gitea_port is defined)
loop_control:
loop_var: ma
- include_tasks: ../../althost/tasks/compose.yml
vars: # forcing since this role is included statically

View File

@ -2,6 +2,12 @@ upstream ssh_{{ vhost.nodo | replace(".", "") }} {
server {{ vhost.nodo }}:22;
}
{% if vhost.gitea_port is defined %}
upstream gitea_{{ vhost.nodo | replace(".", "") }} {
server {{ vhost.nodo }}:{{ vhost.gitea_port }};
}
{% endif %}
server {
listen {{ vhost.ports[0] }};
@ -12,4 +18,18 @@ server {
{% endif %}
proxy_pass ssh_{{ vhost.nodo | replace(".", "") }};
}
}
{% if vhost.gitea_port is defined %}
server {
listen {{ vhost.gitea_port }};
{% if vhost.root | default(false) %}
server_name {{ vhost.domains | join(' ') }};
{% else %}
server_name .{{ vhost.domains | join(' .') }};
{% endif %}
proxy_pass gitea_{{ vhost.nodo | replace(".", "") }};
}
{% endif %}