Skip to content

Commit 1694068

Browse files
committed
update duckdns info and clarify networking
1 parent 0876a88 commit 1694068

1 file changed

Lines changed: 9 additions & 17 deletions

File tree

docs/general/swag.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ docker create \
3232
-e VALIDATION=http \
3333
-e CERTPROVIDER= `#optional` \
3434
-e DNSPLUGIN=cloudflare `#optional` \
35-
-e DUCKDNSTOKEN=<token> `#optional` \
3635
-e EMAIL=<e-mail> `#optional` \
3736
-e ONLY_SUBDOMAINS=false `#optional` \
3837
-e EXTRA_DOMAINS=<extradomains> `#optional` \
@@ -66,7 +65,6 @@ services:
6665
- VALIDATION=http
6766
- CERTPROVIDER= #optional
6867
- DNSPLUGIN=cloudflare #optional
69-
- DUCKDNSTOKEN=<token> #optional
7068
- EMAIL=<e-mail> #optional
7169
- ONLY_SUBDOMAINS=false #optional
7270
- EXTRA_DOMAINS=<extradomains> #optional
@@ -81,20 +79,14 @@ services:
8179
8280
### Authorization method
8381
84-
Our image currently supports three different methods to validate domain ownership:
82+
Our image currently supports two different methods to validate domain ownership:
8583
8684
- **http:**
8785
- Let's Encrypt (acme) server connects to domain on port 80
88-
- Can be owned domain or a dynamic dns address
8986
- **dns:**
9087
- Let's Encrypt (acme) server connects to dns provider
9188
- Api credentials and settings entered into `ini` files under `/config/dns-conf/`
9289
- Supports wildcard certs
93-
- Need to have own domain name (non-free)
94-
- **duckdns:**
95-
- Let's Encrypt (acme) server connects to DuckDNS
96-
- Supports wildcard certs (only for the sub-subdomains)
97-
- No need for own domain (free)
9890

9991
The validation is performed when the container is started for the first time. Nginx won't be up until ssl certs are successfully generated.
10092

@@ -123,9 +115,9 @@ Port 80 forwarding is required for `http` validation only. Same rule as above ap
123115

124116
SWAG container happily runs with bridge networking. However, the default bridge network in docker does not allow containers to connect each other via container names used as dns hostnames. Therefore, it is recommended to first create a [user defined bridge network](https://docs.docker.com/network/bridge/) and attach the containers to that network.
125117

126-
If you are using docker-compose, and your services are on the same yaml, you do not need to do this, because docker-compose automatically creates a user defined bridge network and attaches each container to it as long as no other networking option is defined in their config.
118+
If you are using docker compose, and your services are on the same yaml, you do not need to do this, because docker compose automatically creates a user defined bridge network and attaches each container to it as long as no other networking option is defined in their config.
127119

128-
For the below examples, we will use a network named `lsio`. We can create it via `docker network create lsio`. After that, any container that is created with `--net=lsio` can ping each other by container name as dns hostname.
120+
For the below examples, we will use a network named `lsio` (only for the cli created containers). We can create it via `docker network create lsio`. After that, any container that is created with `--net=lsio` can ping each other by container name as dns hostname.
129121

130122
!!! info
131123
Keep in mind that dns hostnames are meant to be case-insensitive, however container names are case-sensitive. For container names to be used as dns hostnames in nginx, they should be all lowercase as nginx will convert them to all lowercase before trying to resolve.
@@ -274,8 +266,8 @@ docker create \
274266
-e TZ=Europe/London \
275267
-e URL=linuxserver-test.duckdns.org \
276268
-e SUBDOMAINS=wildcard \
277-
-e VALIDATION=duckdns \
278-
-e DUCKDNSTOKEN=97654867496t0877648659765854 \
269+
-e VALIDATION=dns \
270+
-e DNSPLUGIN=duckdns \
279271
-p 443:443 \
280272
-p 80:80 \
281273
-v /home/aptalca/appdata/swag:/config \
@@ -302,8 +294,8 @@ services:
302294
- TZ=Europe/London
303295
- URL=linuxserver-test.duckdns.org
304296
- SUBDOMAINS=wildcard
305-
- VALIDATION=duckdns
306-
- DUCKDNSTOKEN=97654867496t0877648659765854
297+
- VALIDATION=dns
298+
- DNSPLUGIN=duckdns
307299
volumes:
308300
- /home/aptalca/appdata/swag:/config
309301
ports:
@@ -314,9 +306,9 @@ services:
314306

315307
Then we'll fire up the container via `docker-compose up -d`
316308

317-
After the container is started, we'll watch the logs with `docker logs swag -f`. We'll see some initialization and then we will see the validation steps. After all the steps, it should print `Server ready` in the logs.
309+
After the container is started, we'll watch the logs with `docker logs swag -f`. After some init steps, we'll notice that the container will give an error during validation due to wrong credentials. That's because we didn't enter the correct credentials for the Cloudflare API yet. We can browse to the location `/config/dns-conf` which is mapped from the host location (according to above settings) `/home/aptalca/appdata/swag/dns-conf/` and edit the correct ini file for our dns provider. For DuckDNS, we'll enter our API token. The API token can be retrieved from the DuckDNS admin interface.
318310

319-
Now we can access the webserver by browsing to `https://www.linuxserver-test.duckdns.org`.
311+
Once we enter the credentials into the ini file, we'll restart the docker container via `docker restart swag` and again watch the logs. After successful validation, we should see the notice `Server ready` and our webserver should be up and accessible at `https://www.linuxserver-test.duckdns.org`.
320312

321313
!!! warning
322314
Due to a DuckDNS limitation, our cert only covers the wildcard subdomains, but it doesn't cover the main url. So if we try to access `https://linuxserver-test.duckdns.org`, we'll see a browser warning about an invalid ssl cert. But accessing it through the `www` (or `ombi` or any other) subdomain should work fine.

0 commit comments

Comments
 (0)