---
r3status_spaceapi_path: /dev/shm/spaceapi
-r3status_ics_path: /dev/shm/ics
+r3status_ics_path: /dev/shm/ics
\ No newline at end of file
dest: /usr/local/bin/cache_realraum_imported_calendar.sh
mode: 0755
+- name: install tmpfiles config
+ template:
+ src: tmpfiles.j2
+ dest: /etc/tmpfiles.d/r3cache.conf
+ mode: 0644
+
+- name: run systemd-tmpfiles to create cache directories
+ ansible.builtin.command: systemd-tmpfiles --create r3cache.conf
+
- name: copy grical caching services
loop:
- cache_realraum_imported_calendar.timer
content: |
no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding,no-user-rc,command="/usr/local/bin/ssh-spaceapi-update.py" {{ r3status_spaceapi_update_user_ssh_key }}
-### TODO: grical downloader script
-
- name: create status web-root directory
file:
path: /srv/r3status/www
add_header Cache-Control "no-cache";
}
- location ^/ics/(.*)$ {
+ location ~ ^/ics/(.*)$ {
alias {{ r3status_ics_path }}/$1;
add_header Access-Control-Allow-Origin "*";
add_header Pragma "no-cache";
--- /dev/null
+d /dev/shm/wget 0755 spaceapi spaceapi
+d /dev/shm/ics 0755 spaceapi spaceapi
+d /dev/shm/spaceapi 0755 spaceapi spaceapi
root /srv/realraumat/www/;
access_log off;
- error_log /var/log/nginx/realraum.at/error.log notice;
# rewrite_log on;
}
location = /status.json {
+ add_header Access-Control-Allow-Origin "*";
+ add_header Pragma "no-cache";
+ add_header Cache-Control "no-cache";
return 302 https://status.realraum.at/spaceapi.json; # planned: 301
}
location = /shmcache/status.json {
+ add_header Access-Control-Allow-Origin "*";
+ add_header Pragma "no-cache";
+ add_header Cache-Control "no-cache";
return 302 https://status.realraum.at/spaceapi.json; # planned: 301
}
location ~ ^/shmcache/(.*)$ {
+ add_header Access-Control-Allow-Origin "*";
+ add_header Pragma "no-cache";
+ add_header Cache-Control "no-cache";
return 302 https://status.realraum.at/ics/$1; # planned: 301
}