connectbase-client 0.10.9 → 0.10.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +9 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -122,6 +122,7 @@ function loadConfig() {
|
|
|
122
122
|
try {
|
|
123
123
|
const rcContent = JSON.parse(fs.readFileSync(rcPath, "utf-8"));
|
|
124
124
|
if (rcContent.apiKey) config.apiKey = rcContent.apiKey;
|
|
125
|
+
if (rcContent.secretKey) config.secretKey = rcContent.secretKey;
|
|
125
126
|
if (rcContent.storageId) config.storageId = rcContent.storageId;
|
|
126
127
|
if (rcContent.baseUrl) config.baseUrl = rcContent.baseUrl;
|
|
127
128
|
if (rcContent.deployDir) config.deployDir = rcContent.deployDir;
|
|
@@ -638,6 +639,9 @@ ${colors.blue}?${colors.reset} \uC120\uD0DD (\uBC88\uD638): `);
|
|
|
638
639
|
storageId,
|
|
639
640
|
deployDir
|
|
640
641
|
};
|
|
642
|
+
if (secretKey) {
|
|
643
|
+
config.secretKey = secretKey;
|
|
644
|
+
}
|
|
641
645
|
fs.writeFileSync(rcPath, JSON.stringify(config, null, 2) + "\n");
|
|
642
646
|
success(".connectbaserc \uC0DD\uC131 \uC644\uB8CC");
|
|
643
647
|
addToGitignore(".connectbaserc");
|
|
@@ -1111,16 +1115,13 @@ ${colors.blue}?${colors.reset} \uC571 \uC120\uD0DD (\uBC88\uD638): `);
|
|
|
1111
1115
|
return createData.app_id;
|
|
1112
1116
|
}
|
|
1113
1117
|
async function startTunnel(port, config, tunnelOpts) {
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
}
|
|
1119
|
-
if (!config.apiKey.startsWith("cb_sk_")) {
|
|
1120
|
-
error("\uD130\uB110\uC740 \uC720\uC800 Secret Key(cb_sk_)\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. Public Key(cb_pk_)\uB294 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
1121
|
-
info("Secret Key\uB294 \uCF58\uC194 > \uD504\uB85C\uD544 > \uC2DC\uD06C\uB9BF \uD0A4 \uD0ED\uC5D0\uC11C \uC0DD\uC131\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
1118
|
+
const tunnelKey = config.secretKey || (config.apiKey?.startsWith("cb_sk_") ? config.apiKey : "");
|
|
1119
|
+
if (!tunnelKey) {
|
|
1120
|
+
error('Secret Key\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. "npx connectbase init"\uC73C\uB85C \uC124\uC815\uD558\uAC70\uB098 -k \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694');
|
|
1121
|
+
info("init \uC2DC \uBE0C\uB77C\uC6B0\uC800 \uB85C\uADF8\uC778\uC73C\uB85C Secret Key\uAC00 \uC790\uB3D9 \uBC1C\uAE09\uB429\uB2C8\uB2E4");
|
|
1122
1122
|
process.exit(1);
|
|
1123
1123
|
}
|
|
1124
|
+
config.apiKey = tunnelKey;
|
|
1124
1125
|
const appId = await resolveAppForTunnel(config.apiKey, config.baseUrl, tunnelOpts?.appId);
|
|
1125
1126
|
const tunnelServerUrl = getTunnelServerUrl(config.baseUrl);
|
|
1126
1127
|
const parsedUrl = new URL(tunnelServerUrl);
|