DynuIPRefresher/README.md

122 lines
3.3 KiB
Markdown
Raw Normal View History

2020-05-08 15:02:46 +00:00
[![pipeline status](http://gitlab.heili.eu/lukas/dynuiprefresher/badges/master/pipeline.svg)](http://gitlab.heili.eu/lukas/dynuiprefresher/-/commits/master)
2019-05-10 21:09:30 +00:00
# DynuIPRefresher
2020-04-29 20:02:51 +00:00
A lightweight C++ application to setup a service for refreshing a dynamic IP to the Dynu servers.
2020-04-30 17:37:11 +00:00
Dynu.com is a free DDns service and provides an API.
2020-06-08 08:54:22 +00:00
There is also a GUI for Windows Users and beginners.
2020-04-30 17:37:11 +00:00
## Installation
Download the latest Release at [Release_Page](https://github.com/Lukas-Heiligenbrunner/DynuIPRefresher/releases).
I'm providing executables for Debian/Ubuntu (.deb) and RHEL/Debian (.rpm).
But you can still compile the code my your own (see build section).
## Configuration
2020-05-21 12:09:17 +00:00
There is a configuration file `/etc/dynuiprefresher.cfg` where you have to specify the DYNU API key (get it from their homepage), the domainid and your domain.
2020-04-30 17:37:11 +00:00
Furthermore, you can optionally specify a Telegram API key and a Chat ID if you want to be notfied when your local ip changes.
2020-05-01 14:37:15 +00:00
To enable and start the service:
2020-05-21 12:09:17 +00:00
`systemctl enable dynuiprefresher.service` and `systemctl start dynuiprefresher.service`
2020-05-01 14:37:15 +00:00
2020-05-21 09:38:39 +00:00
## Usage
2020-05-21 12:09:17 +00:00
First of all configure the right keys in the `/etc/dynuiprefresher.cfg` or `%appdata%\DynuIpRefresher\dynuiprefresher.cfg` config file.
2020-05-21 09:38:39 +00:00
Afterwards use the following options:
```
help page:
[-h] [--help] print this help page
[-v] [--version] print the software version
[-f] [--force] force refresh of ip
[-l] [--loop] infinite loop to refresh ip every five minutes
[-c] [--checkconfig] validate configuration
[-ip] [--currentip] get current global ip
[no argument] normal ip check and refresh
```
2020-06-08 08:54:22 +00:00
### GUI
You can also build the grapical user inteface if you want.
There you can manually trigger a refresh in a gui and set all the config parameters.
Home Page:
![couldn't load image](https://i.ibb.co/syDwWQg/Screenshot-20200608-104253.png)
Config Page:
![couldn't load image](https://i.ibb.co/89vnJXY/Screenshot-20200608-104308.png)
2019-05-10 21:09:30 +00:00
2019-05-11 09:16:59 +00:00
## Build
2019-05-11 10:18:24 +00:00
## Basic Build
2019-10-26 09:00:57 +00:00
### Download source files
2019-05-11 09:16:59 +00:00
2019-05-10 21:11:01 +00:00
`git clone https://github.com/Lukas-Heiligenbrunner/DynuIPRefresher.git`
2019-05-10 21:14:25 +00:00
2019-10-26 09:00:57 +00:00
### install build dependencies
`libcurl`
`libconfig`
2019-10-26 09:00:57 +00:00
2020-04-30 13:15:01 +00:00
#### Debian:
2019-10-26 09:00:57 +00:00
`apt install libcurl4-openssl-dev`
2020-04-30 13:15:01 +00:00
#### Fedora:
`dnf install libcurl-devel libconfig-devel`
2019-10-26 09:00:57 +00:00
2020-04-30 13:15:01 +00:00
#### Alpine Linux:
Compiler dependencies:
`apk add make cmake g++`
Lib dependencies:
`apk add libcurl curl-dev libconfig libconfig-dev`
Packaging dependencies:
`apk add dpkg rpm`
2019-10-26 09:03:11 +00:00
#### dependencies for package build
`dpkg` --> debian/ubuntu package
`rpmbuild` --> Fedora/RedHat/CentOS package
2019-10-26 09:00:57 +00:00
### cmake project
2019-05-11 09:16:59 +00:00
cd into downloaded files and Generate makefiles:
`cmake -S . -B build`
2019-05-11 09:16:59 +00:00
2019-10-26 09:00:57 +00:00
### compile project
2019-05-11 09:16:59 +00:00
`make`
[root] install it to the system
2019-05-11 09:16:59 +00:00
`make install`
2020-04-30 13:15:01 +00:00
(optional) create Linux packages
2019-05-10 21:09:30 +00:00
`make package`
2019-05-10 21:09:30 +00:00
2020-06-08 08:54:22 +00:00
### GUI Build
please use the predefined Docker-Image here:
[DockerHub](https://hub.docker.com/repository/docker/luki42/dynuiprefresher_build)
2019-05-10 21:14:25 +00:00
2019-05-11 10:23:57 +00:00
### Windows cross build
2020-05-06 09:03:39 +00:00
Set Winbuild flag in CMakeList.txt.
Dependencies:
* MinGW Compiler
* MinGW-libcurl
* MinGW-libconfig++
Optional dependencies
* NSIS Pack tool (for creating installer)
* doxygen (for generating html doc)
2020-06-08 08:54:22 +00:00
The Simplest way to install all dependencies is the preconfigured Docker-Image:
[DockerHub](https://hub.docker.com/repository/docker/luki42/dynuiprefresher_build)
2020-05-06 09:03:39 +00:00
`make package` will pack it into a NSIS installer for Windows.