From 277b61f9c00998471055c774952d138fcdff78ea Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Thu, 7 May 2020 13:45:21 +0200 Subject: [PATCH] provide webserver over unix socket --- tasks/master.yaml | 8 ++++++++ templates/buildbot/master.cfg.j2 | 2 +- vars/main.yaml | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tasks/master.yaml b/tasks/master.yaml index f8bd241..863e430 100644 --- a/tasks/master.yaml +++ b/tasks/master.yaml @@ -37,6 +37,14 @@ group: buildbot mode: 0700 +- name: buildbot run directory + file: + path: /run/buildbot + state: directory + owner: buildbot + group: www-data + mode: u=rwx,g=rx,o= + # source of unit file from https://github.com/buildbot/buildbot-contrib/blob/master/master/contrib/systemd/buildbot%40.service - name: buildbot systemd service unit copy: diff --git a/templates/buildbot/master.cfg.j2 b/templates/buildbot/master.cfg.j2 index a5b61e7..15b5432 100644 --- a/templates/buildbot/master.cfg.j2 +++ b/templates/buildbot/master.cfg.j2 @@ -18,7 +18,7 @@ c['titleURL'] = "https://github.com/covid-videoplattform" c['buildbotURL'] = "https://{{buildbot_server_name}}/" c['www'] = dict( - port=8010, + port="unix:address=/run/buildbot/{{buildbot_server_name}}.www.sock", plugins = dict( waterfall_view={}, console_view={}, diff --git a/vars/main.yaml b/vars/main.yaml index 6ddb69e..21a9fc4 100644 --- a/vars/main.yaml +++ b/vars/main.yaml @@ -12,12 +12,12 @@ buildbot_nginx_vhosts: custom: |- location / { include proxy_params; - proxy_pass http://localhost:8010; + proxy_pass http://unix:/run/buildbot/{{buildbot_server_name}}.www.sock; } # Server sent event (sse) settings location /sse { proxy_buffering off; - proxy_pass http://localhost:8010; + proxy_pass http://unix:/run/buildbot/{{buildbot_server_name}}.www.sock; } # Websocket settings @@ -25,6 +25,6 @@ buildbot_nginx_vhosts: proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_pass http://localhost:8010; + proxy_pass http://unix:/run/buildbot/{{buildbot_server_name}}.www.sock; proxy_read_timeout 6000s; }