decidim 0.30.1 → 0.31.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -9
  3. data/decidim-core/lib/decidim/{webpacker → shakapacker}/configuration.rb +4 -4
  4. data/decidim-core/lib/decidim/{webpacker → shakapacker}/runner.rb +3 -3
  5. data/decidim-core/lib/decidim/shakapacker/shakapacker.rb +8 -0
  6. data/decidim-core/lib/decidim/{webpacker → shakapacker}/shakapacker.yml +3 -1
  7. data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/custom.js +1 -1
  8. data/decidim.gemspec +1 -1
  9. data/docs/antora.yml +1 -1
  10. data/docs/modules/configure/pages/environment_variables.adoc +184 -35
  11. data/docs/modules/configure/pages/index.adoc +2 -3
  12. data/docs/modules/configure/pages/initializer.adoc +45 -31
  13. data/docs/modules/configure/pages/system.adoc +3 -3
  14. data/docs/modules/customize/assets/images/social-share-modal-default.png +0 -0
  15. data/docs/modules/customize/pages/admin_filters.adoc +2 -2
  16. data/docs/modules/customize/pages/content_security_policy.adoc +1 -1
  17. data/docs/modules/customize/pages/images.adoc +1 -1
  18. data/docs/modules/customize/pages/index.adoc +1 -0
  19. data/docs/modules/customize/pages/javascript.adoc +5 -18
  20. data/docs/modules/customize/pages/localization.adoc +75 -0
  21. data/docs/modules/customize/pages/oauth.adoc +12 -0
  22. data/docs/modules/customize/pages/social_shares.adoc +0 -3
  23. data/docs/modules/customize/pages/styles.adoc +3 -16
  24. data/docs/modules/develop/assets/attachments/grafana/metadecidim-csv.json +1106 -0
  25. data/docs/modules/develop/assets/attachments/grafana/metadecidim-graphql.json +632 -0
  26. data/docs/modules/develop/assets/images/grafana/create_account_confirm.png +0 -0
  27. data/docs/modules/develop/assets/images/grafana/create_account_form.png +0 -0
  28. data/docs/modules/develop/assets/images/grafana/create_account_setup.png +0 -0
  29. data/docs/modules/develop/assets/images/grafana/dashboard_example_csv.png +0 -0
  30. data/docs/modules/develop/assets/images/grafana/dashboard_example_graphql.png +0 -0
  31. data/docs/modules/develop/assets/images/grafana/dashboard_import.png +0 -0
  32. data/docs/modules/develop/assets/images/grafana/dashboard_import_csv.png +0 -0
  33. data/docs/modules/develop/assets/images/grafana/dashboards.png +0 -0
  34. data/docs/modules/develop/assets/images/grafana/homepage.png +0 -0
  35. data/docs/modules/develop/pages/api.adoc +12 -2
  36. data/docs/modules/develop/pages/classes/models.adoc +2 -2
  37. data/docs/modules/develop/pages/commentable.adoc +9 -11
  38. data/docs/modules/develop/pages/components.adoc +10 -10
  39. data/docs/modules/develop/pages/elections.adoc +101 -0
  40. data/docs/modules/develop/pages/fixing_locales.adoc +7 -12
  41. data/docs/modules/develop/pages/grafana.adoc +100 -0
  42. data/docs/modules/develop/pages/likeable.adoc +106 -0
  43. data/docs/modules/develop/pages/machine_translations.adoc +6 -2
  44. data/docs/modules/develop/pages/maintainers/releases.adoc +40 -202
  45. data/docs/modules/develop/pages/maps.adoc +8 -8
  46. data/docs/modules/develop/pages/modules.adoc +1 -1
  47. data/docs/modules/develop/pages/notifications.adoc +27 -56
  48. data/docs/modules/develop/pages/permissions.adoc +19 -19
  49. data/docs/modules/develop/pages/share_tokens.adoc +2 -2
  50. data/docs/modules/develop/pages/taxonomies.adoc +1 -15
  51. data/docs/modules/install/pages/checklist.adoc +2 -1
  52. data/docs/modules/install/pages/index.adoc +7 -12
  53. data/docs/modules/install/pages/manual.adoc +27 -35
  54. data/docs/modules/install/pages/update.adoc +0 -2
  55. data/docs/modules/install/partials/version_matrix.adoc +4 -2
  56. data/docs/modules/services/pages/activestorage.adoc +4 -3
  57. data/docs/modules/services/pages/aitools.adoc +0 -2
  58. data/docs/modules/services/pages/etherpad.adoc +5 -20
  59. data/docs/modules/services/pages/machine_translation.adoc +38 -0
  60. data/docs/modules/services/pages/maps.adoc +8 -66
  61. data/docs/modules/services/pages/pdf.adoc +33 -0
  62. data/docs/modules/services/pages/sms.adoc +6 -7
  63. data/docs/modules/services/pages/social_providers.adoc +1 -1
  64. data/docs/modules/services/pages/timestamp.adoc +47 -0
  65. data/lib/decidim/version.rb +1 -1
  66. data/package-lock.json +2413 -2624
  67. data/package.json +3 -2
  68. data/packages/browserslist-config/package.json +1 -1
  69. data/packages/core/package.json +2 -3
  70. data/packages/dev/package.json +2 -2
  71. data/packages/eslint-config/package.json +1 -1
  72. data/packages/prettier-config/package.json +1 -1
  73. data/packages/stylelint-config/package.json +1 -1
  74. data/packages/webpacker/package.json +3 -2
  75. data/packages/webpacker/src/loaders/decidim-sass-loader.js +18 -11
  76. metadata +68 -54
  77. data/docs/modules/develop/pages/endorsable.adoc +0 -110
  78. data/docs/modules/develop/pages/guide_migrate_webpacker_app.adoc +0 -257
  79. data/docs/modules/develop/pages/guide_migrate_webpacker_module.adoc +0 -132
  80. data/docs/modules/develop/pages/metrics.adoc +0 -123
  81. data/docs/modules/develop/pages/troubleshooting_metrics.adoc +0 -255
  82. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/esbuild.config.js +0 -0
  83. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/postcss.config.js +0 -0
  84. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/tsconfig.json +0 -0
  85. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/.modernizrrc +0 -0
  86. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/webpack.config.js +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da55189daf07ff8e4c7f22161de7eda167ca9bf263a1c4e5bfa93872c117dee1
4
- data.tar.gz: 5700d25412756d9b7a50a5fb55f1814322657f52af0f6aa04f06464335a2234d
3
+ metadata.gz: e626a38640359192d2b88c81f738aaf4ec02b5361084ef3bf431ae74f784f317
4
+ data.tar.gz: 8fc55132e141625a45ca5dd645d6e9e8898aaf04e72e91cc473a9c03e98e6d9c
5
5
  SHA512:
6
- metadata.gz: d980c6bac85cac3371978d4c98a0720efe0846d5bcbbc6be1618412eb38e0d9535be071871388e8d4712e4018ca46d05d1e8663c110ec509defc4dc96c558360
7
- data.tar.gz: c50ff6e463d8a80e3d2963ea853cfa94e21cebd5c0d6a51a24d6b4576f6dec4980b46649d6fd4ca706ef52e5d3a51d4f51c005903fc4bbe97c60c37d85483b20
6
+ metadata.gz: 7b94c2f85ba2246ace8097fe3c8fb7b3fbde7561778b8777e531d4a74e8318b3e2f3a17d4f299aebc48faa66ed1451347ce5d73732f9d10f99302a3e94e54bc1
7
+ data.tar.gz: 59ff6b0ec857c76df2039e9eceda04af5c3718b7b1b76b702b97915e4ec6856a5e2367864e6eb294aa14cb280ec0e9937bd86cffd875da8f8479a644e48dea98
data/Rakefile CHANGED
@@ -65,11 +65,7 @@ end
65
65
  desc "Pushes a new build for each gem and package."
66
66
  task release_all: [:ensure_git_remote, :fetch_git_tags, :update_versions, :fetch_git_tags, :check_uncommitted_changes, :check_locale_completeness] do
67
67
  commands = {}
68
- Decidim::GemManager.all_dirs do |dir|
69
- next if dir.include?("decidim-admin")
70
- next if dir.include?("decidim-accountability")
71
- commands[dir] = "rake release[#{Decidim::ReleaseManager.git_remote}]"
72
- end
68
+ Decidim::GemManager.all_dirs { |dir| commands[dir] = "rake release[#{Decidim::ReleaseManager.git_remote}]" }
73
69
  Decidim::GemManager.package_dirs { |dir| commands[dir] = "npm publish --access public" }
74
70
 
75
71
  commands.each do |dir, command|
@@ -94,10 +90,10 @@ end
94
90
 
95
91
  desc "Makes sure there are no uncommitted changes."
96
92
  task :check_uncommitted_changes do
97
- # unless system("git diff --exit-code --quiet")
98
- # puts "There are uncommitted changes, run `git diff` to see them."
99
- # abort "Please commit your changes before release!"
100
- # end
93
+ unless system("git diff --exit-code --quiet")
94
+ puts "There are uncommitted changes, run `git diff` to see them."
95
+ abort "Please commit your changes before release!"
96
+ end
101
97
  end
102
98
 
103
99
  desc "Makes sure all official locales are complete and clean."
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
- module Webpacker
4
+ module Shakapacker
5
5
  class Configuration
6
6
  attr_reader :additional_paths, :entrypoints, :stylesheet_imports
7
7
 
@@ -12,7 +12,7 @@ module Decidim
12
12
  end
13
13
 
14
14
  def configuration_file
15
- # Before webpacker is installed, the original configuration file may not
15
+ # Before shakapacker is installed, the original configuration file may not
16
16
  # be available yet.
17
17
  return unless File.exist?(original_configuration_file_path)
18
18
  return configuration_file_path if configurations_loaded?
@@ -58,13 +58,13 @@ module Decidim
58
58
  if defined?(Rails)
59
59
  Rails.application.root
60
60
  else
61
- # This is used when Rails is not available from the webpacker binstubs
61
+ # This is used when Rails is not available from the shakapacker binstubs
62
62
  File.expand_path(".", Dir.pwd)
63
63
  end
64
64
  end
65
65
 
66
66
  def configuration_file_path
67
- @configuration_file_path ||= File.join(app_path, "tmp/webpacker_runtime.yml")
67
+ @configuration_file_path ||= File.join(app_path, "tmp/shakapacker_runtime.yml")
68
68
  end
69
69
 
70
70
  def original_configuration_file_path
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
- module Webpacker
4
+ module Shakapacker
5
5
  module Runner
6
6
  def self.included(base)
7
7
  base.alias_method :original_initialize, :initialize
8
8
  base.send :private, :original_initialize
9
9
 
10
10
  base.define_method :initialize do |argv|
11
- original_initialize(argv)
12
11
  decidim_initialize(argv)
12
+ original_initialize(argv)
13
13
  end
14
14
  end
15
15
 
@@ -22,7 +22,7 @@ module Decidim
22
22
  Decidim::Assets::Tailwind.write_runtime_configuration
23
23
 
24
24
  # Write the runtime configuration and override the configuration
25
- @shakapacker_config = Decidim::Webpacker.configuration.configuration_file
25
+ ENV["SHAKAPACKER_CONFIG"] = Decidim::Shakapacker.configuration.configuration_file
26
26
  end
27
27
  end
28
28
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shakapacker"
4
+ require "shakapacker/runner"
5
+ require "decidim/shakapacker"
6
+ require "decidim/webpacker"
7
+
8
+ Shakapacker::Runner.include(Decidim::Shakapacker::Runner)
@@ -1,5 +1,5 @@
1
1
  # File written by Decidim generator
2
- # Note: You must restart bin/webpack-dev-server for changes to take effect
2
+ # Note: You must restart bin/shakapacker-dev-server for changes to take effect
3
3
 
4
4
  default: &default
5
5
  source_path: app/packs
@@ -62,6 +62,8 @@ development:
62
62
  # port: 8080
63
63
  # Should we use gzip compression?
64
64
  compress: true
65
+ # Disable live reloading for faster development experience
66
+ live_reload: false
65
67
  # Note that apps that do not check the host are vulnerable to DNS rebinding attacks
66
68
  allowed_hosts: "all"
67
69
  pretty: true
@@ -44,7 +44,7 @@ module.exports = {
44
44
  filename: "media/documents/[hash][ext][query]"
45
45
  }
46
46
  },
47
- // Overwrite webpacker files rule to amend the filename output
47
+ // Overwrite shakapacker files rule to amend the filename output
48
48
  // and include the name of the file, otherwise some SVGs
49
49
  // are not generated because the hash is the same between them
50
50
  {
data/decidim.gemspec CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  package-lock.json
39
39
  packages/
40
40
  babel.config.json
41
- decidim-core/lib/decidim/webpacker/
41
+ decidim-core/lib/decidim/shakapacker/
42
42
  ))
43
43
  end
44
44
  end
data/docs/antora.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  name: en
2
2
  title: "Decidim Documentation"
3
- version: v0.30
3
+ version: v0.31
4
4
  asciidoc:
5
5
  attributes:
6
6
  page-lang: en@
@@ -2,9 +2,9 @@
2
2
 
3
3
  We try to let most of the things defined through Environment Variables, as https://12factor.net/config[12factor applications's config]. You will need to configure through your hosting provider (for example in Heroku), through a gem like `figaro` or through docker-compose `env_file`.
4
4
 
5
- This is an extensive list of all the Env variables supported for an application created with the default `decidim` generator (ie: `decidim my-application`). Custom applications may modify or customize the default decidim initializer (`config/initializers/decidim.rb`) in such a a way that this will have no effect.
5
+ This is an extensive list of all the Env variables supported for an application created with the default `decidim` generator (ie: `decidim my-application`). Custom applications may implement a decidim initializer (`config/initializers/decidim.rb`) in such a way that this will have no effect.
6
6
 
7
- Finally, take into account that there are some config variables not available as Env vars, this is because it is not enough to set them in order to make that particular feature to work, it requires the user to add some custom code (usually a service class that acts a wrapper for an external API). These are the case for initializers such as `sms_gateway_service`, `timestamp_service`, `pdf_signature_service` or `machine_translation_service`. For more information about these extra services check the xref:configure:initializer.adoc[Initializer documentation].
7
+ Finally, take into account that there are some config variables not available to Environment. This is because it is not enough to set them in order to make that particular feature to work, it requires the user to add some custom code (like a local generator). For more information about these extra services check the xref:configure:initializer.adoc[Initializer documentation].
8
8
 
9
9
  The next tables show all the default Env Vars available when running a default Decidim application (note that customized Decidim apps might differ). The ones marked in *bold* are the minimal required to run a production server. The ones marked as _italic_ are only required for development.
10
10
 
@@ -425,6 +425,12 @@ Also some more refined configurations:
425
425
  |auto
426
426
  |No
427
427
 
428
+ | DECIDIM_PAGE_BLOCKS
429
+ | Sets the list of static pages' slugs that can include content blocks.
430
+ By default is only enabled in the terms-of-service static page to allow a summary to be added and include sections with a two-pane view
431
+ | terms-of-service
432
+ | no
433
+
428
434
  |DECIDIM_ENABLE_HTML_HEADER_SNIPPETS
429
435
  |Set to `true` in order to allow administrators to define an arbitrary custom HTML code in the `<head></head>` section any Decidim page.
430
436
 
@@ -518,6 +524,11 @@ You may specify multiple ip in an array, separating by commas, such as `1.2.3.4,
518
524
  |
519
525
  |No
520
526
 
527
+ |DECIDIM_SYSTEM_API_USERS_SECRET_LENGTH
528
+ |The length of API secrets generated for API users.
529
+ |32
530
+ |No
531
+
521
532
  |DECIDIM_BASE_UPLOADS_PATH
522
533
  |A base path for the uploads. If set, make sure it ends in a slash.
523
534
  Uploads will be set to `<base_path>/uploads/`. This can be useful if you
@@ -603,6 +614,15 @@ Additional context: This has been revealed as an issue during a security audit o
603
614
  |false
604
615
  |No
605
616
 
617
+ |DECIDIM_CONTENT_PROCESSORS
618
+ |Exposes a configuration option: an array of symbols representing processors that will be automatically executed when a content is parsed or rendered.
619
+
620
+ A content processor is a concept to refer to a set of two classes:
621
+ - the content parser class
622
+ - the content renderer class.
623
+ | ""
624
+ | No
625
+
606
626
  |DECIDIM_ADMIN_PASSWORD_STRONG
607
627
  |Enable strong password rules for admin users.
608
628
  |true
@@ -623,6 +643,26 @@ Additional context: This has been revealed as an issue during a security audit o
623
643
  |15
624
644
  |No
625
645
 
646
+ | DECIDIM_DELETE_INACTIVE_USERS_AFTER_DAYS
647
+ | Defines after how many days inactive users should be deleted.
648
+ | 365
649
+ | No
650
+
651
+ | DECIDIM_MINIMUM_INACTIVITY_PERIOD_IN_DAYS
652
+ | Minimum allowed inactivity period before a user can be considered inactive.
653
+ | 30
654
+ | No
655
+
656
+ | DECIDIM_DELETE_INACTIVE_USERS_FIRST_WARNING_DAYS_BEFORE
657
+ | Number of days before deletion when the first warning notification is sent.
658
+ | 30
659
+ | No
660
+
661
+ | DECIDIM_DELETE_INACTIVE_USERS_LAST_WARNING_DAYS_BEFORE
662
+ | Number of days before deletion when the last warning notification is sent.
663
+ | 7
664
+ | No
665
+
626
666
  |*DECIDIM_SERVICE_WORKER_ENABLED*
627
667
  |Enable/Disable the service worker. This is used to enable offline support and to deliver push notifications. In development it is recommended to be disabled because its aggressive cache configuration might cause some issues when submitting forms.
628
668
  |false
@@ -633,26 +673,57 @@ Additional context: This has been revealed as an issue during a security audit o
633
673
  |true
634
674
  |No
635
675
 
636
- |*DECIDIM_SPAM_DETECTION_BACKEND_USER*
637
- | The adapter type needed for user classifier. (for CI purposes, you can set "memory")
638
- | redis
676
+ |*DECIDIM_ENABLE_MACHINE_TRANSLATION*
677
+ | Whether the Decidim attempt to automatically translate missing translations.
678
+ Read more about this at xref:services:machine_translation.adoc[Machine Translation] service page.
679
+ | false
639
680
  | No
640
681
 
641
- |*DECIDIM_SPAM_DETECTION_BACKEND_USER_REDIS_URL*
642
- | The redis connection url used by the user classifier
643
- | redis://localhost:6379/3
682
+ |*DECIDIM_MACHINE_TRANSLATION_SERVICE*
683
+ | The name of the class to translate user content.
684
+ Read more about this at xref:services:machine_translation.adoc[Machine Translation] service page.
685
+ | nil
644
686
  | No
645
687
 
646
- |*DECIDIM_SPAM_DETECTION_BACKEND_RESOURCE*
647
- | The adapter type needed for resource classifier. (for CI purposes, you can set "memory")
648
- | redis
688
+
689
+ |*DECIDIM_SMS_GATEWAY_SERVICE*
690
+ | The name of the class to deliver SMS codes to users.
691
+ Read more about this at xref:services:sms.adoc[SMS] service page.
692
+ | nil
649
693
  | No
650
694
 
651
- |*DECIDIM_SPAM_DETECTION_BACKEND_RESOURCE_REDIS_URL*
652
- | The redis connection url used by the resource classifier
653
- | redis://localhost:6379/2
695
+ |*DECIDIM_TIMESTAMP_SERVICE*
696
+ | The name of the class used to generate a timestamp from a document.
697
+ Read more about this at xref:services:timestamp.adoc[Timestamp] service page.
698
+ | nil
699
+ | No
700
+
701
+ |*DECIDIM_PDF_SIGNATURE_SERVICE*
702
+ | The name of the class used to process a pdf and add a signature to the document.
703
+ Read more about this at xref:services:pdf.adoc[PDF signing] service page.
704
+ | nil
705
+ | No
706
+
707
+ |*DECIDIM_USER_ROLES*
708
+ | The list of roles a user can have, not considering the space-specific roles.
709
+ | admin, user_manager
710
+ | No
711
+
712
+ |*DECIDIM_AMENDMENTS_VISIBILITY_OPTIONS*
713
+ | The list of visibility options for amendments.
714
+ | all, participants
654
715
  | No
655
716
 
717
+ |*DECIDIM_DEFAULT_MAX_LAST_ACTIVITY_USERS*
718
+ | The default max last activity users to be shown
719
+ | 6
720
+ | No
721
+
722
+ |DECIDIM_OAUTH_ACCESS_TOKEN_EXPIRES_IN
723
+ |OAuth access token expiration time in minutes.
724
+ |120
725
+ |No
726
+
656
727
  |===
657
728
 
658
729
  .Optional Env Vars fine tuning some Decidim modules (such the API or Proposal behaviors)
@@ -675,6 +746,26 @@ Additional context: This has been revealed as an issue during a security audit o
675
746
  |15
676
747
  |No
677
748
 
749
+ |DECIDIM_API_JWT_SECRET
750
+ |This secret is being used by the devise-jwt to sign the tokens being generated for the api users.
751
+ |
752
+ |Yes
753
+
754
+ |DECIDIM_API_JWT_EXPIRES_IN
755
+ |The expiration time of the JWT tokens in minutes, after which issued token will expire.
756
+ |(value of DECIDIM_OAUTH_ACCESS_TOKEN_EXPIRES_IN)
757
+ |No
758
+
759
+ |DECIDIM_API_FORCE_API_AUTHENTICATION
760
+ |Enable authentication for using api through setting Api configuration option. This is used to filter out unauthorized users from using api endpoint.
761
+ |false
762
+ |No
763
+
764
+ | DECIDIM_API_DISCLOSE_SYSTEM_VERSION
765
+ | This Environment variable instructs decidim whether to display or not the exact version of the application. By default, this is set to false to avoid explicit exposure of Decidim version.
766
+ | false
767
+ | No
768
+
678
769
  |PROPOSALS_PARTICIPATORY_SPACE_HIGHLIGHTED_PROPOSALS_LIMIT
679
770
  |Number of proposals to be shown in blocks with highlighted content across different participatory spaces.
680
771
  |4
@@ -690,30 +781,14 @@ Additional context: This has been revealed as an issue during a security audit o
690
781
  |2
691
782
  |No
692
783
 
693
- |MEETINGS_ENABLE_PROPOSAL_LINKING
694
- |If true, enables several relationships between meetings and proposals. By default is active if Proposals are active (which is true always at the moment).
695
-
696
- *We recommend not to tamper with this setting unless you know what are you doing*
697
- |auto
698
- |No
699
-
700
784
  |MEETINGS_EMBEDDABLE_SERVICES
701
785
  |A list (separated by spaces) of allowed services that can be embedded in a iframe when creating an online meeting.
702
786
  |www.youtube.com www.twitch.tv meet.jit.si
703
787
  |No
704
788
 
705
- |BUDGETS_ENABLE_PROPOSAL_LINKING
706
- |If true, enables several relationships between budgets and proposals. By default is active if Proposals are active (which is true always at the moment).
707
-
708
- *We recommend not to tamper with this setting unless you know what are you doing*
709
- |auto
710
- |No
711
-
712
- |ACCOUNTABILITY_ENABLE_PROPOSAL_LINKING
713
- |If true, enables several relationships between the accountability module and proposals. By default is active if Proposals are active (which is true always at the moment).
714
-
715
- *We recommend not to tamper with this setting unless you know what are you doing*
716
- |auto
789
+ |MEETINGS_WAITING_LIST_ENABLED
790
+ |If set to "false", disables the waiting list feature for meetings. Enabled by default.
791
+ |true
717
792
  |No
718
793
 
719
794
  |INITIATIVES_CREATION_ENABLED
@@ -781,9 +856,79 @@ After this time the initiative will be moved to discarded state.
781
856
  |false
782
857
  |No
783
858
 
859
+ |INITIATIVES_SIGNATURE_HANDLER_ENCRYPTION_SECRET
860
+ |Secret used by the base class Decidim::Initiatives::SignatureHandler to encrypt the user personal data that will be stored in the initiatives votes.
861
+ |personal user metadata
862
+ |No
863
+
864
+ |*DECIDIM_SPAM_REPORTING_USER*
865
+ | This is the email address used by the spam engine to properly identify the user that will report users and content
866
+ | decidim-reporting-user@example.org
867
+ | No
868
+
869
+ |*DECIDIM_SPAM_DETECTION_RESOURCE_SCORE_THRESHOLD*
870
+ | This is the threshold used to report resources. If the score falls under this value, the resource will not be reported.
871
+ | 0.75
872
+ | No
873
+
874
+ |*DECIDIM_SPAM_DETECTION_USER_SCORE_THRESHOLD*
875
+ | This is the threshold used to report users. If the score falls under this value, the user will not be reported.
876
+ | 0.75
877
+ | No
878
+
879
+ |*DECIDIM_SPAM_DETECTION_DELAY_IN_SECONDS*
880
+ | You can configure the spam delay for the spam detection service. It is recommended not to set it to 0, as the request may not finished (ex: resources could not yet exist in Database)
881
+ | 30
882
+ | No
883
+
884
+ |*DECIDIM_SPAM_DETECTION_BACKEND_USER*
885
+ | The adapter type needed for user classifier. (for CI purposes, you can set "memory")
886
+ | redis
887
+ | No
888
+
889
+ |*DECIDIM_SPAM_DETECTION_BACKEND_USER_REDIS_URL*
890
+ | The redis connection url used by the user classifier
891
+ | redis://localhost:6379/3
892
+ | No
893
+
894
+ |*DECIDIM_SPAM_DETECTION_BACKEND_RESOURCE*
895
+ | The adapter type needed for resource classifier. (for CI purposes, you can set "memory")
896
+ | redis
897
+ | No
898
+
899
+ |*DECIDIM_SPAM_DETECTION_BACKEND_RESOURCE_REDIS_URL*
900
+ | The redis connection url used by the resource classifier
901
+ | redis://localhost:6379/2
902
+ | No
903
+
904
+ |*DECIDIM_SPAM_DETECTION_RESOURCE_SERVICE*
905
+ | Spam detection service class.
906
+ | Decidim::Ai::SpamDetection::Service
907
+ | No
908
+
909
+ |*DECIDIM_SPAM_DETECTION_USER_SERVICE*
910
+ | Spam detection service class.
911
+ | Decidim::Ai::SpamDetection::Service
912
+ | No
913
+
914
+ |*DECIDIM_AI_LANGUAGE_FORMATTER*
915
+ | Text cleanup service
916
+ | Decidim::Ai::Language::Formatter
917
+ | No
918
+
919
+ |*DECIDIM_SPAM_HIDE_REPORTED_RESOURCES_AUTOMATICALLY*
920
+ | When the engine is consistently marking spam content without errors, you can skip human intervention by enabling this functionality
921
+ | false
922
+ | No
923
+
924
+ |*VERIFICATIONS_DOCUMENT_TYPES*
925
+ | For the verification of the participants' data in Verifications, you can configure which type of documents a participant can have. By default these documents are `identification_number` and `passport`
926
+ | identification_number,passport
927
+ | No
928
+
784
929
  |===
785
930
 
786
- .Optional Env Vars for extra Rails configuration
931
+ .Optional Env Vars for extra configuration
787
932
  [%autowidth.stretch]
788
933
  |===
789
934
  |Name |Value |Default value|Multitenant's System configurable
@@ -827,7 +972,11 @@ Note that this only applies to production environments.
827
972
  |5
828
973
  |No
829
974
 
975
+ |SLOW_SEEDS
976
+ |If seeding an environment that needs to have more data, please use `SLOW_SEEDS` environment variable to add it.
977
+ |false
978
+ |No
979
+
830
980
  |===
831
981
 
832
982
  Please take care that all these configurations would be the defaults but *some of these could also be changed on a Multitenant's System configuration* (for instance SMTP or OAUTH providers).
833
-
@@ -45,12 +45,11 @@ Then make use of the related xref:configure:environment_variables.adoc[Environme
45
45
  Just as a reminder, these files are important:
46
46
 
47
47
  * config/database.yml
48
- * config/secrets.yml
49
48
 
50
49
  Although most of these settings you can change them through xref:configure:environment_variables.adoc[Environment Variables].
51
50
 
52
51
  You also have more settings in:
53
52
 
54
53
  * xref:configure:initializer.adoc[Decidim initializer file].
55
- * System panel.
56
-
54
+ * xref:configure:environment_variables.adoc[Environment variables].
55
+ * xref:configure:system.adoc[System panel].
@@ -1,15 +1,23 @@
1
1
  = Initializer
2
2
 
3
- There are some settings that you will need to change in the `config/initializer/decidim.rb` file. We recommend that, whenever it is possible, you use xref:configure:environment_variables.adoc[Environment Variables], as just cleaner and easier to work with.
3
+ Decidim relies heavily on the xref:configure:environment_variables.adoc[environment variables], and we strongly recommend to use them, however, when the xref:configure:environment_variables.adoc[environment variables] are not enough, you can use a plain Rails initializer. Starting with Decidim `0.31.0` we will not generate this file, but, if you really need it, you can create in your application a file named `config/initializer/decidim.rb`.
4
4
 
5
- If you need to add special logic or if you feel more comfortable working with Ruby code instead of Environment Variables, then you can of course do all the changes that you need directly in the initializer file. Take into account that this file could be published in a Version Control System (like `git`) so you should be careful with the secrets/API keys that you add here.
5
+ If you need to add special logic or if you feel more comfortable working with Ruby code instead of xref:configure:environment_variables.adoc[Environment Variables], then you can do all the changes that you need directly in the initializer file. Take into account that this file could be published in a Version Control System (like `git`) so you should be careful with the secrets/API keys that you add here.
6
6
 
7
7
  Remember to restart your server when making changes in this file.
8
8
 
9
- This is where you can change the behaviour defined on the different components (most notably from `decidim-core`).
10
-
11
9
  After making changes to this file you will need to also restart your application server.
12
10
 
11
+ == File format
12
+
13
+ [source,ruby]
14
+ ....
15
+ # config/initializer/decidim.rb
16
+ Decidim.configure do |config|
17
+ # here you can add any key config from below.
18
+ end
19
+ ....
20
+
13
21
  == Application name
14
22
 
15
23
  The name of the application.
@@ -107,7 +115,7 @@ Allows to make geographical mapping in some components, like Proposals or Meetin
107
115
  ....
108
116
  config.geocoder = {
109
117
  static_map_url: "https://image.maps.hereapi.com/mia/v3/base/mc/overlay",
110
- here_api_key: Rails.application.secrets.geocoder[:here_api_key]
118
+ here_api_key: ENV["MAPS_API_KEY"]
111
119
  }
112
120
  ....
113
121
 
@@ -154,7 +162,7 @@ Mind that this depends on your environment, for instance you could also need to
154
162
 
155
163
  [source,ruby]
156
164
  ....
157
- config.maximum_attachment_size = 10.megabytes
165
+ config.maximum_attachment_size = 10
158
166
  ....
159
167
 
160
168
  === User avatar file size
@@ -165,7 +173,7 @@ Mind that this depends on your environment, for instance you could also need to
165
173
 
166
174
  [source,ruby]
167
175
  ....
168
- config.maximum_avatar_size = 10.megabytes
176
+ config.maximum_avatar_size = 10
169
177
  ....
170
178
 
171
179
  == Reports
@@ -281,11 +289,11 @@ class MySMSGatewayService
281
289
  end
282
290
  ....
283
291
 
284
- Then you will need to configure it in the Decidim initializer:
292
+ Then you will need to configure it with the help of Environment Variables:
285
293
 
286
- [source,ruby]
294
+ [source,bash]
287
295
  ....
288
- config.sms_gateway_service = "MySMSGatewayService"
296
+ export DECIDIM_SMS_GATEWAY_SERVICE="MySMSGatewayService"
289
297
  ....
290
298
 
291
299
  == Timestamp service configuration
@@ -313,11 +321,11 @@ class MyTimestampService
313
321
  end
314
322
  ....
315
323
 
316
- Then you will need to configure it in the Decidim initializer:
324
+ Then you will need to configure it with the help of Environment Variables:
317
325
 
318
- [source,ruby]
326
+ [source,bash]
319
327
  ....
320
- config.timestamp_service = "MyTimestampService"
328
+ export DECIDIM_TIMESTAMP_SERVICE="MyTimestampService"
321
329
  ....
322
330
 
323
331
  == PDF signature service
@@ -344,8 +352,13 @@ An example class would be something like:
344
352
  # Code to return the pdf signed
345
353
  end
346
354
  end
355
+ ....
356
+
357
+ Then you will need to configure it with the help of Environment Variables:
347
358
 
348
- config.pdf_signature_service = "MyPDFSignatureService"
359
+ [source,bash]
360
+ ....
361
+ export DECIDIM_PDF_SIGNATURE_SERVICE="PdfSignatureExample"
349
362
  ....
350
363
 
351
364
  == Etherpad configuration
@@ -357,9 +370,9 @@ xref:services:etherpad.adoc[Etherpad's Decidim docs] in order to set it up.
357
370
  [source,ruby]
358
371
  ....
359
372
  config.etherpad = {
360
- server: Rails.application.secrets.etherpad[:server],
361
- api_key: Rails.application.secrets.etherpad[:api_key],
362
- api_version: Rails.application.secrets.etherpad[:api_version]
373
+ server: ENV["ETHERPAD_SERVER"],
374
+ api_key: ENV["ETHERPAD_API_KEY"],
375
+ api_version: Decidim::Env.new("ETHERPAD_API_VERSION", "1.2.1")
363
376
  }
364
377
  ....
365
378
 
@@ -367,29 +380,30 @@ xref:services:etherpad.adoc[Etherpad's Decidim docs] in order to set it up.
367
380
 
368
381
  To enable machine translations you need to enable the service and specify the class used for translation (this usually is the one contacting an external API from a 3d party service that actually translates the string).
369
382
 
370
- [source,ruby]
383
+ [source,bash]
371
384
  ....
372
- config.enable_machine_translations = false
373
- config.machine_translation_service = "MyTranslationService"
385
+ export DECIDIM_ENABLE_MACHINE_TRANSLATION="true"
386
+ export DECIDIM_MACHINE_TRANSLATION_SERVICE="MyTranslationService"
374
387
  ....
375
-
376
388
  An example class would be something like:
377
389
 
378
390
  [source,ruby]
379
391
  ....
380
- class MyTranslationService
381
- attr_reader :text, :original_locale, :target_locale
392
+ class MyTranslationService
393
+ attr_reader :text, :source_locale, :target_locale, :resource, :field_name
382
394
 
383
- def initialize(text, original_locale, target_locale)
384
- @text = text
385
- @original_locale = original_locale
386
- @target_locale = target_locale
387
- end
395
+ def initialize(resource, field_name, text, target_locale, source_locale)
396
+ @resource = resource
397
+ @field_name = field_name
398
+ @text = text
399
+ @target_locale = target_locale
400
+ @source_locale = source_locale
401
+ end
388
402
 
389
- def translate
390
- Actual code to translate the text
391
- end
403
+ def translate
404
+ # Actual code to translate the text
392
405
  end
406
+ end
393
407
  ....
394
408
 
395
409
  See xref:develop:machine_translations.adoc[Machine Translations] for more information about how it works and how to set it up.
@@ -76,7 +76,7 @@ Enter each one of them in a new line. For instance, "example.com".
76
76
  |Required
77
77
  |You need to configure at least one language. Decidim is multilingual, meaning that you can have most of the admin
78
78
  contents with any number of languages. For seeing other languages you need to configure first the
79
- xref:configure:initializer.adoc[Decidim's initializer].
79
+ xref:configure:environment_variables.adoc[Decidim's Environment Variables].
80
80
 
81
81
  |Force authentication
82
82
  |Optional
@@ -127,8 +127,8 @@ in multi tenant mode. To learn more, check this https://developer.mozilla.org/en
127
127
  ==== Allow participants to register and login
128
128
 
129
129
  Most of the installations use this setting. Means that everyone can register a participant account and login, without restrictions, only with an email account confirmation.
130
- You can disable that confirmation also if you want to through xref:configure:initializer.adoc[Decidim's initializer], although we do not recommend doing that,
131
- as it is a measure for stopping spam accounts.
130
+ You can disable that confirmation also if you want to through xref:configure:environment_variables.adoc.adoc[Decidim's environment variables], although we do not recommend doing that,
131
+ as it is a measure for stopping spam accounts. For additional details, read about `DECIDIM_UNCONFIRMED_ACCESS_FOR` environment variable.
132
132
 
133
133
  ==== Do not allow participants to register, but allow existing participants to login
134
134
 
@@ -12,8 +12,8 @@ For example, to add new filter to proposals index:
12
12
  ....
13
13
  Decidim.admin_filter(:proposals) do |filter|
14
14
  # An example of how to access to the context. In this case the custom
15
- # filter is only enabled for valuators of the space
16
- if current_participatory_space.user_roles(:valuator).where(user: current_user).exists?
15
+ # filter is only enabled for evaluators of the space
16
+ if current_participatory_space.user_roles(:evaluator).where(user: current_user).exists?
17
17
  filter.add_filters(:custom_new_filter)
18
18
  filter.add_filters_with_values(custom_new_filter: %w(custom_new_value_1 custom_new_value_2))
19
19
  end