Skip to content

Commit

Permalink
added more config values
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxada committed Jan 25, 2024
1 parent 0e28399 commit c6abdcc
Showing 1 changed file with 54 additions and 4 deletions.
58 changes: 54 additions & 4 deletions configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const fs = require("fs");
"Please input the fields below to configure your project locally"
);
const values = {
// database configuration
db_name: await input({ message: "Your database name:" }),
db_user: await input({ message: "Your database user name:" }),
db_password: await password({
Expand All @@ -22,13 +23,36 @@ const fs = require("fs");
default: "mysql",
}),

github_client_ID: await input({
// Github OAuth configuration
github_auth_client_ID: await input({
message: "Your personal Github OAuth App Client ID: ",
}),
github_client_secret: await input({
github_auth_client_secret: await input({
message: "Your personal Github OAuth App Client Secret:",
}),

// GitHub App configuration
github_app_id: await input({
message: "Your personal Github App ID: ",
}),

github_app_client_ID: await input({
message: "Your personal Github App Client ID: ",
}),

github_app_client_secret: await input({
message: "Your personal Github App Client Secret:",
}),

github_app_private_key: await input({
message: "Your personal Github App Private Key:",
}),

github_app_webhook_secret: await input({
message: "Your personal Github App Webhook Secret:",
}),

// Gitlab OAuth configuration
gitlab_client_ID: await input({
message: "Your personal GitLab OAuth App Client ID: ",
}),
Expand All @@ -39,13 +63,29 @@ const fs = require("fs");
message: "Your personal GitLab OAuth APP redirection URI:",
}),

// Augur configuration
augur_client_secret: await input({
message: "Your Augur Client Secret: ",
}),
port: await input({
message: "Port that you'd like server to run on: ",
default: 4040,
}),

// email configuration
email_host: await input({
message: "Your email host:",
default: "Gmail",
}),

email_address: await input({
message: "Your email address:",
}),

email_password: await password({
message: "Your email app password:",
mask: true,
}),
};

const envFile = `
Expand All @@ -55,15 +95,25 @@ const fs = require("fs");
DB_HOST=${values.db_host}
DB_DIALECT=${values.db_dialect}
GITHUB_APP_CLIENT_ID=${values.github_client_ID}
GITHUB_APP_CLIENT_SECRET=${values.github_client_secret}
GITHUB_AUTH_CLIENT_ID=${values.github_auth_client_ID}
GITHUB_AUTH_CLIENT_SECRET=${values.github_auth_client_secret}
GITHUB_APP_ID=${values.github_app_id}
GITHUB_APP_CLIENT_ID=${values.github_app_client_ID}
GITHUB_APP_CLIENT_SECRET=${values.github_app_client_secret}
GITHUB_APP_WEBHOOK_SECRET=${values.github_app_webhook_secret}
GITHUB_APP_PRIVATE_KEY=${values.github_app_private_key}
GITLAB_APP_CLIENT_ID=${values.gitlab_client_ID}
GITLAB_APP_CLIENT_SECRET=${values.gitlab_client_secret}
GITLAB_APP_REDIRECT_URI=${values.gitlab_redirect_uri}
AUGUR_CLIENT_SECRET=${values.augur_client_secret}
PORT=${values.port}
EMAIL_HOST=${values.email_host}
EMAIL_ADDRESS=${values.email_address}
EMAIL_PASSWORD=${values.email_password}
`;

fs.writeFileSync(".env", envFile);
Expand Down

0 comments on commit c6abdcc

Please sign in to comment.