Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bin/cliOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function buildRequest() {
*/
async function cliOperations(req) {
if (!req.target) {
req.target = process.env.CLI_TARGET;
req.target = process.env.CLI_TARGET || process.env.HARPER_CLI_TARGET;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these HARPER_CLI_* env vars? Why aren't the CLI_TARGET* env vars sufficient?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It began with a user setting HARPER_CLI_TARGET in a GH Actions workflow. We discussed on the slack thread, and Kris confirmed we want to move toward HARPER_-prefixed env vars

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K, just checking. We should add a ticket these new env vars.

}
let target;
if (req.target) {
Expand All @@ -73,15 +73,15 @@ async function cliOperations(req) {
try {
target = new URL(`https://${req.target}:9925`);
} catch {
throw error; // throw the original error
throw error;
}
}
target = {
protocol: target.protocol,
hostname: target.hostname,
port: target.port,
username: req.username || target.username || process.env.CLI_TARGET_USERNAME,
password: req.password || target.password || process.env.CLI_TARGET_PASSWORD,
username: req.username || target.username || process.env.CLI_TARGET_USERNAME || process.env.HARPER_CLI_USERNAME,
password: req.password || target.password || process.env.CLI_TARGET_PASSWORD || process.env.HARPER_CLI_PASSWORD,
rejectUnauthorized: req.rejectUnauthorized,
};
} else {
Expand Down
Loading