-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix #15 - Improve developer README for openstudioreleases #17
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,48 @@ | ||
# OpenStudioCoalition GitHub IO Release Pages | ||
|
||
## Install Yarn and package dependencies | ||
|
||
Install the `yarn` package manager. Assuming you have installed nodejs and npm, `npm install -g yarn` | ||
|
||
Now install the dependencies: | ||
|
||
```shell | ||
yarn install | ||
``` | ||
|
||
## Setup secrets | ||
|
||
### Download Firebase config file | ||
|
||
Go to [OSC Downloads](https://console.firebase.google.com/u/2/project/osc-downloads/overview), you can access this with the OSC email. | ||
|
||
https://support.google.com/firebase/answer/7015592?hl=en#zippy=%2Cin-this-article | ||
|
||
Go to the OSC Downloads's Settings, get values from the osc "Config" snippet and place it at `firebase-config.json` next to this readme, changing the format to be a JSON one: | ||
|
||
```json | ||
{ | ||
"apiKey": "XXXXX", | ||
"authDomain": "XXXXX", | ||
"projectId": "osc-downloads", | ||
"storageBucket": "XXXXX", | ||
"messagingSenderId": "XXXXX", | ||
"appId": "XXXXX", | ||
"measurementId": "XXXXX" | ||
} | ||
``` | ||
|
||
Additionally, do `cp .env.example .env` | ||
|
||
Then edit it to add the values to each key. | ||
|
||
### Google Analytics | ||
|
||
Set the `GA_ID` in the `.env` file. This is the Measurement ID for the OS App website itself (OS App Git - GA4) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @macumber I am not sure at all this is right. #15 (comment) |
||
|
||
## Running the website | ||
Run dev mode | ||
|
||
```bash | ||
yarn dev | ||
``` | ||
|
@@ -11,15 +53,33 @@ Build | |
yarn build | ||
``` | ||
|
||
### Too many open files error | ||
|
||
*Note:* if you get this error: `Error: EMFILE: too many open files, watch 'path/to/openstudiocoalition.github.io/openstudioreleases/public'` | ||
|
||
On ubuntu 24.04, I modified `/etc/sysctl.conf`, added | ||
|
||
``` | ||
# Default: 128 | ||
fs.inotify.max_user_instances = 512 | ||
# Default: 65536 | ||
fs.inotify.max_user_watches = 524288 | ||
``` | ||
|
||
Reloaded: `sudo sysctl --system` | ||
|
||
|
||
## Update release assets | ||
|
||
This will parse the Github Releases and save a JSON at `src/releases/releases.json` | ||
|
||
```bash | ||
yarn es scripts/getReleaseInfo.ts | ||
``` | ||
|
||
## Firebase | ||
|
||
[Test Project](https://console.firebase.google.com/u/2/project/osc-downloads/overview) | ||
[OSC Downloads](https://console.firebase.google.com/u/2/project/osc-downloads/overview) | ||
|
||
### Firebase Auth | ||
|
||
|
@@ -37,7 +97,7 @@ This is the firestore rule to let the logged user to modify their own data. | |
|
||
This is needed for firstName, lastName, company, occupation, country | ||
|
||
```yaml | ||
```javascript | ||
rules_version = '2'; | ||
|
||
service cloud.firestore { | ||
|
@@ -53,7 +113,13 @@ service cloud.firestore { | |
|
||
The data is stored in the `users` collection. | ||
|
||
The script below will get all users from the database and save to a json file | ||
The script below will get all users from the database and save to a json file. | ||
|
||
For it to work, you need the `firebase-service-account.json` with the private key next to this README.md (Ask the maintainers). | ||
|
||
To generate one you will need to go to the [Firebase project Service Accounts settings](https://console.firebase.google.com/u/0/project/osc-downloads/settings/serviceaccounts/adminsdk) | ||
|
||
Generate a new private key, and save it to `firebase-service-account.json`. **Note: as soon as you generate a new private key, the old key will stop working, so ask the maintainers to provide it instead** | ||
Comment on lines
+118
to
+122
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @macumber please review this carefully... (also, do you have that json file to share with me?) |
||
|
||
```bash | ||
yarn es scripts/getUsers.ts | ||
|
@@ -67,7 +133,7 @@ Modify the [rules](https://console.firebase.google.com/u/2/project/osc-downloads | |
|
||
This is the rule to enable any logged user to download the release assets | ||
|
||
```yaml | ||
```javascript | ||
rules_version = '2'; | ||
|
||
service firebase.storage { | ||
|
@@ -93,7 +159,7 @@ exec -l $SHELL | |
gcloud init | ||
``` | ||
|
||
Upload `cors.json` to the bucket | ||
Upload `./config/cors.json` to the bucket | ||
|
||
```bash | ||
gcloud storage buckets update gs://osc-downloads.appspot.com --cors-file=cors.json | ||
|
@@ -106,8 +172,6 @@ yarn es scripts/getReleaseInfo.ts | |
yarn es scripts/syncReleaseAssets.ts | ||
``` | ||
|
||
## Google Analytics | ||
|
||
Set the `GA_ID` in the `.env` file | ||
# TODO: explain this | ||
jmarrec marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
set `.env.prd` for production build | ||
set `.env.prd` for production build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a
GA_ID
in the.env
file, I think you just enterFIREBASE_MEASUREMENT_ID
and that links to Google AnalyticsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.