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.
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.
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.
To modify and run the DUC software, you must have:
- Python installed (version 3.11 used).
- Python virtual environment module installed (version 20.17.1 used).
- Git installed (version 2.38.1 used).
- Access to a command shell (e.g., cmd.exe).
The general process is:
- Open command prompt.
- Change to your development directory.
- Clone the software repository.
- Make a Python virtual environment.
- Install the required Python modules.
- 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:
- Right-click on your Windows desktop, and choose
New > Shortcut
. - Browse to the location where the Python DUC application resides.
- Then browse further to the
venv\Scripts
directory and select thepythonw.exe
application. - Click
Next
in theCreate Shortcut
dialog box. - Type a name for the new shortcut, and then select
Finish
. - On your Windows desktop, right-click the new shortcut that you just made and select
Properties
. - In the
Target
field, append the full path to the Python DUC application. - 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).
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
https://pyinstaller.org/en/stable/usage.html#supporting-multiple-python-environments
https://pyinstaller.org/en/stable/usage.html#windows-and-mac-os-x-specific-options
https://realpython.com/pyinstaller-python/
https://kivymd.readthedocs.io/en/0.104.1/unincluded/kivymd/tools/packaging/pyinstaller/index.html
https://stackoverflow.com/questions/62019124/kivy-to-one-exe-cant-find-kv-file
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
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)],