summaryrefslogtreecommitdiff
path: root/spreadspace
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-09 15:56:55 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-09 15:56:55 +0200
commit02e12c31fe488ae4a1f2ae3a395a59577b0b8e6d (patch)
treeb6cb5b08798f72e70a719a1696cf226509e558c6 /spreadspace
parentglt-stream: deploy minimalistics stats collector (WIP) (diff)
glt-stream: one collector per room
Diffstat (limited to 'spreadspace')
-rw-r--r--spreadspace/glt-stream.yml48
1 files changed, 43 insertions, 5 deletions
diff --git a/spreadspace/glt-stream.yml b/spreadspace/glt-stream.yml
index 48541d85..8f380565 100644
--- a/spreadspace/glt-stream.yml
+++ b/spreadspace/glt-stream.yml
@@ -37,6 +37,15 @@
add_header Access-Control-Allow-Methods "GET,HEAD,OPTIONS";
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Expose-Headers "Server,range,Content-Length,Content-Range,Date";
+
+ {% for room_id in [1,2,3] %}
+ location /stats/saal{{ room_id }}/ {
+ include snippets/proxy-nobuff.conf;
+ proxy_set_header Host $host;
+ include snippets/proxy-forward-headers.conf;
+ proxy_pass http://127.0.0.1:{{ 4200 + room_id }}/;
+ }
+ {% endfor %}
locations:
'/':
root: /srv/www/stream
@@ -78,16 +87,41 @@
src: "{{ global_files_dir }}/glt/stream-stats.go"
dest: /srv/www/stats/stream-stats.go
+ - name: install start script for collector
+ copy:
+ content: |
+ #!/bin/bash
+ ROOM=$1
+ case "$ROOM" in
+ saal1)
+ PORT=4201
+ ;;
+ saal2)
+ PORT=4202
+ ;;
+ saal3)
+ PORT=4203
+ ;;
+ *)
+ echo "unknown room"
+ exit 1
+ ;;
+ esac
+ exec /usr/bin/go run /srv/www/stats/stream-stats.go 127.0.0.1:$PORT /srv/www/stats/data/glt21-$ROOM.json
+ dest: /srv/www/stats/run.sh
+ mode: 0755
+
- name: install systemd unit for stats collector
copy:
content: |
[Unit]
- Description=GLT21 Stream Stats Collector
+ Description=GLT21 Stream Stats Collector (%I)
[Service]
Type=simple
+ User=stats
Environment="GOCACHE=/srv/www/stats/.gocache"
- ExecStart=/usr/bin/go run /srv/www/stats/stream-stats.go 127.0.0.1:4200 /srv/www/stats/data/glt21.json
+ ExecStart=/srv/www/stats/run.sh %i
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
@@ -101,11 +135,15 @@
[Install]
WantedBy=multi-user.target
- dest: /etc/systemd/system/stream-stats.service
+ dest: /etc/systemd/system/stream-stats@.service
- - name: make sure stats collector service unit is enabled and started
+ - name: make sure stats collector service units are enabled and started
+ loop:
+ - saal1
+ - saal2
+ - saal3
systemd:
- name: stream-stats.service
+ name: "stream-stats@{{ item }}.service"
daemon_reload: yes
enabled: yes
state: started