Skip to content

Commit

Permalink
update docs and use RECORD_GENERATOR_URL environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
fostermh committed May 31, 2024
1 parent 4d03551 commit c75f204
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,19 @@ firebase deploy --only database:prod # For production
- **Version Control**: Use version control to track changes and collaborate on rule development.
- **Testing**: Thoroughly test your rules in a development or staging environment before deploying to production.

Review the [Firebase CLI documentation](https://firebase.google.com/docs/cli) for more details on managing project resources.
Review the [Firebase CLI documentation](https://firebase.google.com/docs/cli) for more details on managing project resources.


## Hosting on github and Authentication

When hosting the application in a new place there are a couple of things to update.

- You must add your new domain to the allowed list for authenication in firebase.
https://console.firebase.google.com/u/0/project/cioos-metadata-form/authentication/settings
https://console.firebase.google.com/u/0/project/cioos-metadata-form-dev/authentication/settings

- You have to allow your domain under Website restrictions for the firebase browser key
https://console.cloud.google.com/apis/credentials/key/405d637a-efd4-48f5-95c6-f0af1d7f4889?project=cioos-metadata-form
https://console.cloud.google.com/apis/credentials/key/23d360a3-4b55-43f2-bc1c-b485371c0e07?project=cioos-metadata-form-dev


5 changes: 4 additions & 1 deletion cioos-records-update/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

This is a basic Flask app to create XML from the metadata form

Requires `key.json`
Requires `key.json` which contains a service account key json
specifically one from [here](https://console.cloud.google.com/iam-admin/serviceaccounts/details/108735728189650899572/keys?authuser=0&hl=en&project=cioos-metadata-form) you can also generate one [here](https://console.firebase.google.com/u/0/project/cioos-metadata-form/settings/serviceaccounts/adminsdk)

Alternatively the same service account key json string can be specified in the FIREBASE_SERVICE_ACCOUNT_KEY environment variable. The app will look for the environment variable first and fall back to the key.json file if ot found.
5 changes: 4 additions & 1 deletion firebase-functions/functions/updates.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const functions = require("firebase-functions");
const { defineString } = require('firebase-functions/params');
const https = require("https");
const axios = require("axios");

const urlBase = "https://pac-dev1.cioos.org/cioos-xml/";
const generatorURL = defineString('RECORD_GENERATOR_URL');
const urlBase = process.env.RECORD_GENERATOR_URL || generatorURL.value() || "https://pac-dev1.cioos.org/cioos-xml/";


function getRecordFilename(record) {
return `${record.title[record.language].slice(
Expand Down

0 comments on commit c75f204

Please sign in to comment.