Commit 47759ee 1 parent 3493c27 commit 47759ee Copy full SHA for 47759ee
File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -342,6 +342,28 @@ check_change_port() {
342
342
fi
343
343
}
344
344
345
+ generate_auth_keys () {
346
+ pretty_echo " Generating Auth Keys"
347
+
348
+ if ! AUTH_PRIVATE_KEY=$( openssl genrsa 4096 2> /dev/null) ; then
349
+ echo " Error generating private key. Aborting."
350
+ return 1
351
+ fi
352
+
353
+ if ! AUTH_PUBLIC_KEY=$( echo " $AUTH_PRIVATE_KEY " | openssl rsa -pubout 2> /dev/null) ; then
354
+ echo " Error generating public key. Aborting."
355
+ return 1
356
+ fi
357
+
358
+ # Quotes are required around key variables, else dotenv does not load
359
+ export AUTH_PRIVATE_KEY=" \" $AUTH_PRIVATE_KEY \" "
360
+ export AUTH_PUBLIC_KEY=" \" $AUTH_PUBLIC_KEY \" "
361
+
362
+ echo
363
+ echo " Auth keys generated."
364
+ echo
365
+ }
366
+
345
367
generate_dotenv () {
346
368
pretty_echo " Generating Dotenv File"
347
369
@@ -390,6 +412,7 @@ prompt_user_gen_dotenv() {
390
412
fi
391
413
392
414
set_osm_credentials
415
+ generate_auth_keys
393
416
generate_dotenv
394
417
395
418
pretty_echo " Completed dotenv file generation"
You can’t perform that action at this time.
0 commit comments