Skip to content

A Go CLI tool to send email notifications about domains validity and SSL certificates expiration dates.

License

Notifications You must be signed in to change notification settings

KeepSec-Technologies/GoDom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDom - Domain and SSL Expiration Checker

License GitHub issues GitHub go.mod Go version (branch & subdirectory of monorepo)

GoDom is a command-line tool written in Go, designed to check the validity of domain names and SSL certificates expirations, and then send notifications via email. It's an efficient way to stay ahead of domain and SSL renewals, ensuring your websites and services remain uninterrupted.

Table of Contents

Features

  • Check domain validity and SSL certificate expiration from a list of domains.
  • Send email notifications with domain validity and SSL expiration details.
  • Supports reading a list of domains from a file.
  • Configurable via command-line arguments for flexibility and ease of use.

Requirements

  • Go 1.20 or higher recommended (for build).
  • Access to an SMTP server for sending emails.
  • (Optional) Making a cronjob out of this is the intended way to use it.

Installation

  1. Download the binary with wget:

    wget https://github.com/KeepSec-Technologies/GoDom/releases/download/1.1/godom_linux_amd64_1.1.tar.gz
  2. Unpack it with tar

    tar -xf godom_linux_amd64_1.1.tar.gz
  3. Move it to your /usr/local/bin/ (Optional):

    sudo mv godom /usr/local/bin/godom
  4. I recommend making it a cronjob like so (Optional):

    Put this in '/etc/cron.d/godom-cron':

    0 0 1 * * root /usr/local/bin/godom -c path/to/config.json -t admin@example.com -d path/to/domains.txt

    This will run the first of every month.

Building from Source

  1. Ensure you have Go installed on your system. You can download Go from here.

  2. Clone the repository:

    git clone https://github.com/KeepSec-Technologies/GoDom
  3. Navigate to the cloned directory:

    cd GoDom
  4. Build the tool:

    CGO_ENABLED=0 go build -a -installsuffix cgo -o godom .

Usage

Put your domains in a text file, eg: domains.txt:

example.com
example.org
example.ca

Run the GoDom tool with the required flags:

./godom --smtp-server <smtp_server> --smtp-port <smtp_port> \
        --smtp-username <username> --smtp-password <password> \
        --from-email <from_email> --to-email <to_email> \
        --domains-file <path_to_domains_file>

Flags:

  -s, --smtp-server         SMTP server for sending emails
  -p, --smtp-port           SMTP server port
  -u, --smtp-username       Username for SMTP authentication
  -w, --smtp-password       Password for SMTP authentication
  -f, --from-email          Email address to send notifications from
  -c, --config              Path to the SMTP json config file which replaces the above arguments
  -t, --to-email            Email address to send notifications to
  -d, --domains-file        Path to the file containing domain names

Examples:

./godom -s smtp.example.com -p 587 -u user@example.com -w password123 -f godom@example.com -t admin@example.com -d domains.txt

or

./godom -c path/to/config.json -t admin@example.com -d domains.txt

Example of json config file to pass to GoDom:

{
    "smtp_server": "mail.example.com",
    "smtp_port": 587,
    "smtp_username": "user@example.com",
    "smtp_password": "password123",
    "from_email": "mail2go@example.com"
}

Contributing

Contributions are welcome! Feel free to submit pull requests or open issues to improve the functionality or fix problems with GoDom.

License

This project is licensed under MIT - see the LICENSE file for details.