Skip to content

samedayrules/ddns-update-client

Repository files navigation

Dynamic DNS Update Client (DUC)

Audience

This repository is for developers who would like to extend the Dynamic DNS Update Client offered by Same Day Rules. Same Day Rules customers would not normally need access to the source code underlying the DDNS Update Client operation; they would instead download and install the update client from the Same Day Rules website for the operating system of their choice.

Overview

This repository holds software for the Dynamic Domain Name System (DDNS) Update Client (DUC) that is used to configure and start dynamic updates of hostnames and their associated IP addresses. The update client is integrated with the DDNS service provided by Same Day Rules.

DDNS services allow users to create customized names that can be used to access home network resources using standard URL's from the Internet. With DDNS, a user can create a custom domain name (e.g., myiot.samedayrules.net) that is associated with the IP address of their home network gateway (e.g., broadband cable modem). If the IP address of the home network gateway changes, special software running on the home network updates the customized name to point to the new IP address so that the customized name remains current. The special software running on the home network is called a DDNS Update Client or DUC, and that software is held in this repository.

The DDNS Update Client (DUC) interacts with a DDNS server to propagate changes in IP address settings to names held in the Internet Domain Name System. The Same Day Rules DUC interacts with the Same Day Rules DDNS server at https://samedayrules.net using a standard DDNS API that is compatible with the Dyn DNS standard.

Users can subscribe to the Same Day Rules DDNS Service at our storefront.

KivyMD Application

The Same Day Rules DUC is provided to end-users as a Python KivyMD application that is packaged using PyInstaller for use on multiple platforms (i.e., Windows, Linux, Mac OS).

Developers seeking to install and extend the Same Day Rules DUC can follow the instructions below to clone and then run the DUC under different operating systems.

Windows/Linux: Downloading and Running the DUC

To modify and run the DUC software, you must have:

  1. Python installed (version 3.11 used).
  2. Python virtual environment module installed (version 20.17.1 used).
  3. Git installed (version 2.38.1 used).
  4. Access to a command shell (e.g., cmd.exe).

The general process is:

  1. Open command prompt.
  2. Change to your development directory.
  3. Clone the software repository.
  4. Make a Python virtual environment.
  5. Install the required Python modules.
  6. Run the software, either as-needed or upon startup each time you login.

Under Windows, assuming you have opened a command prompt and you have navigated to your development directory:

C:>git clone https://github.com/samedayrules/ddns_update_client.git
C:>cd ddns_update_client
C:>virtualenv venv
C:>venv\Scripts\activate
(venv) C:>pip install -r requirements.txt

Under Linux, assuming you have opened a command prompt and you have navigated to your development directory:

user:~$ git clone https://github.com/samedayrules/ddns_update_client.git
user:~$ cd ddns_update_client
user:~$ python3 -m venv venv
user:~$ source venv/bin/activate
(venv) user:~$ pip install -r requirements.txt

You should have the most recent copy of the DUC software within the target virtual environment on your machine.

To run the software, simply execute the script:

python ddnsupdate.pyw

The Python DUC application does not output anything to the console window when executed nor does it create a console window when launched.

To make a shortcut to the DUC that can then be executed at startup:

  1. Right-click on your Windows desktop, and choose New > Shortcut.
  2. Browse to the location where the Python DUC application resides.
  3. Then browse further to the venv\Scripts directory and select the pythonw.exe application.
  4. Click Next in the Create Shortcut dialog box.
  5. Type a name for the new shortcut, and then select Finish.
  6. On your Windows desktop, right-click the new shortcut that you just made and select Properties.
  7. In the Target field, append the full path to the Python DUC application.
  8. Select Ok in the shortcut properties dialog box.

The command in the Target field above should look something like this:

C:\Users\me\ddns_update_client\venv\Scripts\pythonw.exe C:\Users\me\ddns_update_client\ddnsupdate.pyw

And, you should now be able to launch the DUC from your desktop by double-clicking the shortcut icon. To run the Python DUC application at startup, when you login into Windows, copy the shortcut to your Startup directory (or follow these directions to copy it to your Windows 10 startup area).

Using PyInstaller

For developers interested in creating a Python executable that can be shared with other users (who don't necessarily have a Python development environment), you can use the PyInstaller application. Below are various resources that desctribe how to do that.

https://pyinstaller.org/en/stable/usage.html#using-pyinstaller

Supporting Multiple Python Environments

https://pyinstaller.org/en/stable/usage.html#supporting-multiple-python-environments

Windows And Mac Os X Specific Options

https://pyinstaller.org/en/stable/usage.html#windows-and-mac-os-x-specific-options

Using PyInstaller to Easily Distribute Python Applications

https://realpython.com/pyinstaller-python/

Programming Guide » Create a Package for Windows

https://kivy.org/doc/stable/guide/packaging-windows.html?highlight=pyinstaller#create-a-package-for-windows

KivyMD PyInstaller Hooks

https://kivymd.readthedocs.io/en/0.104.1/unincluded/kivymd/tools/packaging/pyinstaller/index.html

Kivy to one exe can't find kv file

https://stackoverflow.com/questions/62019124/kivy-to-one-exe-cant-find-kv-file

Command to Create One File and One Folder Distrubution

To produce a single executeable file that is decompressed and run in-place and to produce a single folder with all files needed for distribution:

pyinstaller --clean --log-level WARN ddnsupdate.spec

Manual Changes Required for Kivy

If manual changes are made to the .spec file, then run this afterwards:

pyinstaller --log-level WARN ddnsupdate.spec

Add these lines if the .spec file is changed:

-*- mode: python ; coding: utf-8 -*-

# Fixes for Kivy
import os
from kivy_deps import sdl2, glew
from kivymd import hooks_path as kivymd_hooks_path
path = os.path.abspath(".")

block_cipher = None

a = Analysis(
['ddnsupdate.pyw'],
pathex=[path],
binaries=[],
datas=[('ddnsupdate.kv', '.')],
hiddenimports=[],
hookspath=[kivymd_hooks_path],

coll = COLLECT(
exe,
Tree(path),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],

About

Same Day Rules Dynamic DNS Update Client (DUC)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published