decidim-generators 0.28.2 → 0.29.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.
- checksums.yaml +4 -4
- data/Gemfile +2 -3
- data/Gemfile.lock +338 -365
- data/decidim-generators.gemspec +1 -1
- data/exe/decidim +2 -2
- data/lib/decidim/generators/app_generator.rb +35 -8
- data/lib/decidim/generators/app_templates/.ruby-version +1 -1
- data/lib/decidim/generators/app_templates/README.md.erb +1 -1
- data/lib/decidim/generators/app_templates/bullet_initializer.rb +2 -0
- data/lib/decidim/generators/app_templates/docker-compose-etherpad.yml +2 -2
- data/lib/decidim/generators/app_templates/initializer.rb +2 -24
- data/lib/decidim/generators/app_templates/package.json +19 -0
- data/lib/decidim/generators/app_templates/rack_profiler_initializer.rb +1 -0
- data/lib/decidim/generators/app_templates/secrets.yml.erb +0 -40
- data/lib/decidim/generators/component_templates/.ruby-version +1 -1
- data/lib/decidim/generators/component_templates/Gemfile.erb +3 -3
- data/lib/decidim/generators/component_templates/README.md.erb +1 -1
- data/lib/decidim/generators/component_templates/github/ci.yml.erb +6 -6
- data/lib/decidim/generators/install_generator.rb +38 -37
- data/lib/decidim/generators/test/generator_examples.rb +6 -144
- data/lib/decidim/generators/version.rb +1 -1
- metadata +8 -8
- data/lib/decidim/generators/app_templates/carrierwave.rb +0 -31
data/decidim-generators.gemspec
CHANGED
data/exe/decidim
CHANGED
|
@@ -31,8 +31,8 @@ Options:
|
|
|
31
31
|
[name] creates an application based on Decidim
|
|
32
32
|
|
|
33
33
|
App generation extra options (ignored if the --component flag is on):
|
|
34
|
-
--storage [provider] Setup the Gemfile with the
|
|
35
|
-
--queue [provider] Setup the Gemfile with the
|
|
34
|
+
--storage [provider] Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs, azure
|
|
35
|
+
--queue [provider] Setup the Gemfile with the appropriate gem to handle a job queue backend. Only 'sidekiq' is supported as option for now.
|
|
36
36
|
--force_ssl [true|false] Enables or disables mandatory redirection to HTTPS (defaults to enabled)
|
|
37
37
|
--locales [locales] Force the available locales to the ones specified. Separate with comas
|
|
38
38
|
Warning: this option disables the ENV var DECIDIM_AVAILABLE_LOCALES used to setup this configuration by default.
|
|
@@ -79,11 +79,11 @@ module Decidim
|
|
|
79
79
|
|
|
80
80
|
class_option :storage, type: :string,
|
|
81
81
|
default: "local",
|
|
82
|
-
desc: "Setup the Gemfile with the
|
|
82
|
+
desc: "Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs, azure"
|
|
83
83
|
|
|
84
84
|
class_option :queue, type: :string,
|
|
85
85
|
default: "",
|
|
86
|
-
desc: "Setup the Gemfile with the
|
|
86
|
+
desc: "Setup the Gemfile with the appropriate gem to handle a queue adapter provider. Supported options are: (empty, does nothing) and sidekiq"
|
|
87
87
|
|
|
88
88
|
class_option :skip_webpack_install, type: :boolean,
|
|
89
89
|
default: true,
|
|
@@ -98,6 +98,28 @@ module Decidim
|
|
|
98
98
|
[]
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
+
def remove_old_assets
|
|
102
|
+
remove_file "config/initializers/assets.rb"
|
|
103
|
+
remove_dir("app/assets")
|
|
104
|
+
remove_dir("app/javascript")
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def remove_sprockets_requirement
|
|
108
|
+
gsub_file "config/application.rb", %r{require ['"]rails/all['"]\R}, <<~RUBY
|
|
109
|
+
require "decidim/rails"
|
|
110
|
+
|
|
111
|
+
# Add the frameworks used by your app that are not loaded by Decidim.
|
|
112
|
+
# require "action_mailbox/engine"
|
|
113
|
+
# require "action_text/engine"
|
|
114
|
+
require "action_cable/engine"
|
|
115
|
+
require "rails/test_unit/railtie"
|
|
116
|
+
RUBY
|
|
117
|
+
|
|
118
|
+
gsub_file "config/environments/development.rb", /config\.assets.*$/, ""
|
|
119
|
+
gsub_file "config/environments/test.rb", /config\.assets.*$/, ""
|
|
120
|
+
gsub_file "config/environments/production.rb", /config\.assets.*$/, ""
|
|
121
|
+
end
|
|
122
|
+
|
|
101
123
|
def database_yml
|
|
102
124
|
template "database.yml.erb", "config/database.yml", force: true
|
|
103
125
|
end
|
|
@@ -159,7 +181,7 @@ module Decidim
|
|
|
159
181
|
|
|
160
182
|
gsub_file "Gemfile", /gem "decidim-dev".*/, "gem \"decidim-dev\", #{gem_modifier}"
|
|
161
183
|
|
|
162
|
-
%w(conferences design
|
|
184
|
+
%w(conferences design initiatives templates).each do |component|
|
|
163
185
|
if options[:demo]
|
|
164
186
|
gsub_file "Gemfile", /gem "decidim-#{component}".*/, "gem \"decidim-#{component}\", #{gem_modifier}"
|
|
165
187
|
else
|
|
@@ -223,10 +245,10 @@ module Decidim
|
|
|
223
245
|
end
|
|
224
246
|
end
|
|
225
247
|
|
|
226
|
-
def
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
248
|
+
def load_defaults_rails61
|
|
249
|
+
gsub_file "config/application.rb",
|
|
250
|
+
/config.load_defaults 7.0/,
|
|
251
|
+
"config.load_defaults 6.1"
|
|
230
252
|
end
|
|
231
253
|
|
|
232
254
|
def tweak_csp_initializer
|
|
@@ -299,7 +321,7 @@ module Decidim
|
|
|
299
321
|
"config.log_level = %w(debug info warn error fatal).include?(ENV['RAILS_LOG_LEVEL']) ? ENV['RAILS_LOG_LEVEL'] : :info"
|
|
300
322
|
|
|
301
323
|
gsub_file "config/environments/production.rb",
|
|
302
|
-
%r{# config.asset_host =
|
|
324
|
+
%r{# config.asset_host = "http://assets.example.com"},
|
|
303
325
|
"config.asset_host = ENV['RAILS_ASSET_HOST'] if ENV['RAILS_ASSET_HOST'].present?"
|
|
304
326
|
|
|
305
327
|
if options[:force_ssl] == "false"
|
|
@@ -335,6 +357,11 @@ module Decidim
|
|
|
335
357
|
end
|
|
336
358
|
end
|
|
337
359
|
CONFIG
|
|
360
|
+
|
|
361
|
+
if ENV.fetch("RAILS_BOOST_PERFORMANCE", false).to_s == "true"
|
|
362
|
+
gsub_file "Gemfile", /gem "spring".*/, "# gem \"spring\""
|
|
363
|
+
gsub_file "Gemfile", /gem "spring-watcher-listen".*/, "# gem \"spring-watcher-listen\""
|
|
364
|
+
end
|
|
338
365
|
end
|
|
339
366
|
|
|
340
367
|
def authorization_handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.2.2
|
|
@@ -9,7 +9,7 @@ This is the open-source repository for <%= app_name %>, based on [Decidim](https
|
|
|
9
9
|
You will need to do some steps before having the app working properly once you have deployed it:
|
|
10
10
|
|
|
11
11
|
1. Create a System Admin user: `bin/rails decidim_system:create_admin`
|
|
12
|
-
1. Visit `<your app url>/system` and
|
|
12
|
+
1. Visit `<your app url>/system` and log in with your system admin credentials
|
|
13
13
|
1. Create a new organization. Check the locales you want to use for that organization, and select a default locale.
|
|
14
14
|
1. Set the correct default host for the organization, otherwise the app will not work properly. Note that you need to include any subdomain you might be using.
|
|
15
15
|
1. Fill the rest of the form and submit it.
|
|
@@ -5,6 +5,8 @@ if defined?(Bullet) && !Rails.application.config.try(:boost_performance)
|
|
|
5
5
|
Bullet.enable = true
|
|
6
6
|
Bullet.bullet_logger = true
|
|
7
7
|
Bullet.rails_logger = true
|
|
8
|
+
Bullet.add_footer = true
|
|
9
|
+
Bullet.skip_user_in_notification = true
|
|
8
10
|
Bullet.stacktrace_includes = %w(decidim-)
|
|
9
11
|
end
|
|
10
12
|
end
|
|
@@ -11,7 +11,7 @@ services:
|
|
|
11
11
|
- ETHERPAD_ADMIN_PASSWORD=CHANGE_ME_ADMIN_PASSWORD
|
|
12
12
|
# If the admin password is set, this defaults to "admin". Otherwise the user can set it to another username.
|
|
13
13
|
- ETHERPAD_ADMIN_USER=CHANGE_ME_ADMIN_USER
|
|
14
|
-
# Type of
|
|
14
|
+
# Type of database to use. Defaults to mysql.
|
|
15
15
|
- ETHERPAD_DB_TYPE=mysql
|
|
16
16
|
# Hostname of the database to use. Defaults to mysql.
|
|
17
17
|
- ETHERPAD_DB_HOST=mysql
|
|
@@ -27,7 +27,7 @@ services:
|
|
|
27
27
|
- ETHERPAD_API_KEY=CHANGE_ME_API_KEY
|
|
28
28
|
# You can skip this if you are not using any proxy to handle SSL certificates.
|
|
29
29
|
- "TRUST_PROXY=true"
|
|
30
|
-
# Ensure this etherpad allows cookies while
|
|
30
|
+
# Ensure this etherpad allows cookies while embedded in an Iframe
|
|
31
31
|
- "COOKIE_SAME_SITE=None"
|
|
32
32
|
# Official image is etherpad/etherpad but the latest version does not allow yet setting cookies to SameSite=None
|
|
33
33
|
image: 'platoniq/etherpad:1.8.7'
|
|
@@ -236,7 +236,7 @@ Decidim.configure do |config|
|
|
|
236
236
|
#
|
|
237
237
|
# Provide a class to generate a timestamp for a document. The instances of
|
|
238
238
|
# this class are initialized with a hash containing the :document key with
|
|
239
|
-
# the document to be timestamped as value. The
|
|
239
|
+
# the document to be timestamped as value. The instances respond to a
|
|
240
240
|
# timestamp public method with the timestamp
|
|
241
241
|
#
|
|
242
242
|
# An example class would be something like:
|
|
@@ -320,7 +320,7 @@ Decidim.configure do |config|
|
|
|
320
320
|
# to interact with third party service to translate the user content.
|
|
321
321
|
#
|
|
322
322
|
# If you still want to use "Decidim::Dev::DummyTranslator" as translator placeholder,
|
|
323
|
-
# add the
|
|
323
|
+
# add the following line at the beginning of this file:
|
|
324
324
|
# require "decidim/dev/dummy_translator"
|
|
325
325
|
#
|
|
326
326
|
# An example class would be something like:
|
|
@@ -415,8 +415,6 @@ end
|
|
|
415
415
|
|
|
416
416
|
if Decidim.module_installed? :proposals
|
|
417
417
|
Decidim::Proposals.configure do |config|
|
|
418
|
-
config.similarity_threshold = Rails.application.secrets.dig(:decidim, :proposals, :similarity_threshold).presence || 0.25
|
|
419
|
-
config.similarity_limit = Rails.application.secrets.dig(:decidim, :proposals, :similarity_limit).presence || 10
|
|
420
418
|
config.participatory_space_highlighted_proposals_limit = Rails.application.secrets.dig(:decidim, :proposals, :participatory_space_highlighted_proposals_limit).presence || 4
|
|
421
419
|
config.process_group_highlighted_proposals_limit = Rails.application.secrets.dig(:decidim, :proposals, :process_group_highlighted_proposals_limit).presence || 3
|
|
422
420
|
end
|
|
@@ -455,8 +453,6 @@ if Decidim.module_installed? :initiatives
|
|
|
455
453
|
unless Rails.application.secrets.dig(:decidim, :initiatives, :creation_enabled) == "auto"
|
|
456
454
|
config.creation_enabled = Rails.application.secrets.dig(:decidim, :initiatives, :creation_enabled).present?
|
|
457
455
|
end
|
|
458
|
-
config.similarity_threshold = Rails.application.secrets.dig(:decidim, :initiatives, :similarity_threshold).presence || 0.25
|
|
459
|
-
config.similarity_limit = Rails.application.secrets.dig(:decidim, :initiatives, :similarity_limit).presence || 5
|
|
460
456
|
config.minimum_committee_members = Rails.application.secrets.dig(:decidim, :initiatives, :minimum_committee_members).presence || 2
|
|
461
457
|
config.default_signature_time_period_length = Rails.application.secrets.dig(:decidim, :initiatives, :default_signature_time_period_length).presence || 120
|
|
462
458
|
config.default_components = Rails.application.secrets.dig(:decidim, :initiatives, :default_components)
|
|
@@ -471,24 +467,6 @@ if Decidim.module_installed? :initiatives
|
|
|
471
467
|
end
|
|
472
468
|
end
|
|
473
469
|
|
|
474
|
-
if Decidim.module_installed? :elections
|
|
475
|
-
Decidim::Elections.configure do |config|
|
|
476
|
-
config.setup_minimum_hours_before_start = Rails.application.secrets.dig(:elections, :setup_minimum_hours_before_start).presence || 1
|
|
477
|
-
config.start_vote_maximum_hours_before_start = Rails.application.secrets.dig(:elections, :start_vote_maximum_hours_before_start).presence || 6
|
|
478
|
-
config.voter_token_expiration_minutes = Rails.application.secrets.dig(:elections, :voter_token_expiration_minutes).presence || 120
|
|
479
|
-
config.document_types = Rails.application.secrets.dig(:elections, :document_types).presence || %w(identification_number passport)
|
|
480
|
-
end
|
|
481
|
-
|
|
482
|
-
Decidim::Votings.configure do |config|
|
|
483
|
-
config.check_census_max_requests = Rails.application.secrets.dig(:elections, :votings, :check_census_max_requests).presence || 5
|
|
484
|
-
config.throttling_period = Rails.application.secrets.dig(:elections, :votings, :throttling_period).to_i.minutes
|
|
485
|
-
end
|
|
486
|
-
|
|
487
|
-
Decidim::Votings::Census.configure do |config|
|
|
488
|
-
config.census_access_codes_export_expiry_time = Rails.application.secrets.dig(:elections, :votings, :census, :access_codes_export_expiry_time).to_i.days
|
|
489
|
-
end
|
|
490
|
-
end
|
|
491
|
-
|
|
492
470
|
Rails.application.config.i18n.available_locales = Decidim.available_locales
|
|
493
471
|
Rails.application.config.i18n.default_locale = Decidim.default_locale
|
|
494
472
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "decidim-development-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@decidim/browserslist-config": "file:packages/browserslist-config",
|
|
6
|
+
"@decidim/core": "file:packages/core",
|
|
7
|
+
"@decidim/webpacker": "file:packages/webpacker"
|
|
8
|
+
},
|
|
9
|
+
"version": "0.1.0",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@decidim/dev": "file:packages/dev",
|
|
12
|
+
"@decidim/eslint-config": "file:packages/eslint-config",
|
|
13
|
+
"@decidim/prettier-config": "file:packages/prettier-config",
|
|
14
|
+
"@decidim/stylelint-config": "file:packages/stylelint-config"
|
|
15
|
+
},
|
|
16
|
+
"browserslist": [
|
|
17
|
+
"extends @decidim/browserslist-config"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -6,4 +6,5 @@ if Rails.env.development? && !Rails.application.config.try(:boost_performance)
|
|
|
6
6
|
# initialization is skipped so trigger it
|
|
7
7
|
Rack::MiniProfilerRails.initialize!(Rails.application)
|
|
8
8
|
Rack::MiniProfiler.config.skip_paths << "/favicon.ico"
|
|
9
|
+
Rack::MiniProfiler.config.position = "bottom-left"
|
|
9
10
|
end
|
|
@@ -54,8 +54,6 @@ decidim_default: &decidim_default
|
|
|
54
54
|
schema_max_complexity: <%%= Decidim::Env.new("API_SCHEMA_MAX_COMPLEXITY", 5000).to_i %>
|
|
55
55
|
schema_max_depth: <%%= Decidim::Env.new("API_SCHEMA_MAX_DEPTH", 15).to_i %>
|
|
56
56
|
proposals:
|
|
57
|
-
similarity_threshold: <%%= Decidim::Env.new("PROPOSALS_SIMILARITY_THRESHOLD", 0.25).to_f %>
|
|
58
|
-
similarity_limit: <%%= Decidim::Env.new("PROPOSALS_SIMILARITY_LIMIT", 10).to_i %>
|
|
59
57
|
participatory_space_highlighted_proposals_limit: <%%= Decidim::Env.new("PROPOSALS_PARTICIPATORY_SPACE_HIGHLIGHTED_PROPOSALS_LIMIT", 4).to_i %>
|
|
60
58
|
process_group_highlighted_proposals_limit: <%%= Decidim::Env.new("PROPOSALS_PROCESS_GROUP_HIGHLIGHTED_PROPOSALS_LIMIT", 3).to_i %>
|
|
61
59
|
meetings:
|
|
@@ -68,8 +66,6 @@ decidim_default: &decidim_default
|
|
|
68
66
|
enable_proposal_linking: <%%= Decidim::Env.new("ACCOUNTABILITY_ENABLE_PROPOSAL_LINKING", "auto").default_or_present_if_exists.to_s %>
|
|
69
67
|
initiatives:
|
|
70
68
|
creation_enabled: <%%= Decidim::Env.new("INITIATIVES_CREATION_ENABLED", "auto").default_or_present_if_exists.to_s %>
|
|
71
|
-
similarity_threshold: <%%= Decidim::Env.new("INITIATIVES_SIMILARITY_THRESHOLD", 0.25).to_f %>
|
|
72
|
-
similarity_limit: <%%= Decidim::Env.new("INITIATIVES_SIMILARITY_LIMIT", 5).to_i %>
|
|
73
69
|
minimum_committee_members: <%%= Decidim::Env.new("INITIATIVES_MINIMUM_COMMITTEE_MEMBERS", 2).to_i %>
|
|
74
70
|
default_signature_time_period_length: <%%= Decidim::Env.new("INITIATIVES_DEFAULT_SIGNATURE_TIME_PERIOD_LENGTH", 120).to_i %>
|
|
75
71
|
default_components: <%%= Decidim::Env.new("INITIATIVES_DEFAULT_COMPONENTS", "pages, meetings").to_array.to_json %>
|
|
@@ -82,18 +78,6 @@ decidim_default: &decidim_default
|
|
|
82
78
|
verifications:
|
|
83
79
|
document_types: <%%= Decidim::Env.new("VERIFICATIONS_DOCUMENT_TYPES", "identification_number,passport").to_array %>
|
|
84
80
|
|
|
85
|
-
elections_default: &elections_default
|
|
86
|
-
bulletin_board_server: <%%= Decidim::Env.new("ELECTIONS_BULLETIN_BOARD_SERVER", 'http://bulletin-board.lvh.me:8000/api').to_s %>
|
|
87
|
-
bulletin_board_public_key: {"kty":"RSA","n":"zMXsZpYPKkDlSmezX898y7zNOaJ7ENIN4kj4UhQ95Vm4HlgTpIs2VMMsO0eqynMaOR_G1mXdqbpbaJtXijBe4V8323QwGm6WVAa71E7pDXa5g6-uo5f8GePitN0YER9y2yNQN4uTaNzJiWV2uLBUYfMdj3SIif31YwLULHAOj3B_oleFK8coE_Qr3NzATcYBmsqE8AR4NljxTO6KDmP1SLdf5GBOBhOAIFbnL_Kpj2xkm7MS3hjMVKpiRhqA1UgX5oKZ8ixBv46fNJF0pBsHi3fHNjK9oZzgdx_AI-YFpdE_40-8bh_g9sWzxacqOM2-MdQLHbvRPEVltO3E8tr6I5YWrylcP7l9VD8OJeqjq2qFYHnGYdmLoD2XuXmI9EuBvSb9H4-qcartxZSIQCimKib_fxZvgrG1FSRRhK6YpvIdGv4-G2zfCCRsC4XD80TYI2bf-oYCoy7eU3_eVHFMV2yg4p1Wnuw2Vgq0edPL_bKaV9JvGx7F-U5juxNN0WZR9LzbPl4ReejzN95lyHgbj0nTH_u3bSpZmgJrQF-PwdnPcG46deVjJgUeosrlC4lQxVrRz0GL58BuFunnz2uYDBDrcJCiG60EbdkAFHjOcXU4wrUWATin7je_aqdBXhSnkTafcJAMvL7Y2Ld7vDge8nLqjAVlAi5am3rN0kqKT6M","e":"AQAB","kid":"a8e86f02ca27e1861bfc49e2a9a4614ca9068f8efdb6d42d19d3aab0eb2a31be"}
|
|
88
|
-
authority_private_key: {"kty":"RSA","n":"pNgMt8lnPDD3TlWYGhRiV1oZkPQmnLdiUzwyb_-35qKD9k-HU86xo0uSgoOUWkBtnvFsc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SFcGMI_dh2-Ab5RV5yTrTok4onID1dXKbAlRq1ny825U2Eq-TZTyJEQoA3RkZtpSkBzInLrFbd2f3GWodKKSZggpnCLDd4H-1fXlbDYCXSJpoikAdZ1nFgXnnrUDdKRaAajnwpIYtIvXVewSQYR-BULzunUtIRZt8hx_6FRzhRha9gH_TtPTeYZ_vISuz0Y2rhUpx1Q2kaLlR9M8PUxm47l0xvX3LMKN6h6oWxFtn7wq0qwZ-Bjv24mOrOAQ","dq":"nXGD10hURrwk9W7hxP0sjB2Rdnr06iv3THs4JWFL16_h32bZO1BSWoho_chbgYlMmtFXGFFIWVLxAcAI2gWC_MA4cbmapvIMW2LNh1vgxJW5v95_NuGUlECeEEwcAu1-_b7z5XBCmAy3nLem9sbb_5wv0hMpPH0VRvbnZeBO3SBIkO0lddYCqU-8wN9HqkyoexQleSUnAm1O0iy4GIHT2aEmdNaRaKy2EhmNiTZdZeseZueOvyGPtTVONp2ofacMdcN0z39jr22qo9DWtdusd7nVPOpqkllEF6GrGUeHBnGD92n4YjDuxRnqefu8fXxUFrcLav0p8CNSv9ek291woQ","qi":"w6hfKEBLLHRWPkjajgxZyyetj-UFfVkILRT0plOllJ2JV8whcOXRXbiXH2r8zqMeyMFrrMwmuvv4TVQaruKB0ZQOG7Tz5Lw0RZEREOLnBwc3vSi_iLd-jBz01LdExTpqsAHMkaMQR9x62J8DE1ZNxVdn3ELYKik0f1L2r_WErzhvT1uq69HAybUp6WHcFYH0PSqHg4LOneXAdU1_g-ji2Zn9dlA_2oYGQ5S6JXPV7v2IVbEFpxyVD1lPbFT0iKhyZZevictjgD_JGHveIVqsq5w0Csyz08h0oEW9hYEq-4bquMxSf18gjldoS5uQPD7FUECgL8bxsCdc4hP6UEKYGw"}
|
|
89
|
-
authority_name: "Decidim Test Authority"
|
|
90
|
-
authority_api_key: "89Ht70GZNcicu8WEyagz_rRae6brbqZAGuBEICYBCii-PTV3MAstAtx1aRVe5H5YfODi-JgYPvyf9ZMH7tOeZ15e3mf9B2Ymgw7eknvBFMRP213YFGo1SPn_C4uLK90G"
|
|
91
|
-
scheme_name: "dummy"
|
|
92
|
-
quorum: 2
|
|
93
|
-
number_of_trustees: 3
|
|
94
|
-
setup_minimum_hours_before_start: 1
|
|
95
|
-
document_types: <%%= Decidim::Env.new("ELECTIONS_DOCUMENT_TYPES", "identification_number,passport").to_array.to_json %>
|
|
96
|
-
|
|
97
81
|
storage_default: &storage_default
|
|
98
82
|
provider: <%%= Decidim::Env.new("STORAGE_PROVIDER", "local").to_s %>
|
|
99
83
|
cdn_host: <%%= ENV["STORAGE_CDN_HOST"] %>
|
|
@@ -154,8 +138,6 @@ default: &default
|
|
|
154
138
|
server: <%%= ENV["ETHERPAD_SERVER"] %>
|
|
155
139
|
api_key: <%%= ENV["ETHERPAD_API_KEY"] %>
|
|
156
140
|
api_version: <%%= Decidim::Env.new("ETHERPAD_API_VERSION", "1.2.1") %>
|
|
157
|
-
elections:
|
|
158
|
-
<<: *elections_default
|
|
159
141
|
storage:
|
|
160
142
|
<<: *storage_default
|
|
161
143
|
vapid:
|
|
@@ -187,10 +169,6 @@ test:
|
|
|
187
169
|
enabled: true
|
|
188
170
|
client_id:
|
|
189
171
|
client_secret:
|
|
190
|
-
elections:
|
|
191
|
-
<<: *elections_default
|
|
192
|
-
bulletin_board_server: <%%= Decidim::Env.new("ELECTIONS_BULLETIN_BOARD_SERVER", 'http://bulletin-board.lvh.me:5017/api').to_s %>
|
|
193
|
-
|
|
194
172
|
|
|
195
173
|
# Do not keep production secrets in the repository,
|
|
196
174
|
# instead read values from the environment.
|
|
@@ -204,21 +182,3 @@ production:
|
|
|
204
182
|
smtp_port: <%%= Decidim::Env.new("SMTP_PORT", 587).to_i %>
|
|
205
183
|
smtp_starttls_auto: <%%= Decidim::Env.new("SMTP_STARTTLS_AUTO").to_boolean_string %>
|
|
206
184
|
smtp_authentication: <%%= Decidim::Env.new("SMTP_AUTHENTICATION", "plain").to_s %>
|
|
207
|
-
elections:
|
|
208
|
-
bulletin_board_server: <%%= ENV["BULLETIN_BOARD_SERVER"] %>
|
|
209
|
-
bulletin_board_public_key: <%%= ENV["BULLETIN_BOARD_PUBLIC_KEY"] %>
|
|
210
|
-
authority_api_key: <%%= ENV["BULLETIN_BOARD_API_KEY"] %>
|
|
211
|
-
authority_name: <%%= ENV["AUTHORITY_NAME"] %>
|
|
212
|
-
authority_private_key: <%%= ENV["AUTHORITY_PRIVATE_KEY"] %>
|
|
213
|
-
scheme_name: <%%= Decidim::Env.new("ELECTIONS_SCHEME_NAME", "electionguard").to_s %>
|
|
214
|
-
number_of_trustees: <%%= Decidim::Env.new("ELECTIONS_NUMBER_OF_TRUSTEES").to_i %>
|
|
215
|
-
quorum: <%%= Decidim::Env.new("ELECTIONS_QUORUM").to_i %>
|
|
216
|
-
setup_minimum_hours_before_start: <%%= Decidim::Env.new("ELECTIONS_SETUP_MINIMUM_HOURS_BEFORE_START", 1).to_i %>
|
|
217
|
-
start_vote_maximum_hours_before_start: <%%= Decidim::Env.new("ELECTIONS_START_VOTE_MAXIMUM_HOURS_BEFORE_START", 6).to_i %>
|
|
218
|
-
voter_token_expiration_minutes: <%%= Decidim::Env.new("ELECTIONS_VOTER_TOKEN_EXPIRATION_MINUTES", 120).to_i %>
|
|
219
|
-
document_types: <%%= Decidim::Env.new("ELECTIONS_DOCUMENT_TYPES", "identification_number,passport").to_array.to_json %>
|
|
220
|
-
votings:
|
|
221
|
-
check_census_max_requests: <%%= Decidim::Env.new("VOTINGS_CHECK_CENSUS_MAX_REQUESTS", 5).to_i %>
|
|
222
|
-
throttling_period: <%%= Decidim::Env.new("VOTINGS_THROTTLING_PERIOD", 1).to_i %>
|
|
223
|
-
census:
|
|
224
|
-
access_codes_export_expiry_time: <%%= Decidim::Env.new("VOTINGS_CENSUS_ACCESS_CODES_EXPORT_EXPIRY_TIME", 2).to_i %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.2.2
|
|
@@ -5,7 +5,7 @@ source "https://rubygems.org"
|
|
|
5
5
|
|
|
6
6
|
ruby RUBY_VERSION
|
|
7
7
|
|
|
8
|
-
gem "decidim", "~> 0.
|
|
8
|
+
gem "decidim", "~> 0.29.0.rc1"
|
|
9
9
|
gem "decidim-<%= component_name %>", path: "."
|
|
10
10
|
|
|
11
11
|
gem "puma", ">= 6.3.1"
|
|
@@ -14,14 +14,14 @@ gem "bootsnap", "~> 1.4"
|
|
|
14
14
|
group :development, :test do
|
|
15
15
|
gem "byebug", "~> 11.0", platform: :mri
|
|
16
16
|
|
|
17
|
-
gem "decidim-dev", "~> 0.
|
|
17
|
+
gem "decidim-dev", "~> 0.29.0.rc1"
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
group :development do
|
|
21
21
|
gem "faker", "~> 3.2"
|
|
22
22
|
gem "letter_opener_web", "~> 2.0"
|
|
23
23
|
gem "listen", "~> 3.1"
|
|
24
|
-
gem "spring", "~>
|
|
24
|
+
gem "spring", "~> 4.0"
|
|
25
25
|
gem "spring-watcher-listen", "~> 2.0"
|
|
26
26
|
gem "web-console", "~> 4.2"
|
|
27
27
|
end
|
|
@@ -29,7 +29,7 @@ We expect the contributions to follow the [Decidim's contribution guide](https:/
|
|
|
29
29
|
|
|
30
30
|
## Security
|
|
31
31
|
|
|
32
|
-
Security is very important to us. If you have any issue regarding security, please disclose the information responsibly by sending an email to __<%= security_email %>__ and not by creating a
|
|
32
|
+
Security is very important to us. If you have any issue regarding security, please disclose the information responsibly by sending an email to __<%= security_email %>__ and not by creating a GitHub issue.
|
|
33
33
|
|
|
34
34
|
## License
|
|
35
35
|
|
|
@@ -39,19 +39,19 @@ jobs:
|
|
|
39
39
|
DATABASE_PASSWORD: postgres
|
|
40
40
|
DATABASE_HOST: localhost
|
|
41
41
|
steps:
|
|
42
|
-
- uses: actions/checkout@
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
43
|
with:
|
|
44
44
|
fetch-depth: 1
|
|
45
45
|
- uses: ruby/setup-ruby@v1
|
|
46
46
|
with:
|
|
47
47
|
bundler-cache: true
|
|
48
|
-
- uses: actions/setup-node@
|
|
48
|
+
- uses: actions/setup-node@v4
|
|
49
49
|
with:
|
|
50
50
|
node-version: ${{ env.NODE_VERSION }}
|
|
51
51
|
- name: Get npm cache directory path
|
|
52
52
|
id: npm-cache-dir-path
|
|
53
53
|
run: echo "dir=$(npm get cache)-<%= component_name %>" >> $GITHUB_OUTPUT
|
|
54
|
-
- uses: actions/cache@
|
|
54
|
+
- uses: actions/cache@v4
|
|
55
55
|
id: npm-cache
|
|
56
56
|
with:
|
|
57
57
|
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
|
|
@@ -63,13 +63,13 @@ jobs:
|
|
|
63
63
|
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
|
|
64
64
|
name: Create the screenshots folder
|
|
65
65
|
- uses: nanasess/setup-chromedriver@v2
|
|
66
|
-
- run: RAILS_ENV=test bundle exec rails
|
|
66
|
+
- run: RAILS_ENV=test bundle exec rails shakapacker:compile
|
|
67
67
|
name: Precompile assets
|
|
68
68
|
working-directory: ./spec/decidim_dummy_app/
|
|
69
69
|
- run: bundle exec rspec
|
|
70
70
|
name: RSpec
|
|
71
|
-
- uses: codecov/codecov-action@
|
|
72
|
-
- uses: actions/upload-artifact@
|
|
71
|
+
- uses: codecov/codecov-action@v4
|
|
72
|
+
- uses: actions/upload-artifact@v4
|
|
73
73
|
if: always()
|
|
74
74
|
with:
|
|
75
75
|
name: screenshots
|
|
@@ -45,10 +45,6 @@ module Decidim
|
|
|
45
45
|
RUBY
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
def copy_initializer
|
|
49
|
-
copy_file "carrierwave.rb", "config/initializers/carrierwave.rb"
|
|
50
|
-
end
|
|
51
|
-
|
|
52
48
|
def secrets
|
|
53
49
|
template "secrets.yml.erb", "config/secrets.yml", force: true
|
|
54
50
|
end
|
|
@@ -77,6 +73,12 @@ module Decidim
|
|
|
77
73
|
end
|
|
78
74
|
end
|
|
79
75
|
|
|
76
|
+
def skip_gemfile_if_defined
|
|
77
|
+
return unless options[:skip_gemfile]
|
|
78
|
+
|
|
79
|
+
remove_file "Gemfile"
|
|
80
|
+
end
|
|
81
|
+
|
|
80
82
|
def install_decidim_webpacker
|
|
81
83
|
# Copy CSS file
|
|
82
84
|
copy_file "decidim_application.scss", "app/packs/stylesheets/decidim/decidim_application.scss"
|
|
@@ -94,6 +96,9 @@ module Decidim
|
|
|
94
96
|
bundle_install
|
|
95
97
|
rails "shakapacker:binstubs"
|
|
96
98
|
|
|
99
|
+
# Copy package.json
|
|
100
|
+
copy_file "package.json", "package.json"
|
|
101
|
+
|
|
97
102
|
# Run Decidim custom webpacker installation
|
|
98
103
|
rails "decidim:webpacker:install"
|
|
99
104
|
|
|
@@ -109,33 +114,6 @@ module Decidim
|
|
|
109
114
|
rails "decidim_api:generate_docs"
|
|
110
115
|
end
|
|
111
116
|
|
|
112
|
-
def remove_old_assets
|
|
113
|
-
remove_file "config/initializers/assets.rb"
|
|
114
|
-
remove_dir("app/assets")
|
|
115
|
-
remove_dir("app/javascript")
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def remove_sprockets_requirement
|
|
119
|
-
gsub_file "config/application.rb", %r{require ['"]rails/all['"]\R}, <<~RUBY
|
|
120
|
-
require "decidim/rails"
|
|
121
|
-
|
|
122
|
-
# Add the frameworks used by your app that are not loaded by Decidim.
|
|
123
|
-
# require "action_mailbox/engine"
|
|
124
|
-
# require "action_text/engine"
|
|
125
|
-
require "action_cable/engine"
|
|
126
|
-
require "rails/test_unit/railtie"
|
|
127
|
-
RUBY
|
|
128
|
-
|
|
129
|
-
gsub_file "config/environments/development.rb", /config\.assets.*$/, ""
|
|
130
|
-
gsub_file "config/environments/test.rb", /config\.assets.*$/, ""
|
|
131
|
-
gsub_file "config/environments/production.rb", /config\.assets.*$/, ""
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
def copy_migrations
|
|
135
|
-
rails "decidim:choose_target_plugins", "railties:install:migrations"
|
|
136
|
-
recreate_db if options[:recreate_db]
|
|
137
|
-
end
|
|
138
|
-
|
|
139
117
|
def letter_opener_web
|
|
140
118
|
route <<~RUBY
|
|
141
119
|
if Rails.env.development?
|
|
@@ -173,10 +151,31 @@ module Decidim
|
|
|
173
151
|
copy_file "rack_profiler_initializer.rb", "config/initializers/rack_profiler.rb"
|
|
174
152
|
end
|
|
175
153
|
|
|
154
|
+
def tweak_spring
|
|
155
|
+
run "bundle exec spring stop"
|
|
156
|
+
run "bundle exec spring binstub --all"
|
|
157
|
+
|
|
158
|
+
create_file "config/spring.rb", <<~CONFIG
|
|
159
|
+
require "decidim/spring"
|
|
160
|
+
|
|
161
|
+
Spring.watch(
|
|
162
|
+
".ruby-version",
|
|
163
|
+
".rbenv-vars",
|
|
164
|
+
"tmp/restart.txt",
|
|
165
|
+
"tmp/caching-dev.txt"
|
|
166
|
+
)
|
|
167
|
+
CONFIG
|
|
168
|
+
end
|
|
169
|
+
|
|
176
170
|
def bundle_install
|
|
177
171
|
run "bundle install"
|
|
178
172
|
end
|
|
179
173
|
|
|
174
|
+
def copy_migrations
|
|
175
|
+
rails "decidim:choose_target_plugins", "railties:install:migrations"
|
|
176
|
+
recreate_db if options[:recreate_db]
|
|
177
|
+
end
|
|
178
|
+
|
|
180
179
|
private
|
|
181
180
|
|
|
182
181
|
def recreate_db
|
|
@@ -185,19 +184,21 @@ module Decidim
|
|
|
185
184
|
|
|
186
185
|
rails "db:migrate"
|
|
187
186
|
|
|
188
|
-
rails "
|
|
187
|
+
rails "assets:precompile"
|
|
188
|
+
|
|
189
|
+
rails "--trace", "db:seed" if options[:seed_db]
|
|
189
190
|
|
|
190
191
|
rails "db:test:prepare"
|
|
191
192
|
end
|
|
192
193
|
|
|
193
|
-
# Runs rails commands in a subprocess, and aborts if it does not
|
|
194
|
-
def rails(*
|
|
195
|
-
abort unless system("bin/rails", *
|
|
194
|
+
# Runs rails commands in a subprocess, and aborts if it does not succeed
|
|
195
|
+
def rails(*)
|
|
196
|
+
abort unless system("bin/rails", *)
|
|
196
197
|
end
|
|
197
198
|
|
|
198
199
|
# Runs rails commands in a subprocess silencing errors, and ignores status
|
|
199
|
-
def soft_rails(*
|
|
200
|
-
system("bin/rails",
|
|
200
|
+
def soft_rails(*)
|
|
201
|
+
system("bin/rails", *, err: File::NULL)
|
|
201
202
|
end
|
|
202
203
|
|
|
203
204
|
def cut(text, strip: true)
|