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
|`GSP_SKIP_INIT_CHECKS`|`false`| Set to `true` to disable qbt config checks ("Bypass authentication on localhost", etc). Set to `warning`to see check results but continue anyway.|
101
+
|`GSP_CERT_CHECK`|`true`| Set to `false` to disable certificate check. (curl's insecure flag) |
101
102
|`GSP_MINIMAL_LOGS`|`true`| Set to `false` to enable "Ports did not change." logs. |
102
103
|`GSP_INIT_RETRY_WAIT`|`10` (=60s) | Number of retries to connect to qbittorrent's webUI at startup. Each retry takes 6 seconds. Increase to allow a longer wait at startup. |
103
-
|`GSP_DEBUG`|`false`| Set to `true` to enable mod's `set -x`.<br>:warning:**FOR DEBUG ONLY.**<br>This will show your API key in the logs. |
104
+
|`GSP_DEBUG`|`false`| Set to `true` to enable mod's `set -x`.<br>:warning:**FOR DEBUG ONLY.**<br>This will show your credentials in the logs. |
104
105
105
106
I was planning on implementing the option to use Gluetun's port forwarding file but since it will be [deprecated in v4](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/vpn-port-forwarding.md#native-integrations), I won't.
106
107
@@ -152,17 +153,22 @@ Here's some tips for troubleshooting :
152
153
153
154
<details>
154
155
155
-
<summary>Check the logs</summary>
156
+
<summary>Check the logs.</summary>
156
157
157
158
The mod's logs are visible in the container's log :
158
159
```bash
159
160
docker logs -f qbittorrent
160
161
```
161
162
163
+
It's also possible to look at Gluetun's log :
162
164
163
-
<details>
165
+
```bash
166
+
docker logs -f gluetun
167
+
```
164
168
165
-
<summary>Qbittorrent docker logs</summary>
169
+
<details>
170
+
171
+
<summary>Qbittorrent docker logs.</summary>
166
172
167
173
```log
168
174
[mod-init] Running Docker Modification Logic
@@ -223,15 +229,35 @@ Connection to localhost (::1) 8080 port [tcp/http-alt] succeeded!
223
229
04/10/24 01:05:55 [GSP] - Ports did not change.
224
230
```
225
231
226
-
</details>
232
+
</details>
227
233
228
234
To (*drastically*) increase the log level, you can set the `GSP_DEBUG` var to `true`.
229
235
236
+
<details>
237
+
238
+
<summary>Gluetun docker logs.</summary>
239
+
240
+
```log
241
+
2024-12-29T14:22:53+01:00 INFO [port forwarding] starting
242
+
2024-12-29T14:22:53+01:00 INFO [port forwarding] gateway external IPv4 address is 156.71.163.18
243
+
2024-12-29T14:22:53+01:00 INFO [port forwarding] port forwarded is 18008
244
+
2024-12-29T14:22:53+01:00 INFO [firewall] setting allowed input port 18008 through interface tun0...
245
+
2024-12-29T14:22:53+01:00 INFO [port forwarding] writing port file /tmp/gluetun/forwarded_port
246
+
2024-12-29T14:22:58+01:00 INFO [http server] 200 GET /portforwarded wrote 15B to [::1]:55008 in 79.707µs
247
+
2024-12-29T14:23:58+01:00 INFO [http server] 200 GET /portforwarded wrote 15B to [::1]:43420 in 112.741µs
248
+
2024-12-29T14:24:58+01:00 INFO [http server] 200 GET /portforwarded wrote 15B to [::1]:45958 in 88.972µs
249
+
```
250
+
251
+
Explanation :
252
+
- The lines taggued `[port forwarding]` are internal actions related to ... port forwarding. Those are useful to understand what gluetun is doing.
253
+
- The lines taggued `[http server]` are related to gluetun's API. In the example above, you can see that something (here, the mod) is requesting the `/portforwarded` endpoint, every 60 seconds. This DOES NOT indicate a change of forwarded port, only an external request to `GET` the current one.
254
+
255
+
</details>
230
256
</details>
231
257
232
258
<details>
233
259
234
-
<summary>Check Gluetun's control server and forwarded port</summary>
260
+
<summary>Check Gluetun's control server and forwarded port.</summary>
235
261
236
262
If the log indicates `Error retrieving port from Gluetun API.` then try to get the port mannually (replace the container's name and `localhost:8000` if needed) :
237
263
@@ -275,3 +301,17 @@ If you get `0` or an error, then the issue is from your gluetun's configuration,
275
301
This is thanks to [Gluetun's healthcheck](https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md) being healthy only when the connexion is set.
276
302
277
303
</details>
304
+
305
+
<details>
306
+
307
+
<summary>Issues with HTTPS.</summary>
308
+
309
+
There are 2 main issues with HTTPS :
310
+
- Your certificate is not trusted by the container (ex : self signed).
311
+
312
+
To remediate this, you can use the `GSP_CERT_CHECK` variable and set it to `false`. This will use the `insecure` flag for every `curl` request.
313
+
- Your certificate is trusted, but does not contain `localhost` (obviously) and so the connection is refused.
314
+
315
+
For this one, you can check [Unspec7's guide](#14) (Thanks to him).
log "${MSG_prefix} Your qBittorrent certificate is untrusted. See HTTPS section in https://github.com/t-anc/GSP-Qbittorent-Gluetun-sync-port-mod#troubleshooting."
108
+
fi
109
+
fi
110
+
111
+
# Check 2 :
97
112
# Check for the auth bypass in qbittorrent's config file,
98
113
# or check for bad credentials.
99
114
@@ -109,19 +124,19 @@ init_checks(){
109
124
fi
110
125
fi
111
126
112
-
# Check 2 :
127
+
# Check 3 :
113
128
# Check for "Host header validation".
114
-
if [ "$(curl --write-out '%{http_code}' --silent --output /dev/null "${QBITTORRENT}")" -eq 401 ]; then
129
+
if [ "$(curl ${CURL_OPT} --write-out '%{http_code}' --silent --output /dev/null "${QBITTORRENT}")" -eq 401 ]; then
115
130
err='true'
116
131
log "${MSG_prefix} Qbittorrent returned 401. Is the \"Enable Host header validation\" setting set ? Is $(basename "${QBITTORRENT%:*}") whitelisted ?"
117
132
fi
118
133
119
-
# Check 3 :
134
+
# Check 4 :
120
135
# Check Gluetun's authentication
121
136
if [ -z "${GTN_API_KEY}" ];then
122
137
log "[WARNING] It seems you don't have any 'GSP_GTN_API_KEY' set. You should set one, follow the doc here : https://github.com/t-anc/GSP-Qbittorent-Gluetun-sync-port-mod#gluetun"
123
138
else
124
-
if [ "$(curl --write-out '%{http_code}' --silent --output /dev/null "${GTN_AUTH[@]}" "${GLUETUN}/v1/openvpn/portforwarded")" -eq '401' ]; then
139
+
if [ "$(curl ${CURL_OPT} --write-out '%{http_code}' --silent --output /dev/null "${GTN_AUTH[@]}" "${GLUETUN}/v1/openvpn/portforwarded")" -eq '401' ]; then
125
140
err='true'
126
141
log "${MSG_prefix} Gluetun returned 401. Is Gluetun's authentication correctly configured ? See https://github.com/t-anc/GSP-Qbittorent-Gluetun-sync-port-mod#gluetun"
log "Couldn't connect to webUI. Check the address, or maybe your instance is taking to long to start. You can adjust the GSP_INIT_RETRY_WAIT variable to wait longer."
0 commit comments