Compare commits

..

3 commits

Author SHA1 Message Date
f2fd019aa8 Remove unused IMPRESS_LOG_IN_AS feature
The latest version of Yarn's shell interpreter wasn't playing nice with
this undefined variable; okay! It's unused, let's just delete all
trace of it!
2024-01-28 06:36:09 -08:00
106fcf075f Use the same dev database credentials as the main impress app
This should make it easier to test both apps working together!
2024-01-28 06:32:46 -08:00
ae287a0393 Update yarn lockfile
Another environment, another yarn version upgrade thing!
2024-01-28 06:31:47 -08:00
7 changed files with 15428 additions and 11094 deletions

View file

@ -41,7 +41,7 @@ dependencies to install correctly. See the instructions for
### Create your development database ### Create your development database
Next, create two MySQL databases: `openneo_impress` and `openneo_id`. Then, Next, create two MySQL databases: `openneo_impress` and `openneo_id`. Then,
create a MySQL user named `impress_2020_dev` with password `impress_2020_dev`, create a MySQL user named `impress_dev` with password `impress_dev`,
with full permissions for both databases. with full permissions for both databases.
(We're assuming that, on your local machine, your MySQL server isn't connected (We're assuming that, on your local machine, your MySQL server isn't connected

View file

@ -61,8 +61,8 @@
"scripts": { "scripts": {
"prepare": "husky install", "prepare": "husky install",
"start": "next start", "start": "next start",
"dev": "DB_ENV=development yarn build-cached-data && DB_ENV=development REACT_APP_IMPRESS_LOG_IN_AS=$IMPRESS_LOG_IN_AS TS_NODE_COMPILER=typescript-cached-transpile next dev", "dev": "DB_ENV=development yarn build-cached-data && DB_ENV=development TS_NODE_COMPILER=typescript-cached-transpile next dev",
"local-prod": "DB_ENV=production yarn build-cached-data && DB_ENV=production REACT_APP_IMPRESS_LOG_IN_AS=$IMPRESS_LOG_IN_AS TS_NODE_COMPILER=typescript-cached-transpile next dev", "local-prod": "DB_ENV=production yarn build-cached-data && DB_ENV=production TS_NODE_COMPILER=typescript-cached-transpile next dev",
"build": "yarn build-cached-data && next build", "build": "yarn build-cached-data && next build",
"vercel-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/", "vercel-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/",
"test": "jest test --env=jsdom", "test": "jest test --env=jsdom",
@ -71,7 +71,7 @@
"deploy": "ansible-playbook -i deploy/inventory.cfg deploy/playbooks/deploy.yml", "deploy": "ansible-playbook -i deploy/inventory.cfg deploy/playbooks/deploy.yml",
"deploy-skip-build": "ansible-playbook -i deploy/inventory.cfg deploy/playbooks/deploy.yml --extra-vars='{\"skip_build\": true}'", "deploy-skip-build": "ansible-playbook -i deploy/inventory.cfg deploy/playbooks/deploy.yml --extra-vars='{\"skip_build\": true}'",
"mysql": "mysql --host=$(dotenv -p IMPRESS_MYSQL_HOST) --user=$(dotenv -p IMPRESS_MYSQL_USER) --password=$(dotenv -p IMPRESS_MYSQL_PASSWORD) --database=openneo_impress", "mysql": "mysql --host=$(dotenv -p IMPRESS_MYSQL_HOST) --user=$(dotenv -p IMPRESS_MYSQL_USER) --password=$(dotenv -p IMPRESS_MYSQL_PASSWORD) --database=openneo_impress",
"mysql-dev": "mysql --host=localhost --user=impress_2020_dev --password=impress_2020_dev --database=openneo_impress", "mysql-dev": "mysql --host=localhost --user=impress_dev --password=impress_dev --database=openneo_impress",
"mysql-admin": "mysql --host=$(dotenv -p IMPRESS_MYSQL_HOST) --user=matchu --password --database=openneo_impress", "mysql-admin": "mysql --host=$(dotenv -p IMPRESS_MYSQL_HOST) --user=matchu --password --database=openneo_impress",
"mysqldump": "mysqldump --host=$(dotenv -p IMPRESS_MYSQL_HOST) --user=$(dotenv -p IMPRESS_MYSQL_USER) --password=$(dotenv -p IMPRESS_MYSQL_PASSWORD)", "mysqldump": "mysqldump --host=$(dotenv -p IMPRESS_MYSQL_HOST) --user=$(dotenv -p IMPRESS_MYSQL_USER) --password=$(dotenv -p IMPRESS_MYSQL_PASSWORD)",
"setup-mysql": "yarn mysql-admin < scripts/setup-mysql.sql", "setup-mysql": "yarn mysql-admin < scripts/setup-mysql.sql",

View file

@ -18,27 +18,6 @@ function useCurrentUser() {
isEnabled: authMode === "db", isEnabled: authMode === "db",
}); });
// In development, you can start the server with
// `IMPRESS_LOG_IN_AS=12345 vc dev` to simulate logging in as user 12345.
//
// This flag shouldn't be present in prod anyway, but the dev check is an
// extra safety precaution!
//
// NOTE: In package.json, we forward the flag to REACT_APP_IMPRESS_LOG_IN_AS,
// because create-react-app only forwards flags with that prefix.
if (
process.env["NODE_ENV"] === "development" &&
process.env["REACT_APP_IMPRESS_LOG_IN_AS"]
) {
const id = process.env["REACT_APP_IMPRESS_LOG_IN_AS"];
return {
isLoading: false,
isLoggedIn: true,
id,
username: `<Simulated User ${id}>`,
};
}
if (authMode === "auth0") { if (authMode === "auth0") {
return currentUserViaAuth0; return currentUserViaAuth0;
} else if (authMode === "db") { } else if (authMode === "db") {

View file

@ -17,18 +17,6 @@ async function getJwtKey(header, callback) {
} }
async function getUserIdFromToken(token) { async function getUserIdFromToken(token) {
// In development, you can start the server with
// `IMPRESS_LOG_IN_AS=12345 vc dev` to simulate logging in as user 12345.
//
// This flag shouldn't be present in prod anyway, but the dev check is an
// extra safety precaution!
if (
process.env["NODE_ENV"] === "development" &&
process.env["IMPRESS_LOG_IN_AS"]
) {
return process.env["IMPRESS_LOG_IN_AS"];
}
if (!token) { if (!token) {
return null; return null;
} }

View file

@ -13,8 +13,8 @@ const defaultOptions =
process.env["DB_ENV"] === "development" process.env["DB_ENV"] === "development"
? { ? {
host: "localhost", host: "localhost",
user: "impress_2020_dev", user: "impress_dev",
password: "impress_2020_dev", password: "impress_dev",
database: "openneo_impress", database: "openneo_impress",
} }
: { : {

26477
yarn.lock

File diff suppressed because it is too large Load diff