|
@@ -225,10 +225,10 @@ function interactive_setup {
|
225
|
225
|
if [ $SSL_CIPHERS ]; then
|
226
|
226
|
data=$(tempfile 2>/dev/null)
|
227
|
227
|
trap "rm -f $data" 0 1 2 5 15
|
228
|
|
- dialog --backtitle "Freedombone Security Configuration" \
|
229
|
|
- --form "\nWeb/IMAP Ciphers:" 10 95 2 \
|
230
|
|
- "Protocols:" 1 1 "$SSL_PROTOCOLS" 1 15 90 90 \
|
231
|
|
- "Ciphers:" 2 1 "$SSL_CIPHERS" 2 15 90 512 \
|
|
228
|
+ dialog --backtitle $"Freedombone Security Configuration" \
|
|
229
|
+ --form $"\nWeb/IMAP Ciphers:" 10 95 2 \
|
|
230
|
+ $"Protocols:" 1 1 "$SSL_PROTOCOLS" 1 15 90 90 \
|
|
231
|
+ $"Ciphers:" 2 1 "$SSL_CIPHERS" 2 15 90 512 \
|
232
|
232
|
2> $data
|
233
|
233
|
sel=$?
|
234
|
234
|
case $sel in
|
|
@@ -242,12 +242,12 @@ function interactive_setup {
|
242
|
242
|
data=$(tempfile 2>/dev/null)
|
243
|
243
|
trap "rm -f $data" 0 1 2 5 15
|
244
|
244
|
if [ $SSH_HOST_KEY_ALGORITHMS ]; then
|
245
|
|
- dialog --backtitle "Freedombone Security Configuration" \
|
246
|
|
- --form "\nSecure Shell Ciphers:" 13 95 4 \
|
247
|
|
- "Ciphers:" 1 1 "$SSH_CIPHERS" 1 15 90 512 \
|
248
|
|
- "MACs:" 2 1 "$SSH_MACS" 2 15 90 512 \
|
249
|
|
- "KEX:" 3 1 "$SSH_KEX" 3 15 90 512 \
|
250
|
|
- "Host key algorithms:" 4 1 "$SSH_HOST_KEY_ALGORITHMS" 4 15 90 512 \
|
|
245
|
+ dialog --backtitle $"Freedombone Security Configuration" \
|
|
246
|
+ --form $"\nSecure Shell Ciphers:" 13 95 4 \
|
|
247
|
+ $"Ciphers:" 1 1 "$SSH_CIPHERS" 1 15 90 512 \
|
|
248
|
+ $"MACs:" 2 1 "$SSH_MACS" 2 15 90 512 \
|
|
249
|
+ $"KEX:" 3 1 "$SSH_KEX" 3 15 90 512 \
|
|
250
|
+ $"Host key algorithms:" 4 1 "$SSH_HOST_KEY_ALGORITHMS" 4 15 90 512 \
|
251
|
251
|
2> $data
|
252
|
252
|
sel=$?
|
253
|
253
|
case $sel in
|
|
@@ -259,11 +259,11 @@ function interactive_setup {
|
259
|
259
|
255) exit 0;;
|
260
|
260
|
esac
|
261
|
261
|
else
|
262
|
|
- dialog --backtitle "Freedombone Security Configuration" \
|
263
|
|
- --form "\nSecure Shell Ciphers:" 11 95 3 \
|
264
|
|
- "Ciphers:" 1 1 "$SSH_CIPHERS" 1 15 90 512 \
|
265
|
|
- "MACs:" 2 1 "$SSH_MACS" 2 15 90 512 \
|
266
|
|
- "KEX:" 3 1 "$SSH_KEX" 3 15 90 512 \
|
|
262
|
+ dialog --backtitle $"Freedombone Security Configuration" \
|
|
263
|
+ --form $"\nSecure Shell Ciphers:" 11 95 3 \
|
|
264
|
+ $"Ciphers:" 1 1 "$SSH_CIPHERS" 1 15 90 512 \
|
|
265
|
+ $"MACs:" 2 1 "$SSH_MACS" 2 15 90 512 \
|
|
266
|
+ $"KEX:" 3 1 "$SSH_KEX" 3 15 90 512 \
|
267
|
267
|
2> $data
|
268
|
268
|
sel=$?
|
269
|
269
|
case $sel in
|
|
@@ -276,14 +276,14 @@ function interactive_setup {
|
276
|
276
|
fi
|
277
|
277
|
|
278
|
278
|
if [[ $SSH_PASSWORDS == "yes" ]]; then
|
279
|
|
- dialog --title "SSH Passwords" \
|
280
|
|
- --backtitle "Freedombone Security Configuration" \
|
281
|
|
- --yesno "\nAllow SSH login using passwords?" 7 60
|
|
279
|
+ dialog --title $"SSH Passwords" \
|
|
280
|
+ --backtitle $"Freedombone Security Configuration" \
|
|
281
|
+ --yesno $"\nAllow SSH login using passwords?" 7 60
|
282
|
282
|
else
|
283
|
|
- dialog --title "SSH Passwords" \
|
284
|
|
- --backtitle "Freedombone Security Configuration" \
|
|
283
|
+ dialog --title $"SSH Passwords" \
|
|
284
|
+ --backtitle $"Freedombone Security Configuration" \
|
285
|
285
|
--defaultno \
|
286
|
|
- --yesno "\nAllow SSH login using passwords?" 7 60
|
|
286
|
+ --yesno $"\nAllow SSH login using passwords?" 7 60
|
287
|
287
|
fi
|
288
|
288
|
sel=$?
|
289
|
289
|
case $sel in
|
|
@@ -295,10 +295,10 @@ function interactive_setup {
|
295
|
295
|
if [ $XMPP_CIPHERS ]; then
|
296
|
296
|
data=$(tempfile 2>/dev/null)
|
297
|
297
|
trap "rm -f $data" 0 1 2 5 15
|
298
|
|
- dialog --backtitle "Freedombone Security Configuration" \
|
299
|
|
- --form "\nXMPP Ciphers:" 10 95 2 \
|
300
|
|
- "Ciphers:" 1 1 "$XMPP_CIPHERS" 1 15 90 512 \
|
301
|
|
- "ECC Curve:" 2 1 "$XMPP_ECC_CURVE" 2 15 50 50 \
|
|
298
|
+ dialog --backtitle $"Freedombone Security Configuration" \
|
|
299
|
+ --form $"\nXMPP Ciphers:" 10 95 2 \
|
|
300
|
+ $"Ciphers:" 1 1 "$XMPP_CIPHERS" 1 15 90 512 \
|
|
301
|
+ $"ECC Curve:" 2 1 "$XMPP_ECC_CURVE" 2 15 50 50 \
|
302
|
302
|
2> $data
|
303
|
303
|
sel=$?
|
304
|
304
|
case $sel in
|
|
@@ -309,10 +309,10 @@ function interactive_setup {
|
309
|
309
|
esac
|
310
|
310
|
fi
|
311
|
311
|
|
312
|
|
- dialog --title "Final Confirmation" \
|
313
|
|
- --backtitle "Freedombone Security Configuration" \
|
|
312
|
+ dialog --title $"Final Confirmation" \
|
|
313
|
+ --backtitle $"Freedombone Security Configuration" \
|
314
|
314
|
--defaultno \
|
315
|
|
- --yesno "\nPlease confirm that you wish your security settings to be changed?\n\nWARNING: any mistakes made in the security settings could compromise your system, so be extra careful when answering 'yes'." 12 60
|
|
315
|
+ --yesno $"\nPlease confirm that you wish your security settings to be changed?\n\nWARNING: any mistakes made in the security settings could compromise your system, so be extra careful when answering 'yes'." 12 60
|
316
|
316
|
sel=$?
|
317
|
317
|
case $sel in
|
318
|
318
|
1) clear
|
|
@@ -365,21 +365,7 @@ function regenerate_dh_keys {
|
365
|
365
|
3) DH_KEYLENGTH=4096;;
|
366
|
366
|
esac
|
367
|
367
|
|
368
|
|
- ctr=0
|
369
|
|
- for file in /etc/ssl/mycerts/*
|
370
|
|
- do
|
371
|
|
- if [[ -f $file ]]; then
|
372
|
|
- filename=/etc/ssl/certs/$(echo $file | awk -F '/etc/ssl/mycerts/' '{print $2}' | awk -F '.crt' '{print $1}').dhparam
|
373
|
|
- if [ -f $filename ]; then
|
374
|
|
- openssl dhparam -check -text -dsaparam $DH_KEYLENGTH -out $filename
|
375
|
|
- if [ ! "$?" = "0" ]; then
|
376
|
|
- exit 3674
|
377
|
|
- fi
|
378
|
|
- ctr=$((ctr + 1))
|
379
|
|
- fi
|
380
|
|
- fi
|
381
|
|
- done
|
382
|
|
- echo $"$ctr dhparam certificates were regenerated"
|
|
368
|
+ ${PROJECT_NAME}-dhparam --recalc yes -l ${DH_KEYLENGTH}
|
383
|
369
|
fi
|
384
|
370
|
}
|
385
|
371
|
|
|
@@ -387,9 +373,9 @@ function renew_startssl {
|
387
|
373
|
renew_domain=
|
388
|
374
|
data=$(tempfile 2>/dev/null)
|
389
|
375
|
trap "rm -f $data" 0 1 2 5 15
|
390
|
|
- dialog --title "Renew a StartSSL certificate" \
|
391
|
|
- --backtitle "Freedombone Security Settings" \
|
392
|
|
- --inputbox "Enter the domain name" 8 60 2>$data
|
|
376
|
+ dialog --title $"Renew a StartSSL certificate" \
|
|
377
|
+ --backtitle $"Freedombone Security Settings" \
|
|
378
|
+ --inputbox $"Enter the domain name" 8 60 2>$data
|
393
|
379
|
sel=$?
|
394
|
380
|
case $sel in
|
395
|
381
|
0)
|
|
@@ -402,24 +388,24 @@ function renew_startssl {
|
402
|
388
|
fi
|
403
|
389
|
|
404
|
390
|
if [[ $renew_domain == "http"* ]]; then
|
405
|
|
- dialog --title "Renew a StartSSL certificate" \
|
406
|
|
- --msgbox "Don't include the https://" 6 40
|
|
391
|
+ dialog --title $"Renew a StartSSL certificate" \
|
|
392
|
+ --msgbox $"Don't include the https://" 6 40
|
407
|
393
|
return
|
408
|
394
|
fi
|
409
|
395
|
|
410
|
396
|
if [ ! -f /etc/ssl/certs/${renew_domain}.dhparam ]; then
|
411
|
|
- dialog --title "Renew a StartSSL certificate" \
|
412
|
|
- --msgbox "An existing certificate for $renew_domain was not found" 6 40
|
|
397
|
+ dialog --title $"Renew a StartSSL certificate" \
|
|
398
|
+ --msgbox $"An existing certificate for $renew_domain was not found" 6 40
|
413
|
399
|
return
|
414
|
400
|
fi
|
415
|
401
|
|
416
|
402
|
if [[ $renew_domain != *"."* ]]; then
|
417
|
|
- dialog --title "Renew a StartSSL certificate" \
|
418
|
|
- --msgbox "Invalid domain name: $renew_domain" 6 40
|
|
403
|
+ dialog --title $"Renew a StartSSL certificate" \
|
|
404
|
+ --msgbox $"Invalid domain name: $renew_domain" 6 40
|
419
|
405
|
return
|
420
|
406
|
fi
|
421
|
407
|
|
422
|
|
- freedombone-renew-cert -h $renew_domain -p startssl
|
|
408
|
+ ${PROJECT_NAME}-renew-cert -h $renew_domain -p startssl
|
423
|
409
|
|
424
|
410
|
exit 0
|
425
|
411
|
}
|
|
@@ -428,9 +414,9 @@ function renew_letsencrypt {
|
428
|
414
|
renew_domain=
|
429
|
415
|
data=$(tempfile 2>/dev/null)
|
430
|
416
|
trap "rm -f $data" 0 1 2 5 15
|
431
|
|
- dialog --title "Renew a Let's Encrypt certificate" \
|
432
|
|
- --backtitle "Freedombone Security Settings" \
|
433
|
|
- --inputbox "Enter the domain name" 8 60 2>$data
|
|
417
|
+ dialog --title $"Renew a Let's Encrypt certificate" \
|
|
418
|
+ --backtitle $"Freedombone Security Settings" \
|
|
419
|
+ --inputbox $"Enter the domain name" 8 60 2>$data
|
434
|
420
|
sel=$?
|
435
|
421
|
case $sel in
|
436
|
422
|
0)
|
|
@@ -443,24 +429,24 @@ function renew_letsencrypt {
|
443
|
429
|
fi
|
444
|
430
|
|
445
|
431
|
if [[ $renew_domain == "http"* ]]; then
|
446
|
|
- dialog --title "Renew a Let's Encrypt certificate" \
|
447
|
|
- --msgbox "Don't include the https://" 6 40
|
|
432
|
+ dialog --title $"Renew a Let's Encrypt certificate" \
|
|
433
|
+ --msgbox $"Don't include the https://" 6 40
|
448
|
434
|
return
|
449
|
435
|
fi
|
450
|
436
|
|
451
|
437
|
if [ ! -f /etc/ssl/certs/${renew_domain}.dhparam ]; then
|
452
|
|
- dialog --title "Renew a Let's Encrypt certificate" \
|
453
|
|
- --msgbox "An existing certificate for $renew_domain was not found" 6 40
|
|
438
|
+ dialog --title $"Renew a Let's Encrypt certificate" \
|
|
439
|
+ --msgbox $"An existing certificate for $renew_domain was not found" 6 40
|
454
|
440
|
return
|
455
|
441
|
fi
|
456
|
442
|
|
457
|
443
|
if [[ $renew_domain != *"."* ]]; then
|
458
|
|
- dialog --title "Renew a Let's Encrypt certificate" \
|
459
|
|
- --msgbox "Invalid domain name: $renew_domain" 6 40
|
|
444
|
+ dialog --title $"Renew a Let's Encrypt certificate" \
|
|
445
|
+ --msgbox $"Invalid domain name: $renew_domain" 6 40
|
460
|
446
|
return
|
461
|
447
|
fi
|
462
|
448
|
|
463
|
|
- freedombone-renew-cert -h $renew_domain -p 'letsencrypt'
|
|
449
|
+ ${PROJECT_NAME}-renew-cert -h $renew_domain -p 'letsencrypt'
|
464
|
450
|
|
465
|
451
|
exit 0
|
466
|
452
|
}
|