Front end for manipulating a Google Spreadsheet of cybersecurity-related statistics, written in React.
- Create a Google Sheet
- Edit the first row (A1:H1) as follows:
A | B | C | D | E | F | G | H | |
---|---|---|---|---|---|---|---|---|
1 | title | source | org | published | lastTouch | stat | topicTags | row |
- Select View > Freeze > 1 row
- Select columns D & E simultaneously, then select Format > Number > Date
- Make note of the ID in the address bar:
https://docs.google.com/spreadsheets/d/<SPREADSHEET-ID-HERE>/edit
- Visit the Google API Console
- Sign in to your Google account
- Enable the Google Sheets API (follow the prompts to create a project)
- Configure the OAuth consent screen
- Create an OAuth client ID for your project (Credentials > Create credentials > OAuth client ID > Web application) 1. Enter the URI that the application will be served from in Authorized JavaScript origins and in Authorized redirect URIs
- Clone or download this repo
- In your copy of the project, create a file called
config.json
in the root directory - Place the following contents in the file:
{ "client_id" : "<YOUR-OAUTH-CLIENT-ID-HERE>", "sheet_id" : "<YOUR-SHEET-ID-HERE>", "scopes" : ["https://www.googleapis.com/auth/spreadsheets"], "max_rows" : "1000", "first_data_row" : "2", "frequent_tag_threshold" : "10" }
The max_rows
property can be increased.
The frequent_tag_threshold
property is how many times a tag must appear in the Sheet backend before it appears above the StatTable for convenient filtering.
- Run this web app from your preferred webserver
- Navigate to the site from Chrome
- Authenticate with your Google account
You are ready to filter, edit, and add stats.
If there are errors when granting access to your Google account, make sure you are running the webapp from a hostname whitelisted in your Google API Console.
- The architecture of this project makes it difficult/impossible to perform validation server-side. Any validation is therefore performed client-side. Please don't go forging POST requests :(
- Multiple users should be able to add stats without issue. However, attempting to edit/delete will cause issues, including overwritten data, deletion of the incorrect row, etc.
- It is not advised to edit the Sheet directly. If you do, refresh this app before resuming working from it
- When adding a stat, the local date at the client will be submitted to the "Date Added" column (column E in the Sheet)