Skip to content

Commit

Permalink
Use connection_upgrade of nginx settings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Oct 29, 2023
1 parent 8d3bfea commit e4b8b44
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
10 changes: 0 additions & 10 deletions roles/gitlab/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
---
dependencies:
- role: alphanodes.setup.common
- role: alphanodes.setup.rsync
when: not gitlab_remove
- role: alphanodes.setup.ssl
when: not gitlab_remove
- role: alphanodes.setup.redis_server
when: not gitlab_remove
- role: alphanodes.setup.nginx
when: not gitlab_remove
- role: alphanodes.setup.postgresql
when: not gitlab_remove

galaxy_info:
description: Setup gitlab
Expand Down
4 changes: 4 additions & 0 deletions roles/gitlab/tasks/postgresql.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---

- name: Include postgresql role
ansible.builtin.include_role:
name: alphanodes.setup.postgresql

- name: Create gitlab postgresql database user
become_user: postgres
become: true
Expand Down
18 changes: 18 additions & 0 deletions roles/gitlab/tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
ansible.builtin.set_fact:
gitaly_socket_path: "{{ gitaly_socket_dir }}/gitaly.socket"

- name: Include rsync role
ansible.builtin.include_role:
name: alphanodes.setup.rsync

- name: Include ssl role
ansible.builtin.include_role:
name: alphanodes.setup.ssl

- name: Include redis_server role
ansible.builtin.include_role:
name: alphanodes.setup.redis_server

- name: Include nginx role
ansible.builtin.include_role:
name: alphanodes.setup.nginx
vars:
nginx_with_websocket: true

- name: Install required packages for gitlab
ansible.builtin.apt:
name: '{{ gitlab_packages }}'
Expand Down
7 changes: 1 addition & 6 deletions roles/gitlab/templates/etc/nginx/gitlab.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ upstream gitlab-workhorse {
server unix:{{ gitlab_workhorse_socket }} fail_timeout=0;
}

map $http_upgrade $connection_upgrade_gitlab_ssl {
default upgrade;
'' close;
}

## NGINX 'combined' log format with filtered query strings
log_format gitlab_ssl_access '$remote_addr - $remote_user [$time_local] "$request_method $gitlab_ssl_filtered_request_uri $server_protocol" $status $body_bytes_sent "$gitlab_ssl_filtered_http_referer" "$http_user_agent"';

Expand Down Expand Up @@ -101,7 +96,7 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade_gitlab_ssl;
proxy_set_header Connection $connection_upgrade;

proxy_pass http://gitlab-workhorse;
}
Expand Down

0 comments on commit e4b8b44

Please sign in to comment.