GithubHelp home page GithubHelp logo

twilson90 / vesta-server-ssl-cert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ifaist0s/vesta-server-ssl-cert

0.0 2.0 0.0 16 KB

A Linux shell script for VESTA Control Panel to assign and update SSL certificate to all services (vesta, exim, etc).

Home Page: https://www.atgroup.gr

License: GNU General Public License v3.0

Shell 100.00%

vesta-server-ssl-cert's Introduction

vesta-server-ssl-cert

A Linux shell script for VESTA Control Panel to assign and update SSL certificate to all services (vesta, exim, etc)

The problem

VESTA has included support for the free and open Certificate Authority Let’s Encrypt. It now supports automatic issuance and renewal of certificates for domain names. But there is no automatic mechanism (yet) to update the configuration of all VESTA services to use the FQDN server certificate.

The solution

This script compares the FQDN Server certificates issued by Let's Encrypt and if they're different it places them to the correct directory with the correct name.

Usage

The easiest way to use the script is with a cron job that runs every day. At the command line type crontab -e, enter the line 3 3 * * * /root/vesta-server-ssl-cert.sh and then save and exit. Take care to replace the path of the script with the correct path.

How the script works

The script asumes that VESTA has a web domain under the admin account, which is the same as the server's FQDN, (e.g. example.acme.com) and has Let's Encrypt support.

By default, the implementation of Let's Encrypt in VESTA saves domain certificates at /home/[USER]/conf/web so the script checks in /home/admin/conf/web/ for the files ssl.[FQDN].crt, ssl.[FQDN].key and ssl.[FQDN].pem.

In the default VESTA configuration, server certificates are found in /usr/local/vesta/ssl with names certificate.crt, certificate.key and certificate.pem.

The script checks those two sets of certificates and if different, it copies LE certificates from /home/admin/conf/web/ to /usr/local/vesta/ssl overwriting the old ones, setting correct file owner and permissions and then it restarts the relevant services.

Works with...

The script work fine in CentOS 7. Be ware that it needs modifications to run on different OS flavors.

vesta-server-ssl-cert's People

Contributors

ifaist0s avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.