Script - Load & install user-provided SSL certificate, Reload webserver


Recommended Posts

I made two scripts that handle installing custom SSL certificates for Unraid.

It is setup to work with pfsense and ACME certificates

One script retrieves the certs to your local server from pfsense, using the ACME plugin.
The other script copies them over and restarts the webserver.

 

Install using User-Scripts and set a cron schedule, ideally for 60 days.

The two scripts could be combined, but I separated them so people who don't use pfsense can use just the one script.

https://github.com/samssausages/unraid-install-sslcert/tree/main

Edited by samsausages
  • Like 2
Link to comment
  • samsausages changed the title to Script - Load & install user-provided SSL certificate, Reload webserver
  • 11 months later...

@samsausages thanks for those scripts. I got to make small changes to get it work

 

pfsense script refers to /mnt/certs

# Array of local directories to save files to
LOCAL_DIRS=(
  "/mnt/certs"
  # Add more directories here as needed
)

 

and unraid one to

# Define the source directory where the certificates are stored
source_dir="/mnt/user/certs"

 

In pfSense 2.7 rsync is not installed so I change

 rsync -avz -e ssh "$SSH_USER@$SSH_HOST:$REMOTE_DIR/" "$dir"

by

scp $SSH_USER@$SSH_HOST:$REMOTE_DIR/towername* $dir

 

The bad point is that my user needs admin rights in pfSense to execute scp command.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.