fix(qbittorrent): Force password creation by update-config.sh

This commit is contained in:
Adrien Poupa 2024-05-12 23:28:38 -04:00
parent d7cc97f874
commit a8fae89485
4 changed files with 15 additions and 19 deletions

View File

@ -19,7 +19,7 @@ ADGUARD_HOSTNAME=
ADGUARD_USERNAME=
ADGUARD_PASSWORD=
QBITTORRENT_USERNAME=admin
QBITTORRENT_PASSWORD=
QBITTORRENT_PASSWORD=adminadmin
DNS_CHALLENGE=true
DNS_CHALLENGE_PROVIDER=cloudflare
LETS_ENCRYPT_CA_SERVER="https://acme-v02.api.letsencrypt.org/directory"

1
.gitignore vendored
View File

@ -14,7 +14,6 @@ docker-compose.override.yml
/pia
/pia-shared
/letsencrypt
/jellyfin
/jellyseerr
/adguardhome/certs
/adguardhome/conf

View File

@ -89,8 +89,6 @@ see [Optional Services](#optional-services) for more information.
For the first time, run `./update-config.sh` to update the applications base URLs and set the API keys in `.env`.
Get your qBittorrent password from `docker compose logs qbittorrent` and change it in the UI and in `.env.`
If you want to show Jellyfin information in the homepage, create it in Jellyfin settings and fill `JELLYFIN_API_KEY`.
## Environment Variables
@ -114,7 +112,7 @@ If you want to show Jellyfin information in the homepage, create it in Jellyfin
| `ADGUARD_USERNAME` | Optional - AdGuard Home username to show details in the homepage, if enabled | |
| `ADGUARD_PASSWORD` | Optional - AdGuard Home password to show details in the homepage, if enabled | |
| `QBITTORRENT_USERNAME` | qBittorrent username to access the web UI | `admin` |
| `QBITTORRENT_PASSWORD` | qBittorrent password to access the web UI | None, please set your password |
| `QBITTORRENT_PASSWORD` | qBittorrent password to access the web UI | `adminadmin` |
| `DNS_CHALLENGE` | Enable/Disable DNS01 challenge, set to `false` to disable. | `true` |
| `DNS_CHALLENGE_PROVIDER` | Provider for DNS01 challenge, [see list here](https://doc.traefik.io/traefik/https/acme/#providers). | `cloudflare` |
| `LETS_ENCRYPT_CA_SERVER` | Let's Encrypt CA Server used to generate certificates, set to production by default.<br/>Set to `https://acme-staging-v02.api.letsencrypt.org/directory` to test your changes with the staging server. | `https://acme-v02.api.letsencrypt.org/directory` |
@ -199,7 +197,8 @@ Their API keys can be found in Settings > Security > API Key.
## qBittorrent
Since qBittorrent v4.6.2, a temporary password is generated on startup. Get it with `docker compose logs qbittorrent`:
Running `update-config.sh` will set qBittorrent's password to `adminadmin`. If you wish to update the password manually,
since qBittorrent v4.6.2, a temporary password is generated on startup. Get it with `docker compose logs qbittorrent`:
```
The WebUI administrator username is: admin
The WebUI administrator password was not set. A temporary password is provided for this session: <some_password>
@ -223,7 +222,7 @@ To use the VueTorrent WebUI just go to `qBittorrent`, `Options`, `Web UI`, `Use
## Jellyfin
To enable [hardware transcoding](https://jellyfin.org/docs/general/administration/hardware-acceleration/),
depending on your system, you may need to update the following block:
depending on your system, you may need to add the following block:
```
devices:

View File

@ -7,18 +7,17 @@ function update_arr_config {
until [ -f "${CONFIG_ROOT:-.}"/"$container"/config.xml ]; do sleep 1; done
sed -i.bak "s/<UrlBase><\/UrlBase>/<UrlBase>\/$1<\/UrlBase>/" "${CONFIG_ROOT:-.}"/"$container"/config.xml && rm "${CONFIG_ROOT:-.}"/"$container"/config.xml.bak
sed -i.bak 's/^'"${container^^}"'_API_KEY=.*/'"${1^^}"'_API_KEY='"$(sed -n 's/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p' "${CONFIG_ROOT:-.}"/"$container"/config.xml)"'/' .env && rm .env.bak
echo "Update of ${container^} configuration complete."
echo "Restarting ${container^}..."
echo "Update of ${container^} configuration complete, restarting..."
docker compose restart "$container"
}
function update_jellyfin_config {
function update_qbittorrent_config {
echo "Updating ${container^} configuration..."
until [ -f "${CONFIG_ROOT:-.}"/"$container"/network.xml ]; do sleep 1; done
sed -i.bak "s/<BaseUrl \/>/<BaseUrl>\/$container<\/BaseUrl>/" "${CONFIG_ROOT:-.}"/"$container"/network.xml && rm "${CONFIG_ROOT:-.}"/"$container"/network.xml.bak
echo "Update of ${container^} configuration complete."
echo "Restarting ${container^}..."
docker compose restart "$container"
docker compose stop "$container"
until [ -f "${CONFIG_ROOT:-.}"/"$container"/qBittorrent/qBittorrent.conf ]; do sleep 1; done
sed -i.bak '/WebUI\\ServerDomains=*/a WebUI\\Password_PBKDF2="@ByteArray(ARQ77eY1NUZaQsuDHbIMCA==:0WMRkYTUWVT9wVvdDtHAjU9b3b7uB8NR1Gur2hmQCvCDpm39Q+PsJRJPaCU51dEiz+dTzh8qbPsL8WkFljQYFQ==)"' "${CONFIG_ROOT:-.}"/"$container"/qBittorrent/qBittorrent.conf && rm "${CONFIG_ROOT:-.}"/"$container"/qBittorrent/qBittorrent.conf.bak
echo "Update of ${container^} configuration complete, restarting..."
docker compose start "$container"
}
function update_bazarr_config {
@ -34,17 +33,16 @@ function update_bazarr_config {
RADARR_API_KEY=$(sed -n 's/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p' "${CONFIG_ROOT:-.}"/radarr/config.xml)
sed -i.bak "/radarr:/,/^sonarr:/ { s/apikey: .*/apikey: $RADARR_API_KEY/; s/base_url: .*/base_url: \/radarr/; s/ip: .*/ip: radarr/ }" "${CONFIG_ROOT:-.}"/"$container"/config/config/config.yaml && rm "${CONFIG_ROOT:-.}"/"$container"/config/config/config.yaml.bak
sed -i.bak 's/^'"${container^^}"'_API_KEY=.*/'"${container^^}"'_API_KEY='"$(sed -n 's/.*apikey: \(.*\)*/\1/p' "${CONFIG_ROOT:-.}"/"$container"/config/config/config.yaml | head -n 1)"'/' .env && rm .env.bak
echo "Update of ${container^} configuration complete."
echo "Restarting ${container^}..."
echo "Update of ${container^} configuration complete, restarting..."
docker compose restart "$container"
}
for container in $(docker ps --format '{{.Names}}'); do
if [[ "$container" =~ ^(radarr|sonarr|lidarr|prowlarr)$ ]]; then
update_arr_config "$container"
elif [[ "$container" =~ ^(jellyfin)$ ]]; then
update_jellyfin_config "$container"
elif [[ "$container" =~ ^(bazarr)$ ]]; then
update_bazarr_config "$container"
elif [[ "$container" =~ ^(qbittorrent)$ ]]; then
update_qbittorrent_config "$container"
fi
done