Skip to content

Commit

Permalink
Name project IpAddressExpress.
Browse files Browse the repository at this point in the history
Removed code name PublicIpChangeDetector from every file.

Signed-off-by: D9ping <D9ping@users.noreply.github.com>
  • Loading branch information
D9ping committed Dec 23, 2018
1 parent ecd60cc commit 91122ea
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 52 deletions.
4 changes: 2 additions & 2 deletions publicipchangedetector.cbp → IpAddressExpress.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="publicipchangedetector" />
<Option title="ipaddressexpress" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/publicipchangedetector" prefix_auto="1" extension_auto="1" />
<Option output="bin/Debug/IpAddressExpress" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ LDLIBS = -lcurl -lsqlite3
CFLAGS = -O3 -std=c99

build:
gcc main.c db.c $(LDLIBS) $(CFLAGS) -o publicipchangedetector
gcc main.c db.c $(LDLIBS) $(CFLAGS) -o ipaddressexpress

60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
![PublicIpChangeDetector logo](docs/logo.png?raw=true "PublicIpChangeDetector")
![IpAddressExpress logo](docs/logo.png?raw=true "IpAddressExpress")

[<img src="https://img.shields.io/github/issues/D9ping/PublicIpChangeDetector.svg?style=flat-square" alt="Open issues" />](https://github.com/D9ping/PublicIpChangeDetector/issues)
[![Build Status](https://travis-ci.org/D9ping/PublicIpChangeDetector.svg?branch=master)](https://travis-ci.org/D9ping/PublicIpChangeDetector)
### Why use PublicIpChangeDetector?
Compared to shell scripts for figuring out the public IPv4 address PublicIpChangeDetector will
[<img src="https://img.shields.io/github/issues/D9ping/IpAddressExpress.svg?style=flat-square" alt="Open issues" />](https://github.com/D9ping/IpAddressExpress/issues)
[![Build Status](https://travis-ci.org/D9ping/IpAddressExpress.svg?branch=master)](https://travis-ci.org/D9ping/IpAddressExpress)
### Why use IpAddressExpress?
Compared to shell scripts for figuring out the public IPv4 address IpAddressExpress will
securely and more reliable detect the current public IPv4 address than using a single public ip service.
It's more secure because it does not require to trust a single server and uses HTTPS for tamper protection.
What makes PublicIpChangeDetector more secure is, that it requires consensus between two randomly selected public IPv4 address web services.
What makes IpAddressExpress more secure is, that it requires consensus between two randomly selected public IPv4 address web services.
Because of this it's not possible for a single public IPv4 address service to fool the program
incorrectly thinking the public ip address has been changed.
And by using multiple public IPv4 address services the current public IPv4 can still be discovered after some time
even when one or more public IPv4 services are down.
PublicIpChangeDetector is written in C so it executes fast and efficiently.
IpAddressExpress is written in C so it executes fast and efficiently.

### How PublicIpChangeDetector detects public IPv4 address change?
PublicIpChangeDetector randomly selects a HTTPS public IPv4 address service from a list
### How IpAddressExpress detects public IPv4 address change?
IpAddressExpress randomly selects a HTTPS public IPv4 address service from a list
of known HTTPS public IPv4 address services for figuring out the public IPv4 address.
It then compares the result with the previous result to detect if the public IPv4 address has changed.
If change is detected from previous request, the change is confirmed with another randomly
selected public IPv4 address HTTPS service so if one public IPv4 HTTPS service is lying, the lie is detected.
If the public IPv4 address is valid and is different from last run the posthook command is executed
with the new IPv4 address as a commandline argument.

### Flowchart of PublicIpChangeDetector operations ###
A flowcharts of how PublicIpChangeDetector works:
![flowchart PublicIpChangeDetector](https://raw.githubusercontent.com/D9ping/PublicIpChangeDetector/master/docs/PublicIpChangeDetector_flowchart_v3.png?raw=true)
### Flowchart of IpAddressExpress operations ###
A flowcharts of how IpAddressExpress works:
![flowchart IpAddressExpress](https://raw.githubusercontent.com/D9ping/IpAddressExpress/master/docs/IpAddressExpress_flowchart_v3.png?raw=true)


### Compiling PublicIpChangeDetector from source
### Compiling IpAddressExpress from source
Install the required packages.
```
sudo apt-get install build-essential libcurl4-openssl-dev libsqlite3-dev git-core
```
Get the PublicIpChangeDetector sourcecode in the folder /opt/ with:
Get the IpAddressExpress sourcecode in the folder /opt/ with:
```
cd /opt/
git clone https://github.com/D9ping/PublicIpChangeDetector.git
git clone https://github.com/D9ping/IpAddressExpress.git
```
Compile the program with:
```
cd PublicIpChangeDetector/
cd IpAddressExpress/
make
```

### Use of PublicIpChangeDetector
To use PublicIpChangeDetector for check public IPv4 address change of a server and update the
### Use of IpAddressExpress
To use IpAddressExpress for check public IPv4 address change of a server and update the
dynamic DNS entries with a bash script. Do the following:

1. Run ```crontab -e``` to edit your crontab.
2. Add the following line to run PublicIpChangeDetector every 10 minutes as current user.
2. Add the following line to run IpAddressExpress every 10 minutes as current user.
```
*/10 * * * * /opt/PublicIpChangeDetector/publicipchangedetector --posthook "/bin/sh /opt/PublicIpChangeDetector/update_ip_dns.sh"
*/10 * * * * /opt/IpAddressExpress/ipaddressexpress --posthook "/bin/sh /opt/IpAddressExpress/update_ip_dns.sh"
```
Edit the update_ip_dns.sh example bash script with your scripting for updating your dynamic DNS entries.

Expand All @@ -60,7 +60,7 @@ Edit the update_ip_dns.sh example bash script with your scripting for updating y
###### Why not just trust one good public IP service for updating the (Dynamic) DNS?
You could do that but you are putting a lot of trust on one public IP address service
that could technically hijack your domain record that you are automatically updating.
By using PublicIpChangeDetector you don't have to fully trust one public IP address service as lies
By using IpAddressExpress you don't have to fully trust one public IP address service as lies
or an errors from one public IP address service are spotted by using consensus with
an other randomly selected public IP address service. This makes for example fooling your
server on a dynamic public IPv4 address into thinking incorrectly it needs to update
Expand All @@ -69,31 +69,31 @@ You could do that but you are putting a lot of trust on one public IP address se
###### Why not ask my router for my public IP address?
Good question. Well technically you could get the public IPv4 address from your router.
But sadly every router manufacturer has a different webinterface for providing this information via their webinterface.
And often the information is secured by a login screen. PublicIpChangeDetector does not rely on the router and there fautures to provide the public IP address and because of this it just works for everyone where there is internet access.
And often the information is secured by a login screen. IpAddressExpress does not rely on the router and there fautures to provide the public IP address and because of this it just works for everyone where there is internet access.

###### What is the maximum downtime for my server could have if my public IP address changes?
It depends on how often you run the publicipchangedetector program for detecting your public ip change.
Also note that if a public ip address service lies to you it will take an extra publicipchangedetector run longer.
And if you are using PublicIpChangeDetector for DDNS then it also depends on how long the DNS entries that needs to change are cached by the DNS servers for the old DNS records to be removed from cache.
And if you are using IpAddressExpress for DDNS then it also depends on how long the DNS entries that needs to change are cached by the DNS servers for the old DNS records to be removed from cache.

###### Should i run PublicIpChangeDetector as often as possible?
###### Should i run IpAddressExpress as often as possible?
No, please be conservative on how often you run publicipchangedetector. Several public ip services are already serving a lot of requests. They don't like it you use too much bandwidth and they will ban/drop you or maybe send you
a http error if you are making too many requests too quickly.

###### Does PublicIpChangeDetector makes two request on execution?
###### Does IpAddressExpress makes two request on execution?
No, it only make 1 http request if previous public ip address from last run is known.

###### What about IPv6?
There is no need to support IPv6 as the server is given a internet routable IPv6 address from your router.

###### How do i get the current public IPv4 address from commandline?
Run publicipchangedetector with the -showip argument to always print the current public ip address.
Run ipaddressexpress with the -showip argument to always print the current public ip address.

###### What command-line arguments can i use?
Run publicipchangedetector with the -h command-line argument for help on all the possible command-line arguments to use.
Run ipaddressexpress with the -h command-line argument for help on all the possible command-line arguments to use.

###### Does PublicIpChangeDetector need root rights?
No, PublicIpChangeDetector can just run fine as a lower privilege user as long as it can read and write to the data.db sqlite database file. Data.db stores all ipservice PublicIpChangeDetector can use and the information on the the last used ipservice. etc.
###### Does IpAddressExpress need root rights?
No, IpAddressExpress can just run fine as a lower privilege user as long as it can read and write to the data.db sqlite database file. Data.db stores all ipservice IpAddressExpress can use and the information on the the last used ipservice. etc.

###### Are all the pubic ip service's hardcoded in the application?
All the services that are used are stored in a SQLite database file. If the SQLite database file exists you can remove, disable or add any public ip services with standard SQL. If the SQLite database file does not exist then the SQLite database file is created and about 20 public ip services are added to the database file by default to use.
Expand All @@ -104,4 +104,4 @@ You can contact me as copyright holder and ask me to provide you with a close so

## Support
This project is free as in freedom, if you get it as free as in free beer depends on you.
[![Beerpay](https://beerpay.io/D9ping/PublicIpChangeDetector/badge.svg?style=beer-square)](https://beerpay.io/D9ping/PublicIpChangeDetector) [![Beerpay](https://beerpay.io/D9ping/PublicIpChangeDetector/make-wish.svg?style=flat-square)](https://beerpay.io/D9ping/PublicIpChangeDetector?focus=wish)
[![Beerpay](https://beerpay.io/D9ping/IpAddressExpress/badge.svg?style=beer-square)](https://beerpay.io/D9ping/IpAddressExpress) [![Beerpay](https://beerpay.io/D9ping/IpAddressExpress/make-wish.svg?style=flat-square)](https://beerpay.io/D9ping/IpAddressExpress?focus=wish)
6 changes: 3 additions & 3 deletions db.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/***************************************************************************
* Copyright (C) 2018 D9ping
*
* PublicIpChangeDetector is free software: you can redistribute it and/or modify
* IpAddressExpress is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PublicIpChangeDetector is distributed in the hope that it will be useful,
* IpAddressExpress is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PublicIpChangeDetector. If not, see <http://www.gnu.org/licenses/>.
* along with IpAddressExpress. If not, see <http://www.gnu.org/licenses/>.
*
***************************************************************************/
#include <stdio.h>
Expand Down
17 changes: 17 additions & 0 deletions db.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/***************************************************************************
* Copyright (C) 2018 D9ping
*
* IpAddressExpress is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* IpAddressExpress is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IpAddressExpress. If not, see <http://www.gnu.org/licenses/>.
*
***************************************************************************/
#include <stdio.h>
#include <stdbool.h>
#include <sqlite3.h>
Expand Down
Binary file added docs/IpAddressExpress_flowchart_v3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/IpAddressExpress_flowchart_v3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile modified="2018-12-23T14:46:17.147Z" host="www.draw.io" agent="Mozilla/5.0" version="10.0.8" etag="NrM0VvD6tahqai7Xelnd" type="device"><diagram name="Page-1" id="97a40813-6b03-0c74-37c1-0168de264b11">5Vzbkps4EP0aV2Uf7AJJYHicmUwuVdmt1GarsnlKYSPbJNhiAc948vUrgWRbQjaMEQbvzsuALHFp9Wl1n24xgg/r3fs0SFa/kxDHI2CFuxF8OwLAth2f/mMtL2WLZ1llwzKNQt7p0PAl+oV5o+i2jUKcSR1zQuI8SuTGOdls8DyX2oI0Jc9ytwWJ5bsmwRJXGr7Mg7ja+jUK85V4L/Ea7IcPOFqu+K09h/8wC+Y/lynZbvj9RgAuir/y53UgrsX7Z6sgJM9HTfBxBB9SQvLyaL17wDGTrRBbOe7diV/3z53iTd5kwJQ/Rv4iXh2HVBL8lKT5iizJJogfD633xethdgGLnq3ydUwPbXpI75m+/M3bi5Nv7GTi0NMfOM9f+EQH25zQpsPVPxGS8GtUX4C/U0a26Zw/I+AqEaRLzHu5ZRN7+qNh/KXfY7LG9HFohxTHQR49yfMccHVZ7vsdREYPuNT0EhTXeAriLb/qH6Qi1RzvcllYKc6iX8Gs6MDklZBokxfP4dyPnLe0JYij5YY2zKkocEobnnCaR1RJ7/gP6ygMixmJgxmO7/eq90Bikhb3FcqnkyufenZRvBtpUMUfTtJMSZZ8lDWxLBuWQznexzYqzxuLm1/9M5PC4dJjBKj2SFcGSL4IWSwyqgTqjO0fs9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i2JgBOlfqq8qxlxthVyzu8aSc7m11gEuOnYi1gPNjS4bW/DcxulTm4jVInMf1GoDCF7tSI8o8Vcze2QSfKL5SoQcVEuT98g59HrbaZGwhbhr5THSmT5+r22uhq4m3gnFaUxkgc7nbYq7sTJ6J4X/ElahKyNf1rWPLKzqvudsg5jeqfHnd4vi32yCUko1NJfha2br0OitDgOaI6KoBeKZMqPh9Kpzko/MvJkS2oRe4bPFmyAdskDHL8PUq+h5tskq1+a25NeqYJ1O8y6jbR7eOVlrEIPT18HbzUhcMn2OHjvw==</diagram></mxfile>
Binary file removed docs/PublicIpChangeDetector_flowchart_v2.png
Binary file not shown.
1 change: 0 additions & 1 deletion docs/PublicIpChangeDetector_flowchart_v2.xml

This file was deleted.

Binary file removed docs/PublicIpChangeDetector_flowchart_v3.png
Binary file not shown.
Loading

0 comments on commit 91122ea

Please sign in to comment.