]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/web_only.yml.erb
Use dedicated port for discourse mail-receiver service
[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 params:
23   version: v2.8.1
24
25 env:
26   LC_ALL: en_US.UTF-8
27   LANG: en_US.UTF-8
28   LANGUAGE: en_US.UTF-8
29   EMBER_CLI_PROD_ASSETS: 1
30   DISCOURSE_FORCE_HTTPS: true
31
32   ## How many concurrent web requests are supported? Depends on memory and CPU cores.
33   ## will be set automatically by bootstrap based on detected CPUs, or you can override
34   UNICORN_WORKERS: 8
35
36   ## TODO: The domain name this Discourse instance will respond to
37   DISCOURSE_HOSTNAME: community.openstreetmap.org
38
39   ## Uncomment if you want the container to be started with the same
40   ## hostname (-h option) as specified above (default "$hostname-$config")
41   #DOCKER_USE_HOSTNAME: true
42
43   ## TODO: List of comma delimited emails that will be made admin and developer
44   ## on initial signup example 'user1@example.com,user2@example.com'
45   DISCOURSE_DEVELOPER_EMAILS: 'operations@openstreetmap.org'
46
47   ## TODO: The SMTP mail server used to validate new accounts and send notifications
48   # SMTP ADDRESS, username, and password are required
49   # WARNING the char '#' in SMTP password can cause problems!
50   DISCOURSE_SMTP_ADDRESS: mail.openstreetmap.org
51   DISCOURSE_SMTP_PORT: 26
52   DISCOURSE_SMTP_USER_NAME:
53   DISCOURSE_SMTP_PASSWORD:
54   # DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
55   DISCOURSE_SMTP_DOMAIN: community.openstreetmap.org
56   DISCOURSE_NOTIFICATION_EMAIL: community@noreply.openstreetmap.org
57
58   ## TODO: configure connectivity to the databases
59   DISCOURSE_DB_SOCKET: ''
60   #DISCOURSE_DB_USERNAME: discourse
61   DISCOURSE_DB_PASSWORD: '<%= @passwords["database"] %>'
62   DISCOURSE_DB_HOST: data
63   DISCOURSE_REDIS_HOST: data
64
65   ## The maxmind geolocation IP address key for IP address lookup
66   ## see https://meta.discourse.org/t/-/137387/23 for details
67   DISCOURSE_MAXMIND_LICENSE_KEY: '<%= @license_keys[node[:geoipupdate][:account]] %>'
68
69 volumes:
70   - volume:
71       host: /srv/community.openstreetmap.org/shared/web-only
72       guest: /shared
73   - volume:
74       host: /srv/community.openstreetmap.org/shared/web-only/log/var-log
75       guest: /var/log
76   - volume:
77       host: /etc/ssl/certs/community.openstreetmap.org.pem
78       guest: /shared/ssl/ssl.crt;
79   - volume:
80       host: /etc/ssl/private/community.openstreetmap.org.key
81       guest: /shared/ssl/ssl.key;;
82
83 ## Plugins go here
84 ## see https://meta.discourse.org/t/19157 for details
85 hooks:
86   after_code:
87     - exec:
88         cd: $home/plugins
89         cmd:
90           - git clone --depth 1 https://github.com/discourse/docker_manager.git
91           - git clone --depth 1 https://github.com/discourse/discourse-oauth2-basic.git
92           - git clone --depth 1 https://github.com/discourse/discourse-solved.git
93           - git clone --depth 1 https://github.com/discourse/discourse-canned-replies.git
94           - git clone --depth 1 https://github.com/discourse/discourse-reactions.git
95   after_ssl:
96     - file:
97         path: "/etc/nginx/letsencrypt.conf"
98         contents: |
99           user www-data;
100           worker_processes auto;
101           daemon on;
102
103           events {
104             worker_connections 768;
105             # multi_accept on;
106           }
107
108           http {
109             sendfile on;
110             tcp_nopush on;
111             tcp_nodelay on;
112             keepalive_timeout 65;
113             types_hash_max_size 2048;
114
115             access_log /var/log/nginx/access.letsencrypt.log;
116             error_log /var/log/nginx/error.letsencrypt.log;
117
118             server {
119               listen 80;
120               listen [::]:80;
121
122               rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
123
124             }
125           }
126
127     - replace:
128         filename: "/etc/nginx/conf.d/discourse.conf"
129         from: /add_header.+/
130         to: |
131           add_header Strict-Transport-Security 'max-age=63072000';