decidim 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim might be problematic. Click here for more details.

@@ -30,9 +30,9 @@ Once created you are ready to:
30
30
 
31
31
  - `bin/rails s`
32
32
 
33
- ## Gitflow Branching model
33
+ ## GitFlow Branching model
34
34
 
35
- The Decidim respository follows the Gitflow branching model. There are good documentations on it at:
35
+ The Decidim respository follows the GitFlow branching model. There are good documentations on it at:
36
36
 
37
37
  - the original post: https://nvie.com/posts/a-successful-git-branching-model/
38
38
  - provided by Atlassian: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow.
@@ -43,24 +43,41 @@ In summary, Decidim developers that work on `feature/...` or `fix/...` branches
43
43
 
44
44
  Then, to start a new feature branch off from `develop` in the following way:
45
45
 
46
- ```
46
+ ```bash
47
47
  git checkout develop
48
48
  git checkout -b feature/xxx
49
49
  ```
50
50
 
51
51
  Implement the feature, and open a Pull Request as normal, but against `develop` branch. As this is the most common operation, `develop` is the default branch instead of `master`.
52
52
 
53
+ ### Naming Decidim branches
54
+
55
+ We would like to have all branches following this namings:
56
+
57
+ | Branch prefix | Comment |
58
+ | -------- | -------- |
59
+ | chore/ | Internal work. For instance, automatisms, etc. No production code change. |
60
+ | ci/ | For continous integration related tasks. No production code change. |
61
+ | deps/ | For dependency management tasks. |
62
+ | doc/ | For changes to the documentation. |
63
+ | feature/ | For new features for the users or for the Decidim command. |
64
+ | fix/ | For feature bugfixing. |
65
+ | release/ | With MAYOR.MINOR-stable. For instance, release/0.22-stable |
66
+ | refactor/ | For refactorings related with production code. |
67
+ | test/ | When adding missing tests, refactoring tests, improving coverage, etc. |
68
+ | backport/ | We only offer support for the last mayor version. |
69
+
53
70
  ## Git commit messages and Pull Request titles
54
71
 
55
72
  We recommend following [this guide](https://chris.beams.io/posts/git-commit/) for making good git commit messages. It also applies to Pull Request titles. The summary is:
56
73
 
57
- 1. Separate subject from body with a blank line
58
- 1. Limit the subject line to 50 characters
59
- 1. Capitalize the subject line
60
- 1. Do not end the subject line with a period
61
- 1. Use the imperative mood in the subject line
62
- 1. Wrap the body at 72 characters
63
- 1. Use the body to explain what and why vs. how
74
+ 1. Separate subject from body with a blank line
75
+ 1. Limit the subject line to 50 characters
76
+ 1. Capitalize the subject line
77
+ 1. Do not end the subject line with a period
78
+ 1. Use the imperative mood in the subject line
79
+ 1. Wrap the body at 72 characters
80
+ 1. Use the body to explain what and why vs. how
64
81
 
65
82
  ## During development
66
83
 
@@ -167,9 +167,11 @@ You can also make sure new translations are complete for all languages in your
167
167
  application with:
168
168
 
169
169
  ```console
170
- bin/rails decidim:check_locales
170
+ TARGET_BRANCH=release/0.22-stable bin/rails decidim:check_locales
171
171
  ```
172
172
 
173
+ Here the `TARGET_BRANCH` must be the same as the `decidim` dependency in your `Gemfile`.
174
+
173
175
  Be aware that this task might not be able to detect everything, so make sure you
174
176
  also manually check your application before upgrading.
175
177
 
@@ -0,0 +1,38 @@
1
+ # Elections Bulletin Board
2
+
3
+ :warning: This is a work in progress and is not fully working yet.
4
+
5
+ In order to celebrate [End-to-end auditable votings](https://en.wikipedia.org/wiki/End-to-end_auditable_voting_systems) using the Elections module, you will need to connect your Decidim instance with an instance of the [Decidim Bulletin Board application](https://github.com/decidim/decidim-bulletin-board/), preferably run by an independent organization.
6
+
7
+ ## Identification pair of keys generation
8
+
9
+ The first step needed to setup the connection is to generate an a pair of keys to identify the application against the Bulletin Board. This can be done running the following rake task in your application environment:
10
+
11
+ ```sh
12
+ bundle exec rake decidim_elections:generate_identification_keys
13
+ ```
14
+
15
+ This task will output the generated private and public keys. You should copy the public key and send it to the Bulletin Board administrator through a secure channel. When copying the key, include the starting and ending lines with the prefix `-----`.
16
+
17
+ After that, use one of these methods to make the private key available from your Decidim installation:
18
+
19
+ a. Copy the private key, paste in a new file and store its path on the environment variable `BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY`.
20
+ b. Copy the private key and store that value on the environment variable `BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY`.
21
+
22
+ Regardless of the used method, when copying the private key remember to include the lines prefixed by `-----` and ensure that the private key is not lost between deployments and servers reboots and that only can be accessed by the application.
23
+
24
+ ## Configuration of the Bulletin Board application
25
+
26
+ The Bulletin Board administrator will store the received public key in their server and will send you back an API key. To complete the setup process you should store this API key and the Bulletin Board URL address on the environment variables `BULLETIN_BOARD_API_KEY` and `BULLETIN_BOARD_SERVER`, respectively.
27
+
28
+ The following YAML snippet with all the defined environment variables should be used in the `default` block of your application `config/secrets.yml` file. Maybe this is already done, as it was included in the Decidim applications generator during the development of the Elections module.
29
+
30
+ ```yaml
31
+ bulletin_board:
32
+ identification_private_key: |
33
+ <%= ENV["BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY"]&.indent(6) %>
34
+ server: <%= ENV["BULLETIN_BOARD_SERVER"] %>
35
+ api_key: <%= ENV["BULLETIN_BOARD_API_KEY"] %>
36
+ ```
37
+
38
+ After restarting the Decidim instance, administrator users will be able to create elections on the configured Bulletin Board.
@@ -0,0 +1,362 @@
1
+ # Maps and geocoding
2
+
3
+ Decidim has the ability to geocode proposals and meetings and display them on a
4
+ map. Decidim has built-in support for the following map service providers:
5
+
6
+ - [HERE Maps][link-here] (Recommended)
7
+ - Supports map tiles, static map images, geocoding and geocoding
8
+ autocompletion
9
+ - Easy to get started with, comes with a rather generous free plan
10
+ - [Configuring HERE Maps][anchor-configure-here-maps]
11
+ - [Open Street Maps based services][link-osm-commercial]
12
+ - Please pick a service provider that provides all needed services (map tiles,
13
+ static map images, geocoding and geocoding autocompletion)
14
+ - We can't use the OSM's own services by their
15
+ [tile usage policy][link-osm-tile-usage].
16
+ - In case your service provider does not offer static map images, Decidim will
17
+ use the dynamic map tiles to generate a similar map element.
18
+ - As an alternative, you may also want to use your own self-hosted map servers
19
+ (see [Hosting your own map services][anchor-hosting-osm] for
20
+ more information)
21
+ - [Configuring Open Street Maps based service providers][anchor-configure-osm]
22
+
23
+ If you want to integrate Decidim to some other map service provider, read how to
24
+ [write your own integration code][link-docs-custom-maps] for that.
25
+
26
+ ## Configuring maps and geocoding
27
+
28
+ After generating your app, you'll see that your `config/initializers/decidim.rb`
29
+ file includes commented code about map services:
30
+
31
+ ```ruby
32
+ # Map and Geocoder configuration
33
+ # config.maps = {
34
+ # ...
35
+ # }
36
+ ```
37
+
38
+ The initializer comments provide examples for the services mentioned in this
39
+ documentation. Please refer to the section below for the service you have
40
+ registered for the maps functionality.
41
+
42
+ If you want to enable geocoding in your app:
43
+
44
+ 1. Select a service provider for the maps functionality and register an account
45
+ with that provider
46
+ 1. Uncomment or add the code under the selected service provider in your
47
+ `config/initializers/decidim.rb`.
48
+ 1. Make sure your `config/secrets.yml` file has the needed section (it should
49
+ be added by the generator automatically).
50
+ 1. Configure the service provider credentials in `config/secrets.yml` and refer
51
+ to them from your `config/initializers/decidim.rb`.
52
+ 1. If you had your Rails server running, restart it so the changes apply.
53
+
54
+ ### Configuring HERE Maps
55
+
56
+ Use the following configuration for HERE Maps:
57
+
58
+ `config/initializers/decidim.rb`:
59
+
60
+ ```ruby
61
+ # Map and Geocoder configuration
62
+ # == HERE Maps ==
63
+ config.maps = {
64
+ provider: :here,
65
+ api_key: Rails.application.secrets.maps[:api_key],
66
+ static: { url: "https://image.maps.ls.hereapi.com/mia/1.6/mapview" }
67
+ }
68
+ ```
69
+
70
+ `config/secrets.yml`:
71
+
72
+ ```yaml
73
+ default: &default
74
+ # ...
75
+ maps:
76
+ api_key: <%= ENV["MAPS_API_KEY"] %>
77
+ ```
78
+
79
+ `.env`:
80
+
81
+ ```bash
82
+ MAPS_API_KEY=your_api_key_here
83
+ ```
84
+
85
+ ### Configuring Open Street Maps based service providers
86
+
87
+ Use the following configuration for Open Street Maps based service providers:
88
+
89
+ `config/initializers/decidim.rb`:
90
+
91
+ ```ruby
92
+ # Map and Geocoder configuration
93
+ # == OpenStreetMap (OSM) services ==
94
+ config.maps = {
95
+ provider: :osm,
96
+ api_key: Rails.application.secrets.maps[:api_key],
97
+ dynamic: {
98
+ tile_layer: {
99
+ url: "https://tiles.example.org/{z}/{x}/{y}.png?key={apiKey}",
100
+ api_key: true,
101
+ attribution: %(
102
+ <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap</a> contributors
103
+ ).strip
104
+ # Translatable attribution:
105
+ # attribution: -> { I18n.t("tile_layer_attribution") }
106
+ }
107
+ },
108
+ # static: { url: "https://staticmap.example.org/" }, # optional
109
+ geocoding: { host: "nominatim.example.org", use_https: true },
110
+ autocomplete: { url: "https://photon.example.org/api/" }
111
+ }
112
+ ```
113
+
114
+ `config/secrets.yml`:
115
+
116
+ ```yaml
117
+ default: &default
118
+ # ...
119
+ maps:
120
+ api_key: <%= ENV["MAPS_API_KEY"] %>
121
+ ```
122
+
123
+ `.env`:
124
+
125
+ ```bash
126
+ MAPS_API_KEY=your_api_key_here
127
+ ```
128
+
129
+ For further information, see the service provider's documentation or take a look
130
+ at the [Hosting your own map services][anchor-hosting-osm] section.
131
+
132
+ ### Combining multiple service providers
133
+
134
+ It is also possible to combine multiple service providers for the different
135
+ categories of map services. For instance, if you want to use HERE Maps for
136
+ the map tiles but host the other services yourself, use the following
137
+ configuration:
138
+
139
+ ```ruby
140
+ # Map and Geocoder configuration
141
+ # == Combination (OpenStreetMap default + HERE Maps dynamic map tiles) ==
142
+ config.maps = {
143
+ provider: :osm,
144
+ dynamic: {
145
+ provider: :here,
146
+ api_key: Rails.application.secrets.maps[:here_api_key]
147
+ },
148
+ static: { url: "https://staticmap.example.org/" },
149
+ geocoding: { host: "nominatim.example.org", use_https: true },
150
+ autocomplete: { url: "https://photon.example.org/api/" }
151
+ }
152
+ ```
153
+
154
+ `config/secrets.yml`:
155
+
156
+ ```yaml
157
+ default: &default
158
+ # ...
159
+ maps:
160
+ here_api_key: <%= ENV["MAPS_HERE_API_KEY"] %>
161
+ ```
162
+
163
+ `.env`:
164
+
165
+ ```bash
166
+ MAPS_HERE_API_KEY=your_api_key_here
167
+ ```
168
+
169
+ ### Disabling some of the map services
170
+
171
+ When using the maps functionality, you should always aim to provide all the
172
+ services for the user that are available in Decidim. However, not all service
173
+ providers provide all these services, so at times you may need to disable some
174
+ of them.
175
+
176
+ The configuration syntax allows you to disable the map services one by one. For
177
+ example, if you want to use HERE Maps as your default but disable the static map
178
+ images and geocoding autocompletion functionality, you can use the following
179
+ configuration:
180
+
181
+ ```ruby
182
+ config.maps = {
183
+ provider: :here,
184
+ api_key: Rails.application.secrets.maps[:api_key],
185
+ static: false,
186
+ autocomplete: false
187
+ }
188
+ ```
189
+
190
+ Decidim works fine when some of the services are disabled individually but
191
+ obviously, the disabled services are not available for Decidim users.
192
+
193
+ ### Global geocoder configurations
194
+
195
+ In the Dedicim initialiser (`config/initializers/decidim.rb`) you will also see
196
+ a commented section for the global geocoder configurations commented as follows:
197
+
198
+ ```ruby
199
+ # Geocoder configurations ...
200
+ # config.geocoder = {
201
+ # # geocoding service request timeout, in seconds (default 3):
202
+ # timeout: 5,
203
+ # # set default units to kilometers:
204
+ # units: :km,
205
+ # # caching (see https://github.com/alexreisner/geocoder#caching for details):
206
+ # cache: Redis.new,
207
+ # cache_prefix: "..."
208
+ # }
209
+ ```
210
+
211
+ This will change the global geocoding settings for your application. To learn
212
+ more about these settings, take a look at the
213
+ [Geocoder gem's documentation][link-geocoder].
214
+
215
+ ### Geocoding autocompletion configurations
216
+
217
+ Each autocompletion geocoder has their own configurations and this may not apply
218
+ for all geocoding services. The geocoder autocompletion integrations shipped
219
+ with Decidim support the configurations shown in this section.
220
+
221
+ If you want to customize the address format in the geocoding autocompletion
222
+ fields, you can apply the following configuration to your geocoder settings:
223
+
224
+ ```ruby
225
+ config.maps = {
226
+ # ... other configs ...
227
+ autocomplete: {
228
+ # For HERE:
229
+ address_format: [%w(street houseNumber), "city", "country"]
230
+ # For OSM/Photon:
231
+ # address_format: ["name", %w(street housenumber), "city", "country"]
232
+ }
233
+ }
234
+ ```
235
+
236
+ ### Integrating with a new service provider
237
+
238
+ If you want to integrate the map functionality with a new service provider, take
239
+ a look at the [Custom map providers][link-docs-custom-maps] documentation.
240
+
241
+ ## Enabling maps and geocoding
242
+
243
+ Once the maps functionality is configured, you'll need to activate it. As of
244
+ April 2017, only proposals and meetings have maps and geocoding.
245
+
246
+ ### Proposals
247
+
248
+ In order to enable geocoding for proposals you'll need to edit the component
249
+ configuration and turn on "Geocoding enabled" configuration. This works for that
250
+ specific component, so you can have geocoding enabled for proposals in a
251
+ participatory process, and disabled for another proposals component in the same
252
+ participatory process.
253
+
254
+ ### Meetings
255
+
256
+ Meetings do not have a configuration option for geocoding. Instead, if geocoding
257
+ is configured it will try to geocode the address every time you create or update
258
+ a meeting. As of April 2017 there is no way to enable or disable geocoding per
259
+ meetings component.
260
+
261
+ ## Hosting your own map services
262
+
263
+ It is recommended to use a commercial service provider for all the map
264
+ functionality to get up and running more easily. Hosting all these services
265
+ yourself and keeping everything up to date is time consuming and rather complex.
266
+ If the related complexity or the required time is not an issue, feel free to
267
+ setup the following services on your own servers.
268
+
269
+ ### Map tiles: Open Street Maps tile server
270
+
271
+ You will need a [map tiles][link-wiki-map-tiles] server which is used for the
272
+ dynamic maps that the user can move themselves.
273
+
274
+ Follow these instructions to setup your tiles server:
275
+
276
+ https://opentileserver.org/
277
+
278
+ In the example configuration, we assume you have used the following domain for
279
+ the tiles server:
280
+
281
+ https://tiles.example.org
282
+
283
+ ### Static map images: Openstreetmap static maps server (osm-static-maps)
284
+
285
+ Some pages in Decidim display static map images which need to be fetched from
286
+ an external server. The tiles server does not provide such static images by
287
+ itself because one static map image may need multiple tiles to be combined into
288
+ one. The static map image is therefore dynamically generated based on the
289
+ parameters passed for the static map request (such as image dimensions and the
290
+ geocoordinates of the map image position).
291
+
292
+ The Open Street Maps community has made multiple open source
293
+ [static maps image services][link-wiki-static-maps] from which you can pick
294
+ freely but Decidim currently supports only
295
+ [osm-static-maps][link-osm-static-maps] with the Open Street Maps services.
296
+
297
+ Follow these instructions to setup your static map images server:
298
+
299
+ https://github.com/jperelli/osm-static-maps#3-standalone-sample-server
300
+
301
+ In the example configuration, we assume you have used the following domain for
302
+ the static maps image server:
303
+
304
+ https://staticmap.example.org
305
+
306
+ Setting up this service is optional. If you do not configure a static map URL
307
+ for the OSM based map services, Decidim will use the dynamic map tiles to
308
+ generate a similar map element.
309
+
310
+ ### Geocoding: Nominatim geocoding server
311
+
312
+ [Nominatim][link-osm-nominatim] makes it possible to place points on the Decidim
313
+ maps based on addresses. This service provides geocoding capabilities by turning
314
+ human readable addresses to [geographic coordinates][link-wiki-geocoordinates].
315
+
316
+ Follow these instructions to setup your geocoding server:
317
+
318
+ http://nominatim.org/release-docs/latest/admin/Installation/
319
+
320
+ In the example configuration, we assume you have used the following domain for
321
+ the geocoding server:
322
+
323
+ https://nominatim.example.org
324
+
325
+ ### Geocoding autocompletion: Photon geocoding server
326
+
327
+ [Photon][link-osm-photon] makes it possible to provide the autocompletion
328
+ service for people writing addresses to the address fields available in Decidim.
329
+ It uses the Open Street Maps data to serve the autocompletion requests. When
330
+ people select one of the suggested addresses, it will also tell Decidim the map
331
+ point for that address.
332
+
333
+ Follow these instructions to setup your geocoding autocompletion server:
334
+
335
+ https://github.com/komoot/photon#installation
336
+
337
+ In the example configuration, we assume you have used the following domain for
338
+ the Photon geocoding server for the autocompletion functionality:
339
+
340
+ https://photon.example.org
341
+
342
+ ### Configure Decidim
343
+
344
+ After you have all these services running, change your Decidim configurations
345
+ to use these services. Read the
346
+ [Configuring Open Street Maps based service providers][anchor-configure-osm]
347
+ section for more information.
348
+
349
+ [anchor-hosting-osm]: #hosting-your-own-map-services
350
+ [anchor-configure-here-maps]: #configuring-here-maps
351
+ [anchor-configure-osm]: #configuring-open-street-maps-based-service-providers
352
+ [link-docs-custom-maps]: /docs/customization/maps.md
353
+ [link-here]: http://here.com
354
+ [link-geocoder]: https://github.com/alexreisner/geocoder
355
+ [link-osm-commercial]: https://wiki.openstreetmap.org/wiki/Commercial_OSM_Software_and_Services
356
+ [link-osm-nominatim]: https://wiki.openstreetmap.org/wiki/Nominatim
357
+ [link-osm-static-maps]: https://github.com/jperelli/osm-static-maps
358
+ [link-osm-photon]: https://github.com/komoot/photon
359
+ [link-osm-tile-usage]: https://operations.osmfoundation.org/policies/tiles/
360
+ [link-wiki-geocoordinates]: https://en.wikipedia.org/wiki/Geographic_coordinate_system
361
+ [link-wiki-map-tiles]: https://wiki.openstreetmap.org/wiki/Tiles
362
+ [link-wiki-static-maps]: https://wiki.openstreetmap.org/wiki/Static_map_images