Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0400737
Added git secrets hooks.
Jul 25, 2017
38ff015
Git secrets setup script.
Jul 26, 2017
ed1318f
Format for git secrets call.
Jul 26, 2017
8fc4734
Updated the README to provide git-secrets information.
Jul 26, 2017
8f103c3
Removing external ID from cohort DB representation. (#54)
danqrodney Jul 27, 2017
9e73ce8
Database setup script fix for macs. (#52)
s-rubenstein Jul 28, 2017
4d01046
Add error message if db setup script is run from the wrong directory.…
Jul 28, 2017
f18783f
Use real CohortsService. (#51)
Jul 31, 2017
0c47370
Added autorun of script and updated script to not reset hooks
Jul 31, 2017
3a21117
Testing
Jul 31, 2017
c475f45
Hide error if no secrets currently exist.
Jul 31, 2017
765e87c
Added hooks successfully calling git-secrets setup script
Jul 31, 2017
e25f93b
Updated readme
Jul 31, 2017
86de340
Removed set argument for cleaner logs
Jul 31, 2017
aa5e1ac
Removed set argument for cleaner logs
Jul 31, 2017
c3e6596
Merge branch 'blrubenstein/git-secrets' of https://github.com/all-of-…
Aug 1, 2017
874f884
Removed secrets management and assumed onetime run.
Aug 8, 2017
5facc1f
Merge branch 'master' into blrubenstein/git-secrets
Aug 8, 2017
e10894d
Merge branch 'master' into blrubenstein/git-secrets
Aug 8, 2017
b14cfdb
Merge branch 'blrubenstein/git-secrets' of https://github.com/all-of-…
Aug 8, 2017
db61077
Updated README to include instructions for linux, and added setup to …
Aug 9, 2017
83d1181
Merge branch 'master' into blrubenstein/git-secrets
Aug 9, 2017
f98f7bb
Updated secrets to manage secrets on commit
Aug 9, 2017
5cb038a
Updated readme and removed the setup script for git secrets
Aug 9, 2017
84d6abd
Fixed bug in readme.
Aug 9, 2017
638ca33
Fixed shell command for setup_env
Aug 9, 2017
086539a
Removed git secrets from setup_env.sh, and added to README
Aug 9, 2017
63ecc71
Use updated URL for downloading Swagger CLI to fix build (#60)
dmohs Aug 9, 2017
b86bead
Added git secrets hooks.
Jul 25, 2017
f41125b
Git secrets setup script.
Jul 26, 2017
c3034d1
Format for git secrets call.
Jul 26, 2017
062d797
Updated the README to provide git-secrets information.
Jul 26, 2017
b12d8fb
Added autorun of script and updated script to not reset hooks
Jul 31, 2017
55a7d3b
Testing
Jul 31, 2017
89cf18d
Hide error if no secrets currently exist.
Jul 31, 2017
fb32ed9
Added hooks successfully calling git-secrets setup script
Jul 31, 2017
c0d2a2b
Updated readme
Jul 31, 2017
b13c238
Removed set argument for cleaner logs
Jul 31, 2017
67f4802
Removed secrets management and assumed onetime run.
Aug 8, 2017
29a0929
Updated README to include instructions for linux, and added setup to …
Aug 9, 2017
f31d249
Updated secrets to manage secrets on commit
Aug 9, 2017
214fc2f
Updated readme and removed the setup script for git secrets
Aug 9, 2017
02baba2
Fixed bug in readme.
Aug 9, 2017
c415cba
Fixed shell command for setup_env
Aug 9, 2017
63e09a2
Removed git secrets from setup_env.sh, and added to README
Aug 9, 2017
1a45778
Merge branch 'blrubenstein/git-secrets' of https://github.com/all-of-…
Aug 9, 2017
b924a3f
Provided more informative error messages if git secrets not installed
Aug 9, 2017
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
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,37 @@ Example:
You will be prompted to confirm the deployment. When it finishes, you will be able to access the
UI under http://PROJECT.appspot.com and the API under http://api.PROJECT.appspot.com.

## git-secrets

### Setup

Download the git-secrets tool.
If you are on a mac, run:
```Shell
brew install git-secrets
```
If you are on Linux, run:
```Shell
rm -rf git-secrets
git clone https://github.com/awslabs/git-secrets.git
cd git-secrets
sudo make install && sudo chmod o+rx /usr/local/bin/git-secrets
cd ..
rm -rf git-secrets
```
### Running

git-secrets by default runs every time you make a commit. But if you
want to manually scan:
#### The Repository
```Shell
git secrets --scan
```
#### A File(s)
```Shell
git secrets --scan /path/to/file (/other/path/to/file *)
```
#### A Directory (recursively)
```Shell
git secrets --scan -r /path/to/directory
```
19 changes: 19 additions & 0 deletions hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

{ which git-secrets; } || {
echo 'git-secrets required and not found. See README for installation instructions.'
echo
exit 1
}

{
git config --remove-section secrets 2>/dev/null
} || {
:
}
git secrets --add 'private_key'
git secrets --add 'private_key_id'
git secrets --add --allowed --literal "git secrets --add 'private_key'"
git secrets --add --allowed --literal "git secrets --add 'private_key_id'"

git secrets --commit_msg_hook -- "$@"
19 changes: 19 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

{ which git-secrets; } || {
echo 'git-secrets required and not found. See README for installation instructions.'
echo
exit 1
}

{
git config --remove-section secrets 2>/dev/null
} || {
:
}
git secrets --add 'private_key'
git secrets --add 'private_key_id'
git secrets --add --allowed --literal "git secrets --add 'private_key'"
git secrets --add --allowed --literal "git secrets --add 'private_key_id'"

git secrets --pre_commit_hook -- "$@"
19 changes: 19 additions & 0 deletions hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

{ which git-secrets; } || {
echo 'git-secrets required and not found. See README for installation instructions.'
echo
exit 1
}

{
git config --remove-section secrets 2>/dev/null
} || {
:
}
git secrets --add 'private_key'
git secrets --add 'private_key_id'
git secrets --add --allowed --literal "git secrets --add 'private_key'"
git secrets --add --allowed --literal "git secrets --add 'private_key_id'"

git secrets --prepare_commit_msg_hook -- "$@"
2 changes: 1 addition & 1 deletion tools/download_swagger_cli.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
wget https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.3.0-SNAPSHOT/swagger-codegen-cli-2.3.0-20170716.142514-29.jar -O swagger-codegen-cli.jar
wget https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.3.0-SNAPSHOT/swagger-codegen-cli-2.3.0-20170809.095725-71.jar -O swagger-codegen-cli.jar
1 change: 1 addition & 0 deletions tools/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sudo npm install -g @angular/cli
echo Installing UI project dependencies.
npm install


cd ../tools
./download_swagger_cli.sh
./download_cloud_sql_proxy.sh