Giter Club home page Giter Club logo

ipupd's Introduction

ipupd

Fetches current IP addresses of the machine and compares them with DNS records of a domain. If there is a difference, records are updated via configurable HTTP request to an API endpoint.

Work in progress! Since current IP addresses are read from the interface directly at the moment, this tool will update IPv6 addresses only in most cases. If no global address could be detected, it is subsituted by "0.0.0.0" or "::" respectively.

Installation

Building ipupd requires a recent version of cargo and a rust compiler toolchain. The recommended way to install those is using rustup. Afterwards, a binary can be built from source quite easily:

git clone https://github.com/jvytee/ipupd.git
cargo install --path ipupd

Alternatively, linux binaries may be downloaded from the releases section.

Usage

Usage: ipupd [OPTIONS]

Options:
    -h, --help          show help and exit
    -c, --config FILE   configuration file

If no configuration file is given explicitely, ipupd will try to use /etc/ipupd/config.toml.

With SystemD

In most cases, it makes sense to run ipupd in regular intervals to keep IP addresses up to date. For this reason, preconfigured SystemD units implementing a timer to call ipupd every 30 seconds can be found in extra/systemd. To use the SystemD timer, the ipupd binary needs to be installed in /usr/local/bin and service as well as timer files have to be present in /etc/systemd/system. Afterwards, ipupd.timer may be enabled/started like any regular SystemD service.

Configuration

By default, ipupd will try to read its configuration from /etc/ipupd/config.toml. Parameters are set in TOML format like below:

domain = "example.org"
interface = "eth0"
ipv4_url = "https://ipv4.icanhazip.com"
dyndns_url = "https://dyndns.inwx.com/nic/update"

[query]
ipv4 = "myip"
ipv6 = "myipv6"

[basic_auth]
username = "example"
password = "12345"
  • domain is the domain for which IPs are going to be updated
  • interface gives the network interface which will be used to estimate current IP addresses
  • ipv4_url is an HTTP(S) endpoint which returns the client's public IPv4 address as plain text
  • dyndns_url specifies an API endpoint by which IPs are updated
  • query defines the query parameter names for the API. So in combination with dyndns_url, the example will result in a HTTP GET request to https://dyndns.inwx.com/nic/update?myip=1.2.3.4&myipv6=1234:4567::89.
  • basic_auth allows for the configuration of HTTP basic authorization for the API (optional)

ipupd's People

Contributors

jvytee avatar

Stargazers

Tim Schubert avatar

Watchers

James Cloos avatar  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.