Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release - 2021-02-17 #3768

Merged
merged 76 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
2d41a5c
Add global for APP_NAME.
svenaas Jan 18, 2022
d0b9618
Parameterize app name with globals.APP_NAME in front end text.
svenaas Jan 18, 2022
001a680
Change from Federalist to Pages support email in uaaInvite.js.
svenaas Jan 19, 2022
5c2a2f0
Parameterize support email address in api/
svenaas Jan 19, 2022
595bbca
Parameterize support email address in views/
svenaas Jan 19, 2022
89724a6
Make parameterized app name available to views and api backend.
svenaas Jan 20, 2022
cbe46f3
Parameterize app name in metas and title.
svenaas Jan 21, 2022
f3d3c6e
Parameterize logo images in front end.
svenaas Jan 21, 2022
0d83247
Parameterize app name in api/ (message texts, email subject)
svenaas Jan 21, 2022
7b2be5e
Fixing some tests I broke. Whoops.
svenaas Jan 21, 2022
4b962de
Upgrade to at least node 16.13.1 everywhere
davemcorwin Jan 21, 2022
78e5f56
Remove dns workaround
davemcorwin Jan 21, 2022
2092c1f
You can't add and commit all the files if you don't save them all in …
svenaas Jan 24, 2022
8cf045a
Test strategy and test for API parameterization of app name in views.
svenaas Jan 24, 2022
118125b
When I fixed the tests I broke my fixes caused them to break in Circl…
svenaas Jan 25, 2022
4b2c7bb
Parametrize another test for CircleCI.
svenaas Jan 25, 2022
cc6ea3d
Merge branch 'staging' into 3709-parameterize-app-name-in-federalist-web
svenaas Jan 26, 2022
a2c787a
Whitespace in .jsx files.
svenaas Jan 26, 2022
b41389e
Linting (indentation)
svenaas Jan 26, 2022
9dcc664
Merge pull request #3756 from 18F/3709-parameterize-app-name-in-feder…
svenaas Jan 26, 2022
86bcf2b
Update local dockerfile to ensure they are using at least 16.13.1
davemcorwin Jan 26, 2022
e43a8a7
You have to pass a parameter through the controller if you want it to…
svenaas Jan 27, 2022
4491f20
Merge pull request #3761 from 18F/3753-site-engine-do-not-erase
svenaas Jan 27, 2022
2dec0aa
Update .codeclimate.yml
pburkholder Jan 28, 2022
6849b5d
Merge pull request #3762 from 18F/peterb/add-nodesecurity
apburnes Jan 28, 2022
fec1159
Merge branch 'staging' into 3737-upgrade-node-remove-dns-workaround
davemcorwin Jan 28, 2022
6c34807
Merge pull request #3759 from 18F/3737-upgrade-node-remove-dns-workar…
davemcorwin Jan 28, 2022
acfb4da
Remove nsp from CodeClimate configuration
davemcorwin Jan 31, 2022
0f32ad7
Merge pull request #3765 from 18F/3764-remove-nsp
davemcorwin Jan 31, 2022
a06680b
Add `demoBranch` field to sites returned when creating domain to enab…
davemcorwin Feb 1, 2022
8081adf
Merge pull request #3766 from 18F/3758-fix-demo-context-in-domain
davemcorwin Feb 1, 2022
b38a2ae
Change admin org delete button to deactivate button and make it funct…
svenaas Feb 1, 2022
c8b5d0e
Add org activation button do admin interface, to complement the deact…
svenaas Feb 1, 2022
51a00c9
Disable the org status fieldset in favor of the de/activate buttons.
svenaas Feb 2, 2022
e07852f
Add unit tests for org de/activate.
svenaas Feb 2, 2022
62a360b
Typo.
svenaas Feb 2, 2022
a908e37
Add audit logging of org de/activation.
svenaas Feb 2, 2022
9d0dbe0
Merge branch 'staging' into 3728-deactivate-orgs
svenaas Feb 2, 2022
27118b6
Call refreshDnsResults() from de/provision() in admin client domain s…
svenaas Feb 4, 2022
e6ad5ab
whitespace at eol
svenaas Feb 4, 2022
3891871
Only configure UAA auth if feature flag is set
davemcorwin Feb 9, 2022
d0de79d
Also do not call passport functions with uaa in router
davemcorwin Feb 9, 2022
35a9717
Only call logout for UAA
davemcorwin Feb 9, 2022
33d2e8c
skip uaa tests for now
davemcorwin Feb 9, 2022
5921838
Merge pull request #3774 from 18F/dc/make-uaa-auth-config-conditional…
davemcorwin Feb 9, 2022
20af99d
Update api/services/organization/Organization.js
svenaas Feb 10, 2022
638bfe4
Update api/services/organization/Organization.js
svenaas Feb 10, 2022
eb1774f
Merge branch 'staging' into 3728-deactivate-orgs
svenaas Feb 10, 2022
9401f8f
Wait for completion before reloading and handle errors on org de/acti…
svenaas Feb 10, 2022
daa0ccc
Update admin-client/src/pages/organization/Index.svelte
svenaas Feb 10, 2022
aa0c8ed
Update admin-client/src/pages/organization/Index.svelte
svenaas Feb 10, 2022
aa5989e
Add test expectations for returned value from de/activateOrganization().
svenaas Feb 10, 2022
d96ad0c
Merge pull request #3770 from 18F/3728-deactivate-orgs
svenaas Feb 10, 2022
0811416
Merge branch 'staging' into 3727-refresh-after-domain-provision-change
svenaas Feb 10, 2022
8e94a67
Merge pull request #3772 from 18F/3727-refresh-after-domain-provision…
svenaas Feb 11, 2022
80448e7
Fix .audit() calls in controllers.
svenaas Feb 11, 2022
341b5d6
Add script to create a Federalist environment
davemcorwin Feb 11, 2022
0cdf1c3
Typo
davemcorwin Feb 11, 2022
2e0e99c
Merge pull request #3775 from 18F/3771-fix-event-audit-logging
svenaas Feb 14, 2022
2ede912
Merge branch 'staging' into dc/add-create-script
davemcorwin Feb 14, 2022
252f2e2
Merge pull request #3776 from 18F/dc/add-create-script
davemcorwin Feb 14, 2022
15a9453
Await de/provision before refreshing DNS results. HT @davemcorwin
svenaas Feb 15, 2022
7f9db1c
Merge pull request #3781 from 18F/3727-await-provision-change-before-…
svenaas Feb 15, 2022
1d9182b
Add Github auth for queues ui, refactor to help separate queues ui, u…
davemcorwin Feb 15, 2022
7383b52
Set session secret
davemcorwin Feb 15, 2022
ac952c2
Merge branch 'staging' into 3780-github-auth-for-queues-ui
davemcorwin Feb 15, 2022
45ca7ff
Merge branch 'main' into staging
svenaas Feb 16, 2022
1f1bce9
Skipping bull board auth tests for now
davemcorwin Feb 16, 2022
6c09621
Merge branch 'staging' into 3780-github-auth-for-queues-ui
davemcorwin Feb 16, 2022
57a3f89
bind additional service for session secret
davemcorwin Feb 16, 2022
5b9ca00
Merge pull request #3782 from 18F/3780-github-auth-for-queues-ui
davemcorwin Feb 16, 2022
428b55c
Update filename
davemcorwin Feb 16, 2022
0a83aa2
Merge pull request #3783 from 18F/dc/fix-bull-board-start-command
davemcorwin Feb 16, 2022
60d8ef0
completely separate bull board, update config
davemcorwin Feb 17, 2022
4b57773
add default values for uaa client in test
davemcorwin Feb 17, 2022
999e27c
Merge pull request #3784 from 18F/dc/fix-queues-service-name
davemcorwin Feb 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ commands:
jobs:
build:
docker:
- image: circleci/node:16.4
- image: circleci/node:16.13
environment:
YARN_VERSION: 0.24.6-1
CC_TEST_REPORTER_ID: 101a439651b6abd27e5440028a53b5b8f08fe0889f3948d5f58f6cf9f7c786a0
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:

deploy:
docker:
- image: circleci/node:16.4
- image: circleci/node:16.13
parameters:
app:
type: string
Expand All @@ -190,7 +190,7 @@ jobs:

deploy-admin-client:
docker:
- image: circleci/node:16.4
- image: circleci/node:16.13
parameters:
app:
type: string
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:

deploy-queues-ui:
docker:
- image: circleci/node:16.4
- image: circleci/node:16.13
parameters:
app:
type: string
Expand Down
9 changes: 7 additions & 2 deletions .cloudgov/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ applications:
- route: admin.((domain))
- name: ((product))-queues-ui((env_postfix))
buildpack: nodejs_buildpack
command: yarn start-bull-board
command: yarn start-bull-board:cg
disk_quota: 2G
instances: 1
memory: ((memory))
Expand All @@ -69,11 +69,16 @@ applications:
services:
- app-((env))-uaa-client
- federalist-((env))-redis
- federalist-((env))-github-queues-ui
- ((product))-((env))-env
env:
ADMIN_GITHUB_ORGANIZATION: 18F
ADMIN_GITHUB_TEAM: federalist-admins
NODE_ENV: production
APP_ENV: ((env))
APP_HOSTNAME: https://queues.((domain))
LOG_LEVEL: ((log_level))
NPM_CONFIG_PRODUCTION: true
NODE_MODULES_CACHE: false
UAA_HOST: ((uaa_host))
UAA_HOST: ((uaa_host))
PRODUCT: ((product))
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ exclude_patterns:
- "test/"
- "scripts/"
- "coverage/"
- "migrate.js"
- "migrate.js"
2 changes: 1 addition & 1 deletion Dockerfile-app
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.4
FROM node:16.13.1

WORKDIR /app

Expand Down
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,36 @@ _Note: some terminal commands may take a while to process, without offering feed

1. Clone the `18F/federalist` repository from Github and `cd` to that directory.

#### Editing the local configuration file
#### Editing the local configuration files

1. Make a copy of `config/local.sample.js` and name it `local.js` and place it in the `config` folder. You can do this by running `cp config/local{.sample,}.js`
This will be the file that holds your S3 and SQS configurations.
1. [Register a new OAuth application on GitHub](https://github.com/settings/applications/new). Give your app a name and "Homepage URL" (`http://localhost:1337`), and use `http://localhost:1337/auth/github2/callback` as the "Authorization callback url".

1. Once you have created the application, you'll see a `Client ID` and `Client Secret`. Open the `config/local.js` file in your text or code editor and update it with these values:
2. Assuming you have been added to the `FederalistLocal` Github organization, navigate to the [developer settings for the `FederalistLocal` OAuth application](https://github.com/organizations/FederalistLocal/settings/applications/968257) and create a new Client secret.

3. Once you have the new Client secret, you'll see a `Client ID` and `Client Secret`. Open the `config/local.js` file in your text or code editor and update it with the Client ID and Client secret from the `FederalistLocal` OAuth application:
```js
const githubOptions = {
clientID: 'VALUE FROM GITHUB',
clientSecret: 'VALUE FROM GITHUB',
};
```
1. [Register or create a new GitHub organization](https://github.com/settings/organizations) with a name of your choosing. Then find your organization's ID by visiting `https://api.github.com/orgs/<your-org-name>` and copying the `id` into the allowed `organizations` in `config/local.js`.
```js
organizations: [
99999999 // your org added here
]
```
The organization will need to grant access to Federalist, which can be done:
* during a first-time login with your GitHub credentials, or
* in the [Authorized OAuth Apps](https://github.com/settings/applications) tab in your GitHub Account settings

4. Make a copy of `api/bull-board/.env.sample`, name it `.env`, and place it in `api/bull-board/`.

2. Assuming you have been added to the `FederalistLocal` Github organization, navigate to the [developer settings for the `FederalistLocal-Queues` OAuth application](https://github.com/organizations/FederalistLocal/settings/applications/1832231) and create a new Client secret.

3. Once you have the new Client secret, you'll see a `Client ID` and `Client Secret`. Open the `api/bull-board/.env` file in your text or code editor and update it with the Client ID and Client secret from the `FederalistLocal-Queues` OAuth application:
```
GITHUB_CLIENT_ID=VALUE FROM GITHUB
GITHUB_CLIENT_SECRET=VALUE FROM GITHUB
```
**For 18F/TTS developers:** This section is primarily for 18F/TTS developers working on the Federalist project. Before you get started, make sure you have been fully on-boarded, including getting access to the Federalist cloud.gov `staging` space.

1. Paste `cf login --sso -a https://api.fr.cloud.gov -o gsa-18f-federalist -s staging` into your terminal window.
1. Visit https://login.fr.cloud.gov/passcode to get a Temporary Authentication Code.
1. Paste this code into the terminal, and hit the return key. (For security purposes, the code won't be rendered in the terminal.)
1. Type `npm run update-local-config` to read necessary service keys from the staging environment and load them into a local file called `config/local-from-staging.js`.
2. Visit https://login.fr.cloud.gov/passcode to get a Temporary Authentication Code.
3. Paste this code into the terminal, and hit the return key. (For security purposes, the code won't be rendered in the terminal.)
4. Type `npm run update-local-config` to read necessary service keys from the staging environment and load them into a local file called `config/local-from-staging.js`.

Note that `npm run update-local-config` will need to be re-run with some frequency, as service keys are changed every time Federalist's staging instance is deployed.

Expand Down
2 changes: 1 addition & 1 deletion admin-client/Dockerfile-admin
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.4
FROM node:16.13.1

WORKDIR /app

Expand Down
4 changes: 2 additions & 2 deletions admin-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"start": "sirv public -p 3000 --host --single --dev"
},
"engines": {
"node": "16.x.x",
"npm": "7.x.x"
"node": "^16.13.1",
"npm": "^8.1.2"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^12.0.0",
Expand Down
10 changes: 10 additions & 0 deletions admin-client/src/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ async function updateOrganization(id, params) {
return put(`/organizations/${id}`, params);
}

async function deactivateOrganization(id) {
return post(`/organizations/${id}/deactivate`);
}

async function activateOrganization(id) {
return post(`/organizations/${id}/activate`);
}

async function fetchRoles() {
return get('/roles').catch(() => []);
}
Expand Down Expand Up @@ -241,6 +249,8 @@ export {
fetchOrganization,
fetchOrganizations,
updateOrganization,
deactivateOrganization,
activateOrganization,
removeUserOrgRole,
updateUserOrgRole,
fetchRoles,
Expand Down
12 changes: 8 additions & 4 deletions admin-client/src/pages/domain/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@
dnsResultsPromise = fetchDomainDnsResult(id);
}

function provision() {
async function provision() {
domainPromise = provisionDomain(id);
await domainPromise;
refreshDnsResults();
}

function deprovision() {
async function deprovision() {
// eslint-disable-next-line no-alert
if (window.confirm('Are you sure you want to deprovision this domain?')) {
domainPromise = deprovisionDomain(id);
await domainPromise;
refreshDnsResults();
}
}

Expand Down Expand Up @@ -74,11 +78,11 @@
<LabeledItem label="origin" value={domain.origin} />
<LabeledItem label="path" value={domain.path} />
<LabeledItem label="service" value={domain.serviceName} />
{/if}
{/if}
</div>
<div class="tablet:grid-col-auto padding-bottom-1">
<LabeledItem label="created at" value={formatDateTime(domain.createdAt)} />
<LabeledItem label="updated at" value={formatDateTime(domain.updatedAt)} />
<LabeledItem label="updated at" value={formatDateTime(domain.updatedAt)} />
</div>
</div>
<Await on={dnsResultsPromise} let:response={dnsResults}>
Expand Down
8 changes: 4 additions & 4 deletions admin-client/src/pages/organization/Edit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
<form
class="usa-form usa-form--large"
on:submit|preventDefault={handleSubmit} >

<legend class="usa-legend usa-legend--large">Edit Organization</legend>

<p>
Required fields are marked with an asterisk (<abbr title="required" class="usa-hint usa-hint--required">*</abbr>).
</p>

<fieldset class="usa-fieldset">
<label class="usa-label" for="name">Organization Name<abbr title="required" class="usa-hint usa-hint--required">*</abbr></label>
<span class="usa-hint">Organization name must be globally unique</span>
Expand Down Expand Up @@ -104,7 +104,7 @@
</div>
</fieldset>

<fieldset class="usa-fieldset">
<fieldset class="usa-fieldset" disabled>
<legend class="usa-legend usa-legend">Organization Status</legend>
<div class="usa-radio">
<input
Expand Down
40 changes: 38 additions & 2 deletions admin-client/src/pages/organization/Index.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
<script>
import { fetchOrganizations } from '../../lib/api';
import page from 'page';
import { notification } from '../../stores';
import { fetchOrganizations, deactivateOrganization, activateOrganization } from '../../lib/api';
import { formatDateTime } from '../../helpers/formatter';
import { DataTable, PaginatedQueryPage } from '../../components';

async function deactivate(id) {
// eslint-disable-next-line no-alert
if (!window.confirm('Are you sure you want to deactivate this organization?')) { return null; }
try {
await deactivateOrganization(id);
page('/organizations');
return notification.setSuccess(`Organization ${id} deactivated successfully!`);
} catch (error) {
return notification.setError(`Unable to deactivate organization ${id}: ${error.message}`);
}
}

async function activate(id) {
try {
await activateOrganization(id);
page('/organizations');
return notification.setSuccess(`Organization ${id} activated successfully!`);
} catch (error) {
return notification.setError(`Unable to activate organization ${id}: ${error.message}`);
}
}
</script>

<PaginatedQueryPage path="organizations" query={fetchOrganizations} addAction let:data>
Expand Down Expand Up @@ -52,7 +76,19 @@
</ul>
</td>
<td>
<button class="usa-button usa-button--secondary">Delete</button>
{#if org.isActive}
<button
class="usa-button usa-button--secondary"
on:click={() => deactivate(org.id)}>
Deactivate
</button>
{:else}
<button
class="usa-button"
on:click={() => activate(org.id)}>
Activate
</button>
{/if}
</td>
</tr>
</DataTable>
Expand Down
2 changes: 1 addition & 1 deletion api/admin/controllers/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = wrapHandlers({
if (!build) return res.notFound();

await build.update({ state });
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'Build Updated', { build: { id, state } });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Build Updated', { build: { id, state } });

return res.json(buildSerializer.serializeObject(build));
},
Expand Down
8 changes: 4 additions & 4 deletions api/admin/controllers/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = wrapHandlers({

try {
const domain = await Domain.create({ siteId, context, names });
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'Domain Created', { domain });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Domain Created', { domain });
return res.json(domainSerializer.serialize(domain, true));
} catch (err) {
if (!err.errors) {
Expand All @@ -106,7 +106,7 @@ module.exports = wrapHandlers({

try {
await DomainService.destroy(domain);
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'Domain Destroyed', { domain });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Domain Destroyed', { domain });
return res.json({});
} catch (error) {
return res.unprocessableEntity(error);
Expand Down Expand Up @@ -166,7 +166,7 @@ module.exports = wrapHandlers({

try {
const updatedDomain = await DomainService.deprovision(domain);
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'Domain Deprovisioned', { domain: updatedDomain });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Domain Deprovisioned', { domain: updatedDomain });
return res.json({
dnsRecords: DomainService.buildDnsRecords(updatedDomain),
domain: domainSerializer.serialize(updatedDomain, true),
Expand All @@ -190,7 +190,7 @@ module.exports = wrapHandlers({

try {
const updatedDomain = await DomainService.provision(domain, dnsResults);
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'Domain Provisioned', { domain: updatedDomain });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Domain Provisioned', { domain: updatedDomain });
return res.json({
dnsRecords: DomainService.buildDnsRecords(updatedDomain),
domain: domainSerializer.serialize(updatedDomain, true),
Expand Down
4 changes: 2 additions & 2 deletions api/admin/controllers/organization-role.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = wrapHandlers({
userId: toInt(userId),
},
});
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'OrganizationRole Removed', { organizationRole: { organizationId, userId } });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'OrganizationRole Removed', { organizationRole: { organizationId, userId } });

return res.json({});
},
Expand All @@ -45,7 +45,7 @@ module.exports = wrapHandlers({
userId: toInt(userId),
},
});
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'OrganizationRole Updated', { organizationRole: { organizationId, userId, roleId } });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'OrganizationRole Updated', { organizationRole: { organizationId, userId, roleId } });
const member = await OrganizationRole.forOrganization(org)
.findOne({ where: { userId: toInt(userId) } });

Expand Down
26 changes: 26 additions & 0 deletions api/admin/controllers/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,30 @@ module.exports = wrapHandlers({

return res.json(serialize(org));
},

async deactivate(req, res) {
const {
params: { id },
} = req;

const org = await fetchModelById(id, Organization);
if (!org) return res.notFound();

const deactivatedOrg = await OrganizationService.deactivateOrganization(org);
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Organization Deactivated', { organization: deactivatedOrg });
return res.json(serialize(deactivatedOrg));
},

async activate(req, res) {
const {
params: { id },
} = req;

const org = await fetchModelById(id, Organization);
if (!org) return res.notFound();

const activatedOrg = await OrganizationService.activateOrganization(org);
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Organization Activated', { organization: activatedOrg });
return res.json(serialize(activatedOrg));
},
});
4 changes: 2 additions & 2 deletions api/admin/controllers/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const updateableAttrs = [

module.exports = wrapHandlers({
listRaw: async (req, res) => {
const sites = await Site.findAll({ attributes: ['id', 'owner', 'repository'], raw: true });
const sites = await Site.findAll({ attributes: ['id', 'owner', 'repository', 'demoBranch'], raw: true });
return res.json(sites);
},

Expand Down Expand Up @@ -85,7 +85,7 @@ module.exports = wrapHandlers({

// This will not remove the webhook since we don't have permissions
await SiteDestroyer.destroySite(site);
EventCreator.audit(req.user, Event.labels.ADMIN_ACTION, 'Site Destroyed', { site });
EventCreator.audit(Event.labels.ADMIN_ACTION, req.user, 'Site Destroyed', { site });

return res.json({});
},
Expand Down