Giter Site home page Giter Site logo

pyacmedns's Introduction

pyacmedns

A client library to handle acme-dns client communication and persistent account storage.

Installation

Install from PyPI

$ pip install pyacmedns

Usage

The following is a complete example of handling the validation using this library.

#!/usr/bin/env python

from pyacmedns import Client, Storage

whitelisted_networks = ["192.168.11.0/24", "[::1]/128"]
domain = "your.example.org"

# Initialize the client. Point it towards your acme-dns instance.
client = Client("https://auth.acme-dns.io")
# Initialize the storage. If the file does not exist, it will be
# automatically created.
storage = Storage("/path/to/storage.json")

# Check if credentials were previously saved for your domain
account = storage.fetch("your.example.org")
if not account:
    # Account did not exist. Let's create a new one
    # The whitelisted networks parameter is optional
    account = client.register_account(whitelisted_networks)
    # Save it
    storage.put(domain, account)
    storage.save()

# Update the acme-dns TXT record.
client.update_txt_record(account, "___validation_token_recieved_from_the_ca___")

pyacmedns's People

Contributors

joohoi avatar

Stargazers

George Birbilis avatar Mike Sager avatar GAURAV avatar idoxtreme avatar Nikolaus Schlemm avatar

Watchers

James Cloos avatar  avatar

Forkers

fawaf jvanasco

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.