Use env vars for MySQL in export-users-to-auth0
Huh, oops, there are a _few_ reasons the user sync cron job hasn't been running correctly. I fixed some of the config in prod, but then discovered one more issue: the script prompts for an admin database password, so of _course_ it can't auto-run, lol. Instead, I've now created a `impress2020-util` account, with just a few permissions (but specifically the `openneo_id.users` permission that I _don't_ give the app!), and added the username and password to the secret .env file, both locally and in prod. (In this case, prod means the Linode VPS, not Vercel, because that's where our cron runs.)
This commit is contained in:
parent
9b856a40b8
commit
357061221f
1 changed files with 4 additions and 5 deletions
|
@ -35,11 +35,10 @@ const auth0 = new ManagementClient({
|
||||||
async function main() {
|
async function main() {
|
||||||
const connectionsPromise = auth0.getConnections();
|
const connectionsPromise = auth0.getConnections();
|
||||||
|
|
||||||
const { user, password } = await inquirer.prompt([
|
const db = await connectToDb({
|
||||||
{ name: "user", message: "MySQL admin user:" },
|
user: process.env.IMPRESS_MYSQL_SCRIPT_USER,
|
||||||
{ name: "password", type: "password" },
|
password: process.env.IMPRESS_MYSQL_SCRIPT_PASSWORD,
|
||||||
]);
|
});
|
||||||
const db = await connectToDb({ user, password });
|
|
||||||
|
|
||||||
const connections = await connectionsPromise;
|
const connections = await connectionsPromise;
|
||||||
const { connectionId } = await inquirer.prompt([
|
const { connectionId } = await inquirer.prompt([
|
||||||
|
|
Loading…
Reference in a new issue