Skip to content

Commit

Permalink
Update google env variables to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
johan-lindell authored Dec 6, 2023
1 parent 4c12309 commit 48a8ef1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ Teknologföreningen's homepage. Built with Next.js and Strapi.
3. Install dependencies `yarn install`
4. Set environmental variables in `.env.local`
5. Run development server `yarn dev`


## Google environment variables

For calendar and file handling we use the google api. These requests are fetched with 2 [google service accounts](https://cloud.google.com/iam/docs/service-account-overview), one private defined by GOOGLE_PRIVATE_CREDS (for private file handling) and one public GOOGLE_CREDS (public file handling and calendar). These are currently managed by Teknologföreningen google workspace admin. New service account can be created like [this](https://cloud.google.com/iam/docs/service-accounts-create), the service account environment variables are [google service account keys](https://cloud.google.com/iam/docs/keys-create-delete#creating). Google drive and calendar api read permissions need to be given to the service accounts for the features to work properly.

### Calendar
The calendar events are directly fetched from a public google calendar by [Google calendar api](https://developers.google.com/calendar/api/quickstart/nodejs) (calendar defined by NEXT_PUBLIC_GOOGLE_CALENDAR_ID in .env file). Implementation in [/lib/google/calendar.ts](https://github.com/Teknologforeningen/tf.fi/blob/master/lib/google/calendar.ts).

### File handling
The file handling is separated into public and private (needing auth) files, implementaiton in [app/api/drive](https://github.com/Teknologforeningen/tf.fi/tree/master/app/api/drive). These use the [google drive api](https://developers.google.com/drive/api/guides/about-sdk). The files are fetched from a specific google workspace for which SHARED_GOOGLE_DRIVE_ID needs to be defined to search files from the workspace.

0 comments on commit 48a8ef1

Please sign in to comment.