Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔒 dencrypt

The ultimate command-line companion for managing web server configurations and Let's Encrypt SSL certificates.

Python Version License Maintenance


🌟 Overview

dencrypt takes the hassle out of adding new domains to your Linux server. Whether you're running Nginx or Apache, dencrypt automates the entire process: creating virtual hosts, setting up document roots, and provisioning Let's Encrypt SSL certificates via certbot—all with a single command!


✨ Features

  • 🚀 Automated Configuration: Generates optimized Nginx or Apache server blocks instantly.
  • 📁 Smart Provisioning: Automatically sets up the document root (/var/www/domain/html) with proper permissions.
  • 🔐 One-Click SSL: Seamlessly integrates with certbot to provision Let's Encrypt certificates and auto-configure HTTP-to-HTTPS redirection.
  • 🩺 Health Checks: Built-in commands to verify your web server syntax and configuration status.
  • 🧠 Auto-Detection: Intelligently detects your active web server so you don't have to specify it manually.

🛠️ Requirements

Before you begin, ensure you have the following on your Linux server:

  • Root access (sudo privileges)
  • Python 3 installed
  • Nginx or Apache2 installed
  • Certbot installed (sudo apt install certbot python3-certbot-nginx python3-certbot-apache)

📦 Installation

Get up and running in seconds. Clone the repository and install the package globally:

git clone https://github.com/yourusername/dencrypt.git
cd dencrypt
sudo python3 setup.py install

📖 Usage Guide

⚠️ Note: dencrypt modifies protected system files (/etc/nginx, /etc/apache2) and runs certbot. It must be executed with root privileges (sudo).

➕ 1. Add a New Domain

Set up a new domain from scratch. This command generates the config, creates the web root, enables the site, reloads the server, and provisions an SSL certificate.

sudo dencrypt add example.com

Customization Flags:

  • --server [nginx|apache]: Force a specific web server (useful if both are installed).
  • --no-ssl: Skip SSL provisioning (useful for local testing or pre-DNS configuration).

Example (Nginx without SSL):

sudo dencrypt add example.com --server nginx --no-ssl

🔒 2. Provision SSL for an Existing Domain

Already have a configuration set up but need to secure it? Provision a Let's Encrypt certificate effortlessly:

sudo dencrypt ssl example.com

🩺 3. Check Configuration Health

Ensure your server is healthy and configurations are syntax-error free:

sudo dencrypt check

You can optionally check the SSL expiration status for a specific domain:

sudo dencrypt check example.com

🏗️ How It Works Under the Hood

  1. Config Generation: Creates standard HTTP configuration files in /etc/nginx/sites-available/ or /etc/apache2/sites-available/.
  2. Document Root: Scaffolds the directory structure at /var/www/<domain>/html complete with a default index.html.
  3. Site Enablement: Creates safe symlinks to sites-enabled/ (or utilizes a2ensite for Apache environments).
  4. SSL Provisioning: Uses the respective certbot plugin (--nginx or --apache) to fetch certificates securely and safely updates your config to redirect HTTP to HTTPS.

Made with ❤️ for System Administrators and Developers.

About

A command-line tool to set-up and manage SSL-secured domains with Apache and Nginx on Linux.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages