]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/web_only.yml.erb
community: use faffy for mail relay
[chef.git] / cookbooks / community / templates / default / web_only.yml.erb
1 templates:
2   - "templates/web.template.yml"
3   - "templates/web.ratelimited.template.yml"
4   - "templates/web.ssl.template.yml"
5
6 ## which TCP/IP ports should this container expose?
7 ## If you want Discourse to share a port with another webserver like Apache or nginx,
8 ## see https://meta.discourse.org/t/17247 for details
9 expose:
10   - "80:80"   # http
11   - "443:443" # https
12
13 # Use 'links' key to link containers together, aka use Docker --link flag.
14 links:
15   - link:
16       name: data
17       alias: data
18
19 # any extra arguments for Docker?
20 # docker_args:
21
22 # Workaround bug: https://github.com/discourse/discourse_docker/pull/505
23 # params:
24 #  version: v2.8.11 - NOT USED HERE. UPDATE THE EXEC GIT ACTIONS BELOW WITH VERSION
25
26 env:
27   LC_ALL: en_US.UTF-8
28   LANG: en_US.UTF-8
29   LANGUAGE: en_US.UTF-8
30   EMBER_CLI_PROD_ASSETS: 1
31   DISCOURSE_FORCE_HTTPS: true
32
33   ## How many concurrent web requests are supported? Depends on memory and CPU cores.
34   ## will be set automatically by bootstrap based on detected CPUs, or you can override
35   UNICORN_WORKERS: <%= node[:cpu][:total] %>
36
37   ## TODO: The domain name this Discourse instance will respond to
38   DISCOURSE_HOSTNAME: community.openstreetmap.org
39
40   ## Uncomment if you want the container to be started with the same
41   ## hostname (-h option) as specified above (default "$hostname-$config")
42   #DOCKER_USE_HOSTNAME: true
43
44   ## TODO: List of comma delimited emails that will be made admin and developer
45   ## on initial signup example 'user1@example.com,user2@example.com'
46   DISCOURSE_DEVELOPER_EMAILS: 'operations@openstreetmap.org'
47
48   DISCOURSE_SMTP_ADDRESS: <%= node[:exim][:smarthost_via].split(":", 2)[0] %>
49   DISCOURSE_SMTP_PORT: <%= node[:exim][:smarthost_via].split(":", 2)[1] || "25" %>
50   DISCOURSE_SMTP_USER_NAME:
51   DISCOURSE_SMTP_PASSWORD:
52   DISCOURSE_SMTP_DOMAIN: community.openstreetmap.org
53   DISCOURSE_NOTIFICATION_EMAIL: community@noreply.openstreetmap.org
54
55   ## TODO: configure connectivity to the databases
56   DISCOURSE_DB_SOCKET: ''
57   #DISCOURSE_DB_USERNAME: discourse
58   DISCOURSE_DB_PASSWORD: '<%= @passwords["database"] %>'
59   DISCOURSE_DB_HOST: data
60   DISCOURSE_REDIS_HOST: data
61
62   ## The maxmind geolocation IP address key for IP address lookup
63   ## see https://meta.discourse.org/t/-/137387/23 for details
64 <% if @license_keys -%>
65   DISCOURSE_MAXMIND_LICENSE_KEY: '<%= @license_keys[node[:geoipupdate][:account]] %>'
66 <% end -%>
67
68 volumes:
69   - volume:
70       host: /srv/community.openstreetmap.org/shared/web-only
71       guest: /shared
72   - volume:
73       host: /srv/community.openstreetmap.org/shared/web-only/log/var-log
74       guest: /var/log
75   - volume:
76       host: /etc/ssl/certs/community.openstreetmap.org.pem
77       guest: /shared/ssl/ssl.crt
78   - volume:
79       host: /etc/ssl/private/community.openstreetmap.org.key
80       guest: /shared/ssl/ssl.key
81
82 ## Plugins go here
83 ## see https://meta.discourse.org/t/19157 for details
84 hooks:
85   after_code:
86     - exec:
87         cd: $home/plugins
88         cmd:
89           - git clone --depth 1 https://github.com/discourse/discourse-oauth2-basic.git
90           - git clone --depth 1 https://github.com/discourse/discourse-solved.git
91           - git clone --depth 1 https://github.com/discourse/discourse-canned-replies.git
92           - git clone --depth 1 https://github.com/discourse/discourse-reactions.git
93           - git clone --depth 1 https://github.com/discourse/discourse-prometheus.git
94           - git clone --depth 1 https://github.com/discourse/discourse-translator.git
95     - exec:
96         cd: $home
97         cmd:
98           - git fetch --depth=1 origin tag v2.8.11 --no-tags
99           - git checkout v2.8.11
100   after_ssl:
101     - replace:
102         filename: "/etc/nginx/conf.d/discourse.conf"
103         from: /listen 80;/
104         to: |
105           listen 80;
106           rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
107
108     - replace:
109         filename: "/etc/nginx/conf.d/discourse.conf"
110         from: /add_header.+/
111         to: |
112           add_header Strict-Transport-Security 'max-age=63072000';