rails_template_18f 0.8.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +58 -28
  4. data/README.md +5 -5
  5. data/Rakefile +12 -0
  6. data/SECURITY.md +18 -0
  7. data/lib/generators/rails_template18f/active_storage/active_storage_generator.rb +2 -9
  8. data/lib/generators/rails_template18f/active_storage/templates/oscal/component-definitions/active_storage/component-definition.json +69 -0
  9. data/lib/generators/rails_template18f/circleci/circleci_generator.rb +3 -3
  10. data/lib/generators/rails_template18f/circleci/templates/bin/ci-server-start +1 -1
  11. data/lib/generators/rails_template18f/circleci/templates/circleci/config.yml.tt +59 -16
  12. data/lib/generators/rails_template18f/circleci/templates/docker-compose.ci.yml +1 -0
  13. data/lib/generators/rails_template18f/circleci/templates/oscal/component-definitions/circleci/component-definition.json.tt +310 -0
  14. data/lib/generators/rails_template18f/github_actions/github_actions_generator.rb +7 -12
  15. data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-languages/action.yml.tt +1 -1
  16. data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt +1 -0
  17. data/lib/generators/rails_template18f/github_actions/templates/github/actions/trestle-cmd/action.yml +20 -0
  18. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/assemble-ssp.yml.tt +26 -0
  19. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/brakeman-analysis.yml +6 -2
  20. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/dependency-scans.yml +4 -4
  21. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt +14 -25
  22. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt +14 -25
  23. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt +8 -3
  24. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt +4 -3
  25. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt +6 -2
  26. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/rspec.yml.tt +1 -1
  27. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-production.yml +20 -58
  28. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-staging.yml +20 -58
  29. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml.tt +46 -0
  30. data/lib/generators/rails_template18f/github_actions/templates/oscal/component-definitions/github_actions/component-definition.json.tt +310 -0
  31. data/lib/generators/rails_template18f/i18n/i18n_generator.rb +7 -6
  32. data/lib/generators/rails_template18f/i18n/templates/config/locales/en.yml.tt +1 -0
  33. data/lib/generators/rails_template18f/i18n/templates/config/locales/es.yml +2 -0
  34. data/lib/generators/rails_template18f/i18n/templates/config/locales/fr.yml +2 -0
  35. data/lib/generators/rails_template18f/i18n/templates/config/locales/zh.yml +2 -0
  36. data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +2 -37
  37. data/lib/generators/rails_template18f/newrelic/templates/oscal/component-definitions/newrelic/component-definition.json.tt +113 -0
  38. data/lib/generators/rails_template18f/oscal/oscal_generator.rb +55 -17
  39. data/lib/generators/rails_template18f/oscal/templates/bin/trestle.tt +10 -0
  40. data/lib/generators/rails_template18f/oscal/templates/doc/compliance/oscal/trestle-config.yaml.tt +6 -0
  41. data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +2 -2
  42. data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +1 -1
  43. data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +4 -4
  44. data/lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt +0 -1
  45. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +4 -4
  46. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf.tt +0 -1
  47. data/lib/rails_template18f/generators/base.rb +9 -24
  48. data/lib/rails_template18f/generators/pipeline_options.rb +0 -172
  49. data/lib/rails_template18f/version.rb +1 -1
  50. data/rails-template-18f.gemspec +6 -6
  51. data/railsrc +1 -0
  52. data/railsrc-hotwire +1 -0
  53. data/template.rb +48 -44
  54. data/templates/Brewfile +2 -2
  55. data/templates/README.md.tt +3 -4
  56. data/templates/app/assets/stylesheets/uswds-components.scss +6 -0
  57. data/templates/app/assets/stylesheets/uswds-overrides/_index.scss +2 -0
  58. data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-banner.scss +13 -0
  59. data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-language-selector.scss +38 -0
  60. data/templates/app/views/application/_header.html.erb +6 -5
  61. data/templates/app/views/application/_language_selector.html.erb +35 -0
  62. data/templates/app/views/application/_usa_banner.html.erb +21 -16
  63. data/templates/bin/owasp-scan +3 -3
  64. data/templates/bin/pa11y-scan +1 -1
  65. data/templates/config/environments/ci.rb +1 -0
  66. data/templates/pa11y.js +12 -0
  67. data/templates/pa11yci.js +8 -0
  68. metadata +31 -16
  69. data/templates/pa11yci +0 -9
  70. /data/lib/generators/rails_template18f/circleci/templates/{Dockerfile.tt → Dockerfile.ci.tt} +0 -0
@@ -31,12 +31,12 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  # For more information and examples about making a new gem, checkout our
33
33
  # guide at: https://bundler.io/guides/creating_gem.html
34
- spec.add_dependency "railties", "~> 7.0.0"
35
- spec.add_dependency "activesupport", "~> 7.0.0"
36
- spec.add_dependency "thor", "~> 1.0"
37
- spec.add_dependency "colorize", "~> 0.8"
34
+ spec.add_dependency "railties", "~> 7.1.0"
35
+ spec.add_dependency "activesupport", "~> 7.1.0"
36
+ spec.add_dependency "thor", "~> 1.3"
37
+ spec.add_dependency "colorize", "~> 1.1"
38
38
 
39
- spec.add_development_dependency "rspec", "~> 3.11"
39
+ spec.add_development_dependency "rspec", "~> 3.13"
40
40
  spec.add_development_dependency "ammeter", "~> 1.1"
41
- spec.add_development_dependency "standard", "~> 1.3"
41
+ spec.add_development_dependency "standard", "~> 1.36"
42
42
  end
data/railsrc CHANGED
@@ -3,6 +3,7 @@
3
3
  --skip-action-cable
4
4
  --skip-action-mailbox
5
5
  --skip-hotwire
6
+ --skip-docker
6
7
  --skip-test
7
8
  --javascript=webpack
8
9
  --css=postcss
data/railsrc-hotwire CHANGED
@@ -1,6 +1,7 @@
1
1
  --skip-active-storage
2
2
  --skip-action-text
3
3
  --skip-action-mailbox
4
+ --skip-docker
4
5
  --skip-test
5
6
  --javascript=webpack
6
7
  --css=postcss
data/template.rb CHANGED
@@ -15,7 +15,7 @@ def skip_active_job?
15
15
  end
16
16
 
17
17
  def webpack?
18
- adjusted_javascript_option == "webpack"
18
+ options[:javascript] == "webpack"
19
19
  end
20
20
 
21
21
  def hotwire?
@@ -39,12 +39,14 @@ def print_announcements
39
39
  end
40
40
  end
41
41
 
42
- unless Gem::Dependency.new("rails", "~> 7.0.0").match?("rails", Rails.gem_version)
43
- warn "This template requires Rails 7.0.x"
42
+ unless Gem::Dependency.new("rails", "~> 7.1.0").match?("rails", Rails.gem_version)
43
+ warn "This template requires Rails 7.1.x"
44
44
  if Gem::Dependency.new("rails", "~> 6.1.0").match?("rails", Rails.gem_version)
45
- warn "See the rails-6 branch https://github.com/18f/rails-template/tree/rails-6"
46
- elsif Gem::Dependency.new("rails", "~> 7.1.0").match?("rails", Rails.gem_version)
47
- warn "Rails 7.1 is out! Please file an issue so we can get the template updated"
45
+ warn "See the rails-6 branch https://github.com/gsa-tts/rails-template/tree/rails-6"
46
+ elsif Gem::Dependency.new("rails", "~> 7.0.0").match?("rails", Rails.gem_version)
47
+ warn "See the rails-7.0 branch https://github.com/gsa-tts/rails-template/tree/rails-7.0"
48
+ elsif Gem::Dependency.new("rails", "~> 7.2.0").match?("rails", Rails.gem_version)
49
+ warn "We haven't updated the template for Rails 7.2 yet! Please file an issue so we can get the template updated"
48
50
  else
49
51
  warn "We didn't recognize the version of Rails you are using: #{Rails.version}"
50
52
  end
@@ -52,20 +54,20 @@ unless Gem::Dependency.new("rails", "~> 7.0.0").match?("rails", Rails.gem_versio
52
54
  end
53
55
 
54
56
  # ask setup questions
55
- compliance_template = yes?("Include OSCAL files from compliance-template? (y/n)")
56
- compliance_template_repo = "git@github.com:GSA-TTS/compliance-template.git"
57
- compliance_template_submodule = compliance_template && yes?("Clone #{compliance_template_repo} as a git submodule? (y/n)")
58
- if compliance_template_submodule
59
- compliance_template_repo = ask("What is the git clone address of your compliance-template fork?")
57
+ compliance_trestle = yes?("Set up docker-trestle integration for Compliance-as-Code? (y/n)")
58
+ compliance_trestle_repo = nil
59
+ compliance_trestle_submodule = compliance_trestle && yes?("Set up compliance documents as a git submodule? (y/n)")
60
+ if compliance_trestle_submodule
61
+ compliance_trestle_repo = ask("What is the git clone address of your compliance document repo?")
60
62
  end
61
- if compliance_template_repo.blank?
63
+ if compliance_trestle_submodule && compliance_trestle_repo.blank?
62
64
  register_announcement("OSCAL Documentation", <<~EOM)
63
- Skipping OSCAL files as the compliance-template fork was left blank.
65
+ Skipping docker-trestle integration as the compliance document repository was left blank.
64
66
 
65
- Re-run the oscal generator after creating your template fork to get started with OSCAL.
67
+ Re-run the oscal generator after creating your repo to get started with OSCAL.
66
68
  EOM
67
- compliance_template = false
68
- compliance_template_submodule = false
69
+ compliance_trestle = false
70
+ compliance_trestle_submodule = false
69
71
  end
70
72
 
71
73
  terraform = yes?("Create terraform files for cloud.gov services? (y/n)")
@@ -103,6 +105,23 @@ register_announcement("Documentation", <<~EOM)
103
105
  * Review any TBD sections of the README and update where appropriate.
104
106
  EOM
105
107
 
108
+ # do early so later generators register files in the correct location
109
+ if compliance_trestle
110
+ after_bundle do
111
+ generator_arguments = []
112
+ if compliance_trestle_submodule
113
+ generator_arguments << "--oscal_repo=#{compliance_trestle_repo}"
114
+ end
115
+ generate "rails_template18f:oscal", *generator_arguments
116
+ end
117
+ register_announcement("OSCAL Documentation", <<~EOM)
118
+ OSCAL files have been generated with some default implementation statements in `doc/compliance/oscal`
119
+
120
+ All generated statements must be reviewed for accuracy with your system's implementation before being
121
+ submitted for authorization.
122
+ EOM
123
+ end
124
+
106
125
  # ensure dependencies are installed
107
126
  copy_file "Brewfile"
108
127
  insert_into_file "bin/setup", <<EOSETUP, after: /Add necessary setup steps to this file.\n/
@@ -153,7 +172,8 @@ directory "bin", mode: :preserve
153
172
  chmod "bin/ops/create_service_account.sh", 0o755
154
173
  chmod "bin/ops/destroy_service_account.sh", 0o755
155
174
  chmod "bin/ops/set_space_egress.sh", 0o755
156
- copy_file "pa11yci", ".pa11yci"
175
+ copy_file "pa11y.js"
176
+ copy_file "pa11yci.js"
157
177
  copy_file "editorconfig", ".editorconfig"
158
178
  copy_file "zap.conf"
159
179
  after_bundle do
@@ -200,11 +220,11 @@ uncomment_lines csp_initializer, "content_security_policy_nonce"
200
220
 
201
221
  # install development & testing gems
202
222
  gem_group :development, :test do
203
- gem "rspec-rails", "~> 5.1"
204
- gem "dotenv-rails", "~> 2.7"
205
- gem "brakeman", "~> 5.2"
223
+ gem "rspec-rails", "~> 6.1"
224
+ gem "dotenv-rails", "~> 3.1"
225
+ gem "brakeman", "~> 6.1"
206
226
  gem "bundler-audit", "~> 0.9"
207
- gem "standard", "~> 1.7"
227
+ gem "standard", "~> 1.36"
208
228
  end
209
229
  if ENV["RT_DEV"] == "true"
210
230
  gem "rails_template_18f", group: :development, path: ENV["PWD"]
@@ -289,8 +309,10 @@ after_bundle do
289
309
  end
290
310
  directory "app/assets"
291
311
  append_to_file "app/assets/stylesheets/application.postcss.css", <<~EOCSS
292
- @forward "uswds-settings.scss";
293
- @forward "uswds-components.scss";
312
+ @forward "uswds-settings";
313
+ @forward "uswds-components";
314
+
315
+ @forward "uswds-overrides";
294
316
  EOCSS
295
317
  inside "app/assets/stylesheets" do
296
318
  File.rename("application.postcss.css", "application.postcss.scss")
@@ -336,22 +358,6 @@ after_bundle do
336
358
  generate "rails_template18f:rails_erd"
337
359
  end
338
360
 
339
- if compliance_template
340
- after_bundle do
341
- generator_arguments = [
342
- "--oscal_repo=#{compliance_template_repo}",
343
- (compliance_template_submodule ? "--no-detach" : "--detach")
344
- ]
345
- generate "rails_template18f:oscal", *generator_arguments
346
- end
347
- register_announcement("OSCAL Documentation", <<~EOM)
348
- OSCAL files have been generated with some default implementation statements in `doc/compliance/oscal`
349
-
350
- All generated statements must be reviewed for accuracy with your system's implementation before being
351
- submitted for authorization.
352
- EOM
353
- end
354
-
355
361
  after_bundle do
356
362
  # Setup translations
357
363
  generate "rails_template18f:i18n", "--languages=#{supported_languages.join(",")}", "--force"
@@ -481,8 +487,7 @@ EOM
481
487
  # ensure this is the very last step
482
488
  after_bundle do
483
489
  if run_db_setup
484
- rails_command "db:create"
485
- rails_command "db:migrate"
490
+ rails_command "db:setup"
486
491
  end
487
492
 
488
493
  # x86_64-linux is required to install gems on any linux system such as cloud.gov or CI pipelines
@@ -490,7 +495,6 @@ after_bundle do
490
495
 
491
496
  # bring generated code into compliance with standard ruby: https://github.com/testdouble/standard
492
497
  gsub_file "config/environments/production.rb", "(STDOUT)", "($stdout)"
493
- gsub_file "config/puma.rb", /\) { (\S+) }/, ', \1)'
494
498
  run "bundle exec standardrb --fix"
495
499
 
496
500
  unless skip_git?
@@ -500,10 +504,10 @@ after_bundle do
500
504
  # compliance documentation
501
505
  /doc/compliance/
502
506
  EOM
503
- if compliance_template_submodule
507
+ if compliance_trestle_submodule
504
508
  inside "doc/compliance/oscal" do
505
509
  run "git add -A"
506
- run "git diff-index --quiet HEAD || git commit -am 'rails-template generated control statements'"
510
+ run "git diff-index --quiet HEAD || git commit -am 'rails-template generated components'"
507
511
  end
508
512
  end
509
513
  git add: "."
data/templates/Brewfile CHANGED
@@ -1,8 +1,8 @@
1
1
  # Brewfile
2
2
  # add any dependencies that must be installed from homebrew here
3
3
 
4
- # cloud.gov RDS is on postgres 12
5
- brew "postgresql@12", link: true
4
+ # cloud.gov RDS is on postgres 15
5
+ brew "postgresql@15", link: true
6
6
 
7
7
  # used in bin/with-server script
8
8
  brew "dockerize"
@@ -23,9 +23,8 @@ guide for an introduction to the framework.
23
23
  * Manually: clicking "allow" when you run the integration tests for the first time and a dialogue opens up
24
24
  * Install Ruby dependencies: `bundle install`
25
25
  * Install JS dependencies: `yarn install`
26
- * Create database: `bundle exec rake db:create`
27
- * Run migrations: `bundle exec rake db:migrate`
28
- * Run the server: `bundle exec rails s`
26
+ * Create database and run migrations: `bundle exec rake db:setup`
27
+ * Run the server: `bin/dev`
29
28
  * Visit the site: http://localhost:3000
30
29
 
31
30
  ### Local Configuration
@@ -98,7 +97,7 @@ Run everything: `bundle exec rake`
98
97
 
99
98
  #### Pa11y Scan
100
99
 
101
- When new pages are added to the application, ensure they are added to `./.pa11yci` so that they can be scanned.
100
+ When new pages are added to the application, ensure they are added to `./pa11y.js` so that they can be scanned.
102
101
 
103
102
  ### Automatic linting
104
103
 
@@ -1,7 +1,13 @@
1
1
  @forward "uswds-global";
2
2
  @forward "uswds-utilities";
3
3
  @forward "uswds-typography";
4
+ @forward "usa-layout-grid";
4
5
  @forward "usa-header";
5
6
  @forward "usa-banner";
6
7
  @forward "usa-section";
8
+ @forward "usa-language-selector";
7
9
  // add additional packages here as you use them
10
+
11
+ // or replace these all with
12
+ // @forward "uswds";
13
+ // to import the entirety of uswds
@@ -0,0 +1,2 @@
1
+ @forward "override-usa-banner";
2
+ @forward "override-usa-language-selector";
@@ -0,0 +1,13 @@
1
+
2
+ .banner__text-container {
3
+ flex: 1;
4
+ }
5
+
6
+ .usa-banner__button {
7
+ margin-right: 0.5rem;
8
+ }
9
+
10
+ [dir="rtl"] .usa-banner__header-flag {
11
+ margin-left: 0.5rem;
12
+ margin-right: 0;
13
+ }
@@ -0,0 +1,38 @@
1
+
2
+ .usa-language-container {
3
+ padding: 0.5rem 1rem;
4
+ }
5
+
6
+ .usa-language__submenu {
7
+ padding: 20px;
8
+ width: auto;
9
+ border-radius: 3px;
10
+ white-space: nowrap;
11
+ }
12
+
13
+ .usa-language__submenu-item {
14
+ padding: 4px 8px;
15
+
16
+ &:last-child {
17
+ border-bottom: 1px solid #dfe1e2;
18
+ }
19
+ }
20
+
21
+ .switcher-desktop {
22
+ @media (max-width: 800px) {
23
+ display: none;
24
+ }
25
+ }
26
+
27
+ .switcher-mobile {
28
+ @media (min-width: 800px) {
29
+ display: none;
30
+ }
31
+ }
32
+
33
+ .usa-language__primary-item:last-of-type .usa-language__submenu {
34
+ [dir="rtl"] & {
35
+ right: unset;
36
+ left: 0;
37
+ }
38
+ }
@@ -1,5 +1,8 @@
1
1
  <div class="usa-overlay"></div>
2
2
  <header class="usa-header usa-header--basic">
3
+ <div class="switcher-mobile">
4
+ <%= render partial: "application/language_selector", locals: {mode: "mobile"} %>
5
+ </div>
3
6
  <div class="usa-nav-container">
4
7
  <div class="usa-navbar">
5
8
  <div class="usa-logo">
@@ -14,11 +17,9 @@
14
17
  <%= image_tag "@uswds/uswds/dist/img/usa-icons/close.svg", role: "img", alt: t('shared.header.close') %>
15
18
  </button>
16
19
  <ul class="usa-nav__primary usa-accordion">
17
- <% I18n.available_locales.each do |l| %>
18
- <li class="usa-nav__primary-item">
19
- <%= format_active_locale(l) %>
20
- </li>
21
- <% end %>
20
+ <li class="usa-nav__primary-item">
21
+ <%= link_to "Example Nav Item", root_path %>
22
+ </li>
22
23
  </ul>
23
24
  </nav>
24
25
  </div>
@@ -0,0 +1,35 @@
1
+
2
+ <% if I18n.available_locales.count == 2 %>
3
+ <% I18n.available_locales.each do |l| %>
4
+ <% unless active_locale?(l) %>
5
+ <div class="usa-language-container usa-language--small">
6
+ <%= link_to language_span(l), root_path(locale: l), class: "usa-button" %>
7
+ </div>
8
+ <% end %>
9
+ <% end %>
10
+ <% elsif I18n.available_locales.count > 2 %>
11
+ <div class="usa-language-container">
12
+ <ul class="usa-language__primary usa-accordion">
13
+ <li class="usa-language__primary-item">
14
+ <button
15
+ type="button"
16
+ class="usa-button usa-language__link"
17
+ role="button"
18
+ aria-expanded="false"
19
+ aria-controls="language-options-<%= mode %>"
20
+ >
21
+ <%= t "shared.languages.selector" %>
22
+ </button>
23
+ <ul id="language-options-<%= mode %>" class="usa-language__submenu" hidden="true">
24
+ <% I18n.available_locales.each do |l| %>
25
+ <% unless active_locale?(l) %>
26
+ <li class="usa-language__submenu-item">
27
+ <%= link_to content_tag(:strong, language_span(l)), root_path(locale: l) %>
28
+ </li>
29
+ <% end %>
30
+ <% end %>
31
+ </ul>
32
+ </li>
33
+ </ul>
34
+ </div>
35
+ <% end %>
@@ -4,24 +4,29 @@
4
4
  <div class="usa-accordion">
5
5
  <header class="usa-banner__header">
6
6
  <div class="usa-banner__inner">
7
- <div class="grid-col-auto">
8
- <%= image_tag "@uswds/uswds/dist/img/us_flag_small.png", alt: t('shared.banner.us_flag'), class: "usa-banner__header-flag" %>
7
+ <div class="banner__text-container grid-row">
8
+ <div class="grid-col-auto">
9
+ <%= image_tag "@uswds/uswds/dist/img/us_flag_small.png", alt: t('shared.banner.us_flag'), class: "usa-banner__header-flag" %>
10
+ </div>
11
+ <div class="grid-col-fill tablet:grid-col-auto">
12
+ <p class="usa-banner__header-text">
13
+ <%= t('shared.banner.official_site') %>
14
+ </p>
15
+ <p class="usa-banner__header-action" aria-hidden="true">
16
+ <%= t('shared.banner.how') %>
17
+ </p>
18
+ </div>
19
+ <button
20
+ class="usa-accordion__button usa-banner__button"
21
+ aria-expanded="false"
22
+ aria-controls="gov-banner"
23
+ >
24
+ <span class="usa-banner__button-text"><%= t('shared.banner.how') %></span>
25
+ </button>
9
26
  </div>
10
- <div class="grid-col-fill tablet:grid-col-auto">
11
- <p class="usa-banner__header-text">
12
- <%= t('shared.banner.official_site') %>
13
- </p>
14
- <p class="usa-banner__header-action" aria-hidden="true">
15
- <%= t('shared.banner.how') %>
16
- </p>
27
+ <div class="switcher-desktop">
28
+ <%= render partial: "application/language_selector", locals: {mode: "desktop"} %>
17
29
  </div>
18
- <button
19
- class="usa-accordion__button usa-banner__button"
20
- aria-expanded="false"
21
- aria-controls="gov-banner"
22
- >
23
- <span class="usa-banner__button-text"><%= t('shared.banner.how') %></span>
24
- </button>
25
30
  </div>
26
31
  </header>
27
32
  <div class="usa-banner__content usa-accordion__content" id="gov-banner">
@@ -24,7 +24,7 @@ Notes:
24
24
  set -e
25
25
 
26
26
  scan="zap-baseline.py"
27
- docker_name="owasp/zap2docker-weekly"
27
+ docker_tag="weekly"
28
28
 
29
29
  while getopts "hfs" opt; do
30
30
  case "$opt" in
@@ -32,7 +32,7 @@ while getopts "hfs" opt; do
32
32
  scan="zap-full-scan.py"
33
33
  ;;
34
34
  s)
35
- docker_name="owasp/zap2docker-stable"
35
+ docker_tag="stable"
36
36
  ;;
37
37
  *)
38
38
  echo "$usage"
@@ -44,6 +44,6 @@ done
44
44
 
45
45
  hostname="http://host.docker.internal:3000"
46
46
  args="-c zap.conf -I -r zap_report.html"
47
- cmd="docker run --rm --user root -v $(pwd):/zap/wrk/:rw -t $docker_name $scan -t $hostname $args"
47
+ cmd="docker run --rm -v $(pwd):/zap/wrk/:rw -t ghcr.io/zaproxy/zaproxy:$docker_tag $scan -t $hostname $args"
48
48
 
49
49
  `dirname "$0"`/with-server "$cmd"
@@ -7,4 +7,4 @@
7
7
  # * no other server is listening on port 3000
8
8
 
9
9
 
10
- `dirname "$0"`/with-server "yarn run pa11y-ci"
10
+ `dirname "$0"`/with-server "yarn run pa11y-ci -c pa11y.js"
@@ -2,6 +2,7 @@ require_relative "production"
2
2
 
3
3
  Rails.application.configure do
4
4
  config.public_file_server.enabled = true
5
+ config.force_ssl = false
5
6
 
6
7
  logger = ActiveSupport::Logger.new($stdout)
7
8
  logger.formatter = config.log_formatter
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ defaults: {
3
+ standard: "WCAG2AA",
4
+ runners: ["axe"],
5
+ hideElements: [
6
+ ".usa-banner__button-text" // axe can't determine the background color for this button
7
+ ]
8
+ },
9
+ urls: [
10
+ "http://localhost:3000"
11
+ ]
12
+ };
@@ -0,0 +1,8 @@
1
+ let defaults = require("./pa11y.js");
2
+
3
+ // set chrome path for github actions
4
+ defaults.defaults.chromeLaunchConfig = {
5
+ "executablePath": "/usr/bin/google-chrome"
6
+ };
7
+
8
+ module.exports = defaults;