1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
|
---
layout: page
title: Configuration settings
---
# Configuration settings
<p class="lead">
You can control much of how FixMyStreet looks and behaves just by
changing the config settings.
</p>
## The general configuration file
<div class="attention-box info">
You can look at a summary of the live configuration of your site by going to
the Configuration page of your administration interface, at
<code>/admin/config</code>.
</div>
The FixMyStreet code ships with an example configuration file:
`conf/general.yml-example`.
As part of the [installation process]({{ "/install " | relative_url }}), the example
file gets copied to `conf/general.yml`. You **must** edit this file to suit
your needs.
When you edit this file, remember it must be in the <a
href="http://yaml.org">YAML syntax</a>. It's not complicated but —
especially if you're editing a list — be careful to get the indentation
correct. If in doubt, look at the examples already in the file, and don't use
tabs.
## Config settings by topic
The following are all the configuration settings that you can change in `conf/general.yml`.
### Database config
* <code><a href="#fms_db_host">FMS_DB_HOST</a></code>,
<code><a href="#fms_db_port">FMS_DB_PORT</a></code>,
<code><a href="#fms_db_name">FMS_DB_NAME</a></code>,
<code><a href="#fms_db_user">FMS_DB_USER</a></code>, and
<code><a href="#fms_db_pass">FMS_DB_PASS</a></code>
### Site settings and behaviour
* <code><a href="#allowed_cobrands">ALLOWED_COBRANDS</a></code>
* <code><a href="#rss_limit">RSS_LIMIT</a></code>
* <code><a href="#open311_limit">OPEN311_LIMIT</a></code>
* <code><a href="#all_reports_per_page">ALL_REPORTS_PER_PAGE</a></code>
* <code><a href="#area_links_from_problems">AREA_LINKS_FROM_PROBLEMS</a></code>
### URLs and directories
* <code><a href="#base_url">BASE_URL</a></code>
* <code><a href="#secure_proxy_ssl_header">SECURE_PROXY_SSL_HEADER</a></code>
* <code><a href="#upload_dir">UPLOAD_DIR</a></code>
* <code><a href="#geo_cache">GEO_CACHE</a></code>
* <code><a href="#admin_base_url">ADMIN_BASE_URL</a></code>
### Emailing
* <code><a href="#email_domain">EMAIL_DOMAIN</a></code>
* <code><a href="#contact_email">CONTACT_EMAIL</a></code>
* <code><a href="#contact_name">CONTACT_NAME</a></code>
* <code><a href="#do_not_reply_email">DO_NOT_REPLY_EMAIL</a></code>
* SMTP server settings: <code><a href="#smtp_smarthost">SMTP_SMARTHOST</a></code>,
<code><a href="#smtp_type">SMTP_TYPE</a></code>,
<code><a href="#smtp_port">SMTP_PORT</a></code>,
<code><a href="#smtp_username">SMTP_USERNAME</a></code>,
and <code><a href="#smtp_password">SMTP_PASSWORD</a></code>
### Login methods, authentication
* Social login: <code><a href="#facebook_app_id">FACEBOOK_APP_ID</a></code>,
<code><a href="#facebook_app_secret">FACEBOOK_APP_SECRET</a></code>,
<code><a href="#twitter_key">TWITTER_KEY</a></code>, and
<code><a href="#twitter_secret">TWITTER_SECRET</a></code>
* SMS text authentication: <code><a href="#sms_authentication">SMS_AUTHENTICATION</a></code>,
<code><a href="#phone_country">PHONE_COUNTRY</a></code>,
<code><a href="#twilio_account_sid">TWILIO_ACCOUNT_SID</a></code>,
<code><a href="#twilio_auth_token">TWILIO_AUTH_TOKEN</a></code>, and
<code><a href="#twilio_from_parameter">TWILIO_FROM_PARAMETER</a></code>
* <code><a href="#login_required">LOGIN_REQUIRED</a></code>
* <code><a href="#signups_disabled">SIGNUPS_DISABLED</a></code>
### Staging site (not production) behaviour
* <code><a href="#staging_site">STAGING_SITE</a></code>
* <code><a href="#staging_flags">STAGING_FLAGS</a></code>
### MapIt (admin boundary service)
* <code><a href="#mapit_url">MAPIT_URL</a></code>
* <code><a href="#mapit_types">MAPIT_TYPES</a></code>
* <code><a href="#mapit_api_key">MAPIT_API_KEY</a></code>
* <code><a href="#mapit_id_whitelist">MAPIT_ID_WHITELIST</a></code>
* <code><a href="#mapit_generation">MAPIT_GENERATION</a></code>
* <code><a href="#mapit_types_children">MAPIT_TYPES_CHILDREN</a></code>
### Localisation and maps
* <code><a href="#languages">LANGUAGES</a></code>
* <code><a href="#time_zone">TIME_ZONE</a></code>
* <code><a href="#geocoder">GEOCODER</a></code>
* <code><a href="#geocoding_disambiguation">GEOCODING_DISAMBIGUATION</a></code>
* <code><a href="#example_places">EXAMPLE_PLACES</a></code>
* <code><a href="#map_type">MAP_TYPE</a></code>
* <code><a href="#google_maps_api_key">GOOGLE_MAPS_API_KEY</a></code>
* <code><a href="#bing_maps_api_key">BING_MAPS_API_KEY</a></code>
### Sundry external services
* <code><a href="#gaze_url">GAZE_URL</a></code>
* <code><a href="#message_manager_url">MESSAGE_MANAGER_URL</a></code>
---
## All the general settings
<dl class="glossary">
<dt>
<a name="fms_db_host"><code>FMS_DB_HOST</code></a>,
<a name="fms_db_port"><code>FMS_DB_PORT</code></a>,
<a name="fms_db_name"><code>FMS_DB_NAME</code></a>,
<a name="fms_db_user"><code>FMS_DB_USER</code></a> &
<a name="fms_db_pass"><code>FMS_DB_PASS</code></a>
</dt>
<dd>
These are the PostgreSQL database details for FixMyStreet.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>
FMS_DB_HOST: 'localhost'<br>
FMS_DB_PORT: '5432'<br>
FMS_DB_NAME: 'fms'<br>
FMS_DB_USER: 'fmsuser'<br>
FMS_DB_PASS: 'aSecretWord'
</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="base_url"><code>BASE_URL</code></a>
</dt>
<dd>
The base URL of your site.
<div class="more-info">
<p>Examples:</p>
<ul class="examples">
<li>
<code>BASE_URL: 'http://www.example.org'</code>
</li>
<li>
<p>
Use this if you're using the Catalyst development server:
</p>
<code>BASE_URL: 'http://localhost:3000'</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="secure_proxy_ssl_header"><code>SECURE_PROXY_SSL_HEADER</code></a>
</dt>
<dd>
If you are behind a proxy that is performing SSL termination, and so
FixMyStreet is e.g. responding locally on a non-HTTPS connection, then you
need to make your proxy set a custom HTTP header saying that the request
was via HTTPS, and then set this value to a two-element list containing the
trusted HTTP header and the required value.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>SECURE_PROXY_SSL_HEADER: [ 'X-Forwarded-Proto', 'https' ]</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="email_domain"><code>EMAIL_DOMAIN</code></a>,
<a name="contact_email"><code>CONTACT_EMAIL</code></a> &
<a name="contact_name"><code>CONTACT_NAME</code></a>
</dt>
<dd>
The email domain used for emails, and the contact name and email
for admin use.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>
EMAIL_DOMAIN: 'example.org'<br>
CONTACT_EMAIL: 'team@example.org'<br>
CONTACT_NAME: 'FixMyStreet team'
</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="do_not_reply_email"><code>DO_NOT_REPLY_EMAIL</code></a>
</dt>
<dd>
The address used for emails you don't expect a reply to (for example,
confirmation emails). This can be the same as
<code><a href="#contact_email">CONTACT_EMAIL</a></code>, of course, if you don't have a special address.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>DO_NOT_REPLY_EMAIL: 'do-not-reply@example.org'</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="staging_site"><code>STAGING_SITE</code></a>
</dt>
<dd>
Is this site a
<a href="{{ "/glossary/#staging" | relative_url }}" class="glossary__link">staging</a>
(or <a href="{{ "/glossary/#development" | relative_url }}" class="glossary__link">development</a>)
site?
<p>
On a staging site, templates/CSS modified times aren't cached. Staging
sites also don't send reports to bodies unless explicitly configured to
(see <code><a href="#staging_flags">STAGING_FLAGS</a></code>)
— this means you can easily test your site without really sending
emails to the bodies' contacts that may be in your database.
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
If this is your live
<a href="{{ "/glossary/#production" | relative_url }}" class="glossary__link">production</a>
server:
<p>
<code>STAGING_SITE: 0</code>
</p>
</li>
<li>
If this is a development or staging server:
<p>
<code>STAGING_SITE: 1</code>
</p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="staging_flags"><code>STAGING_FLAGS</code></a>
</dt>
<dd>
<p>
A variety of flags that change the behaviour of a site when
<code><a href="#staging_site">STAGING_SITE</a></code> is <code>1</code>.
<code>send_reports</code> being set to 0 will
<a href="{{ "/customising/send_reports" | relative_url }}">send
reports</a> to the reporter <em>instead of</em> the relevant body's
contact address; <code>skip_checks</code> will stop cobrands from
performing some checks such as the map pin location being within their
covered area, which makes testing multiple cobrands much easier;
<code>enable_appcache</code> lets you say whether the appcache should be
active or not.
</p>
<p>
Note that this setting is only relevant on a
<a href="{{ "/glossary/#staging" | relative_url }}" class="glossary__link">staging</a>
server.
On your
<a href="{{ "/glossary/#production" | relative_url }}" class="glossary__link">production</a>
server (where
<code><a href="#staging_site">STAGING_SITE</a></code> is <code>0</code>)
it will be ignored.
</p>
<div class="more-info">
<p>Example:</p>
<pre>
STAGING_FLAGS:
send_reports: 0
skip_checks: 1
enable_appcache: 0
</pre>
</div>
<p>
Any reports created will now be sent to the email of the reporter
and <em>not</em> the body's; any location checks are skipped, and
we won't ever use appcache. Great for testing!
</p>
</dd>
<dt>
<a name="example_places"><code>EXAMPLE_PLACES</code></a>
</dt>
<dd>
The suggested input for a place name or names. By default, this appears
as a placeholder in the text input on FixMyStreet's front page, and in
alert emails. It defaults to displaying "High Street, Main Street".
<p>
You should ensure that the example places do return clear,
relevant results if they're entered in the font page text input
— this will probably depend on how you've set
<code><a href="#geocoding_disambiguation">GEOCODING_DISAMBIGUATION</a></code>.
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
The default behaviour is this, which you should certainly change:
<p>
<code>EXAMPLE_PLACES: [ 'High Street', 'Main Street' ]</code>
</p>
</li>
<li>
<code>EXAMPLE_PLACES: [ 'Iffley Road', 'Park St, Woodstock' ]</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="languages"><code>LANGUAGES</code></a>
</dt>
<dd>
An array of languages the site supports, each in the following format:
<p>
<em><language code>,<pretty name>,<locale></em>
</p>
<p>
Some important things to note:
</p>
<ul>
<li>
Put the default language as the first entry in the list.
</li>
<li>
Don't put any extra spaces in the strings (e.g., after the commas).
</li>
<li>
Remember that if you want your site to run in languages other than
English, you'll also need to check that the translations are
available, and your system supports the appropriate
<a href="{{ "/glossary/#locale" | relative_url }}" class="glossary__link">locales</a>.
</li>
</ul>
<p>
Just adding a language here does not necessarily mean FixMyStreet will
always use it (for example, a language coded subdomain name or browser preference may be considered). See this page about
<a href="{{ "/customising/language" | relative_url }}">languages and FixMyStreet</a> for more information.
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<pre>
LANGUAGES:
- 'en-gb,English,en_GB'
</pre>
</li>
<li>
<pre>
LANGUAGES:
- 'de,German,de_DE'
- 'en-gb,English,en_GB'
</pre>
</li>
</ul>
</div>
</dd>
<dt>
<a name="time_zone"><code>TIME_ZONE</code></a>
</dt>
<dd>
If you're running an installation that is being used in a different time zone
from the server, set the time zone here. Use a
<a href="http://en.wikipedia.org/wiki/List_of_tz_database_time_zones">standard time zone (TZ) string</a>.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>TIME_ZONE: 'Asia/Manila'</code>
</li>
<li>
Leave the setting blank to use your server's default:
<p><code>TIME_ZONE: ''</code></p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="upload_dir"><code>UPLOAD_DIR</code></a> &
<a name="geo_cache"><code>GEO_CACHE</code></a>
</dt>
<dd>
The file locations for uploaded photos and cached geocoding results.
Normally you don't need to change these settings from the examples.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>
UPLOAD_DIR: '../upload/'<br>
GEO_CACHE: '../cache/'
</code>
</li>
</ul>
</div>
</dd>
<dt>
<code><a name="facebook_app_id">FACEBOOK_APP_ID</a></code> &
<code><a name="facebook_app_secret">FACEBOOK_APP_SECRET</a></code>
</dt>
<dd>
If these parameters are set to a Facebook App's ID and secret, then
a user will be able to log in using their Facebook account when reporting,
updating, or logging in. <a href="../login/">More details</a>
</dd>
<dt>
<code><a name="twitter_key">TWITTER_KEY</a></code> &
<code><a name="twitter_secret">TWITTER_SECRET</a></code>
</dt>
<dd>
If these parameters are set to a Twitter App's key and secret, then
a user will be able to log in using their Twitter account when reporting,
updating, or logging in. <a href="../login/">More details</a>
</dd>
<dt>
<code><a name="sms_authentication">SMS_AUTHENTICATION</a></code>
</dt>
<dd>
Set this to 1 if you wish people to be able to use their mobiles as login
identifiers, receiving confirmation codes by text to report, update or
login in a similar way to how they receive a link in a confirmation email.
<a href="../login/">More details</a>
</dd>
<dt>
<code><a name="phone_country">PHONE_COUNTRY</a></code>
</dt>
<dd>
Set this to the country code of where you are operating the site, so that
phone number parsing knows how to deal with national phone numbers entered.
</dd>
<dt>
<a name="twilio_account_sid"><code>TWILIO_ACCOUNT_SID</code></a> &
<a name="twilio_auth_token"><code>TWILIO_AUTH_TOKEN</code></a>
</dt>
<dd>
These are your Twilio account details to use for sending text messages for
report and update verification.
See the <a href="https://www.twilio.com/docs/usage/api">Twilio docs</a> for more information.
</dd>
<dt>
<a name="twilio_from_parameter"><code>TWILIO_FROM_PARAMETER</code></a>
</dt>
<dd>
This is the phone number or alphanumeric string to use as the From of any
sent text messages.
You must specify either this or <code>TWILIO_MESSAGING_SERVICE_SID</code>.
See the <a href="https://www.twilio.com/docs/sms/send-messages">Twilio docs</a> for more information.
</dd>
<dt>
<a name="twilio_from_parameter"><code>TWILIO_MESSAGING_SERVICE_SID</code></a>
</dt>
<dd>
This is the unique id of the Twilio Messaging Service you want to associate with this message.
You must specify either this or <code>TWILIO_FROM_PARAMETER</code>.
See the <a href="https://www.twilio.com/docs/sms/send-messages">Twilio docs</a> for more information.
</dd>
<dt>
<a name="login_required"><code>LOGIN_REQUIRED</code></a>
</dt>
<dd>
If you're running an installation that should only be accessible to logged
in people, set this variable.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>LOGIN_REQUIRED: 1</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="signups_disabled"><code>SIGNUPS_DISABLED</code></a>
</dt>
<dd>
If you don't want any new people to be able to use the site, only the users
you have already created, then set this variable.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>SIGNUPS_DISABLED: 1</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="mapit_url"><code>MAPIT_URL</code></a>,
<a name="mapit_types"><code>MAPIT_TYPES</code></a>,
<a name="mapit_api_key"><code>MAPIT_API_KEY</code></a>
</dt>
<dd>
FixMyStreet uses the external service MapIt to map locations (points) to
administrative areas: see this
<a href="{{ "/customising/fms_and_mapit" | relative_url }}">explanation of MapIt</a>.
<!-- TODO link to explanation of boundaries -->
<p>
You must provide the URL of a MapIt server, and nominate what types of
area from it you want to use. If you leave this blank, a default area
will be used everywhere (a URL needs to be given for non-web things, like sending of reports, to function). <!-- TODO explain this: function? -->
If the MapIt you are using requires an API key, you can provide one.
</p>
<p>
See also <code><a href="#mapit_id_whitelist">MAPIT_ID_WHITELIST</a></code> to
efficiently limit the areas you need (especially if you're using
global MapIt).
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
If using the Catalyst development server, set to:
<p><code>
MAPIT_URL: 'http://localhost:3000/fakemapit/'<br>
MAPIT_TYPES: [ 'ZZZ' ]
</code></p>
</li>
<li>
In the UK, you probably want, to cover all councils:
<p><code>
MAPIT_URL: 'https://mapit.mysociety.org/'<br>
MAPIT_API_KEY: '12345'<br>
MAPIT_TYPES: [ 'DIS', 'LBO', 'MTD', 'UTA', 'CTY', 'COI', 'LGD' ]
</code></p>
<p>
...but perhaps <code>MAPIT_TYPES: [ 'WMC' ]</code>
if you want to report on a per-constituency basis?
</p>
</li>
<li>
If our global MapIt (which is loaded with OpenStreetMap data)
contains boundaries you can use:
<p><code>
MAPIT_URL: 'http://global.mapit.mysociety.org/'
</code></p>
<p>
And then specify whichever type code have the boundaries you want:
</p>
<p><code>MAPIT_TYPES: [ 'O06' ]</code></p>
<p>
OSM type codes consist of the letter O followed by two digits
indicating the type of boundary. Typically, the higher the number,
the more specfic (localised) the boundary type.
</p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="mapit_id_whitelist"><code>MAPIT_ID_WHITELIST</code></a>
</dt>
<dd>
If you are using global MapIt (see
<code><a href="#mapit_url">MAPIT_URL</a></code>),
you might want to restrict FixMyStreet usage
to only one or more areas, rather than <em>all</em> areas of the
specified type (afer all, there are a lot of <code>O04</code> boundaries
in the whole world, for example). Provide a list of all the MapIt
IDs that your FixMyStreet should recognise.
<p>
Note that you must still set <code><a href="#mapit_types">MAPIT_TYPES</a></code> to match
the type or types of each of these areas. And we recommend you set
<code><a href="#mapit_generation">MAPIT_GENERATION</a></code> too.
</p>
<p>
We recommend you use this setting, because doing so can improves the efficiency of your site's calls to MapIt considerably.
</p>
<div class="more-info">
<p>Examples:</p>
<ul class="examples">
<li>
If you don't specify a whitelist, all results (of the given area
type) will be considered. This may be OK if you're using a MapIt
server which is already only returning relevant results.
<p><code>MAPIT_ID_WHITELIST: []</code></p>
</li>
<li>
Otherwise, explicitly list the IDs (from the MapIt server you're
using) of the areas you're interested in:
<p>
<code>MAPIT_ID_WHITELIST: [ 240838, 246176, 246733 ]</code>
</p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="mapit_generation"><code>MAPIT_GENERATION</code></a>
</dt>
<dd>
If you have set
<code><a href="#mapit_id_whitelist">MAPIT_ID_WHITELIST</a></code>, then you
should also specify the generation of MapIt data you are using, especially
if you are using our global MapIt service.
<p>
Global MapIt uses <a href="{{ "/glossary/#osm" | relative_url }}"
class="glossary__link">OpenStreetMap</a> data. From time to time we import the latest
data in order to pull in newly-added boundaries, or reflect changes to existing
ones. When this happens, the area IDs may change, which means the values in your
<code><a href="#mapit_id_whitelist">MAPIT_ID_WHITELIST</a></code> might no longer
be correct (because, by default, MapIt returns values from the <em>latest</em>
generation of data). Use the <code>MAPIT_GENERATION</code> setting to lock
the area IDs in your whitelist — and the geometry described by their boundary
data — to the specific generation they belong to. MapIt's generations
are numbered with an integer that we increment with each update.
</p>
<p>
To determine the generation of the data you're using, when you initially
identify the area IDs look at the <code>generation-high</code> and
<code>generation-low</code> values MapIt is returning. For example,
here's the global MapIt data for
<a href="http://global.mapit.mysociety.org/point/4326/100.466667,13.75.html">a
point within Thailand</a> — the national border for Thailand is the
top level returned ("OSM Administrative Boundary Level 2"). Look on
that page for "Exists in generations" (or "<code>generation-</code>" in the
JSON data, available by changing MapIt's <code>.html</code> URL to <code>.json</code>)
to see the range of generations in which this area appears. You should
probably use the highest number (that is, the most recent update).
</p>
<div class="more-info">
<p>Examples:</p>
<ul class="examples">
<li>
In this example, the whitelist contains a single area ID from global
MapIt's generation <code>4</code> for
<a href="http://global.mapit.mysociety.org/area/507455.html?generation=4">Thailand's national border</a>
(hence <code>507455</code> and
<a href="{{ "/glossary/#area-type" | relative_url }}" class="glossary__link">area type</a> <code>O02</code>):
<pre>MAPIT_URL: http://global.mapit.mysociety.org/
MAPIT_TYPES: ['O02']
MAPIT_ID_WHITELIST: [507455]
MAPIT_ID_GENERATION: 4
</pre>
</li>
<li>
If you're not using a <code>MAPIT_ID_WHITELIST</code>
you usually don't need to specify a <code>MAPIT_ID_GENERATION</code>.
</li>
</ul>
</div>
</dd>
<dt>
<a name="mapit_types_children"><code>MAPIT_TYPES_CHILDREN</code></a>
</dt>
<dd>
If your MapIt has the concept of council wards (subareas of councils, where
people can sign up for alerts, but not report things), then you can give the
MapIt type codes for them here.
<p>
You can leave this blank if your jurisidction doesn't use subareas.
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
It's OK to leave this setting blank:
<p><code>MAPIT_TYPES_CHILDREN: ''</code></p>
</li>
<li>
In the UK we use something like:
<p><code>
MAPIT_TYPES_CHILDREN: [ 'DIW', 'LBW', 'MTW', 'UTE', 'UTW', 'CED', 'COP', 'LGW' ]
</code></p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="geocoder"><code>GEOCODER</code></a>
</dt>
<dd>
Which <a href="{{ "/glossary/#geocoder" | relative_url }}" class="glossary__link">geocoder service</a> to use to look up results, for
example, from front page "Enter your location" searches.
<p>
Possible choices are
<code>Google</code>, <code>Bing</code>, or <code>OSM</code>.
By default, FixMyStreet will use <code>OSM</code>, the
<a href="{{ "/glossary/#osm" | relative_url }}" class="glossary__link">OpenStreetMap</a>
geocoder.
</p>
<p>
For more information, see the
<a href="{{ "/customising/geocoder" | relative_url }}">page about geocoding</a>.
</p>
<p>
It's also possible to add a new geocoder (for example, if your
jurisdiction provides a custom one). This requires some coding work, but
you can see exampes of <a
href="https://github.com/mysociety/fixmystreet/tree/master/perllib/FixMyStreet/Geocode">supported geocoders</a> in the FixMyStreet repo.
</p>
<p>
Whichever geocoder you use, check the terms of use for it
— there may be restrictions. You may also need to provide an API
key to use it: see
<code><a href="#google_maps_api_key">GOOGLE_MAPS_API_KEY</a></code>
and
<code><a href="#bing_maps_api_key">BING_MAPS_API_KEY</a></code>.
</p>
<p>
See also <code><a href="#geocoding_disambiguation">GEOCODING_DISAMBIGUATION</a></code>
for restricting geocoder service to specific places.
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
FixMyStreet defaults to <code>OSM</code> if you don't specify
a geocoder:
<p><code>GEOCODER: ''</code></p>
</li>
<li>
<code>GEOCODER: 'Bing'</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="google_maps_api_key"><code>GOOGLE_MAPS_API_KEY</code></a> &
<a name="bing_maps_api_key"><code>BING_MAPS_API_KEY</code></a>
</dt>
<dd>
If you wish to use Google Maps or Bing Maps Geocoding, get the
relevant key and set it here. See also the
<code><a href="#geocoder">GEOCODER</a></code> setting.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>
GOOGLE_MAPS_API_KEY: ''<br>
BING_MAPS_API_KEY: ''
</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="geocoding_disambiguation"><code>GEOCODING_DISAMBIGUATION</code></a>
</dt>
<dd>
This setting provides parameters that are included in
<a href="{{ "/glossary/#geocoder" | relative_url }}" class="glossary__link">geocoding</a> requests, to hopefully
return more useful results. The options that will be applied vary depending
on which geocoder you are using (although unwanted options will be ignored,
so you can specify all of them, which might be convenient if you change
geocoder).
<p>
Remember that you specify which geocoder you are using with the
<code><a href="#geocoder">GEOCODER</a></code> setting.
</p>
<p>
For OSM, which is the default, you can use:
</p>
<pre>
GEOCODING_DISAMBIGUATION:
bounds: [ <em><min lat>, <min lon>, <max lat>, <max lon></em> ]
country: <em><country code to restrict results to></em>
town: <em><string added to geocoding requests if not already there></em>
</pre>
<p>
If using Bing, you can use <code>town</code> and <code>bounds</code>, plus any of:
</p>
<pre>
centre: "<em><lat><lon></em>"
bing_culture: <em><culture code: see <a href="http://msdn.microsoft.com/en-us/library/hh441729.aspx">Bing docs</a>></em>
bing_country: <em><country name: only accept results that match this></em>
</pre>
<p>
If using Google, you can use:
</p>
<pre>
bounds: [ <em><min lat>, <min lon>, <max lat>, <max lon></em> ]
google_country: <em><.ccTLD to restrict results to></em>
lang: <em><language for results></em>
</pre>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
This limits geocoding requests to only return results in Mumbai, India:
<pre>
GEOCODER: 'OSM'
GEOCODING_DISAMBIGUATION:
country: 'in'
town: 'Mumbai'
</pre>
</li>
</ul>
</div>
</dd>
<dt>
<a name="map_type"><code>MAP_TYPE</code></a>
</dt>
<dd>
The type of map you want to use. If left blank, the default is
<code>OSM</code> for
<a href="{{ "/glossary/#osm" | relative_url }}" class="glossary__link">OpenStreetMap</a>.
Other options are <code>GoogleOL</code> for Google Open Layers,
and other UK-specific values, including <code>FMS</code>
for UK <a href="https://www.fixmystreet.com">FixMyStreet</a>.
<p>
Check the usage terms for the type of map you use — there may be
restrictions.
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>MAP_TYPE: 'OSM'</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="allowed_cobrands"><code>ALLOWED_COBRANDS</code></a>
</dt>
<dd>
FixMyStreet uses a templating
<a href="{{ "/glossary/#cobrand" | relative_url }}" class="glossary__link">cobrand</a>
system to provide different looks (and behaviour) for
different installations. For example, if you create a cobrand
called <code>moon</code>, then FixMyStreet will look for templates in the
<code>templates/web/moon</code> directory and CSS in <code>web/cobrands/moon</code>. To make this work, set:
<pre>
ALLOWED_COBRANDS:
- moon
</pre>
<p>
If you specify <em>only one</em> cobrand in this way, your FixMyStreet site will simply run using that cobrand (so that would be <code>moon</code> in the example above). This is probably all you need!
</p>
<p>
However, it is possible for a FixMyStreet site to support <em>more than
one cobrand at the same time</em>. <strong>Most installations don't need
this</strong>, but if yours does, it's very useful: the server decides
which cobrand to use by inspecting the hostname of the incoming request.
</p>
<p>
If you wish to use multiple cobrands, specify them in a list, optionally
with hostname-matching regular expressions if the name of the cobrand is
not enough. If the hostname of the current request does not match with
any in the list, FixMyStreet will use the Default cobrand. For example:
</p>
<pre>
ALLOWED_COBRANDS:
- moon
- venus
</pre>
<p>
Any hostname with "<code>moon</code>" in it will use the moon cobrand
(for example, <code>fixmymoon.org</code>), any with "<code>venus</code>"
will use the venus cobrand. Anything else (such as
<code>www.example.com</code>, which contains neither "<code>moon</code>"
nor "<code>venus</code>") will use the Default cobrand.
</p>
<p>
Instead of using the cobrand's name as the matching string, you can
specify an alternative string to match on (in fact, the string can be a
regular expression):
</p>
<pre>
ALLOWED_COBRANDS:
- moon: 'orbital'
- venus
</pre>
<p>
Here, any hostname with "<code>orbital</code>" in it will use the moon
cobrand. Conversely, a request to <code>www.fixmymoon.org</code> won't
match anything, so it would be served with the Default cobrand instead.
This also allows development servers to map to different cobrands if
needed, using DNS subdomains, for example.
</p>
<p>
If you're running a site with multiple cobrands, you'll never want to
serve the Default cobrand on your
<a href="{{ "/glossary/#production" | relative_url }}" class="glossary__link">production</a>
server, so make sure you've set ALLOWED_COBRANDS correctly.
</p>
<div class="more-info">
<p>Examples:</p>
<ul class="examples">
<li>
<p>
Note that specifying <em>a single allowed cobrand</em> is a
special, simple case: FixMyStreet will always use the
<code>mycobrand</code>. This is probably all you need!
</p>
<pre>
ALLOWED_COBRANDS:
- mycobrand
</pre>
</li>
<li>
<p>
If there's more than one allowed cobrand, FixMyStreet uses string
matching (described above) on the hostname to determine which one
to use:
</p>
<pre>
ALLOWED_COBRANDS:
- cobrand1
- cobrand2: 'hostname_substring2'
- cobrand3
</pre>
<p>
Make sure you've covered everything, because any requests to a
hostname that don't match will be served using the Default cobrand,
which isn't what you want.
</p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="admin_base_url"><code>ADMIN_BASE_URL</code></a>
</dt>
<dd>
This is used in "offensive report" emails to provide a link directly
to the admin interface, and to make sure the admin can work through a
proxy. It defaults to `/admin` in your installation.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>ADMIN_BASE_URL: ''</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="rss_limit"><code>RSS_LIMIT</code></a>
</dt>
<dd>
How many items are returned in the GeoRSS feeds?
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>RSS_LIMIT: '20'</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="open311_limit"><code>OPEN311_LIMIT</code></a>
</dt>
<dd>
How many items are returned by default in an Open311 response?
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>OPEN311_LIMIT: 100</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="all_reports_per_page"><code>ALL_REPORTS_PER_PAGE</code></a>
</dt>
<dd>
How many reports to show per page on the <em>All Reports</em> pages?
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>ALL_REPORTS_PER_PAGE: 100</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="smtp_smarthost"><code>SMTP_SMARTHOST</code></a>
</dt>
<dd>
The default SMTP smarthost is <code>localhost</code>, a mail server on the
same machine you are running FixMyStreet. If you wish to send email through
a SMTP server elsewhere, change this and the other SMTP settings.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>SMTP_SMARTHOST: 'localhost'</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="smtp_type"><code>SMTP_TYPE</code></a>
</dt>
<dd>
If your SMTP server supports SSL or TLS, set this variable to 'ssl' or
'tls', otherwise leave it as '' for unencrypted SMTP.
</dd>
<dt>
<a name="smtp_port"><code>SMTP_PORT</code></a>
</dt>
<dd>
The default SMTP port is 25 for unencrypted, 465 for SSL and 587 for TLS.
Leave as '' to use the default, otherwise set to your SMTP server port.
</dd>
<dt>
<a name="smtp_username"><code>SMTP_USERNAME</code></a>
</dt>
<dd>
The username for authenticating with your SMTP server, if required.
</dd>
<dt>
<a name="smtp_password"><code>SMTP_PASSWORD</code></a>
</dt>
<dd>
The password for authenticating with your SMTP server, if required.
</dd>
<dt>
<a name="area_links_from_problems"><code>AREA_LINKS_FROM_PROBLEMS</code></a>
</dt>
<dd>
Should problem reports link to the council summary pages? Set to <code>0</code> to disable, or <code>1</code> to enable.
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
Disable links to the summary page:
<p><code>AREA_LINKS_FROM_PROBLEMS: '0'</code></p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="gaze_url"><code>GAZE_URL</code></a>
</dt>
<dd>
Gaze is a world-wide service for population density lookups. You can leave
this as is. It is used to provide the default radius for email/RSS alerts
and to set the default zoom level on a map page (so in rural areas, you're
more likely to get a slightly more zoomed out map).
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>GAZE_URL: 'https://gaze.mysociety.org/gaze'</code>
</li>
</ul>
</div>
</dd>
<dt>
<a name="message_manager_url"><code>MESSAGE_MANAGER_URL</code></a>
</dt>
<dd>
If you're using <a href="https://github.com/mysociety/message-manager/">Message Manager</a>,
integrated with an SMS gateway, include the URL here. FixMyStreet does
not usually use this, so you can leave it blank.
<p>
Providing a URL does not automatically enable the service — your <a
href="{{ "/glossary/#cobrand" | relative_url }}" class="glossary__link">cobrand</a>
must be explicitly coded to use it. Contact us if you need to use Message
Manager with your FixMyStreet site.
</p>
<div class="more-info">
<p>Example:</p>
<ul class="examples">
<li>
<code>MESSAGE_MANAGER_URL: ''</code>
</li>
</ul>
</div>
</dd>
</dl>
|