Skip to content

Commit dd5dd8d

Browse files
committed
fix: update CLI to use SECRET_KEY terminology
- Renamed function and related variables from SSL_CERT to SECRET_KEY in CLI - Updated error messages and success notifications to reflect the new terminology - Added `cli` as alias for `remnawave`
1 parent dc57c0e commit dd5dd8d

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"url": "https://github.com/remnawave/backend/issues"
1616
},
1717
"bin": {
18-
"remnawave": "dist/src/bin/cli/cli.js"
18+
"remnawave": "dist/src/bin/cli/cli.js",
19+
"cli": "dist/src/bin/cli/cli.js"
1920
},
2021
"scripts": {
2122
"build": "nest build",
@@ -184,4 +185,4 @@
184185
"cron": "4.3.5"
185186
}
186187
}
187-
}
188+
}

src/bin/cli/cli.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const enum CLI_ACTIONS {
4343
ENABLE_PASSWORD_AUTH = 'enable-password-auth',
4444
EXIT = 'exit',
4545
FIX_POSTGRES_COLLATION = 'fix-postgres-collation',
46-
GET_SSL_CERT_FOR_NODE = 'get-ssl-cert-for-node',
46+
GET_SECRET_KEY_FOR_NODE = 'get-secret-key-for-node',
4747
RESET_CERTS = 'reset-certs',
4848
RESET_SUPERADMIN = 'reset-superadmin',
4949
TRUNCATE_HWID_USER_DEVICES = 'truncate-hwid-user-devices',
@@ -145,19 +145,19 @@ async function resetCerts() {
145145
}
146146
}
147147

148-
async function getSslCertForNode() {
149-
consola.start('🔑 Getting SSL cert for node...');
148+
async function getSecretKeyForNode() {
149+
consola.start('🔑 Getting SECRET_KEY for node...');
150150

151151
try {
152152
const keygen = await prisma.keygen.findFirst();
153153

154154
if (!keygen) {
155-
consola.error('❌ Keygen not found. Reset certs first or restart Remnawave.');
155+
consola.error('❌ Keygen not found. Reset SECRET_KEY first or restart Remnawave.');
156156
process.exit(1);
157157
}
158158

159159
if (!keygen.caCert || !keygen.caKey) {
160-
consola.error('❌ Certs not found. Reset certs first or restart Remnawave.');
160+
consola.error('❌ Certs not found. Reset SECRET_KEY first or restart Remnawave.');
161161
process.exit(1);
162162
}
163163

@@ -170,13 +170,13 @@ async function getSslCertForNode() {
170170
jwtPublicKey: keygen.pubKey,
171171
});
172172

173-
consola.success('✅ SSL cert for node generated successfully.');
173+
consola.success('✅ SECRET_KEY for node generated successfully.');
174174

175-
consola.info(`\nSSL_CERT="${nodePayload}"`);
175+
consola.info(`\nSECRET_KEY="${nodePayload}"`);
176176

177177
process.exit(0);
178178
} catch (error) {
179-
consola.error('❌ Failed to get SSL cert for node:', error);
179+
consola.error('❌ Failed to get SECRET_KEY for node:', error);
180180
process.exit(1);
181181
}
182182
}
@@ -332,9 +332,9 @@ async function main() {
332332
hint: 'Fully reset certs',
333333
},
334334
{
335-
value: CLI_ACTIONS.GET_SSL_CERT_FOR_NODE,
336-
label: 'Get SSL_CERT for a Remnawave Node',
337-
hint: 'Get SSL_CERT in cases, where you can not get from Panel',
335+
value: CLI_ACTIONS.GET_SECRET_KEY_FOR_NODE,
336+
label: 'Get SECRET_KEY for a Remnawave Node',
337+
hint: 'Get SECRET_KEY in cases, where you can not get from Panel',
338338
},
339339
{
340340
value: CLI_ACTIONS.FIX_POSTGRES_COLLATION,
@@ -366,8 +366,8 @@ async function main() {
366366
case CLI_ACTIONS.RESET_CERTS:
367367
await resetCerts();
368368
break;
369-
case CLI_ACTIONS.GET_SSL_CERT_FOR_NODE:
370-
await getSslCertForNode();
369+
case CLI_ACTIONS.GET_SECRET_KEY_FOR_NODE:
370+
await getSecretKeyForNode();
371371
break;
372372
case CLI_ACTIONS.FIX_POSTGRES_COLLATION:
373373
await fixPostgresCollation();

0 commit comments

Comments
 (0)