f318e1
{%- from 'macros.jinja' import redis %}
f318e1
Jacob Michalskie 9b41d1
include:
Jacob Michalskie 9b41d1
{%- if salt['grains.get']('include_secrets', True) %}
Jacob Michalskie 9b41d1
  - secrets.role.calendar
Jacob Michalskie 9b41d1
{%- endif %}
Jacob Michalskie 9b41d1
  - role.common.nginx
Jacob Michalskie 9b41d1
Jacob Michalskie 9b41d1
profile:
Jacob Michalskie 9b41d1
  calendar:
Jacob Michalskie 9b41d1
    database_name: calendar
Jacob Michalskie 9b41d1
    database_user: calendar
Jacob Michalskie 9b41d1
    database_host: postgresql.infra.opensuse.org
Jacob Michalskie 9b41d1
    # OIDC secret is in pillar/secrets/role/calendar.sls
Jacob Michalskie 9b41d1
    openidc:
Jacob Michalskie 9b41d1
      client_id: calendar.opensuse.org
Jacob Michalskie 9b41d1
Jacob Michalskie 9b41d1
nginx:
a20cbc
  servers:
a20cbc
    managed:
a20cbc
      calendar.opensuse.org.conf:
a20cbc
        config:
a20cbc
          - server:
68e999
              - listen: '[::]:80 default_server'
a20cbc
              - server_name: calendar.opensuse.org
a20cbc
              - root: /srv/www/calendar-o-o/public
a20cbc
              - client_max_body_size: 20m
a20cbc
              - keepalive_timeout: 5
a20cbc
              - try_files $uri/index.html $uri @calendar
797784
              {%- for location in ['@calendar', '/cable'] %}
797784
              - location {{ location }}:
a20cbc
                  - proxy_set_header: X-Forwarded-For $proxy_add_x_forwarded_for
a20cbc
                  - proxy_set_header: Host $http_host
a20cbc
                  - proxy_pass: 'http://unix:/run/calendar/puma'
797784
              {%- endfor %}
797784
                  - proxy_set_header: Upgrade $http_upgrade
a20cbc
              - error_page: 500 502 503 504 /50x.html
a20cbc
              - location = /50x.html:
a20cbc
                  - root: /srv/www/htdocs
a20cbc
              - access_log: /var/log/nginx/calendar.access.log combined
a20cbc
              - error_log: /var/log/nginx/calendar.error.log
a20cbc
        enabled: True
f318e1
0f77ea
users:
0f77ea
  calendar:
0f77ea
    system: true
0f77ea
0f77ea
groups:
0f77ea
  redis:
0f77ea
    system: true
0f77ea
    members:
0f77ea
      - calendar
0f77ea
0f77ea
{{ redis('calendar') }}