decidim 0.23.5 → 0.24.2
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 +135 -98
- 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
@@ -1,25 +1,26 @@
|
|
1
|
-
|
1
|
+
= Manual installation tutorial
|
2
2
|
|
3
|
-
|
3
|
+
== Step by step
|
4
4
|
|
5
5
|
In order to develop on decidim, you'll need:
|
6
6
|
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
7
|
+
* *Git* 2.15+
|
8
|
+
* *PostgreSQL* 9.5+
|
9
|
+
* *Ruby* 2.5.0 (2.3+ should work just fine, but that's the version we test against)
|
10
|
+
* *NodeJS* 9.x.x
|
11
|
+
* *ImageMagick*
|
12
|
+
* *Chrome* browser and https://sites.google.com/a/chromium.org/chromedriver/[chromedriver].
|
13
13
|
|
14
|
-
We're starting with an Ubuntu 16.04 LTS. This is an opinionated guide and YMMV, so if you're free to use the technology that you fell most comfortable on. If you have any doubts and you're blocked you can go and ask on
|
14
|
+
We're starting with an Ubuntu 16.04 LTS. This is an opinionated guide and YMMV, so if you're free to use the technology that you fell most comfortable on. If you have any doubts and you're blocked you can go and ask on https://gitter.im/decidim/decidim[our Gitter]. We recommend that you follow some Ruby on Rails tutorials (like http://guides.rubyonrails.org/getting_started.html[Getting Started with Ruby on Rails]) and have some knowledge on how gems and engines work.
|
15
15
|
|
16
16
|
On this tutorial we'll see how to install rbenv, PostgreSQL and Decidim, and how to configure everything together.
|
17
17
|
|
18
|
-
|
18
|
+
=== Installing rbenv
|
19
19
|
|
20
|
-
First we're going to install rbenv, for managing various ruby versions. We're following the guide from
|
20
|
+
First we're going to install rbenv, for managing various ruby versions. We're following the guide from https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-16-04[DigitalOcean]. You could also use https://rvm.io/[rvm] as an alternative on this step. On these instruction we're using the latest ruby published version at the moment (2.5.3), but you should check this out on https://www.ruby-lang.org/en/downloads/[Ruby official website].
|
21
21
|
|
22
|
-
|
22
|
+
[source,bash]
|
23
|
+
----
|
23
24
|
sudo apt update
|
24
25
|
sudo apt install -y build-essential autoconf bison libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev libicu-dev
|
25
26
|
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
|
@@ -31,83 +32,92 @@ rbenv install 2.5.3
|
|
31
32
|
rbenv global 2.5.3
|
32
33
|
echo "gem: --no-document" > ~/.gemrc
|
33
34
|
gem install bundler
|
34
|
-
|
35
|
+
----
|
35
36
|
|
36
|
-
|
37
|
+
=== Installing PostgreSQL
|
37
38
|
|
38
39
|
Now we're going to install PostgreSQL for the database:
|
39
40
|
|
40
|
-
|
41
|
+
[source,bash]
|
42
|
+
----
|
41
43
|
sudo apt install -y postgresql libpq-dev
|
42
44
|
sudo -u postgres psql -c "CREATE USER decidim_app WITH SUPERUSER CREATEDB NOCREATEROLE PASSWORD 'thepassword'"
|
43
|
-
|
45
|
+
----
|
44
46
|
|
45
47
|
You need to change the password (on this example is "thepassword") and save it somewhere to configure it later with the application.
|
46
48
|
|
47
|
-
|
49
|
+
=== Installing Decidim
|
48
50
|
|
49
51
|
Next, we need to install the `decidim` gem:
|
50
52
|
|
51
|
-
|
53
|
+
[source,bash]
|
54
|
+
----
|
52
55
|
gem install bootsnap
|
53
56
|
gem install listen
|
54
57
|
gem install decidim
|
55
|
-
|
58
|
+
----
|
56
59
|
|
57
60
|
Afterwards, we can create an application with the nice `decidim` executable, where `decidim_application` is your application name (ie decidim.barcelona):
|
58
61
|
|
59
|
-
|
62
|
+
[source,bash]
|
63
|
+
----
|
60
64
|
decidim decidim_application
|
61
65
|
cd decidim_application
|
62
|
-
|
66
|
+
----
|
63
67
|
|
64
68
|
We recommend that you save it all on Git.
|
65
69
|
|
66
|
-
|
70
|
+
[source,bash]
|
71
|
+
----
|
67
72
|
git init .
|
68
73
|
git commit -m "Initial commit. Generated with Decidim 0.X https://decidim.org"
|
69
|
-
|
74
|
+
----
|
70
75
|
|
71
|
-
|
76
|
+
=== Configure the database
|
72
77
|
|
73
|
-
You need to modify your secrets (see `config/database.yml`). For this you can use
|
78
|
+
You need to modify your secrets (see `config/database.yml`). For this you can use https://github.com/laserlemon/figaro[figaro], https://github.com/bkeepers/dotenv[dotenv] or https://github.com/rbenv/rbenv-vars[rbenv-vars]. You should always be careful of not uploading your plain secrets on git or your version control system. You can also upload the encrypted secrets, using the sekrets gem or if you're on Ruby on Rails greater than 5.1 you can do it natively.
|
74
79
|
|
75
80
|
For instance, for working with figaro, add this to your `Gemfile`:
|
76
81
|
|
77
|
-
|
82
|
+
[source,ruby]
|
83
|
+
----
|
78
84
|
gem "figaro"
|
79
|
-
|
85
|
+
----
|
80
86
|
|
81
87
|
Then install it:
|
82
88
|
|
83
|
-
|
89
|
+
[source,bash]
|
90
|
+
----
|
84
91
|
bundle install
|
85
92
|
bundle exec figaro install
|
86
|
-
|
93
|
+
----
|
87
94
|
|
88
95
|
Next add this to your `config/application.yml`, using the setup the PostgreSQL database name, user and password that you configure before.
|
89
96
|
|
90
|
-
|
97
|
+
[source,yaml]
|
98
|
+
----
|
91
99
|
DATABASE_HOST: localhost
|
92
100
|
DATABASE_USERNAME: decidim_app
|
93
101
|
DATABASE_PASSWORD: your_password
|
94
|
-
|
102
|
+
----
|
95
103
|
|
96
104
|
Finally, save it all to git:
|
97
105
|
|
98
|
-
|
106
|
+
[source,bash]
|
107
|
+
----
|
99
108
|
git add .
|
100
109
|
git commit -m "Adds figaro configuration management"
|
101
|
-
|
110
|
+
----
|
102
111
|
|
103
|
-
|
112
|
+
=== Initializing your app for local development
|
104
113
|
|
105
114
|
We should now setup your database:
|
106
115
|
|
107
|
-
|
116
|
+
[source,bash]
|
117
|
+
----
|
108
118
|
bin/rails db:create db:migrate
|
109
119
|
bin/rails db:seed
|
110
|
-
|
120
|
+
----
|
111
121
|
|
112
122
|
This will also create some default data so you can start testing the app:
|
113
123
|
|
@@ -118,18 +128,20 @@ This will also create some default data so you can start testing the app:
|
|
118
128
|
|
119
129
|
This data won't be created in production environments, if you still want to do it, run:
|
120
130
|
|
121
|
-
|
131
|
+
[source,bash]
|
132
|
+
----
|
122
133
|
SEED=true rails db:setup
|
123
|
-
|
134
|
+
----
|
124
135
|
|
125
|
-
|
136
|
+
==== Notes
|
126
137
|
|
127
138
|
When you run `bin/rails db:migrate` you should see a lot of output. If you don't, or if you run into errors seeding your database, try runnning `bin/rake decidim:upgrade` before.
|
128
139
|
|
129
140
|
You can now start your server!
|
130
141
|
|
131
|
-
|
142
|
+
[source,bash]
|
143
|
+
----
|
132
144
|
bin/rails s
|
133
|
-
|
145
|
+
----
|
134
146
|
|
135
|
-
Visit
|
147
|
+
Visit http://localhost:3000 to see your app running. 🎉 🎉
|
@@ -0,0 +1,95 @@
|
|
1
|
+
= Updating Decidim
|
2
|
+
|
3
|
+
IMPORTANT: This section was initially copied from https://platoniq.github.io/decidim-install/decidim-update/[Platoniq's Guide]
|
4
|
+
|
5
|
+
Because Decidim is a gem in our system, to update it we will have to edit our `Gemfile` and specify the new version number.
|
6
|
+
|
7
|
+
To keep our system up to date, we can visit the page https://github.com/decidim/decidim/releases and compare with our `Gemfile`. See if the lines specifying the gem called "decidim-something" are followed by the number corresponding to the latest release:
|
8
|
+
|
9
|
+
[source,ruby]
|
10
|
+
----
|
11
|
+
gem "decidim", "0.20.1"
|
12
|
+
gem "decidim-conferences", "0.20.1"
|
13
|
+
gem "decidim-consultations", "0.20.1"
|
14
|
+
gem "decidim-initiatives", "0.20.1"
|
15
|
+
|
16
|
+
gem "decidim-dev", "0.20.1"
|
17
|
+
----
|
18
|
+
|
19
|
+
For example, if the latest release is 0.16 we could decide to update.
|
20
|
+
|
21
|
+
To update, usually requires only to change the old version number on these gems to the new one. For instance, previous example should be:
|
22
|
+
|
23
|
+
[source,ruby]
|
24
|
+
----
|
25
|
+
gem "decidim", "0.21"
|
26
|
+
gem "decidim-conferences", "0.21"
|
27
|
+
gem "decidim-consultations", "0.21"
|
28
|
+
gem "decidim-initiatives", "0.21"
|
29
|
+
|
30
|
+
gem "decidim-dev", "0.21"
|
31
|
+
----
|
32
|
+
|
33
|
+
After doing that, you need to execute these commands:
|
34
|
+
|
35
|
+
[source,console]
|
36
|
+
----
|
37
|
+
bundle update decidim
|
38
|
+
bin/rails decidim:upgrade
|
39
|
+
bin/rails db:migrate
|
40
|
+
----
|
41
|
+
|
42
|
+
In theory, that would be all. However, you need to be careful in certain situations, specially if your copy of Decidim has many code modifications. We'd recommend to always test the upgrade following Ruby on Rails best practices: working with development mode in localhost, deploying to a staging/preproduction server to test it manually (specially your modifications) and finally deploying to production. As an alternative you can test the upgrade in a separate machine with the same configuration (If using Digitalocean you can create an snapshot of the server, tested the update, and then remove it, similar process on other providers).
|
43
|
+
|
44
|
+
== From git repositories
|
45
|
+
|
46
|
+
For managing the gems we use the standard Rails gem called Bundler, where you can also point to https://bundler.io/v2.1/guides/git.html[git repositories and branches]. This is specially useful if you want to try an unreleased version, then you can do so by pointing to the release branch.
|
47
|
+
|
48
|
+
[source,ruby]
|
49
|
+
----
|
50
|
+
gem "decidim", git: "https://github.com/decidim/decidim", branch: "release/0.22-stable"
|
51
|
+
gem "decidim-conferences", git: "https://github.com/decidim/decidim", branch: "release/0.22-stable"
|
52
|
+
gem "decidim-consultations", git: "https://github.com/decidim/decidim", branch: "release/0.22-stable"
|
53
|
+
gem "decidim-initiatives", git: "https://github.com/decidim/decidim", branch: "release/0.22-stable"
|
54
|
+
|
55
|
+
gem "decidim-dev", git: "https://github.com/decidim/decidim", branch: "release/0.22-stable"
|
56
|
+
----
|
57
|
+
|
58
|
+
== DRY
|
59
|
+
|
60
|
+
You can also work with variables in your Gemfile so you can keep it DRY (Don't Repeat Yourself):
|
61
|
+
|
62
|
+
[source,ruby]
|
63
|
+
----
|
64
|
+
DECIDIM_VERSION = "0.21"
|
65
|
+
|
66
|
+
gem "decidim", DECIDIM_VERSION
|
67
|
+
gem "decidim-conferences", DECIDIM_VERSION
|
68
|
+
gem "decidim-consultations", DECIDIM_VERSION
|
69
|
+
gem "decidim-initiatives", DECIDIM_VERSION
|
70
|
+
|
71
|
+
gem "decidim-dev", DECIDIM_VERSION
|
72
|
+
----
|
73
|
+
|
74
|
+
or
|
75
|
+
|
76
|
+
[source,console]
|
77
|
+
----
|
78
|
+
DECIDIM_VERSION = { git: 'https://github.com/decidim/decidim.git', branch: 'release/0.22-stable' }
|
79
|
+
|
80
|
+
gem "decidim", DECIDIM_VERSION
|
81
|
+
gem "decidim-conferences", DECIDIM_VERSION
|
82
|
+
gem "decidim-consultations", DECIDIM_VERSION
|
83
|
+
gem "decidim-initiatives", DECIDIM_VERSION
|
84
|
+
|
85
|
+
gem "decidim-dev", DECIDIM_VERSION
|
86
|
+
----
|
87
|
+
|
88
|
+
|
89
|
+
[discrete]
|
90
|
+
== Recommendations
|
91
|
+
|
92
|
+
. Make a full backup of the database before updating, just in case something unexpected happens.
|
93
|
+
. If you are more than update away. Always update from one version to the immediately next one and then repeat the process until you are up to date.
|
94
|
+
. Always check the instructions for a certain version upgrade in https://github.com/decidim/decidim/releases. Some releases require to perform certain actions as they may change some database structures. Follow that instructions if you are affected.
|
95
|
+
. Check also the file https://github.com/decidim/decidim/blob/develop/CHANGELOG.md It may have relevant information for updates between versions.
|
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
= ActiveJob
|
2
2
|
|
3
|
-
For some kind of actions to work on production (for instance, sending emails on user registration) you need to configure an
|
3
|
+
For some kind of actions to work on production (for instance, sending emails on user registration) you need to configure an http://edgeguides.rubyonrails.org/active_job_basics.html[ActiveJob] backend on your application.
|
4
4
|
|
5
|
-
If you don't want to introduce any other external dependencies for `decidim` (such as `redis`), you can use the `delayed_job` backend. That setup only depends on an underlying database which is already a requirement for `decidim` to work. Add the
|
5
|
+
If you don't want to introduce any other external dependencies for `decidim` (such as `redis`), you can use the `delayed_job` backend. That setup only depends on an underlying database which is already a requirement for `decidim` to work. Add the https://github.com/collectiveidea/delayed_job/[delayed_job] gem to your `Gemfile` and follow the instructions in its readme to set it up.
|
6
6
|
|
7
7
|
However, Decidim is agnostic on which kind of backend do you use, so feel free to set up the backend (ie `sidekiq`, `resque`, etc) you like the most.
|
@@ -0,0 +1,52 @@
|
|
1
|
+
= Elections Bulletin Board
|
2
|
+
|
3
|
+
[CAUTION]
|
4
|
+
====
|
5
|
+
This is a work in progress and is not fully working yet.
|
6
|
+
====
|
7
|
+
|
8
|
+
In order to celebrate https://en.wikipedia.org/wiki/End-to-end_auditable_voting_systems[End-to-end auditable votings] using the Elections module, you will need to connect your Decidim instance with an instance of the https://github.com/decidim/decidim-bulletin-board/[Decidim Bulletin Board application], preferably run by an independent organization.
|
9
|
+
|
10
|
+
== Identification pair of keys generation
|
11
|
+
|
12
|
+
The first step needed to setup the connection is to generate an a pair of keys to identify the application against the Bulletin Board.
|
13
|
+
This can be done running the following rake task in your application environment:
|
14
|
+
|
15
|
+
[source,sh]
|
16
|
+
----
|
17
|
+
bundle exec rake decidim_elections:generate_identification_keys
|
18
|
+
----
|
19
|
+
|
20
|
+
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. Together with the key, send your *Authority name* to the Bulletin Board administrator and store its value on the environment variable `BULLETIN_BOARD_AUTHORITY_NAME`.
|
21
|
+
|
22
|
+
After that, copy the private key and store that value on the environment variable `BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY`.
|
23
|
+
|
24
|
+
Ensure that the private key is not lost between deployments and servers reboots and that only can be accessed by the application.
|
25
|
+
|
26
|
+
== Configuration of the Bulletin Board application
|
27
|
+
|
28
|
+
The Bulletin Board administrator will store the received public key in their server and will send you back an API key.
|
29
|
+
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.
|
30
|
+
|
31
|
+
The following YAML snippet with all the defined environment variables should be used in the `default` block of your application `config/secrets.yml` file.
|
32
|
+
Maybe this is already done, as it was included in the Decidim applications generator during the development of the Elections module.
|
33
|
+
|
34
|
+
[source,yaml]
|
35
|
+
----
|
36
|
+
bulletin_board:
|
37
|
+
identification_private_key: <%= ENV["BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY"] %>
|
38
|
+
server: <%= ENV["BULLETIN_BOARD_SERVER"] %>
|
39
|
+
api_key: <%= ENV["BULLETIN_BOARD_API_KEY"] %>
|
40
|
+
number_of_trustees: <%= ENV["BULLETIN_BOARD_NUMBER_OF_TRUSTEES"] %>
|
41
|
+
authority_name: <%= ENV["BULLETIN_BOARD_AUTHORITY_NAME"] %>
|
42
|
+
scheme:
|
43
|
+
name: <%= ENV["BULLETIN_BOARD_SCHEME_NAME"] %>
|
44
|
+
parameters:
|
45
|
+
quorum: <%= ENV["BULLETIN_BOARD_SCHEME_QUORUM"] %>
|
46
|
+
----
|
47
|
+
|
48
|
+
After restarting the Decidim instance, administrator users will be able to create elections on the configured Bulletin Board.
|
49
|
+
|
50
|
+
== Scheduled tasks
|
51
|
+
|
52
|
+
A *crontab* line must be added to your server to be able to open and close the Ballot Box for the elections automatically. You could use https://github.com/javan/whenever[Whenever] to manage it directly from the APP. You probably want to schedule a `bundle exec rake decidim_elections:scheduled_tasks` every hour.
|
@@ -1,51 +1,54 @@
|
|
1
|
-
|
1
|
+
= Etherpad
|
2
2
|
|
3
3
|
On some cases, users need to have near real time collaborative writing, for instance for having the minutes on a physical meeting.
|
4
4
|
|
5
5
|
To ease online/offline participation, Decidim can be integrated with Etherpad so meetings can have their own pads.
|
6
6
|
|
7
|
-
|
7
|
+
== Integration
|
8
8
|
|
9
9
|
In order to use it you need to have your own Etherpad deployment, you can do it
|
10
10
|
with the Docker compose using the provided `docker-compose-etherpad.yml`.
|
11
11
|
|
12
12
|
You should edit that file to configure the environment variables and then run:
|
13
13
|
|
14
|
-
|
14
|
+
[source,sh]
|
15
|
+
----
|
15
16
|
docker swarm init # just one time
|
16
17
|
|
17
18
|
docker stack deploy --compose-file docker-compose-etherpad.yml decidim-etherpad
|
18
|
-
|
19
|
+
----
|
19
20
|
|
20
21
|
After deploying Etherpad, you should get back to Decidim's server and set the Etherpad host and API Key at
|
21
22
|
`config/initializers/decidim.rb` and `config/secrets.yml`
|
22
23
|
|
23
24
|
An example snippet in `config/initializers/decidim.rb` may be:
|
24
25
|
|
25
|
-
|
26
|
+
[source,ruby]
|
27
|
+
----
|
26
28
|
config.etherpad = {
|
27
29
|
server: Rails.application.secrets.etherpad[:server],
|
28
30
|
api_key: Rails.application.secrets.etherpad[:api_key],
|
29
31
|
api_version: Rails.application.secrets.etherpad[:api_version]
|
30
32
|
}
|
31
|
-
|
33
|
+
----
|
32
34
|
|
33
35
|
and then in `config/secrets.yml`:
|
34
36
|
|
35
|
-
|
37
|
+
[source,yaml]
|
38
|
+
----
|
36
39
|
etherpad:
|
37
40
|
server: <%= ENV["ETHERPAD_SERVER"] %>
|
38
41
|
api_key: <%= ENV["ETHERPAD_API_KEY"] %>
|
39
42
|
api_version: <%= ENV["ETHERPAD_API_VERSION"] %>
|
40
|
-
|
43
|
+
----
|
41
44
|
|
42
|
-
|
45
|
+
== How is Etherpad Lite integrated in Meetings?
|
43
46
|
|
44
47
|
To better understand this feature, the final idea is to have the three moments of a meeting covered on Decidim itself by default:
|
45
48
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
* *Before the meeting*, you let know that the meeting is going to happen, where, when and what is going to be discussed
|
50
|
+
* *During the meeting*, notes can be taken on a collaborative way
|
51
|
+
* *After the meeting*, you upload the notes, minutes, metadata and/or pictures to have a record on what was discussed
|
49
52
|
|
50
53
|
Pad creation can be enabled by administrators in each `Meetings` component. When enabled, the public view of a Meeting renders an iframe which encapsulates the integrated Pad. This Pad is automatically created before rendering, so there's nothing the user or the administrators has to do to see the Pad.
|
51
54
|
|
@@ -0,0 +1,311 @@
|
|
1
|
+
= Maps and geocoding
|
2
|
+
|
3
|
+
Decidim has the ability to geocode proposals and meetings and display them on a map.
|
4
|
+
Decidim has built-in support for the following map service providers:
|
5
|
+
|
6
|
+
* http://here.com[HERE Maps] (Recommended)
|
7
|
+
** Supports map tiles, static map images, geocoding and geocoding autocompletion
|
8
|
+
** Easy to get started with, comes with a rather generous free plan
|
9
|
+
** <<configuring-here-maps,Configuring HERE Maps>>
|
10
|
+
* https://wiki.openstreetmap.org/wiki/Commercial_OSM_Software_and_Services[Open Street Maps based services]
|
11
|
+
** Please pick a service provider that provides all needed services (map tiles, static map images, geocoding and geocoding autocompletion)
|
12
|
+
** We can't use the OSM's own services by their https://operations.osmfoundation.org/policies/tiles/[tile usage policy].
|
13
|
+
** In case your service provider does not offer static map images, Decidim will use the dynamic map tiles to generate a similar map element.
|
14
|
+
** As an alternative, you may also want to use your own self-hosted map servers (see <<hosting-your-own-map-services,Hosting your own map services>> for more information)
|
15
|
+
** <<configuring-open-street-maps-based-service-providers,Configuring Open Street Maps based service providers>>
|
16
|
+
|
17
|
+
If you want to integrate Decidim to some other map service provider, read how to xref:/docs/customization/maps.adoc[write your own integration code] for that.
|
18
|
+
|
19
|
+
== Configuring maps and geocoding
|
20
|
+
|
21
|
+
After generating your app, you'll see that your `config/initializers/decidim.rb` file includes commented code about map services:
|
22
|
+
|
23
|
+
[source,ruby]
|
24
|
+
----
|
25
|
+
# Map and Geocoder configuration
|
26
|
+
# config.maps = {
|
27
|
+
# ...
|
28
|
+
# }
|
29
|
+
----
|
30
|
+
|
31
|
+
The initializer comments provide examples for the services mentioned in this documentation.
|
32
|
+
Please refer to the section below for the service you have registered for the maps functionality.
|
33
|
+
|
34
|
+
If you want to enable geocoding in your app:
|
35
|
+
|
36
|
+
. Select a service provider for the maps functionality and register an account with that provider
|
37
|
+
. Uncomment or add the code under the selected service provider in your `config/initializers/decidim.rb`.
|
38
|
+
. Make sure your `config/secrets.yml` file has the needed section (it should be added by the generator automatically).
|
39
|
+
. Configure the service provider credentials in `config/secrets.yml` and refer to them from your `config/initializers/decidim.rb`.
|
40
|
+
. If you had your Rails server running, restart it so the changes apply.
|
41
|
+
|
42
|
+
=== Configuring HERE Maps
|
43
|
+
|
44
|
+
Use the following configuration for HERE Maps:
|
45
|
+
|
46
|
+
`config/initializers/decidim.rb`:
|
47
|
+
|
48
|
+
[source,ruby]
|
49
|
+
----
|
50
|
+
# Map and Geocoder configuration
|
51
|
+
# == HERE Maps ==
|
52
|
+
config.maps = {
|
53
|
+
provider: :here,
|
54
|
+
api_key: Rails.application.secrets.maps[:api_key],
|
55
|
+
static: { url: "https://image.maps.ls.hereapi.com/mia/1.6/mapview" }
|
56
|
+
}
|
57
|
+
----
|
58
|
+
|
59
|
+
`config/secrets.yml`:
|
60
|
+
|
61
|
+
[source,yaml]
|
62
|
+
----
|
63
|
+
default: &default
|
64
|
+
# ...
|
65
|
+
maps:
|
66
|
+
api_key: <%= ENV["MAPS_API_KEY"] %>
|
67
|
+
----
|
68
|
+
|
69
|
+
`.env`:
|
70
|
+
|
71
|
+
[source,bash]
|
72
|
+
----
|
73
|
+
MAPS_API_KEY=your_api_key_here
|
74
|
+
----
|
75
|
+
|
76
|
+
=== Configuring Open Street Maps based service providers
|
77
|
+
|
78
|
+
Use the following configuration for Open Street Maps based service providers:
|
79
|
+
|
80
|
+
`config/initializers/decidim.rb`:
|
81
|
+
|
82
|
+
[source,ruby]
|
83
|
+
----
|
84
|
+
# Map and Geocoder configuration
|
85
|
+
# == OpenStreetMap (OSM) services ==
|
86
|
+
config.maps = {
|
87
|
+
provider: :osm,
|
88
|
+
api_key: Rails.application.secrets.maps[:api_key],
|
89
|
+
dynamic: {
|
90
|
+
tile_layer: {
|
91
|
+
url: "https://tiles.example.org/{z}/{x}/{y}.png?key={apiKey}",
|
92
|
+
api_key: true,
|
93
|
+
attribution: %(
|
94
|
+
<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a> contributors
|
95
|
+
).strip
|
96
|
+
# Translatable attribution:
|
97
|
+
# attribution: -> { I18n.t("tile_layer_attribution") }
|
98
|
+
}
|
99
|
+
},
|
100
|
+
# static: { url: "https://staticmap.example.org/" }, # optional
|
101
|
+
geocoding: { host: "nominatim.example.org", use_https: true },
|
102
|
+
autocomplete: { url: "https://photon.example.org/api/" }
|
103
|
+
}
|
104
|
+
----
|
105
|
+
|
106
|
+
`config/secrets.yml`:
|
107
|
+
|
108
|
+
[source,yaml]
|
109
|
+
----
|
110
|
+
default: &default
|
111
|
+
# ...
|
112
|
+
maps:
|
113
|
+
api_key: <%= ENV["MAPS_API_KEY"] %>
|
114
|
+
----
|
115
|
+
|
116
|
+
`.env`:
|
117
|
+
|
118
|
+
[source,bash]
|
119
|
+
----
|
120
|
+
MAPS_API_KEY=your_api_key_here
|
121
|
+
----
|
122
|
+
|
123
|
+
For further information, see the service provider's documentation or take a look at the <<hosting-your-own-map-services,Hosting your own map services>> section.
|
124
|
+
|
125
|
+
=== Combining multiple service providers
|
126
|
+
|
127
|
+
It is also possible to combine multiple service providers for the different categories of map services.
|
128
|
+
For instance, if you want to use HERE Maps for the map tiles but host the other services yourself, use the following configuration:
|
129
|
+
|
130
|
+
[source,ruby]
|
131
|
+
----
|
132
|
+
# Map and Geocoder configuration
|
133
|
+
# == Combination (OpenStreetMap default + HERE Maps dynamic map tiles) ==
|
134
|
+
config.maps = {
|
135
|
+
provider: :osm,
|
136
|
+
dynamic: {
|
137
|
+
provider: :here,
|
138
|
+
api_key: Rails.application.secrets.maps[:here_api_key]
|
139
|
+
},
|
140
|
+
static: { url: "https://staticmap.example.org/" },
|
141
|
+
geocoding: { host: "nominatim.example.org", use_https: true },
|
142
|
+
autocomplete: { url: "https://photon.example.org/api/" }
|
143
|
+
}
|
144
|
+
----
|
145
|
+
|
146
|
+
`config/secrets.yml`:
|
147
|
+
|
148
|
+
[source,yaml]
|
149
|
+
----
|
150
|
+
default: &default
|
151
|
+
# ...
|
152
|
+
maps:
|
153
|
+
here_api_key: <%= ENV["MAPS_HERE_API_KEY"] %>
|
154
|
+
----
|
155
|
+
|
156
|
+
`.env`:
|
157
|
+
|
158
|
+
[source,bash]
|
159
|
+
----
|
160
|
+
MAPS_HERE_API_KEY=your_api_key_here
|
161
|
+
----
|
162
|
+
|
163
|
+
=== Disabling some of the map services
|
164
|
+
|
165
|
+
When using the maps functionality, you should always aim to provide all the services for the user that are available in Decidim.
|
166
|
+
However, not all service providers provide all these services, so at times you may need to disable some of them.
|
167
|
+
|
168
|
+
The configuration syntax allows you to disable the map services one by one.
|
169
|
+
For example, if you want to use HERE Maps as your default but disable the static map images and geocoding autocompletion functionality, you can use the following configuration:
|
170
|
+
|
171
|
+
[source,ruby]
|
172
|
+
----
|
173
|
+
config.maps = {
|
174
|
+
provider: :here,
|
175
|
+
api_key: Rails.application.secrets.maps[:api_key],
|
176
|
+
static: false,
|
177
|
+
autocomplete: false
|
178
|
+
}
|
179
|
+
----
|
180
|
+
|
181
|
+
Decidim works fine when some of the services are disabled individually but obviously, the disabled services are not available for Decidim users.
|
182
|
+
|
183
|
+
=== Global geocoder configurations
|
184
|
+
|
185
|
+
In the Dedicim initialiser (`config/initializers/decidim.rb`) you will also see a commented section for the global geocoder configurations commented as follows:
|
186
|
+
|
187
|
+
[source,ruby]
|
188
|
+
----
|
189
|
+
# Geocoder configurations ...
|
190
|
+
# config.geocoder = {
|
191
|
+
# # geocoding service request timeout, in seconds (default 3):
|
192
|
+
# timeout: 5,
|
193
|
+
# # set default units to kilometers:
|
194
|
+
# units: :km,
|
195
|
+
# # caching (see https://github.com/alexreisner/geocoder#caching for details):
|
196
|
+
# cache: Redis.new,
|
197
|
+
# cache_prefix: "..."
|
198
|
+
# }
|
199
|
+
----
|
200
|
+
|
201
|
+
This will change the global geocoding settings for your application.
|
202
|
+
To learn more about these settings, take a look at the https://github.com/alexreisner/geocoder[Geocoder gem's documentation].
|
203
|
+
|
204
|
+
=== Geocoding autocompletion configurations
|
205
|
+
|
206
|
+
Each autocompletion geocoder has their own configurations and this may not apply for all geocoding services.
|
207
|
+
The geocoder autocompletion integrations shipped with Decidim support the configurations shown in this section.
|
208
|
+
|
209
|
+
If you want to customize the address format in the geocoding autocompletion fields, you can apply the following configuration to your geocoder settings:
|
210
|
+
|
211
|
+
[source,ruby]
|
212
|
+
----
|
213
|
+
config.maps = {
|
214
|
+
# ... other configs ...
|
215
|
+
autocomplete: {
|
216
|
+
# For HERE:
|
217
|
+
address_format: [%w(street houseNumber), "city", "country"]
|
218
|
+
# For OSM/Photon:
|
219
|
+
# address_format: ["name", %w(street housenumber), "city", "country"]
|
220
|
+
}
|
221
|
+
}
|
222
|
+
----
|
223
|
+
|
224
|
+
=== Integrating with a new service provider
|
225
|
+
|
226
|
+
If you want to integrate the map functionality with a new service provider, take a look at the xref:/docs/customization/maps.adoc[Custom map providers] documentation.
|
227
|
+
|
228
|
+
== Enabling maps and geocoding
|
229
|
+
|
230
|
+
Once the maps functionality is configured, you'll need to activate it.
|
231
|
+
As of April 2017, only proposals and meetings have maps and geocoding.
|
232
|
+
|
233
|
+
=== Proposals
|
234
|
+
|
235
|
+
In order to enable geocoding for proposals you'll need to edit the component configuration and turn on "Geocoding enabled" configuration.
|
236
|
+
This works for that specific component, so you can have geocoding enabled for proposals in a participatory process, and disabled for another proposals component in the same participatory process.
|
237
|
+
|
238
|
+
=== Meetings
|
239
|
+
|
240
|
+
Meetings do not have a configuration option for geocoding.
|
241
|
+
Instead, if geocoding is configured it will try to geocode the address every time you create or update a meeting.
|
242
|
+
As of April 2017 there is no way to enable or disable geocoding per meetings component.
|
243
|
+
|
244
|
+
== Hosting your own map services
|
245
|
+
|
246
|
+
It is recommended to use a commercial service provider for all the map functionality to get up and running more easily.
|
247
|
+
Hosting all these services yourself and keeping everything up to date is time consuming and rather complex.
|
248
|
+
If the related complexity or the required time is not an issue, feel free to setup the following services on your own servers.
|
249
|
+
|
250
|
+
=== Map tiles: Open Street Maps tile server
|
251
|
+
|
252
|
+
You will need a https://wiki.openstreetmap.org/wiki/Tiles[map tiles] server which is used for the dynamic maps that the user can move themselves.
|
253
|
+
|
254
|
+
Follow these instructions to setup your tiles server:
|
255
|
+
|
256
|
+
https://opentileserver.org/
|
257
|
+
|
258
|
+
In the example configuration, we assume you have used the following domain for the tiles server:
|
259
|
+
|
260
|
+
https://tiles.example.org
|
261
|
+
|
262
|
+
=== Static map images: Openstreetmap static maps server (osm-static-maps)
|
263
|
+
|
264
|
+
Some pages in Decidim display static map images which need to be fetched from an external server.
|
265
|
+
The tiles server does not provide such static images by itself because one static map image may need multiple tiles to be combined into one.
|
266
|
+
The static map image is therefore dynamically generated based on the parameters passed for the static map request (such as image dimensions and the geocoordinates of the map image position).
|
267
|
+
|
268
|
+
The Open Street Maps community has made multiple open source https://wiki.openstreetmap.org/wiki/Static_map_images[static maps image services] from which you can pick freely but Decidim currently supports only https://github.com/jperelli/osm-static-maps[osm-static-maps] with the Open Street Maps services.
|
269
|
+
|
270
|
+
Follow these instructions to setup your static map images server:
|
271
|
+
|
272
|
+
https://github.com/jperelli/osm-static-maps#3-standalone-sample-server
|
273
|
+
|
274
|
+
In the example configuration, we assume you have used the following domain for the static maps image server:
|
275
|
+
|
276
|
+
https://staticmap.example.org
|
277
|
+
|
278
|
+
Setting up this service is optional.
|
279
|
+
If you do not configure a static map URL for the OSM based map services, Decidim will use the dynamic map tiles to generate a similar map element.
|
280
|
+
|
281
|
+
=== Geocoding: Nominatim geocoding server
|
282
|
+
|
283
|
+
https://wiki.openstreetmap.org/wiki/Nominatim[Nominatim] makes it possible to place points on the Decidim maps based on addresses.
|
284
|
+
This service provides geocoding capabilities by turning human readable addresses to https://en.wikipedia.org/wiki/Geographic_coordinate_system[geographic coordinates].
|
285
|
+
|
286
|
+
Follow these instructions to setup your geocoding server:
|
287
|
+
|
288
|
+
http://nominatim.org/release-docs/latest/admin/Installation/
|
289
|
+
|
290
|
+
In the example configuration, we assume you have used the following domain for the geocoding server:
|
291
|
+
|
292
|
+
https://nominatim.example.org
|
293
|
+
|
294
|
+
=== Geocoding autocompletion: Photon geocoding server
|
295
|
+
|
296
|
+
https://github.com/komoot/photon[Photon] makes it possible to provide the autocompletion service for people writing addresses to the address fields available in Decidim.
|
297
|
+
It uses the Open Street Maps data to serve the autocompletion requests.
|
298
|
+
When people select one of the suggested addresses, it will also tell Decidim the map point for that address.
|
299
|
+
|
300
|
+
Follow these instructions to setup your geocoding autocompletion server:
|
301
|
+
|
302
|
+
https://github.com/komoot/photon#installation
|
303
|
+
|
304
|
+
In the example configuration, we assume you have used the following domain for the Photon geocoding server for the autocompletion functionality:
|
305
|
+
|
306
|
+
https://photon.example.org
|
307
|
+
|
308
|
+
=== Configure Decidim
|
309
|
+
|
310
|
+
After you have all these services running, change your Decidim configurations to use these services.
|
311
|
+
Read the <<configuring-open-street-maps-based-service-providers,Configuring Open Street Maps based service providers>> section for more information.
|