Skip to content

Commit c86a935

Browse files
committed
duckdns: add service
This container includes cron and should be easier to use than the current duck.sh script. After a test period this should completely replace the current ./duck/duck.sh script. Currently uses my fork of linuxserver/docker-duckdns to include some needed pull-requests that are pending. Depends on SensorsIot#553 to generate .env with IOTSTACK_UID and IOTSTACK_GID Mkdocs and material versions updated to fix layout bug.
1 parent 732889a commit c86a935

File tree

5 files changed

+103
-5
lines changed

5 files changed

+103
-5
lines changed

.templates/duckdns/service.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
duckdns:
2+
container_name: duckdns
3+
build: https://github.com/ukkopahis/docker-duckdns.git
4+
network_mode: host
5+
restart: unless-stopped
6+
environment:
7+
PUID: ${IOTSTACK_UID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
8+
PGID: ${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
9+
#TOKEN: define this in docker-compose.override.yml, see docs
10+
#SUBDOMAIN: define this in docker-compose.override.yml, see docs

docs/Basic_setup/Accessing-your-Device-from-the-internet.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ A behind-the-router technique usually relies on sending updates according to a s
3939

4040
> This seems to be a problem for DuckDNS which takes a beating because almost every person using it is sending an update bang-on five minutes.
4141
42-
### DuckDNS client
42+
### DuckDNS container
43+
44+
The recommended and easiest solution is to install the Duckdns docker-container
45+
from the menu. It includes the cron service and logs are handled by Docker.
46+
47+
For configuration see [Containers/Duck DNS]( ../Containers/Duckdns.md).
48+
49+
### DuckDNS client script (DEPRECATED) { #duckdns-client }
50+
51+
!!! warning "This method is now deprecated"
4352

4453
IOTstack provides a solution for DuckDNS. The best approach to running it is:
4554

docs/Containers/Duckdns.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Duck DNS
2+
3+
Duckdns is a DNS service that provides you with a domain name you can update to
4+
match your dynamic IP-address.
5+
6+
This container automates the process to update your duckdns.org IP.
7+
8+
## References
9+
10+
* Register an account, add your subdomain and get your token from
11+
[http://www.duckdns.org/](http://www.duckdns.org/)
12+
* based on the linuxserver
13+
[docker-duckdns](https://github.com/linuxserver/docker-duckdns) container
14+
15+
## Configuration
16+
17+
Create the file `~/IOTstack/docker-compose.override.yml` and place your Duckdns
18+
token and chosen domain name there:
19+
20+
``` yaml title="docker-compose.override.yml"
21+
version: '3.6'
22+
services:
23+
duckdns:
24+
environment:
25+
TOKEN: your-duckdns-token
26+
SUBDOMAINS: subdomain
27+
```
28+
29+
Observe that at least the initial update is successful:
30+
31+
``` console
32+
$ cd ~/IOTstack
33+
$ docker-compose up -d duckdns
34+
$ docker-compose logs duckdns
35+
...SNIP...
36+
Retrieving subdomain and token from the environment variables
37+
log will be output to docker log
38+
Your IP was updated at Wed May 4 03:31:14 UTC 2022
39+
...SNIP...
40+
```
41+
42+
If there is a problem, check that the resulting effective configuration of
43+
'duckdns:' looks OK:
44+
``` console
45+
$ cd ~/IOTstack && docker-compose config
46+
```
47+
48+
### Domain name for the private IP
49+
50+
!!! note inline end "Example IP:s and domains"
51+
52+
``` mermaid
53+
flowchart
54+
I([Internet])
55+
G("Router\npublic IP: 52.85.51.71\nsubdomain.duckdns.org")
56+
R(Raspberry pi\nprivate IP: 192.168.0.100\nprivate_subdomain.duckdns.org)
57+
I --- G --- |LAN| R
58+
```
59+
60+
As a public DNS server, Duckdns is not meant to be used for private IPs. It's
61+
recommended that for resolving internal LAN IPs you use the [Pi
62+
Hole](Pi-hole.md) container.
63+
64+
That said, it's possible to update Duckdns with to your LAN IP. This may be
65+
convenient if you have devices that don't support mDNS (.local) and don't want
66+
to run Pi-hole. This is especially useful if you can't assign a static IP to
67+
your RPi. Add a `PRIVATE_SUBDOMAIN` variable indicating your subdomain for
68+
this:
69+
70+
``` yaml title="added variable to docker-compose.override.yml"
71+
version: '3.6'
72+
services:
73+
duckdns:
74+
environment:
75+
TOKEN: ...
76+
SUBDOMAINS: ...
77+
PRIVATE_SUBDOMAIN: private_subdomain
78+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ extra_javascript:
6161
- javascript/fix-codeblock-console-copy-button.js
6262

6363
markdown_extensions:
64+
- attr_list
6465
- pymdownx.highlight:
6566
pygments_lang_class: true
6667
- admonition

requirements-mkdocs.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Jinja2==3.0.3
66
Markdown==3.3.6
77
MarkupSafe==2.1.0
88
mergedeep==1.3.4
9-
mkdocs==1.2.3
9+
mkdocs==1.3.0
1010
mkdocs-awesome-pages-plugin==2.7.0
11-
mkdocs-material==8.2.3
11+
mkdocs-material==8.2.13
1212
mkdocs-material-extensions==1.0.3
1313
mkdocs-redirects==1.0.3
1414
packaging==21.3
15-
Pygments==2.11.2
16-
pymdown-extensions==9.2
15+
Pygments==2.12.0
16+
pymdown-extensions==9.4
1717
pyparsing==3.0.7
1818
python-dateutil==2.8.2
1919
PyYAML==6.0

0 commit comments

Comments
 (0)