]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/web_only.yml.erb
tile: ensure headers always sent, including 404
[chef.git] / cookbooks / community / templates / default / web_only.yml.erb
1 templates:
2   - "templates/web.template.yml"
3   - "templates/web.ipv6.template.yml"
4   - "templates/web.ssl.template.yml"
5   - "templates/enable-ruby-yjit.yml"
6
7 ## which TCP/IP ports should this container expose?
8 ## If you want Discourse to share a port with another webserver like Apache or nginx,
9 ## see https://meta.discourse.org/t/17247 for details
10 expose:
11   - "80:80"   # http
12   - "443:443" # https
13
14 # Use 'links' key to link containers together, aka use Docker --link flag.
15 links:
16   - link:
17       name: data
18       alias: data
19
20 # any extra arguments for Docker?
21 # docker_args:
22
23 # Latest Version v3.4.6
24 # Discourse only support tests-passed and stable branches
25 params:
26   version: stable
27
28 env:
29   LC_ALL: en_US.UTF-8
30   LANG: en_US.UTF-8
31   LANGUAGE: en_US.UTF-8
32   DISCOURSE_FORCE_HTTPS: true
33
34   ## How many concurrent web requests are supported? Depends on memory and CPU cores.
35   ## will be set automatically by bootstrap based on detected CPUs, or you can override
36   UNICORN_WORKERS: <%= node.cpu_cores %>
37
38   ## TODO: The domain name this Discourse instance will respond to
39   DISCOURSE_HOSTNAME: community.openstreetmap.org
40   DISCOURSE_CDN_URL: https://community-cdn.openstreetmap.org
41
42   ## Uncomment if you want the container to be started with the same
43   ## hostname (-h option) as specified above (default "$hostname-$config")
44   #DOCKER_USE_HOSTNAME: true
45
46   ## TODO: List of comma delimited emails that will be made admin and developer
47   ## on initial signup example 'user1@example.com,user2@example.com'
48   DISCOURSE_DEVELOPER_EMAILS: 'operations@openstreetmap.org'
49
50   DISCOURSE_SMTP_ADDRESS: <%= node[:exim][:smarthost_via].split(":", 2)[0] %>
51   DISCOURSE_SMTP_PORT: <%= node[:exim][:smarthost_via].split(":", 2)[1] || "25" %>
52   DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
53   DISCOURSE_SMTP_USER_NAME:
54   DISCOURSE_SMTP_PASSWORD:
55   DISCOURSE_SMTP_DOMAIN: community.openstreetmap.org
56   DISCOURSE_SMTP_OPEN_TIMEOUT: 30
57   DISCOURSE_SMTP_READ_TIMEOUT: 30
58   DISCOURSE_NOTIFICATION_EMAIL: community@noreply.openstreetmap.org
59
60   ## TODO: configure connectivity to the databases
61   DISCOURSE_DB_SOCKET: ''
62   #DISCOURSE_DB_USERNAME: discourse
63   DISCOURSE_DB_PASSWORD: '<%= @passwords["database"] %>'
64   DISCOURSE_DB_HOST: data
65   DISCOURSE_REDIS_HOST: data
66
67   ## The maxmind geolocation IP address key for IP address lookup
68   ## see https://meta.discourse.org/t/-/137387/23 for details
69 <% if @license_keys -%>
70   # DISCOURSE_MAXMIND_ACCOUNT_ID: '<%= node[:geoipupdate][:account] %>'
71   # DISCOURSE_MAXMIND_LICENSE_KEY: '<%= @license_keys[node[:geoipupdate][:account]] %>'
72 <% end -%>
73
74   # Allow list for prometheus metric collection
75   DISCOURSE_PROMETHEUS_TRUSTED_IP_ALLOWLIST_REGEX: '^<%= @prometheus_servers.map { |a| Regexp.escape(a) }.join("|") %>$'
76
77   # Increase base SIDEKIQ memory limit to 1GB
78   UNICORN_SIDEKIQ_MAX_RSS: 1000
79
80 volumes:
81   - volume:
82       host: /srv/community.openstreetmap.org/shared/web-only
83       guest: /shared
84   - volume:
85       host: /srv/community.openstreetmap.org/shared/web-only/log/var-log
86       guest: /var/log
87   - volume:
88       host: /etc/ssl/certs/community.openstreetmap.org.pem
89       guest: /shared/ssl/ssl.crt
90   - volume:
91       host: /etc/ssl/private/community.openstreetmap.org.key
92       guest: /shared/ssl/ssl.key
93   - volume:
94       host: /etc/ssl/certs/dhparam.pem
95       guest: /shared/ssl/dhparam.pem
96   - volume:
97       host: /srv/community.openstreetmap.org/files/update-feeds.atom
98       guest: /shared/feeds/update-feeds.atom
99
100 ## Plugins go here
101 ## see https://meta.discourse.org/t/19157 for details
102 hooks:
103   after_code:
104     - exec:
105         cd: $home/plugins
106         cmd:
107           - sudo -H -E -u discourse git clone --depth 1 --branch main https://github.com/discourse/discourse-oauth2-basic.git
108           - sudo -H -E -u discourse git clone --depth 1 --branch main https://github.com/discourse/discourse-solved.git
109           - sudo -H -E -u discourse git clone --depth 1 --branch main https://github.com/discourse/discourse-reactions.git
110           - sudo -H -E -u discourse git clone --depth 1 --branch main https://github.com/discourse/discourse-prometheus.git
111           - sudo -H -E -u discourse git clone --depth 1 --branch main https://github.com/discourse/discourse-translator.git
112           - sudo -H -E -u discourse git clone --depth 1 --branch main https://github.com/discourse/discourse-saved-searches.git
113           - sudo -H -E -u discourse git clone --depth 1 --branch main https://github.com/discourse/discourse-post-voting.git
114     - exec:
115         # Needs to be copied in else builtin git cleanup fails
116         cd: $home
117         cmd:
118           - sudo -H -E -u discourse cp /shared/feeds/update-feeds.atom public/update-feeds.atom
119   after_ssl:
120     - file:
121         path: "/etc/nginx/conf.d/outlets/server/25-https-osm-settings.conf"
122         contents: |
123           ssl_stapling on;
124           resolver <%= @resolvers.join(" ") %>;
125           resolver_timeout 5s;
126           ssl_dhparam /shared/ssl/dhparam.pem;
127
128 run:
129   - replace:
130       filename: "/etc/nginx/conf.d/outlets/before-server/20-redirect-http-to-https.conf"
131       from: /listen 80;/
132       to: |
133         listen 80;
134         rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;