Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

/postgres-data

# Avoid hard-pinning Homebrew dependencies
Brewfile.lock.json

# Ignore the files generated during setup
/config/local-certs/rootCA.key
/config/local-certs/rootCA.pem
Expand Down
3 changes: 3 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
brew 'nginx'
brew 'postgresql@14'
brew 'openssl@1.1'
74 changes: 10 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,77 +10,23 @@ PIV/CAC support for login.gov.
- Ruby 3.0
- OpenSSL 1.1 (see [troubleshooting notes](#troubleshooting-openssl-or-certificate-validation-errors))
- [PostgreSQL](http://www.postgresql.org/download/)
- Nginx

#### Setting up and running the app

1. Make sure you have a working development environment with all the
[dependencies](#dependencies) installed. On OS X, the easiest way
to set up a development environment is by running our [Laptop]
script. The script will install all of this project's dependencies.
Run the following command to set up your local environment:

If using rbenv, you may need to alias your specific installed ruby
version to the more generic version found in the `.ruby-version` file.
To do this, use [`rbenv-aliases`](https://github.com/tpope/rbenv-aliases):

```
git clone git://github.com/tpope/rbenv-aliases.git "$(rbenv root)/plugins/rbenv-aliases" # install rbenv-aliases per its documentation

rbenv alias 3.0 3.0.6 # create the version alias
```

1. Make sure you have Nginx installed.

```
$ brew install nginx
```

1. Make sure Postgres is running.

For example, if you've installed the laptop script on OS X, you can start the services like this:

```
$ brew services start postgresql
```

1. Create the development and test databases:

```
$ psql -c "CREATE DATABASE identity_pki_dev;"
$ psql -c "CREATE DATABASE identity_pki_test;"
```

1. Run the following command to set up the environment

- The first time, it will prompt for a passphrase for the root certificate. You can put anything as long as you remember it, it's just for development. To keep it simple, try `salty pickles`.

- Make sure to [trust the root SSL certificate](#trust-the-root-ssl-certificate)

```
$ make setup
```

This command copies sample configuration files, installs required gems
and sets up the database.

1. Run the app server with:

```
$ make run
```

Before making any commits, you'll also need to run `overcommit --sign.`
This verifies that the commit hooks defined in our `.overcommit.yml` file are
the ones we expect. Each change to the `.overcommit.yml` file, including the initial install
performed in the setup script, will necessitate a new signature.
```
$ make setup
```

For more information, see [overcommit](https://github.com/brigade/overcommit)
The first time, it will prompt for a passphrase for the root certificate. You can put anything as long as you remember it, it's just for development. You will also want to make sure to [trust the root SSL certificate](#trust-the-root-ssl-certificate)

If you want to measure the app's performance in development, set the
`rack_mini_profiler` option to `'on'` in `config/application.yml` and
restart the server. See the [rack_mini_profiler] gem for more details.
Run the app server with:

[Laptop]: https://github.com/18F/laptop
[rack_mini_profiler]: https://github.com/MiniProfiler/rack-mini-profiler
```
$ make run
```

### Running the app locally with the IDP

Expand Down
2 changes: 2 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ chdir APP_ROOT do
File.write('config/application.yml', default_application_yml.to_yaml) unless File.exist?('config/application.yml')

puts '== Installing dependencies =='
brew_installed = system "brew -v 2>&1"
run "brew bundle" if brew_installed
system! 'gem install bundler --conservative'
run 'gem install foreman --conservative && gem update foreman'
system('bundle check') || system!('bundle install --without deploy production')
Expand Down