Git Product home page Git Product logo

nuclearmeltd0wn101 / timeweb-api-acme-dns-sidecar Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 37 KB

A simple sidecar, that mimics an acme-dns API server and allows to easily automate LetsEncrypt DNS-01 challenge for domains with Timeweb Cloud managed nameservers

Home Page: https://git.nm101.ru/nm101/timeweb-api-acme-dns-sidecar

Dockerfile 5.46% Makefile 2.59% Python 91.95%
acme-dns dns-01 dns-01-acme-challenge dns-01-challenge fastapi letsencrypt python python312 sidecar timeweb

timeweb-api-acme-dns-sidecar's Introduction

ACME DNS Timeweb Sidecar

A simple sidecar, that mimics an acme-dns API server and allows to easily automate LetsEncrypt DNS-01 challenge for domains with Timeweb Cloud managed nameservers

Written with FastAPI, AioHTTP and AioTinyDB

Purpose

To obtain a wildcard TLS Let's Encrypt certificate with a minimal effort using managed cloud DNS, without messing up with deploying own nameservers - it's your only choice if you don't want to deploy your own DNS server, as at the moment cloud managed DNS API does not give you an option to add NS records for subdomains, and therefore you cannot delegate it to acme-dns.

This sidecar automatically manage acme challenge TXT records for a single domain and optionally its subdomains: it keeps created TXT records IDs in a small database and deletes old records automatically during the next renewal. Moreover, it mimics acme-dns API semantic, and therefore you don't need to reinvent a new plugin for certbot.

Installation

  1. Build it with docker:
docker build . -t ${DOCKER_IMAGE_FULL_NAME}
  1. Fill env file (see .env.example)

Security warning: keep cloud access token as safe as possible, as the PaaS currently have no option to limit its permissions and allows access to all cloud infrastructure of your account, not just DNS

  1. Start:
docker run -d --env-file .env -p 8000:8000 -v ./data/:/data/ ${DOCKER_IMAGE_FULL_NAME} --name 'acme-dns-timeweb-sidecar'
  1. Then fill your registration.json with pattern below, according to configuration:
{
	"${MANAGED_DOMAIN}": {
		"username":"${UPDATE_USERNAME}",
		"password":"${UPDATE_PASSWORD}",
		"fulldomain":"_acme-challenge.${MANAGED_DOMAIN}",
		"subdomain":"${MANAGED_DOMAIN}",
		"allowfrom":["0.0.0.0/0"]
	}
}

Notice: You can use it for subdomains of ${MANAGED_DOMAIN} as well - just set subdomain key's value to something like foo.bar.example.com assuming ${MANAGED_DOMAIN} is example.com.

Just keep in mind, you'll need to add additional records to those subdomains if it was set via wildcard, as once this automation will create TXT record for subdomain, it will no longer be resolved via parent wildcard's records. For example, if you've added foo.example.com, and earlier had it via A record for *.example.com pointing to somewhere, foo.example.com will no longer resolve unless you explicitly add A records foo.example.com and optionally *.foo.example.com

  1. Use a standard acme-dns plugin for certbot (or whatever you use) to obtain the certificate
  2. Enjoy a wildcard certificate

timeweb-api-acme-dns-sidecar's People

Contributors

nuclearmeltd0wn101 avatar

Stargazers

 avatar

Watchers

 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.