Ver código fonte

Add cert renewal to security settings

Bob Mottram 9 anos atrás
pai
commit
6b0a1fc97f
2 arquivos alterados com 25 adições e 3 exclusões
  1. 2
    2
      doc/EN/faq.org
  2. 23
    1
      src/freedombone-sec

+ 2
- 2
doc/EN/faq.org Ver arquivo

@@ -313,7 +313,7 @@ Now visit your web site at https://mydomainname.com and you should notice that t
313 313
 * How do I renew a StartSSL certificate?
314 314
 The StartSSL certificates last for a year. You can check the expiry date of your current certificate/s by going to your site and if you're using Firefox then click on the *lock icon*, select "*more information*" then "*view certificate*".
315 315
 
316
-Before changing any certificates it's a good idea to make a backup of the existing system. Plug in a USB drive, log into the Freedombone and become the root user, then run the command *backup*. Backing up may take a while, but it ensures that if anything goes wrong and you mess up the certificates then there is a way to restore the previous ones.
316
+Before changing any certificates it's a good idea to make a backup of the existing system. Use /Backup and Restore/ from the control panel to make a backup of the system to a USB drive. Backing up may take a while, but it ensures that if anything goes wrong and you mess up the certificates then there is a way to restore the previous ones.
317 317
 
318 318
 Make sure that you have the StartSSL certificate which was created when you initially made an account. You did save it somewhere safe, didn't you? If it's not installed into your browser then in Firefox go to *Menu/Preferences/Advanced/View Certificates*. Make sure the "*Your Cerificates*" tab is selected and click "*import*", then import the StartSSL certificate.
319 319
 
@@ -326,7 +326,7 @@ Log in to the Freedombone, become the root user, then issue the renew command:
326 326
 #+BEGIN_SRC bash
327 327
 ssh username@mydomainname -p 2222
328 328
 su
329
-freedombone-renew-cert -h mydomainname
329
+freedombone-renew-cert -h mydomainname -p startssl
330 330
 #+END_SRC
331 331
 
332 332
 For the email address it's a good idea to use /postmaster@mydomainname/.

+ 23
- 1
src/freedombone-sec Ver arquivo

@@ -375,13 +375,32 @@ function regenerate_dh_keys {
375 375
   fi
376 376
 }
377 377
 
378
+function renew_startssl {
379
+  data=$(tempfile 2>/dev/null)
380
+  trap "rm -f $data" 0 1 2 5 15
381
+  dialog --title "Renew a StartSSL certificate" \
382
+         --backtitle "Freedombone Security Settings" \
383
+         --inputbox "Enter the domain name" 8 60 2>$data
384
+  sel=$?
385
+  case $sel in
386
+      0)
387
+          renew_domain=$(<$data)
388
+          if [[ $renew_domain == *"."* ]]; then
389
+              freedombone-renew-cert -h $renew_domain -p startssl
390
+          fi
391
+          ;;
392
+  esac
393
+  exit 0
394
+}
395
+
378 396
 function housekeeping {
379 397
   cmd=(dialog --separate-output \
380 398
               --backtitle "Freedombone Security Configuration" \
381 399
               --title "Housekeeping options" \
382 400
               --checklist "If you don't need to do any of these things then just press Enter:" 10 76 16)
383 401
   options=(1 "Regenerate ssh host keys" off
384
-           2 "Regenerate Diffie-Hellman keys" off)
402
+           2 "Regenerate Diffie-Hellman keys" off
403
+           3 "Renew a StartSSL certificate" off)
385 404
   choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
386 405
   clear
387 406
   for choice in $choices
@@ -393,6 +412,9 @@ function housekeeping {
393 412
       2)
394 413
         REGENERATE_DH_KEYS="yes"
395 414
         ;;
415
+      3)
416
+        renew_startssl
417
+        ;;
396 418
     esac
397 419
   done
398 420
 }