Giter Site home page Giter Site logo

dnscrypt-service-scripts's Introduction

dnscrypt-service-scripts

Running a highly-available DNSCrypt endpoint is a bit of a pain in the ass. To protect your users' privacy, you need to rotate your server keys at least once every 12 hours. You don't want your service to be unresponsive during key rotation so you must do a fine dance where you swap in a new server instance and remove the old instance once the new one is up and running. Managing these instances and the re-keying is tough, so I wrote some scripts and systemd units to help.

Key Rotation

Managing DNSCrypt server keys is tricky. Keys must be rotated at least twice a day but because clients only check their server for new keys once an hour, the server needs to continue to present older keys for a little while so that clients with an old key don't hang during DNS queries. The dnscrypt-wrapper.sh script takes care of the creation/rotating/purging of keys and the starting of the DNSCrypt service (dnscrypt-wrapper).

Installation

As root:

cp dnscrypt-server-rotate.sh /usr/local/bin/
cp dnscrypt-wrapper.sh /usr/local/bin/
chmod 755 /usr/local/bin/dnscrypt*.sh
cp *.service /usr/lib/systemd/system/
cp *.timer /usr/liib/systemd/system/
systemctl daemon-reload
systemctl enable dnscrypt-server-rotate.timer
systemctl start dnscrypt-server-rotate.timer
systemctl enable [email protected]
systemctl start [email protected]
# Test rotation and re-keying manually
/usr/local/bin/dnscrypt-server-rotate.sh

dnscrypt-service-scripts's People

Contributors

chrissnell avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pengelana

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.