decidim 0.23.6 → 0.24.0.rc1
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.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/docs/README.adoc +74 -0
- data/docs/antora.yml +7 -0
- data/docs/modules/configure/pages/environment_variables.adoc +69 -0
- data/docs/modules/configure/pages/index.adoc +16 -0
- data/docs/modules/configure/pages/initializer.adoc +376 -0
- data/docs/modules/customize/assets/images/header-snippet.png +0 -0
- data/docs/modules/customize/assets/images/menu.png +0 -0
- data/docs/modules/customize/assets/images/organization-colors.png +0 -0
- data/docs/modules/customize/pages/authorizations.adoc +22 -0
- data/docs/{customization/code.md → modules/customize/pages/code.adoc} +12 -9
- data/docs/{customization/gemfile.md → modules/customize/pages/gemfile.adoc} +5 -4
- data/docs/modules/customize/pages/images.adoc +7 -0
- data/docs/modules/customize/pages/javascript.adoc +59 -0
- data/docs/modules/customize/pages/menu.adoc +25 -0
- data/docs/modules/customize/pages/oauth.adoc +33 -0
- data/docs/modules/customize/pages/styles.adoc +64 -0
- data/docs/modules/customize/pages/texts.adoc +30 -0
- data/docs/modules/customize/pages/users_registration_mode.adoc +17 -0
- data/docs/{customization/views.md → modules/customize/pages/views.adoc} +13 -13
- data/docs/modules/develop/assets/images/barcelona.png +0 -0
- data/docs/modules/develop/assets/images/helsinki.png +0 -0
- data/docs/modules/develop/assets/images/indices.png +0 -0
- data/docs/{advanced/api.md → modules/develop/pages/api.adoc} +2 -2
- data/docs/{advanced/authorship.md → modules/develop/pages/authorable.adoc} +5 -5
- data/docs/modules/develop/pages/c4_component.adoc +91 -0
- data/docs/modules/develop/pages/c4_container.adoc +42 -0
- data/docs/modules/develop/pages/c4_context.adoc +35 -0
- data/docs/{advanced/components.md → modules/develop/pages/components.adoc} +47 -10
- data/docs/{advanced/content_blocks.md → modules/develop/pages/content_blocks.adoc} +16 -13
- data/docs/{advanced/content_processors.md → modules/develop/pages/content_processors.adoc} +25 -19
- data/docs/modules/develop/pages/data-picker.adoc +85 -0
- data/docs/modules/develop/pages/deploy.adoc +15 -0
- data/docs/modules/develop/pages/docker.adoc +12 -0
- data/docs/{advanced/embeddable.md → modules/develop/pages/embeddable.adoc} +6 -6
- data/docs/{advanced/endorsable.md → modules/develop/pages/endorsable.adoc} +31 -25
- data/docs/{advanced/fixing_locales.md → modules/develop/pages/fixing_locales.adoc} +36 -23
- data/docs/{advanced/followers.md → modules/develop/pages/followable.adoc} +9 -8
- data/docs/modules/develop/pages/guide.adoc +16 -0
- data/docs/modules/develop/pages/guide_architecture.adoc +17 -0
- data/docs/modules/develop/pages/guide_changelog.adoc +8 -0
- data/docs/modules/develop/pages/guide_commands.adoc +86 -0
- data/docs/modules/develop/pages/guide_development_app.adoc +44 -0
- data/docs/modules/develop/pages/guide_development_with_custom_seed_data.adoc +31 -0
- data/docs/modules/develop/pages/guide_development_with_localhost_ssl.adoc +63 -0
- data/docs/modules/develop/pages/guide_example_apps.adoc +59 -0
- data/docs/modules/develop/pages/guide_git_conventions.adoc +75 -0
- data/docs/modules/develop/pages/guide_github_projects.adoc +42 -0
- data/docs/modules/develop/pages/guide_semver.adoc +7 -0
- data/docs/{advanced/how_to_fix_metrics.md → modules/develop/pages/how_to_fix_metrics.adoc} +76 -59
- data/docs/modules/develop/pages/machine_translations.adoc +42 -0
- data/docs/modules/develop/pages/managing_translations_i18n.adoc +24 -0
- data/docs/modules/develop/pages/maps.adoc +499 -0
- data/docs/modules/develop/pages/metrics.adoc +119 -0
- data/docs/{advanced/modules.md → modules/develop/pages/modules.adoc} +16 -6
- data/docs/{advanced/newsletter_templates.md → modules/develop/pages/newsletter_templates.adoc} +12 -10
- data/docs/{advanced/notifications.md → modules/develop/pages/notifications.adoc} +40 -38
- data/docs/{advanced/open-data.md → modules/develop/pages/open-data.adoc} +4 -3
- data/docs/modules/develop/pages/permissions.adoc +92 -0
- data/docs/{advanced/profiling.md → modules/develop/pages/profiling.adoc} +15 -12
- data/docs/modules/develop/pages/releases.adoc +148 -0
- data/docs/modules/develop/pages/reportable.adoc +31 -0
- data/docs/modules/develop/pages/security.adoc +33 -0
- data/docs/{advanced/share_tokens.md → modules/develop/pages/share_tokens.adoc} +18 -14
- data/docs/{advanced/templates.md → modules/develop/pages/templates.adoc} +14 -12
- data/docs/{advanced/testing.md → modules/develop/pages/testing.adoc} +21 -20
- data/docs/{advanced/activity_log.md → modules/develop/pages/traceable.adoc} +31 -26
- data/docs/modules/develop/pages/turbolinks.adoc +7 -0
- data/docs/{advanced/view_hooks.md → modules/develop/pages/view_hooks.adoc} +29 -23
- data/docs/modules/develop/pages/view_models_aka_cells.adoc +105 -0
- data/docs/modules/install/pages/checklist.adoc +39 -0
- data/docs/modules/install/pages/index.adoc +148 -0
- data/docs/{manual-installation.md → modules/install/pages/manual.adoc} +54 -42
- data/docs/modules/install/pages/update.adoc +95 -0
- data/docs/{services/activejob.md → modules/services/pages/activejob.adoc} +3 -3
- data/docs/modules/services/pages/elections_bulletin_board.adoc +52 -0
- data/docs/{services/etherpad.md → modules/services/pages/etherpad.adoc} +15 -12
- data/docs/modules/services/pages/maps.adoc +311 -0
- data/docs/modules/services/pages/smtp.adoc +10 -0
- data/docs/modules/services/pages/social_providers.adoc +122 -0
- data/lib/decidim/gem_manager.rb +5 -5
- data/lib/decidim/version.rb +1 -1
- metadata +137 -100
- data/README.md +0 -157
- data/docs/advanced/add_authorizable_action.md +0 -63
- data/docs/advanced/adding_fixtures_aka_dummy_content.md +0 -9
- data/docs/advanced/data-picker.md +0 -83
- data/docs/advanced/deploy.md +0 -9
- data/docs/advanced/how_to_create_a_module.md +0 -9
- data/docs/advanced/machine_translation_service.md +0 -12
- data/docs/advanced/managing_translations_i18n.md +0 -24
- data/docs/advanced/metrics.md +0 -114
- data/docs/advanced/permissions.md +0 -23
- data/docs/advanced/releases.md +0 -114
- data/docs/advanced/tradeoffs.md +0 -14
- data/docs/advanced/view_models_aka_cells.md +0 -99
- data/docs/checklist.md +0 -55
- data/docs/customization/authorizations.md +0 -5
- data/docs/customization/images.md +0 -7
- data/docs/customization/javascript.md +0 -9
- data/docs/customization/machine_translations.md +0 -30
- data/docs/customization/maps.md +0 -610
- data/docs/customization/oauth.md +0 -50
- data/docs/customization/styles.md +0 -11
- data/docs/customization/texts.md +0 -27
- data/docs/customization/users_registration_mode.md +0 -17
- data/docs/development_guide.md +0 -166
- data/docs/getting_started.md +0 -191
- data/docs/possible_flows_for_proposal.png +0 -0
- data/docs/services/analytics.md +0 -23
- data/docs/services/elections_bulletin_board.md +0 -38
- data/docs/services/maps.md +0 -362
- data/docs/services/social_providers.md +0 -98
Binary file
|
data/docs/services/analytics.md
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# Analytics
|
2
|
-
|
3
|
-
Decidim, for a matter of privacy, doesn't come bundled (or associated with) any analytics service, leaving that part to the developer.
|
4
|
-
|
5
|
-
Adding analytics is quite easy. We've set up a partial in place for that. Just create a view in your app under `app/views/layouts/decidim/_head_extra.html.erb` with your content.
|
6
|
-
|
7
|
-
Here's an example for Piwik:
|
8
|
-
|
9
|
-
```javascript
|
10
|
-
<script type="text/javascript">
|
11
|
-
var _paq = _paq || [];
|
12
|
-
// tracker methods like "setCustomDimension" should be called before "trackPageView"
|
13
|
-
_paq.push(['trackPageView']);
|
14
|
-
_paq.push(['enableLinkTracking']);
|
15
|
-
(function() {
|
16
|
-
var u="?????";
|
17
|
-
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
18
|
-
_paq.push(['setSiteId', '?']);
|
19
|
-
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
20
|
-
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
21
|
-
})();
|
22
|
-
</script>
|
23
|
-
```
|
@@ -1,38 +0,0 @@
|
|
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.
|
data/docs/services/maps.md
DELETED
@@ -1,362 +0,0 @@
|
|
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">© 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
|
@@ -1,98 +0,0 @@
|
|
1
|
-
# Social providers integration
|
2
|
-
|
3
|
-
If you want to enable sign up through social providers like Facebook you will need to generate app credentials and store them in one of the following places:
|
4
|
-
|
5
|
-
- In the Rails secrets file: `config/secrets.yml`. This configuration will be shared by all tenants.
|
6
|
-
- In the site configuration (ex. system/organizations/1/edit). This configuration overrides the one in `config/secrets.yml`.
|
7
|
-
|
8
|
-
Take into account that for a social provider integration appearing in the organization form, it must also be defined in `config/secrets.yml` (but the values are optional). For example:
|
9
|
-
|
10
|
-
```yaml
|
11
|
-
twitter:
|
12
|
-
enabled: false # disabled by default, unless activated in the organization
|
13
|
-
api_key:
|
14
|
-
api_secret:
|
15
|
-
```
|
16
|
-
|
17
|
-
## Facebook
|
18
|
-
|
19
|
-
1. Navigate to [Facebook Developers Page](https://developers.facebook.com/)
|
20
|
-
1. Follow the "Add a New App" link.
|
21
|
-
1. Click the "Website" option.
|
22
|
-
1. Fill in your application name and click "Create New Facebook App ID" button.
|
23
|
-
1. Fill in the contact email info and category.
|
24
|
-
1. Validate the captcha.
|
25
|
-
1. Ignore the source code and fill in the URL field with `https://YOUR_DECIDIM_HOST/users/auth/facebook/callback`
|
26
|
-
1. Navigate to the application dashboard and copy the APP_ID and APP_SECRET
|
27
|
-
1. Paste credentials in `config/secrets.yml` or in the organization configuration. Ensure the `enabled` attribute is `true`.
|
28
|
-
|
29
|
-
## Twitter
|
30
|
-
|
31
|
-
1. Navigate to [Twitter Developers Page](https://dev.twitter.com/)
|
32
|
-
1. Follow the "My apps" link.
|
33
|
-
1. Click the "Create New App" button.
|
34
|
-
1. Fill in the `Name`, `Description` fields.
|
35
|
-
1. Fill in the `Website` and `Callback URL` fields with the same value. If you are working on a development app you need to use `http://127.0.0.1:3000/` instead of `http://localhost:3000/`.
|
36
|
-
1. Check the 'Developer Agreement' checkbox and click the 'Create your Twitter application' button.
|
37
|
-
1. Navigate to the "Keys and Access Tokens" tab and copy the API_KEY and API_SECRET.
|
38
|
-
1. (Optional) Navigate to the "Permissions" tab and check the "Request email addresses from users" checkbox.
|
39
|
-
1. Paste credentials in `config/secrets.yml` or in the organization configuration. Ensure the `enabled` attribute is `true`.
|
40
|
-
|
41
|
-
## Google
|
42
|
-
|
43
|
-
1. Navigate to [Google Developers Page](https://console.developers.google.com)
|
44
|
-
1. Follow the 'Create projecte' link.
|
45
|
-
1. Fill in the name of your app.
|
46
|
-
1. Navigate to the projecte dashboard and click on "Enable API"
|
47
|
-
1. Click on `Google+ API` and then "Enable"
|
48
|
-
1. Navigate to the project credentials page and click on `OAuth consent screen`.
|
49
|
-
1. Fill in the `Product name` field
|
50
|
-
1. Click on `Credentials` tab and click on "Create credentials" button. Select `OAuth client ID`.
|
51
|
-
1. Select `Web applications`. Fill in the `Authorized Javascript origins` with your url. Then fill in the `Authorized redirect URIs` with your url and append the path `/users/auth/google_oauth2/callback`.
|
52
|
-
1. Copy the CLIENT_ID AND CLIENT_SECRET
|
53
|
-
1. Paste credentials in `config/secrets.yml` or in the organization configuration. Ensure the `enabled` attribute is `true`.
|
54
|
-
|
55
|
-
## Custom providers
|
56
|
-
|
57
|
-
- You can define your own provider, to allow users from other external applications to login into Decidim.
|
58
|
-
- The provider should implement an [OmniAuth](https://github.com/omniauth/omniauth) strategy.
|
59
|
-
- You can use any of the [existing OnmiAuth strategies](https://github.com/omniauth/omniauth/wiki/List-of-Strategies).
|
60
|
-
- Or you can create a new strategy, as the [Decidim OmniAuth Strategy](https://github.com/decidim/omniauth-decidim). This strategy allow users from a Decidim instance to login in other Decidim instance. For example, this strategy is used to allow [decidim.barcelona](https://decidim.barcelona) users to log into [meta.decidim.barcelona](https://meta.decidim.barcelona).
|
61
|
-
- Once you have defined your strategy, you can configure it in the `config/secrets.yml` or in the organization configuration, as it is done for the built-in providers.
|
62
|
-
- By default, Decidim will search in its icons library for an icon named as the provider. You can change this adding an `icon` or `icon_path` attribute to the provider configuration. The `icon` attribute sets the icon name to look for in the Decidim's icons library. The `icon_path` attribute sets the route to the image that should be used.
|
63
|
-
- Here is an example of the configuration section for the Decidim strategy, using an icon located on the application's `app/assets/images` folder:
|
64
|
-
|
65
|
-
```yaml
|
66
|
-
decidim:
|
67
|
-
enabled: true
|
68
|
-
client_id: <%= ENV["DECIDIM_CLIENT_ID"] %>
|
69
|
-
client_secret: <%= ENV["DECIDIM_CLIENT_SECRET"] %>
|
70
|
-
site_url: <%= ENV["DECIDIM_SITE_URL"] %>
|
71
|
-
icon_path: decidim-logo.svg
|
72
|
-
```
|
73
|
-
|
74
|
-
- You will need a custom initializer for your provider in order to pass the proper params to the OmniaAuth Builder.
|
75
|
-
|
76
|
-
An example of custom initializer could be written as:
|
77
|
-
|
78
|
-
```ruby
|
79
|
-
#config/initializers/omniauth_myprovider.rb
|
80
|
-
if Rails.application.secrets.dig(:omniauth, :myprovider).present?
|
81
|
-
Rails.application.config.middleware.use OmniAuth::Builder do
|
82
|
-
provider(
|
83
|
-
:myprovider,
|
84
|
-
setup: ->(env) {
|
85
|
-
request = Rack::Request.new(env)
|
86
|
-
organization = Decidim::Organization.find_by(host: request.host)
|
87
|
-
provider_config = organization.enabled_omniauth_providers[:myprovider]
|
88
|
-
env["omniauth.strategy"].options[:client_id] = provider_config[:client_id]
|
89
|
-
env["omniauth.strategy"].options[:client_secret] = provider_config[:client_secret]
|
90
|
-
env["omniauth.strategy"].options[:site] = provider_config[:site_url]
|
91
|
-
},
|
92
|
-
scope: :public
|
93
|
-
)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
```
|
97
|
-
|
98
|
-
The custom provider may have different configuration options, instead of `client_id`, `client_secret` and `site`.
|