You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/general/swag.md
+9-17Lines changed: 9 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ docker create \
32
32
-e VALIDATION=http \
33
33
-e CERTPROVIDER= `#optional` \
34
34
-e DNSPLUGIN=cloudflare `#optional` \
35
-
-e DUCKDNSTOKEN=<token>`#optional` \
36
35
-e EMAIL=<e-mail>`#optional` \
37
36
-e ONLY_SUBDOMAINS=false `#optional` \
38
37
-e EXTRA_DOMAINS=<extradomains>`#optional` \
@@ -66,7 +65,6 @@ services:
66
65
- VALIDATION=http
67
66
- CERTPROVIDER= #optional
68
67
- DNSPLUGIN=cloudflare #optional
69
-
- DUCKDNSTOKEN=<token> #optional
70
68
- EMAIL=<e-mail> #optional
71
69
- ONLY_SUBDOMAINS=false #optional
72
70
- EXTRA_DOMAINS=<extradomains> #optional
@@ -81,20 +79,14 @@ services:
81
79
82
80
### Authorization method
83
81
84
-
Our image currently supports three different methods to validate domain ownership:
82
+
Our image currently supports two different methods to validate domain ownership:
85
83
86
84
- **http:**
87
85
- Let's Encrypt (acme) server connects to domain on port 80
88
-
- Can be owned domain or a dynamic dns address
89
86
- **dns:**
90
87
- Let's Encrypt (acme) server connects to dns provider
91
88
- Api credentials and settings entered into `ini` files under `/config/dns-conf/`
92
89
- 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)
98
90
99
91
The validation is performed when the container is started for the first time. Nginx won't be up until ssl certs are successfully generated.
100
92
@@ -123,9 +115,9 @@ Port 80 forwarding is required for `http` validation only. Same rule as above ap
123
115
124
116
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.
125
117
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 dockercompose, and your services are on the same yaml, you do not need to do this, because dockercompose 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.
127
119
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.
129
121
130
122
!!! info
131
123
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 \
274
266
-e TZ=Europe/London \
275
267
-e URL=linuxserver-test.duckdns.org \
276
268
-e SUBDOMAINS=wildcard \
277
-
-e VALIDATION=duckdns \
278
-
-e DUCKDNSTOKEN=97654867496t0877648659765854 \
269
+
-e VALIDATION=dns \
270
+
-e DNSPLUGIN=duckdns \
279
271
-p 443:443 \
280
272
-p 80:80 \
281
273
-v /home/aptalca/appdata/swag:/config \
@@ -302,8 +294,8 @@ services:
302
294
- TZ=Europe/London
303
295
- URL=linuxserver-test.duckdns.org
304
296
- SUBDOMAINS=wildcard
305
-
- VALIDATION=duckdns
306
-
- DUCKDNSTOKEN=97654867496t0877648659765854
297
+
- VALIDATION=dns
298
+
- DNSPLUGIN=duckdns
307
299
volumes:
308
300
- /home/aptalca/appdata/swag:/config
309
301
ports:
@@ -314,9 +306,9 @@ services:
314
306
315
307
Then we'll fire up the container via `docker-compose up -d`
316
308
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.
318
310
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`.
320
312
321
313
!!! warning
322
314
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