Skip to content

Commit

Permalink
Merge changes from main
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed Sep 24, 2024
2 parents 5b8d316 + 93f4456 commit a62506f
Show file tree
Hide file tree
Showing 7 changed files with 3,262 additions and 4,604 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
credentials.ts
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ v1/npm-debug.log
v1/utilities/scripts/credentials.py
.idea
venv
.env

!v2/credentials.ts
credentials.ts
!v1/credentials.ts
v2/utilities/scripts/credentials.py

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ NOTE: Postgres connections are completely broken in node v14 and v15 (as of
This will also run the script `postinstall.sh` which copies credentials files
into place.



**Old config below. We now use env variables specifying which db and environment to connect to.**
For `credentials.ts` fill in your MariaDB and PostgreSQL user information,
update the port for Redis if necessary, and follow the inline instructions for
generating a cache refresh key. The cache refresh key is used as a secret
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"brute-force-equal-area": "git+https://github.com/UW-Macrostrat/brute-force-equal-area.git",
"csv-express": "^1.1.0",
"dbgeo": "^1.0.1",
"dotenv": "^16.4.5",
"express": "4.x.x",
"filesize-parser": "^1.3.0",
"geojson-precision": "^0.4.0",
Expand Down
3 changes: 1 addition & 2 deletions v2/column-cache-refresh.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const larkin = require("./larkin");
const credentials = require("./credentials");

module.exports = (req, res, next) => {
if (
req.query &&
req.query.cacheRefreshKey &&
req.query.cacheRefreshKey === credentials.cacheRefreshKey
req.query.cacheRefreshKey === process.env.CACHE_REFRESH_KEY
) {
larkin.setupCache();
res.json({ success: "cache refreshed" });
Expand Down
3 changes: 1 addition & 2 deletions v2/definitions/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var api = require("../api"),
dbgeo = require("dbgeo"),
gp = require("geojson-precision");

const credentials = require("../credentials");

module.exports = function (req, res, next, cb) {
if (Object.keys(req.query).length < 1) {
Expand Down Expand Up @@ -80,7 +79,7 @@ module.exports = function (req, res, next, cb) {
${"sample" in req.query ? "LIMIT 5" : ""}
`;
larkin.queryPg(
credentials.pg_macrostrat_database,
"burwell",
sql,
params,
function (error, result) {
Expand Down
Loading

0 comments on commit a62506f

Please sign in to comment.