Browse Source

Add cert renewal to security settings

Bob Mottram 9 years ago
parent
commit
6b0a1fc97f
2 changed files with 25 additions and 3 deletions
  1. 2
    2
      doc/EN/faq.org
  2. 23
    1
      src/freedombone-sec

+ 2
- 2
doc/EN/faq.org View File

313
 * How do I renew a StartSSL certificate?
313
 * How do I renew a StartSSL certificate?
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*".
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
 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.
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
 #+BEGIN_SRC bash
326
 #+BEGIN_SRC bash
327
 ssh username@mydomainname -p 2222
327
 ssh username@mydomainname -p 2222
328
 su
328
 su
329
-freedombone-renew-cert -h mydomainname
329
+freedombone-renew-cert -h mydomainname -p startssl
330
 #+END_SRC
330
 #+END_SRC
331
 
331
 
332
 For the email address it's a good idea to use /postmaster@mydomainname/.
332
 For the email address it's a good idea to use /postmaster@mydomainname/.

+ 23
- 1
src/freedombone-sec View File

375
   fi
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
 function housekeeping {
396
 function housekeeping {
379
   cmd=(dialog --separate-output \
397
   cmd=(dialog --separate-output \
380
               --backtitle "Freedombone Security Configuration" \
398
               --backtitle "Freedombone Security Configuration" \
381
               --title "Housekeeping options" \
399
               --title "Housekeeping options" \
382
               --checklist "If you don't need to do any of these things then just press Enter:" 10 76 16)
400
               --checklist "If you don't need to do any of these things then just press Enter:" 10 76 16)
383
   options=(1 "Regenerate ssh host keys" off
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
   choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
404
   choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
386
   clear
405
   clear
387
   for choice in $choices
406
   for choice in $choices
393
       2)
412
       2)
394
         REGENERATE_DH_KEYS="yes"
413
         REGENERATE_DH_KEYS="yes"
395
         ;;
414
         ;;
415
+      3)
416
+        renew_startssl
417
+        ;;
396
     esac
418
     esac
397
   done
419
   done
398
 }
420
 }