rails_template_18f 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +92 -70
- data/README.md +60 -63
- data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +3 -3
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/main.tf.tt +1 -1
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/run.sh.tt +1 -1
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/teardown_creds.sh.tt +1 -1
- data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +11 -6
- data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +9 -5
- data/lib/generators/rails_template18f/terraform/terraform_generator.rb +0 -10
- data/lib/rails_template18f/version.rb +1 -1
- data/template.rb +18 -1
- data/templates/Brewfile +3 -0
- data/templates/README.md.tt +1 -0
- data/templates/bin/ops/create_service_account.sh.tt +72 -0
- data/templates/bin/ops/destroy_service_account.sh.tt +53 -0
- data/{lib/generators/rails_template18f/terraform/templates/terraform → templates/bin/ops}/set_space_egress.sh.tt +1 -1
- data/templates/config/environments/ci.rb +1 -1
- data/templates/config/environments/staging.rb +1 -1
- data/templates/doc/compliance/TODO.md +37 -0
- metadata +7 -21
- data/lib/generators/rails_template18f/terraform/templates/terraform/create_space_deployer.sh +0 -33
- data/lib/generators/rails_template18f/terraform/templates/terraform/destroy_space_deployer.sh +0 -19
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/main.tf.tt +0 -50
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/providers.tf +0 -16
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/variables.tf +0 -47
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/database/main.tf.tt +0 -23
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/database/providers.tf +0 -16
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/database/variables.tf +0 -42
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/domain/main.tf.tt +0 -46
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/domain/providers.tf +0 -16
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/domain/variables.tf +0 -47
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/main.tf.tt +0 -23
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/providers.tf +0 -16
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/variables.tf +0 -42
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/s3/main.tf +0 -27
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/s3/providers.tf +0 -16
- data/lib/generators/rails_template18f/terraform/templates/terraform/shared/s3/variables.tf +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d21603b715f565d239901a62f7350b2b607f8ad264b2e23910d5c1203419038
|
4
|
+
data.tar.gz: 20b9516691e7819b443d06fb05e141992cf4f8e179363b43ad11d87918319929
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f1350e3598ae74b8dcb039ec6c85b7dd124e2b42e3563c5edb5e72a3c061c33cce3bfe43274d7c3fa07bb8f9cd0462df7fa40926ffc90fe913c043edeb86c28
|
7
|
+
data.tar.gz: d9bf899901b7cf2451d77dbd0eb50ddd016acc874d5144cee525d2b14df9bcb93887094e4ca1fa5a4b95a38ecb75ea622ffbfd9541e05edf292197016f909f3b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.8.1] - 2024-06-04
|
4
|
+
|
5
|
+
- fix error when compliance-template fork question is left blank
|
6
|
+
- fix deprecated and then removed use of `npm set-scripts`
|
7
|
+
- add a doc/compliance/TODO.md file with tasks that can sometimes be useful on the ATO journey.
|
8
|
+
- generalize create_space_deployer.sh to create_service_account.sh to make it easier to create SpaceAuditor users
|
9
|
+
- move support scripts set_space_egress.sh, create_service_account.sh, and destroy_service_account.sh out of terraform generator
|
10
|
+
|
3
11
|
## [0.8.0] - 2022-07-14
|
4
12
|
|
5
13
|
- use rails-erd gem for auto-updating logical data models
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_template_18f (0.8.
|
4
|
+
rails_template_18f (0.8.1)
|
5
5
|
activesupport (~> 7.0.0)
|
6
6
|
colorize (~> 0.8)
|
7
7
|
railties (~> 7.0.0)
|
@@ -10,25 +10,25 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actionpack (7.0.
|
14
|
-
actionview (= 7.0.
|
15
|
-
activesupport (= 7.0.
|
16
|
-
rack (~> 2.0, >= 2.2.
|
13
|
+
actionpack (7.0.8.4)
|
14
|
+
actionview (= 7.0.8.4)
|
15
|
+
activesupport (= 7.0.8.4)
|
16
|
+
rack (~> 2.0, >= 2.2.4)
|
17
17
|
rack-test (>= 0.6.3)
|
18
18
|
rails-dom-testing (~> 2.0)
|
19
19
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
20
|
-
actionview (7.0.
|
21
|
-
activesupport (= 7.0.
|
20
|
+
actionview (7.0.8.4)
|
21
|
+
activesupport (= 7.0.8.4)
|
22
22
|
builder (~> 3.1)
|
23
23
|
erubi (~> 1.4)
|
24
24
|
rails-dom-testing (~> 2.0)
|
25
25
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
26
|
-
activesupport (7.0.
|
26
|
+
activesupport (7.0.8.4)
|
27
27
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
28
28
|
i18n (>= 1.6, < 2)
|
29
29
|
minitest (>= 5.1)
|
30
30
|
tzinfo (~> 2.0)
|
31
|
-
ammeter (1.1.
|
31
|
+
ammeter (1.1.7)
|
32
32
|
activesupport (>= 3.0)
|
33
33
|
railties (>= 3.0)
|
34
34
|
rspec-rails (>= 2.2)
|
@@ -36,90 +36,112 @@ GEM
|
|
36
36
|
builder (3.2.4)
|
37
37
|
byebug (11.1.3)
|
38
38
|
colorize (0.8.1)
|
39
|
-
concurrent-ruby (1.1
|
39
|
+
concurrent-ruby (1.3.1)
|
40
40
|
crass (1.0.6)
|
41
|
-
diff-lcs (1.5.
|
42
|
-
erubi (1.
|
43
|
-
i18n (1.
|
41
|
+
diff-lcs (1.5.1)
|
42
|
+
erubi (1.12.0)
|
43
|
+
i18n (1.14.5)
|
44
44
|
concurrent-ruby (~> 1.0)
|
45
|
-
|
45
|
+
json (2.7.2)
|
46
|
+
language_server-protocol (3.17.0.3)
|
47
|
+
lint_roller (1.1.0)
|
48
|
+
loofah (2.22.0)
|
46
49
|
crass (~> 1.0.2)
|
47
|
-
nokogiri (>= 1.
|
48
|
-
method_source (1.
|
49
|
-
minitest (5.
|
50
|
-
nokogiri (1.
|
50
|
+
nokogiri (>= 1.12.0)
|
51
|
+
method_source (1.1.0)
|
52
|
+
minitest (5.23.1)
|
53
|
+
nokogiri (1.16.5-arm64-darwin)
|
51
54
|
racc (~> 1.4)
|
52
|
-
nokogiri (1.
|
55
|
+
nokogiri (1.16.5-x86_64-darwin)
|
53
56
|
racc (~> 1.4)
|
54
|
-
|
55
|
-
|
57
|
+
nokogiri (1.16.5-x86_64-linux)
|
58
|
+
racc (~> 1.4)
|
59
|
+
parallel (1.24.0)
|
60
|
+
parser (3.3.2.0)
|
56
61
|
ast (~> 2.4.1)
|
57
|
-
|
58
|
-
|
59
|
-
rack
|
62
|
+
racc
|
63
|
+
racc (1.8.0)
|
64
|
+
rack (2.2.9)
|
65
|
+
rack-test (2.1.0)
|
60
66
|
rack (>= 1.3)
|
61
|
-
rails-dom-testing (2.0
|
62
|
-
activesupport (>=
|
67
|
+
rails-dom-testing (2.2.0)
|
68
|
+
activesupport (>= 5.0.0)
|
69
|
+
minitest
|
63
70
|
nokogiri (>= 1.6)
|
64
|
-
rails-html-sanitizer (1.
|
65
|
-
loofah (~> 2.
|
66
|
-
|
67
|
-
|
68
|
-
|
71
|
+
rails-html-sanitizer (1.6.0)
|
72
|
+
loofah (~> 2.21)
|
73
|
+
nokogiri (~> 1.14)
|
74
|
+
railties (7.0.8.4)
|
75
|
+
actionpack (= 7.0.8.4)
|
76
|
+
activesupport (= 7.0.8.4)
|
69
77
|
method_source
|
70
78
|
rake (>= 12.2)
|
71
79
|
thor (~> 1.0)
|
72
80
|
zeitwerk (~> 2.5)
|
73
81
|
rainbow (3.1.1)
|
74
|
-
rake (13.
|
75
|
-
regexp_parser (2.
|
76
|
-
rexml (3.2.
|
77
|
-
|
78
|
-
|
79
|
-
rspec-
|
80
|
-
rspec-
|
81
|
-
|
82
|
-
|
83
|
-
|
82
|
+
rake (13.2.1)
|
83
|
+
regexp_parser (2.9.2)
|
84
|
+
rexml (3.2.8)
|
85
|
+
strscan (>= 3.0.9)
|
86
|
+
rspec (3.13.0)
|
87
|
+
rspec-core (~> 3.13.0)
|
88
|
+
rspec-expectations (~> 3.13.0)
|
89
|
+
rspec-mocks (~> 3.13.0)
|
90
|
+
rspec-core (3.13.0)
|
91
|
+
rspec-support (~> 3.13.0)
|
92
|
+
rspec-expectations (3.13.0)
|
84
93
|
diff-lcs (>= 1.2.0, < 2.0)
|
85
|
-
rspec-support (~> 3.
|
86
|
-
rspec-mocks (3.
|
94
|
+
rspec-support (~> 3.13.0)
|
95
|
+
rspec-mocks (3.13.1)
|
87
96
|
diff-lcs (>= 1.2.0, < 2.0)
|
88
|
-
rspec-support (~> 3.
|
89
|
-
rspec-rails (
|
90
|
-
actionpack (>=
|
91
|
-
activesupport (>=
|
92
|
-
railties (>=
|
93
|
-
rspec-core (~> 3.
|
94
|
-
rspec-expectations (~> 3.
|
95
|
-
rspec-mocks (~> 3.
|
96
|
-
rspec-support (~> 3.
|
97
|
-
rspec-support (3.
|
98
|
-
rubocop (1.
|
97
|
+
rspec-support (~> 3.13.0)
|
98
|
+
rspec-rails (6.1.2)
|
99
|
+
actionpack (>= 6.1)
|
100
|
+
activesupport (>= 6.1)
|
101
|
+
railties (>= 6.1)
|
102
|
+
rspec-core (~> 3.13)
|
103
|
+
rspec-expectations (~> 3.13)
|
104
|
+
rspec-mocks (~> 3.13)
|
105
|
+
rspec-support (~> 3.13)
|
106
|
+
rspec-support (3.13.1)
|
107
|
+
rubocop (1.63.5)
|
108
|
+
json (~> 2.3)
|
109
|
+
language_server-protocol (>= 3.17.0)
|
99
110
|
parallel (~> 1.10)
|
100
|
-
parser (>= 3.
|
111
|
+
parser (>= 3.3.0.2)
|
101
112
|
rainbow (>= 2.2.2, < 4.0)
|
102
113
|
regexp_parser (>= 1.8, < 3.0)
|
103
114
|
rexml (>= 3.2.5, < 4.0)
|
104
|
-
rubocop-ast (>= 1.
|
115
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
105
116
|
ruby-progressbar (~> 1.7)
|
106
|
-
unicode-display_width (>=
|
107
|
-
rubocop-ast (1.
|
108
|
-
parser (>= 3.
|
109
|
-
rubocop-performance (1.
|
110
|
-
rubocop (>= 1.
|
111
|
-
rubocop-ast (>=
|
112
|
-
ruby-progressbar (1.
|
113
|
-
standard (1.
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
117
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
118
|
+
rubocop-ast (1.31.3)
|
119
|
+
parser (>= 3.3.1.0)
|
120
|
+
rubocop-performance (1.21.0)
|
121
|
+
rubocop (>= 1.48.1, < 2.0)
|
122
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
123
|
+
ruby-progressbar (1.13.0)
|
124
|
+
standard (1.36.0)
|
125
|
+
language_server-protocol (~> 3.17.0.2)
|
126
|
+
lint_roller (~> 1.0)
|
127
|
+
rubocop (~> 1.63.0)
|
128
|
+
standard-custom (~> 1.0.0)
|
129
|
+
standard-performance (~> 1.4)
|
130
|
+
standard-custom (1.0.2)
|
131
|
+
lint_roller (~> 1.0)
|
132
|
+
rubocop (~> 1.50)
|
133
|
+
standard-performance (1.4.0)
|
134
|
+
lint_roller (~> 1.1)
|
135
|
+
rubocop-performance (~> 1.21.0)
|
136
|
+
strscan (3.1.0)
|
137
|
+
thor (1.3.1)
|
138
|
+
tzinfo (2.0.6)
|
118
139
|
concurrent-ruby (~> 1.0)
|
119
|
-
unicode-display_width (2.
|
120
|
-
zeitwerk (2.6.
|
140
|
+
unicode-display_width (2.5.0)
|
141
|
+
zeitwerk (2.6.15)
|
121
142
|
|
122
143
|
PLATFORMS
|
144
|
+
arm64-darwin-23
|
123
145
|
x86_64-darwin-20
|
124
146
|
x86_64-darwin-21
|
125
147
|
x86_64-linux
|
data/README.md
CHANGED
@@ -1,71 +1,90 @@
|
|
1
|
-
18F
|
1
|
+
18F Rails Template
|
2
2
|
============================
|
3
|
+
The 18F Rails template starts or upgrades Rails projects so that they're more secure, follow compliance rules, and are nearly ready to deploy onto cloud.gov. This gem sets up security checks and compliance diagrams, adds the U.S. Web Design System (USWDS), and much much more — [see the full list of features](#features).
|
3
4
|
|
4
5
|
This template will create a new Rails 7.0.x project.
|
5
6
|
|
6
|
-
See the `rails-6` branch for Rails 6.1.x
|
7
|
+
[See the `rails-6` branch for Rails 6.1.x](https://github.com/18F/rails-template/tree/rails-6)
|
7
8
|
|
8
|
-
##
|
9
|
+
## Installation
|
9
10
|
|
10
|
-
|
11
|
-
1. `rails_template_18f help new` for usage instructions
|
11
|
+
### For a new Rails project
|
12
12
|
|
13
|
-
|
13
|
+
1. Install the gem:
|
14
|
+
```
|
15
|
+
$ gem install rails_template_18f
|
16
|
+
```
|
14
17
|
|
15
|
-
|
18
|
+
2. Decide whether to install Rails with Hotwire, a framework for client-side interactivity using JavaScript
|
19
|
+
- **For entirely server-side rendered applications**, without any Javascript:
|
20
|
+
- Use the default configuration (`rails_template_18f new <project name> --no-hotwire`)
|
21
|
+
- **For applications that need [a bit of client-side interactivity][aBitOfJS]**, but not a full single page application like React or Vue:
|
22
|
+
- Use Hotwire (`rails_template_18f new <project name> --hotwire`)
|
23
|
+
- **For single-page applications** where most of the interaction will take place via JavaScript, and which will use a framework like React or Vue:
|
24
|
+
- Use the default configuration (`rails_template_18f new <project name> --no-hotwire`)
|
16
25
|
|
17
|
-
`
|
26
|
+
The `--hotwire` flag means that [Hotwire](https://hotwired.dev/) and [ActionCable](https://guides.rubyonrails.org/action_cable_overview.html) are installed. ActionCable is included to enable the [Turbo Streams](https://turbo.hotwired.dev/handbook/streams) functionality of Hotwire.
|
18
27
|
|
19
|
-
|
20
|
-
as well as a basis for installing a separate Single Page Application (SPA) library such as React.
|
28
|
+
Before installing, you may want to consider the other application configuration options in the next section.
|
21
29
|
|
22
|
-
|
30
|
+
[aBitOfJS]: https://engineering.18f.gov/web-architecture/#:~:text=are%20more%20complex-,If%20your%20use%20case%20requires%20a%20bit%20of%20client%2Dside%20interactivity%2C%20use%20the%20above%20options%20with%20a%20bit%20of%20JavaScript.,-You%20might%20use
|
23
31
|
|
24
|
-
|
32
|
+
#### Advanced configuration
|
25
33
|
|
26
|
-
|
34
|
+
There are a variety of options that customize your Rails application.
|
27
35
|
|
28
|
-
|
29
|
-
for more interactivity than server-rendered apps, but less than a full SPA.
|
36
|
+
**Important:** Do not use flags `--skip-bundle` or `--skip-javascript`, or various parts of this template will break.
|
30
37
|
|
31
|
-
|
38
|
+
#### Default configuration
|
32
39
|
|
33
|
-
|
40
|
+
```sh
|
41
|
+
--skip-active-storage # Don't include ActiveStorage for document upload
|
42
|
+
--skip-action-text # Don't include ActionText libraries for WYSIWYG editing
|
43
|
+
--skip-action-cable # Don't include ActionCable websocket implementation
|
44
|
+
--skip-action-mailbox # Don't include inbound email
|
45
|
+
--skip-hotwire # Don't include Hotwire JS library
|
46
|
+
--skip-test # Skip built-in test framework. (We include RSpec)
|
47
|
+
--javascript=webpack # Use webpack for JS bundling
|
48
|
+
--css=postcss # Use the PostCSS framework for bundling CSS
|
49
|
+
--template=template.rb # Add additional configuration from template.rb
|
50
|
+
--database=postgresql # Use a PostgreSQL database
|
51
|
+
```
|
34
52
|
|
35
|
-
|
53
|
+
#### Customizing the installation
|
36
54
|
|
37
|
-
|
55
|
+
| Option | Description |
|
56
|
+
|--------|-------------|
|
57
|
+
| `--no-skip-<framework>` | Each of the skipped frameworks listed above (also in `railsrc`) can be overridden on the command line. For example: `--no-skip-active-storage` will include support for `ActiveStorage` document uploads |
|
58
|
+
| `--javascript=esbuild` | Use [esbuild](https://esbuild.github.io/) instead of [webpack](https://webpack.js.org/) for JavaScript bundling. Note that maintaining IE11 support with esbuild may be tricky. |
|
59
|
+
| `--no-skip-<FRAMEWORK>` | Each of the skipped frameworks in `railsrc` can be overridden on the command line. For example: `--no-skip-active-storage` will include support for `ActiveStorage` document uploads |
|
38
60
|
|
39
|
-
|
40
|
-
maintaining IE11 support with esbuild may be tricky.
|
61
|
+
You probably won't want to customize the template — that defeats the purpose of using this gem!
|
41
62
|
|
42
|
-
|
63
|
+
_TODO: Documentation on whether you can override the `css` and `database` options._
|
43
64
|
|
44
|
-
|
65
|
+
### For an existing Rails project
|
45
66
|
|
46
|
-
|
67
|
+
Installing this gem in a new Rails project will _TODO: say how it will help_
|
47
68
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
--skip-action-mailbox # don't include inbound email
|
53
|
-
--skip-hotwire # don't include Hotwire JS library
|
54
|
-
--skip-test # Skip built in test framework. (RSpec included via template.rb)
|
55
|
-
--javascript=webpack # Use webpack for JS bundling
|
56
|
-
--css=postcss # Use the postcss CSS bundling framework
|
57
|
-
--template=template.rb # add additional configuration from template.rb
|
58
|
-
--database=postgresql # default to PostgreSQL
|
69
|
+
Add this line to your application's Gemfile:
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
gem "rails_template_18f", group: :development
|
59
73
|
```
|
60
74
|
|
61
|
-
|
75
|
+
And then run:
|
62
76
|
|
63
|
-
|
77
|
+
$ bundle install
|
64
78
|
|
65
|
-
|
79
|
+
For a list of commands this gem can perform, run:
|
66
80
|
|
81
|
+
$ rails generate | grep 18f
|
67
82
|
|
68
|
-
|
83
|
+
_TODO: Add documentation on each option._
|
84
|
+
|
85
|
+
### Features
|
86
|
+
|
87
|
+
This template does a lot! The template completes the following to-do list to make your application more secure, closer to standards-compliant, and nearly production-ready.
|
69
88
|
|
70
89
|
1. Create a better default `README`
|
71
90
|
1. Copy `CONTRIBUTING.md` and `LICENSE.md` from the [18F Open Source Policy repo](https://github.com/18F/open-source-policy/)
|
@@ -101,29 +120,7 @@ ActionCable is included to enable the [Turbo Streams](https://turbo.hotwired.dev
|
|
101
120
|
1. Create [Architecture Decision Records](https://adr.github.io/) for above setup
|
102
121
|
1. Commit the resulting project with git (unless `--skip-git` is passed)
|
103
122
|
|
104
|
-
##
|
105
|
-
|
106
|
-
### Installation
|
107
|
-
|
108
|
-
Add this line to your application's Gemfile:
|
109
|
-
|
110
|
-
```ruby
|
111
|
-
gem "rails_template_18f", group: :development
|
112
|
-
```
|
113
|
-
|
114
|
-
And then run:
|
115
|
-
|
116
|
-
$ bundle install
|
117
|
-
|
118
|
-
Or install it yourself as:
|
119
|
-
|
120
|
-
$ gem install rails_template_18f
|
121
|
-
|
122
|
-
### Usage
|
123
|
-
|
124
|
-
Run `rails generate` for a list of commands this gem can run
|
125
|
-
|
126
|
-
## Development
|
123
|
+
## Developing this gem
|
127
124
|
|
128
125
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
129
126
|
|
@@ -133,6 +130,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
133
130
|
|
134
131
|
Bug reports and pull requests are welcome on GitHub at https://github.com/18f/rails-template. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/18f/rails-template/blob/main/CODE_OF_CONDUCT.md).
|
135
132
|
|
136
|
-
## Code of
|
133
|
+
## Code of conduct
|
137
134
|
|
138
135
|
Everyone interacting in the 18F Rails Template project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rahearn/rails-template-18f/blob/main/CODE_OF_CONDUCT.md).
|
@@ -59,7 +59,7 @@ The bootstrap module is used to create an s3 bucket for later terraform runs to
|
|
59
59
|
A [SpaceDeployer](https://cloud.gov/docs/services/cloud-gov-service-account/) account is required to run terraform or
|
60
60
|
deploy the application from the CI/CD pipeline. Create a new account by running:
|
61
61
|
|
62
|
-
|
62
|
+
`../bin/ops/create_service_account.sh -s <SPACE_NAME> -u <ACCOUNT_NAME>`
|
63
63
|
|
64
64
|
## Set up a new environment manually
|
65
65
|
|
@@ -75,7 +75,7 @@ The below steps rely on you first configuring access to the Terraform state in s
|
|
75
75
|
# something that communicates the purpose of the deployer
|
76
76
|
# for example: circleci-deployer for the credentials CircleCI uses to
|
77
77
|
# deploy the application or <your_name>-terraform for credentials to run terraform manually
|
78
|
-
|
78
|
+
../../bin/ops/create_service_account.sh -s <SPACE_NAME> -u <ACCOUNT_NAME> > secrets.auto.tfvars
|
79
79
|
```
|
80
80
|
|
81
81
|
The script will output the `username` (as `cf_user`) and `password` (as `cf_password`) for your `<ACCOUNT_NAME>`. Read more in the [cloud.gov service account documentation](https://cloud.gov/docs/services/cloud-gov-service-account/).
|
@@ -93,7 +93,7 @@ The below steps rely on you first configuring access to the Terraform state in s
|
|
93
93
|
1. Remove the space deployer service instance if it doesn't need to be used again, such as when manually running terraform once.
|
94
94
|
```bash
|
95
95
|
# <SPACE_NAME> and <ACCOUNT_NAME> have the same values as used above.
|
96
|
-
|
96
|
+
../../bin/ops/destroy_service_account.sh -s <SPACE_NAME> -u <ACCOUNT_NAME>
|
97
97
|
```
|
98
98
|
|
99
99
|
## Structure
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
3
|
if [[ ! -f "secrets.auto.tfvars" ]]; then
|
4
|
-
|
4
|
+
../../bin/ops/create_service_account.sh -s <%= cloud_gov_production_space %> -u config-bootstrap-deployer > secrets.auto.tfvars
|
5
5
|
fi
|
6
6
|
|
7
7
|
if [[ $# -gt 0 ]]; then
|
@@ -2,43 +2,46 @@ locals {
|
|
2
2
|
cf_org_name = "<%= cloud_gov_organization %>"
|
3
3
|
cf_space_name = "<%= cloud_gov_production_space %>"
|
4
4
|
env = "production"
|
5
|
+
app_name = "<%= app_name %>"
|
5
6
|
recursive_delete = false
|
6
7
|
}
|
7
8
|
|
8
9
|
module "database" {
|
9
|
-
source = "
|
10
|
+
source = "github.com/18f/terraform-cloudgov//database"
|
10
11
|
|
11
12
|
cf_user = var.cf_user
|
12
13
|
cf_password = var.cf_password
|
13
14
|
cf_org_name = local.cf_org_name
|
14
15
|
cf_space_name = local.cf_space_name
|
15
16
|
env = local.env
|
17
|
+
app_name = local.app_name
|
16
18
|
recursive_delete = local.recursive_delete
|
17
19
|
rds_plan_name = "TKTK-production-rds-plan"
|
18
20
|
}
|
19
21
|
<% if has_active_job? %>
|
20
22
|
module "redis" {
|
21
|
-
source = "
|
23
|
+
source = "github.com/18f/terraform-cloudgov//redis"
|
22
24
|
|
23
25
|
cf_user = var.cf_user
|
24
26
|
cf_password = var.cf_password
|
25
27
|
cf_org_name = local.cf_org_name
|
26
28
|
cf_space_name = local.cf_space_name
|
27
29
|
env = local.env
|
30
|
+
app_name = local.app_name
|
28
31
|
recursive_delete = local.recursive_delete
|
29
32
|
redis_plan_name = "TKTK-production-redis-plan"
|
30
33
|
}
|
31
34
|
<% end %>
|
32
35
|
<% if has_active_storage? %>
|
33
36
|
module "s3" {
|
34
|
-
source = "
|
37
|
+
source = "github.com/18f/terraform-cloudgov//s3"
|
35
38
|
|
36
39
|
cf_user = var.cf_user
|
37
40
|
cf_password = var.cf_password
|
38
41
|
cf_org_name = local.cf_org_name
|
39
42
|
cf_space_name = local.cf_space_name
|
40
43
|
recursive_delete = local.recursive_delete
|
41
|
-
s3_service_name = "
|
44
|
+
s3_service_name = "${local.app_name}-s3-${local.env}"<% if cloud_gov_organization == "sandbox-gsa" %>
|
42
45
|
s3_plan_name = "basic-sandbox"<% end %>
|
43
46
|
}
|
44
47
|
|
@@ -49,13 +52,14 @@ module "s3" {
|
|
49
52
|
# 2) Your organization has sufficient memory. Each clamav app requires 3GB
|
50
53
|
###########################################################################
|
51
54
|
# module "clamav" {
|
52
|
-
# source = "
|
55
|
+
# source = "github.com/18f/terraform-cloudgov//clamav"
|
53
56
|
#
|
54
57
|
# cf_user = var.cf_user
|
55
58
|
# cf_password = var.cf_password
|
56
59
|
# cf_org_name = local.cf_org_name
|
57
60
|
# cf_space_name = local.cf_space_name
|
58
61
|
# env = local.env
|
62
|
+
# app_name = local.app_name
|
59
63
|
# clamav_image = "ajilaag/clamav-rest:20211229"
|
60
64
|
# max_file_size = "30M"
|
61
65
|
# }
|
@@ -69,13 +73,14 @@ module "s3" {
|
|
69
73
|
# `cf create-domain <%= cloud_gov_organization %> TKTK-production-domain-name`
|
70
74
|
###########################################################################
|
71
75
|
# module "domain" {
|
72
|
-
# source = "
|
76
|
+
# source = "github.com/18f/terraform-cloudgov//domain"
|
73
77
|
#
|
74
78
|
# cf_user = var.cf_user
|
75
79
|
# cf_password = var.cf_password
|
76
80
|
# cf_org_name = local.cf_org_name
|
77
81
|
# cf_space_name = local.cf_space_name
|
78
82
|
# env = local.env
|
83
|
+
# app_name = local.app_name
|
79
84
|
# recursive_delete = local.recursive_delete
|
80
85
|
# cdn_plan_name = "domain"
|
81
86
|
# domain_name = "TKTK-production-domain-name"
|
@@ -2,43 +2,46 @@ locals {
|
|
2
2
|
cf_org_name = "<%= cloud_gov_organization %>"
|
3
3
|
cf_space_name = "<%= cloud_gov_staging_space %>"
|
4
4
|
env = "staging"
|
5
|
+
app_name = "<%= app_name %>"
|
5
6
|
recursive_delete = true
|
6
7
|
}
|
7
8
|
|
8
9
|
module "database" {
|
9
|
-
source = "
|
10
|
+
source = "github.com/18f/terraform-cloudgov//database"
|
10
11
|
|
11
12
|
cf_user = var.cf_user
|
12
13
|
cf_password = var.cf_password
|
13
14
|
cf_org_name = local.cf_org_name
|
14
15
|
cf_space_name = local.cf_space_name
|
15
16
|
env = local.env
|
17
|
+
app_name = local.app_name
|
16
18
|
recursive_delete = local.recursive_delete
|
17
19
|
rds_plan_name = "micro-psql"
|
18
20
|
}
|
19
21
|
<% if has_active_job? %>
|
20
22
|
module "redis" {
|
21
|
-
source = "
|
23
|
+
source = "github.com/18f/terraform-cloudgov//redis"
|
22
24
|
|
23
25
|
cf_user = var.cf_user
|
24
26
|
cf_password = var.cf_password
|
25
27
|
cf_org_name = local.cf_org_name
|
26
28
|
cf_space_name = local.cf_space_name
|
27
29
|
env = local.env
|
30
|
+
app_name = local.app_name
|
28
31
|
recursive_delete = local.recursive_delete
|
29
32
|
redis_plan_name = "redis-dev"
|
30
33
|
}
|
31
34
|
<% end %>
|
32
35
|
<% if has_active_storage? %>
|
33
36
|
module "s3" {
|
34
|
-
source = "
|
37
|
+
source = "github.com/18f/terraform-cloudgov//s3"
|
35
38
|
|
36
39
|
cf_user = var.cf_user
|
37
40
|
cf_password = var.cf_password
|
38
41
|
cf_org_name = local.cf_org_name
|
39
42
|
cf_space_name = local.cf_space_name
|
40
43
|
recursive_delete = local.recursive_delete
|
41
|
-
s3_service_name = "
|
44
|
+
s3_service_name = "${local.app_name}-s3-${local.env}"<% if cloud_gov_organization == "sandbox-gsa" %>
|
42
45
|
s3_plan_name = "basic-sandbox"<% end %>
|
43
46
|
}
|
44
47
|
|
@@ -49,13 +52,14 @@ module "s3" {
|
|
49
52
|
# 2) Your organization has sufficient memory. Each clamav app requires 3GB
|
50
53
|
###########################################################################
|
51
54
|
# module "clamav" {
|
52
|
-
# source = "
|
55
|
+
# source = "github.com/18f/terraform-cloudgov//clamav"
|
53
56
|
#
|
54
57
|
# cf_user = var.cf_user
|
55
58
|
# cf_password = var.cf_password
|
56
59
|
# cf_org_name = local.cf_org_name
|
57
60
|
# cf_space_name = local.cf_space_name
|
58
61
|
# env = local.env
|
62
|
+
# app_name = local.app_name
|
59
63
|
# clamav_image = "ajilaag/clamav-rest:20211229"
|
60
64
|
# max_file_size = "30M"
|
61
65
|
# }
|
@@ -15,20 +15,10 @@ module RailsTemplate18f
|
|
15
15
|
|
16
16
|
def install
|
17
17
|
directory "terraform", mode: :preserve
|
18
|
-
chmod "terraform/set_space_egress.sh", 0o755
|
19
18
|
chmod "terraform/bootstrap/run.sh", 0o755
|
20
19
|
chmod "terraform/bootstrap/teardown_creds.sh", 0o755
|
21
20
|
end
|
22
21
|
|
23
|
-
def install_jq
|
24
|
-
append_to_file "Brewfile", <<~EOB
|
25
|
-
|
26
|
-
# used in terraform/create_space_deployer.sh
|
27
|
-
brew "jq"
|
28
|
-
EOB
|
29
|
-
insert_into_file "README.md", indent("* [jq](https://stedolan.github.io/jq/)\n"), after: /\* Install homebrew dependencies: `brew bundle`\n/
|
30
|
-
end
|
31
|
-
|
32
22
|
def ignore_files
|
33
23
|
unless skip_git?
|
34
24
|
append_to_file ".gitignore", <<~EOM
|