Skip to content

Commit

Permalink
Merge pull request #4655 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
asteel-gsa authored Jan 23, 2025
2 parents 0108e78 + d4e84d1 commit 376ab2d
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 23 deletions.
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ Here's a checklist to get you started and to make sure you've got access to :all
- [ ] Survey existing TTS projects which use Django+Cloud.gov like: [Tock](https://github.com/18F/tock) and the [DOJ CRT Portal](https://github.com/usdoj-crt/crt-portal).
- [ ] Get set up for [local development](https://github.com/GSA-TTS/FAC/blob/main/docs/development.md#local-development) so you can start contributing
- [ ] Review [NIST SP 800-161 Rev.1](https://csrc.nist.gov/pubs/sp/800/161/r1/final) on supply chain risk management. Reply to this onboarding ticket in a comment when you have completed this review.
- [ ] Make sure you have a `login.gov` account and have logged into the FAC application at least once.
- [ ] Then, add your email to the `readonly` list in [staffusers.json](../../backend/config/staffusers.json).
**For helpdesk, also..**
- [ ] Make sure you have a `login.gov` account and have logged into the FAC application at least once.
- [ ] Then, add your email to the `helpdesk` list in [staffusers.json](../../backend/config/staffusers.json).
## For your onboarding buddy
Expand All @@ -80,8 +86,6 @@ Note: If you're not able to do any of these yourself, you're still responsible f
- [ ] [Add as a form manager to the touchpoints recruitment intercept](https://touchpoints.app.cloud.gov/admin/forms/9412c559/permissions)
**For engineers, also...**
- [ ] Make sure you have a `login.gov` account and have logged into the FAC application at least once.
- [ ] Then, add your email to the `readonly` list in [staffusers.json](../../backend/config/staffusers.json).
- [ ] [Add as a member of the FAC group in New Relic](https://one.newrelic.com/admin-portal/organizations/users-list) (@GSA-TTS/fac-admins can do this)
**For product leads/owners, also...**
Expand All @@ -90,6 +94,4 @@ Note: If you're not able to do any of these yourself, you're still responsible f
- [ ] Also give them the `Maintainer` role in [the FAC-team team in GitHub](https://github.com/orgs/GSA-TTS/teams/fac-team/members).
**For helpdesk, also...**
- [ ] Make sure you have a `login.gov` account and have logged into the FAC application at least once.
- [ ] Then, add your email to the `helpdesk` list in [staffusers.json](../../backend/config/staffusers.json).
- [ ] Give them access to the [Help Desk](https://fac-gov.zendesk.com/admin/people/team/members) as a team member.
3 changes: 2 additions & 1 deletion .github/workflows/deploy-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ jobs:
cf_command: update-user-provided-service fac-key-service -p '"{\"SAM_API_KEY\":\"${{ secrets.SAM_API_KEY }}\", \"DJANGO_SECRET_LOGIN_KEY\":\"${{ secrets.DJANGO_SECRET_LOGIN_KEY }}\", \"LOGIN_CLIENT_ID\":\"${{ secrets.LOGIN_CLIENT_ID }}\", \"SECRET_KEY\":\"${{ secrets.SECRET_KEY}}\"}"'

- name: Backup the database
if: startsWith(github.ref, 'refs/tags/v1.')
uses: cloud-gov/cg-cli-tools@main
with:
cf_username: ${{ secrets.CF_USERNAME }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: gsa-tts-oros-fac
cf_space: ${{ env.space }}
command: cf run-task gsa-fac -k 7G -m 3G --name deploy_backup --command "./fac-backup-util.sh v0.1.5 deploy_backup"
command: cf run-task gsa-fac -k 7G -m 3G --name deploy_backup --command "./fac-backup-util.sh v0.1.10 deploy_backup"

- name: Deploy Preview to cloud.gov
if: ${{ inputs.environment == 'preview' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fac-backup-util-scheduled.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Backup the database with fac-backup-utility
### Common Commands:
# ./fac-backup-util.sh v0.1.8 scheduled_backup
# ./fac-backup-util.sh v0.1.8 daily_backup
# ./fac-backup-util.sh v0.1.10 scheduled_backup
# ./fac-backup-util.sh v0.1.10 daily_backup
on:
workflow_call:
inputs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fac-backup-util.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Backup the database with fac-backup-utility
### Common Commands:
# ./fac-backup-util.sh v0.1.8 initial_backup
# ./fac-backup-util.sh v0.1.8 deploy_backup
# ./fac-backup-util.sh v0.1.10 initial_backup
# ./fac-backup-util.sh v0.1.10 deploy_backup
on:
workflow_dispatch:
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fac-check-tables.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Check existing tables in an environment
### Common Commands:
# ./fac-backup-util.sh v0.1.8 check_tables
# ./fac-backup-util.sh v0.1.10 check_tables
on:
workflow_dispatch:
inputs:
Expand Down
1 change: 1 addition & 0 deletions backend/config/staffusers.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
Expand Down
23 changes: 15 additions & 8 deletions backend/static/js/check-ueid.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,21 @@ function showValidUeiInfo() {
const auditeeName = document.getElementById('auditee_name');
const ueiInfoEl = document.createElement('div');

ueiInfoEl.innerHTML = `
<dl data-testid="uei-info">
<dt>Unique Entity ID</dt>
<dd>${auditeeUei}</dd>
<dt>Auditee name</dt>
<dd>${auditeeName.value}</dd>
</dl>
`;
let dl; let dtUei; let ddUei; let dtName; let ddName;
dl = document.createElement('dl');
dtUei = document.createElement('dt');
ddUei = document.createElement('dd');
dtName = document.createElement('dt');
ddName = document.createElement('dd');

dl.setAttribute('data-testid', 'uei-info');
dtUei.textContent = 'Unique Entity ID';
ddUei.textContent = auditeeUei;
dtName.textContent = 'Auditee name';
ddName.textContent = auditeeName.value;

dl.append(dtUei,ddUei,dtName,ddName);
ueiInfoEl.appendChild(dl);

auditeeName.removeAttribute('disabled');
auditeeName.parentNode.setAttribute('hidden', 'hidden');
Expand Down
10 changes: 5 additions & 5 deletions docs/backups_and_restores.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Information regarding the fac-backup-utility can be found [at the repository](ht
Database backups occur in the following ways:
1. An initial backup, where a backup has not been run in the target environment. This input of `initial_backup` is important, as when it does a the `db_to_db` command, it will not truncate the target table, as the table does not exist in the destination database.
```bash
./fac-backup-util.sh v0.1.5 initial_backup
./fac-backup-util.sh v0.1.10 initial_backup
# Curl the utility
# Install AWS
# DB to S3 table dump (backups)
Expand All @@ -44,7 +44,7 @@ Database backups occur in the following ways:

2. A deploy backup, where the `db_to_db` function is not called. This is a standard backup strategy before the application deploys, to ensure the s3 contents of the primary s3 are sync'd to the backups bucket, and a table dump is stored in the backups bucket.
```bash
./fac-backup-util.sh v0.1.5 deploy_backup
./fac-backup-util.sh v0.1.10 deploy_backup
# Curl the utility
# Install AWS
# DB to S3 table dump (backups)
Expand All @@ -53,7 +53,7 @@ Database backups occur in the following ways:

3. A scheduled backup is run every two hours, across each environment, ensuring that we have a clean backup in s3, rds, and the bucket contents are in sync.
```bash
./fac-backup-util.sh v0.1.5 scheduled_backup
./fac-backup-util.sh v0.1.10 scheduled_backup
# Curl the utility
# Install AWS
# DB to S3 table dump (fac-db -> backups)
Expand All @@ -66,7 +66,7 @@ Restoring from backups can be run via workflow, from designated individuals. The

1. S3 Restore takes a `operation-mm-DD-HH` input (ex `scheduled-06-04-10`), and is required for the backups to be restored. The utility looks in `s3://${bucket}/backups/operation-mm-DD-HH/` for its table dumps, and without supplying the target backups, it will not restore. Once it does a `--data-only` restoration, it will then sync the files from the backups bucket to the application bucket. We do this to ensure the contents of the application bucket are up to date, relative to the data in the database. We know that if we use the latest folder in `/backups/` then the contents of the s3 are the latest available, from the prior backup.
```bash
./fac-restore-util.sh v0.1.5 s3_restore scheduled-06-04-10
./fac-restore-util.sh v0.1.10 s3_restore scheduled-06-04-10
# Curl the utility
# Install AWS
# DB to S3 table dump (backups -> fac-db) [Truncate target table before --data-only pg_restore]
Expand All @@ -81,7 +81,7 @@ daily-mm-dd

2. Database to database restoration also can occur as well, using `psql` to dump the tables from the cold store database to the live database.
```bash
./fac-restore-util.sh v0.1.5 db_restore
./fac-restore-util.sh v0.1.10 db_restore
# Curl the utility
# Install AWS
# DB to DB table dump (fac-snapshot-db -> fac-db) [Truncate target table before dump]
Expand Down

0 comments on commit 376ab2d

Please sign in to comment.