1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-23 22:32:16 +02:00

Compare commits

...

45 Commits

Author SHA1 Message Date
sledgehammer999
dbfaf35db4 Fix Changelog date and entry. 2017-09-07 19:13:59 +03:00
sledgehammer999
f3b4c4acfc Fix broken build. 2017-09-06 14:50:10 +03:00
sledgehammer999
b37c395118 Bump to 3.3.16 2017-09-05 22:22:04 +03:00
sledgehammer999
d6ab0d6f02 Update Changelog. 2017-09-05 22:22:03 +03:00
Chocobo1
1b8c61c390 Setup parent ownership to avoid memory leak 2017-09-05 22:00:48 +03:00
Vladimir Golovnev
cbfdc8f721 Skip user input events when adding torrent
Closes #7327.
2017-09-05 22:00:37 +03:00
Evengard
cfae8c6399 Disable skipping of loopback interfaces
This fixes the absence of VPN tunnel interfaces under Windows and works around the QTBUG-32349
Fixes #7291
2017-09-05 22:00:10 +03:00
Chocobo1
246a19d685 WebAPI: fix validating wrong header field. Closes #7311.
X-Forwarded-Host is a foreign proxy setting, it isn't the same as
qbt's local setting and thus it makes no sense to verify it.
2017-09-05 21:57:28 +03:00
sledgehammer999
8b6e06cfff Options to better memory control by libtorrent. Closes #7029. 2017-09-05 21:57:16 +03:00
sledgehammer999
7e8f2ecc76 Fix connection problems when a specific interface/ip is configured.
Closes #7235.
Bug related to #7099 and Qt.
2017-09-05 21:57:07 +03:00
vlakoff
0f061aa40d Windows installer: also detect running process when it is 64-bit
Replacing FindProcDLL with a different one that can be found here:

http://forums.winamp.com/showthread.php?t=322583#post2777719
2017-09-05 21:54:35 +03:00
sledgehammer999
256211c16a Bump to 3.3.15 2017-08-03 23:25:18 +03:00
sledgehammer999
bd684df315 Update Chagelog. 2017-08-03 23:22:43 +03:00
Vladimir Golovnev (Glassez)
8eb9117033 Fix temporary subfolder isn't deleted 2017-07-28 20:17:34 +03:00
sledgehammer999
83ae15550d Bump to 3.3.14 2017-07-18 22:52:48 +03:00
sledgehammer999
3783541c30 Update Changelog. 2017-07-18 22:50:18 +03:00
sledgehammer999
cc388fe772 Bump API_VERSION and API_VERSION_MIN to 15. 2017-07-18 22:47:13 +03:00
sledgehammer999
78f2afa239 Fix duplicate variable name in .ui file. 2017-07-18 22:47:02 +03:00
sledgehammer999
245e8e09bb Fix Qt4 compilation. 2017-07-18 16:04:50 +03:00
sledgehammer999
986cff9e66 Fix typo. 2017-07-18 03:33:40 +03:00
Tom Piccirello
73f477072f Add Status column to webui (addresses #6815) (#7032)
* Add Status column to webui (addresses #6815)
2017-07-18 03:22:46 +03:00
Chocobo1
7e9ece2701 Load the domain list at least once on startup.
Fixup of 0532d546d7
2017-07-18 03:22:41 +03:00
Eugene Shalygin
ba8641f1ac Set interface for outgoing traffic.
This sets interface for outgoing traffic to the same as for ingoing
(listetning) with libtorrent 1.1.x.
2017-07-18 03:21:31 +03:00
Chocobo1
76c6041031 Implement HTTP host header filtering
This filtering is required to defend against DNS rebinding attack.
2017-07-18 03:21:26 +03:00
Chocobo1
2ae8472a78 Avoid modifing request headers 2017-07-18 02:53:58 +03:00
Chocobo1
dc9df6d681 Revert back to intended fallthrough
Partial revert a7f4ea8b18
2017-07-18 02:53:57 +03:00
Chocobo1
aed9e8f1b7 Fix value comparison. Closes #7081.
`category` could be 'undefined'.
Fixup of a7f4ea8b18.
2017-07-18 02:53:55 +03:00
sledgehammer999
a94d14acaf Update Travis to use the new macOS packages for qt and libtorrent. 2017-07-18 02:53:37 +03:00
Thomas Piccirello
317689bd5d Fix javascript errors and follow best practices 2017-07-18 02:51:42 +03:00
Thomas Piccirello
1ad66ba791 Skip username/password check for active sessions (closes #6860) 2017-07-18 02:51:34 +03:00
sledgehammer999
b4fb193d4a Fix Qt 5.2 build. 2017-07-03 18:17:27 +03:00
sledgehammer999
ab47559bf2 Switch appveyor to msvc2017. 2017-07-03 18:17:25 +03:00
sledgehammer999
ac87728150 Leave a comment about boost DEFINE and RC_1_1. Issues #7050 #6761. 2017-07-03 18:17:24 +03:00
scootergrisen
1559205114 Added danish translation 2017-07-03 18:17:23 +03:00
Anton-Latukha
54e8b6944e systemd service with user switch.
rm previous systemd unit service

cmake now placing new file 'qbittorrent-nox@.service.in'

systemd service now "Type=simple"
2017-07-03 18:17:22 +03:00
Chocobo1
164e8156db Separate "Release mode" linker options 2017-07-03 18:17:21 +03:00
Chocobo1
c83bb22e80 Raise total stack size on Windows to 8 MB. Closes #7021.
MSVC default was 1 MB.
2017-07-03 18:17:20 +03:00
Andrei Stepanov
166c2a72ac Update russian.nsi 2017-07-03 18:17:19 +03:00
sledgehammer999
6b659804c7 Pad shorter python versions. Closes #6877. 2017-07-03 18:17:18 +03:00
Chocobo1
0831320f17 [WebAPI] Convert all header name constants to lowercase
This save us another transition when some day we implements HTTP/2
(which all headers are in lowercase).
2017-06-26 01:33:17 +03:00
Chocobo1
8d2fb06f65 [WebUI] relax CSRF defense. Closes #6882.
Allow HTTP request which has neither Origin nor Referer header included
2017-06-26 01:33:16 +03:00
Chocobo1
bf6f103142 Fix KEEP_ALIVE_DURATION value
I intended to specify 7 seconds, which should be 7000 milliseconds
2017-06-26 01:33:15 +03:00
thalieht
c4b12b854e Add greek translation for windows installer 2017-06-26 01:33:13 +03:00
Burak Yavuz
de514e29c2 Updated turkish installer 2017-06-26 01:33:12 +03:00
KingLucius
03d020f0f2 Installer Arabic language update 2017-06-26 01:33:05 +03:00
52 changed files with 551 additions and 311 deletions

View File

@@ -3,7 +3,7 @@ version: '{branch}-{build}'
# Do not build on tags (GitHub only)
skip_tags: true
os: Visual Studio 2015
image: Visual Studio 2017
environment:
REPO_DIR: &REPO_DIR c:\qbittorrent
@@ -36,7 +36,7 @@ install:
before_build:
# setup env
- CALL "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
- CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
- SET PATH=%PATH%;c:\qbt\qt5_32\bin;%CACHE_DIR%\jom;
# setup project
- COPY /Y "%CACHE_DIR%\winconf.pri" "%REPO_DIR%"

View File

@@ -132,15 +132,15 @@ install:
cp "version" $HOME/hombebrew_cache ;
cd "$HOME/hombebrew_cache" ;
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar.rb ;
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar-1.0.10.el_capitan.bottle.tar.gz ;
wget https://builds.shiki.hu/homebrew/qt5.rb ;
wget https://builds.shiki.hu/homebrew/qt5-5.7.1_1.el_capitan.bottle.tar.gz ;
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar-1.0.11+git20172003.8736a59adc.el_capitan.bottle.tar.gz
wget https://builds.shiki.hu/homebrew/qt.rb
wget https://builds.shiki.hu/homebrew/qt-5.9.1.el_capitan.bottle.tar.gz
fi
# Copy custom libtorrent bottle to homebrew's cache so it can find and install it
# Also install our custom libtorrent formula by passing the local path to it
# These 2 files are restored from Travis' cache.
cp "$HOME/hombebrew_cache/libtorrent-rasterbar-1.0.10.el_capitan.bottle.tar.gz" "$(brew --cache)" ;
cp "$HOME/hombebrew_cache/libtorrent-rasterbar-1.0.11+git20172003.8736a59adc.el_capitan.bottle.tar.gz" "$(brew --cache)"
brew install "$HOME/hombebrew_cache/libtorrent-rasterbar.rb" ;
# Qt
@@ -149,9 +149,9 @@ install:
# Copy custom qt5 bottle to homebrew's cache so it can find and install it
# Also install our custom qt5 formula by passing the local path to it
# These 2 files are restored from Travis' cache.
cp "$HOME/hombebrew_cache/qt5-5.7.1_1.el_capitan.bottle.tar.gz" "$(brew --cache)" ;
brew install "$HOME/hombebrew_cache/qt5.rb" ;
brew link --force qt5 ;
cp "$HOME/hombebrew_cache/qt-5.9.1.el_capitan.bottle.tar.gz" "$(brew --cache)"
brew install "$HOME/hombebrew_cache/qt.rb"
brew link --force qt
fi
fi
- |

View File

@@ -1,3 +1,31 @@
* Thu Sep 07 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.16
- BUGFIX: Better memory footprint when using libtorrent 1.1.x. The cache is turned off by default(`0 (disabled)` value in the settings). The value `-1 (auto)` makes it use 1/8 of your RAM. (sledgehammer999)
- BUGFIX: Skip user input events when adding torrent. Closes #7327. (glassez)
- BUGFIX: Avoid memory leak in the speed graph. (Chocobo1)
- WEBUI: Fix validating wrong header field. X-Forwarded-Host is a foreign proxy setting, it isn't the same as qbt's local setting and thus it makes no sense to verify it. Closes #7311. (Chocobo1)
- WINDOWS: Fix connection problems when a specific interface/ip is configured. (sledgehammer999)
- WINDOWS: Disable skipping of loopback interfaces. This fixes the absence of VPN tunnel interfaces under Windows and works around the QTBUG-32349. Fixes #7291. (Evengard)
- WINDOWS: The installer detects the 64bit running process too. (vlakoff)
* Thu Aug 03 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.15
- BUGFIX: Temporary subfolder wasn't being deleted. (glassez)
* Tue Jul 18 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.14
- BUGFIX: Set interface for outgoing traffic(libtorrent 1.1.x series). (evsh)
- WEBUI: Fix KEEP_ALIVE_DURATION value (Chocobo1)
- WEBUI: Relax CSRF defense. Closes #6882. Allow HTTP request which has neither Origin nor Referer header included. (Chocobo1)
- WEBUI: Skip username/password check for active sessions (closes #6860) (Thomas Piccirello)
- WEBUI: Fix javascript errors and follow best practices (Thomas Piccirello)
- WEBUI: Fix value comparison. Closes #7081. (Chocobo1)
- WEBUI: Avoid modifying request headers (Chocobo1)
- WEBUI: Implement HTTP host header filtering. This filtering is required to defend against DNS rebinding attack. Fixes security issues reported by @beardog108 privately. (Chocobo1)
- WEBUI: Add Status column to webui (addresses #6815) (#7032) (Tom Piccirello)
- WEBUI: Bump API_VERSION and API_VERSION_MIN to 15.
- SEARCH: Pad shorter python versions. Closes #6877. (sledgehammer999)
- WINDOWS: Updated Arabic, Turkish, Greek, Russian, Danish languages of the installer. (KingLucius, BouRock, thalieht, Andrei Stepanov, scootergrisen)
- WINDOWS: Raise total stack size on Windows to 8 MB. Closes #7021. (Chocobo1)
- LINUX: Systemd service with user switch and other fixes/optimizations. (anton.latukha)
* Thu Jun 01 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.13
- BUGFIX: Fixed UI glitch about torrent numbers in the sidepanel. Fixes #6454. (evsh)
- BUGFIX: Fix downloaded/uploaded columns were not highlighted properly when selected. (Chocobo1)

4
configure vendored
View File

@@ -6962,7 +6962,7 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
if test "x$enable_systemd" = "xyes"; then :
ac_config_files="$ac_config_files dist/unix/systemd/qbittorrent-nox.service"
ac_config_files="$ac_config_files dist/unix/systemd/qbittorrent-nox@.service"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -7716,7 +7716,7 @@ do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"conf.pri") CONFIG_FILES="$CONFIG_FILES conf.pri" ;;
"dist/unix/systemd/qbittorrent-nox.service") CONFIG_FILES="$CONFIG_FILES dist/unix/systemd/qbittorrent-nox.service" ;;
"dist/unix/systemd/qbittorrent-nox@.service") CONFIG_FILES="$CONFIG_FILES dist/unix/systemd/qbittorrent-nox@.service" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac

View File

@@ -260,7 +260,7 @@ AC_SUBST(QBT_REMOVE_DEFINES)
AC_OUTPUT(conf.pri)
AS_IF([test "x$enable_systemd" = "xyes"],
[AC_OUTPUT(dist/unix/systemd/qbittorrent-nox.service)])
[AC_OUTPUT(dist/unix/systemd/qbittorrent-nox@.service)])

2
dist/mac/Info.plist vendored
View File

@@ -45,7 +45,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.3.13</string>
<string>3.3.16</string>
<key>CFBundleSignature</key>
<string>qBit</string>
<key>CFBundleExecutable</key>

View File

@@ -2,8 +2,8 @@ if (SYSTEMD)
find_package(Systemd)
if (SYSTEMD_FOUND)
set(EXPAND_BINDIR ${CMAKE_INSTALL_FULL_BINDIR})
configure_file(systemd/qbittorrent-nox.service.in ${CMAKE_CURRENT_BINARY_DIR}/qbittorrent-nox.service @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qbittorrent-nox.service
configure_file(systemd/qbittorrent-nox@.service.in ${CMAKE_CURRENT_BINARY_DIR}/qbittorrent-nox@.service @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qbittorrent-nox@.service
DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR}
COMPONENT data)
endif(SYSTEMD_FOUND)

View File

@@ -1,11 +0,0 @@
[Unit]
Description=qBittorrent Daemon Service
After=network.target
[Service]
Type=forking
User=1000
ExecStart=@EXPAND_BINDIR@/qbittorrent-nox -d
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,14 @@
[Unit]
Description=qBittorrenti-nox service for user %I
Documentation=man:qbittorrent-nox(1)
After=network.target
[Service]
Type=simple
PrivateTmp=false
User=%i
ExecStart=@EXPAND_BINDIR@/qbittorrent-nox
[Install]
WantedBy=multi-user.target

View File

@@ -17,13 +17,13 @@ LangString inst_firewallinfo ${LANG_ARABIC} "جاري اضافة القاعدة
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_ARABIC} "البرنامج يعمل. يرجى اغلاقه قبل البدء في التنصيب"
;LangString inst_uninstall_question ${LANG_ENGLISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_ARABIC} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_ARABIC} "يوجد نسخة سابقة من البرنامج. سيتم إزالتها دون حذف إعدادات المستخدم"
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_ARABIC} "جاري ازالة النسخة السابقة من البرنامج"
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_ARABIC} "تشغيل البرنامج"
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_ARABIC} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_ARABIC} "هذا المثبت يعمل فقط في نسخ ويندوز 64 بت"
;------------------------------------

View File

@@ -1,53 +1,53 @@
;Installer strings
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_DANISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_DANISH} "qBittorrent (påkrævet)"
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_DANISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_DANISH} "Opret skrivebordsgenvej"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_DANISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_DANISH} "Opret genvej i menuen Start"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_DANISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_DANISH} "Åbn .torrent-filer med qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_DANISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_DANISH} "Åbn magnet-links med qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_DANISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_DANISH} "Tilføj Windows Firewall-regel"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_DANISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_DANISH} "Tilføjer Windows Firewall-regel"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_DANISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_DANISH} "qBittorrent kører. Luk venligst programmet inden installation."
;LangString inst_uninstall_question ${LANG_ENGLISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_DANISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_DANISH} "En tidligere installation blev registreret. Den vil blive afinstalleret uden at brugerindstillingerne slettes."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_DANISH} "Uninstalling previous version."
LangString inst_unist ${LANG_DANISH} "Afinstallerer tidligere version."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_DANISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_DANISH} "Start qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_DANISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_DANISH} "Dette installationsprogram virker kun i 64-bit Windows versioner."
;------------------------------------
;Uninstaller strings
;LangString remove_files ${LANG_ENGLISH} "Remove files"
LangString remove_files ${LANG_DANISH} "Remove files"
LangString remove_files ${LANG_DANISH} "Fjern filer"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_DANISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_DANISH} "Fjern genveje"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_DANISH} "Remove file associations"
LangString remove_associations ${LANG_DANISH} "Fjern filtilknytninger"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_DANISH} "Remove registry keys"
LangString remove_registry ${LANG_DANISH} "Fjern registreringsnøgler"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
LangString remove_conf ${LANG_DANISH} "Remove configuration files"
LangString remove_conf ${LANG_DANISH} "Fjern konfigurationsfiler"
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_DANISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_DANISH} "Fjern Windows Firewall-regel"
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_DANISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_DANISH} "Fjerner Windows Firewall-regel"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_DANISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_DANISH} "Fjern torrents og mellemlagret data"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_DANISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_DANISH} "qBittorrent kører. Luk venligst programmet inden afinstallation."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_DANISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_DANISH} "Fjerner ikke .torrent-tilknytning. Det er tilknyttet:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_DANISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_DANISH} "Fjerner ikke magnet-tilknytning. Det er tilknyttet:"

View File

@@ -1,53 +1,53 @@
;Installer strings
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_GREEK} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_GREEK} "qBittorrent (απαιτείται)"
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_GREEK} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_GREEK} "Δημιουργία συντόμευσης στην Επιφάνεια Εργασίας"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_GREEK} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_GREEK} "Δημιουργία συντόμευσης στο Μενού Έναρξης"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_GREEK} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_GREEK} "Άνοιγμα των αρχείων .torrent με το qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_GREEK} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_GREEK} "Άνοιγμα των μαγνητικών συνδέσμων με το qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_GREEK} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_GREEK} "Προσθήκη κανόνα εξαίρεσης στο Τείχος Προστασίας των Windows"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_GREEK} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_GREEK} "Προστίθεται κανόνας εξαίρεσης στο Τείχος Προστασίας των Windows"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_GREEK} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_GREEK} "Το qBittorrent βρίσκεται σε εκτέλεση. Παρακαλούμε κλείστε την εφαρμογή πριν την εγκατάσταση."
;LangString inst_uninstall_question ${LANG_ENGLISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_GREEK} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_GREEK} "Ανιχνεύθηκε προηγούμενη εγκατάσταση. Θα απεγκατασταθεί χωρίς να διαγραφούν οι ρυθμίσεις του χρήστη."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_GREEK} "Uninstalling previous version."
LangString inst_unist ${LANG_GREEK} "Γίνεται απεγκατάσταση της προηγούμενης έκδοσης."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_GREEK} "Launch qBittorrent."
LangString launch_qbt ${LANG_GREEK} "Εκκίνηση του qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_GREEK} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_GREEK} "Αυτό το αρχείο εγκατάστασης λειτουργεί μόνο σε 64-bit εκδόσεις των Windows."
;------------------------------------
;Uninstaller strings
;LangString remove_files ${LANG_ENGLISH} "Remove files"
LangString remove_files ${LANG_GREEK} "Remove files"
LangString remove_files ${LANG_GREEK} "Να διαγραφούν τα αρχεία"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_GREEK} "Remove shortcuts"
LangString remove_shortcuts ${LANG_GREEK} "Να διαγραφούν οι συντομεύσεις"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_GREEK} "Remove file associations"
LangString remove_associations ${LANG_GREEK} "Να καταργηθούν οι συσχετίσεις αρχείων"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_GREEK} "Remove registry keys"
LangString remove_registry ${LANG_GREEK} "Να διαγραφούν τα κλειδιά μητρώου"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
LangString remove_conf ${LANG_GREEK} "Remove configuration files"
LangString remove_conf ${LANG_GREEK} "Να διαγραφούν τα αρχεία ρυθμίσεων"
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_GREEK} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_GREEK} "Να διαγραφεί ο κανόνας εξαίρεσης στο Τείχος Προστασίας των Windows"
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_GREEK} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_GREEK} "Γίνεται διαγραφή του κανόνα εξαίρεσης στο Τείχος Προστασίας των Windows"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_GREEK} "Remove torrents and cached data"
LangString remove_cache ${LANG_GREEK} "Να διαγραφούν τα torrents και τα δεδομένα προσωρινής αποθήκευσης"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_GREEK} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_GREEK} "Το qBittorrent βρίσκεται σε εκτέλεση. Παρακαλούμε κλείστε την εφαρμογή πριν την απεγκατάσταση."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_GREEK} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_GREEK} "Δεν θα καταργηθεί η συσχέτιση με τα αρχεία .torrent. Είναι συσχετισμένα με το:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_GREEK} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_GREEK} "Δεν θα καταργηθεί η συσχέτιση με τους μαγνητικούς συνδέσμους. Είναι συσχετισμένοι με το:"

View File

@@ -7,9 +7,9 @@ LangString inst_dekstop ${LANG_RUSSIAN} "Создать ярлык на рабо
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_RUSSIAN} "Создать ярлык в меню Пуск"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_RUSSIAN} "Открывать торрент файлы с помощью qBittorrent"
LangString inst_torrent ${LANG_RUSSIAN} "Открывать торрент-файлы с помощью qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_RUSSIAN} "Открывать magnet ссылки с помощью qBittorrent"
LangString inst_magnet ${LANG_RUSSIAN} "Открывать magnet-ссылки с помощью qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_RUSSIAN} "Добавить в список исключений брандмауера"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
@@ -23,7 +23,7 @@ LangString inst_unist ${LANG_RUSSIAN} "Деинсталлируем старую
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_RUSSIAN} "Запустить qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_RUSSIAN} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_RUSSIAN} "Этот установщик работает только на 64-битных версиях Windows."
;------------------------------------
@@ -44,10 +44,10 @@ LangString remove_firewall ${LANG_RUSSIAN} "Удалить из списка и
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_RUSSIAN} "Удаление из списка исключений брандмауера"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_RUSSIAN} "Удалить сохраненные торрент файлы"
LangString remove_cache ${LANG_RUSSIAN} "Удалить сохранённые торрент-файлы"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_RUSSIAN} "qBittorrent запущен. Пожалуйста, закройте qBittorrent и перезапустите программу удаления."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_RUSSIAN} "Ассоциации торрент файлов не сброшены. Уже ассоциированы с:"
LangString uninst_tor_warn ${LANG_RUSSIAN} "Ассоциации торрент-файлов не сброшены. Уже ассоциированы с:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_RUSSIAN} "Ассоциации magnet ссылок не сброшены. Уже ассоциированы с:"
LangString uninst_mag_warn ${LANG_RUSSIAN} "Ассоциации magnet-ссылок не сброшены. Уже ассоциированы с:"

View File

@@ -23,7 +23,7 @@ LangString inst_unist ${LANG_TURKISH} "Önceki sürüm kaldırılıyor."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_TURKISH} "qBittorrent'i çalıştır."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_TURKISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_TURKISH} "Bu yükleyici sadece 64-bit Windows sürümlerinde çalışır."
;------------------------------------

Binary file not shown.

View File

@@ -27,7 +27,7 @@ XPStyle on
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
; Program specific
!define PROG_VERSION "3.3.13"
!define PROG_VERSION "3.3.16"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun

View File

@@ -42,6 +42,7 @@
#include <QString>
#include <QThread>
#include <QTimer>
#include <QUuid>
#include <cstdlib>
#include <queue>
@@ -88,6 +89,14 @@
#include "tracker.h"
#include "trackerentry.h"
#ifdef Q_OS_WIN
#include <iphlpapi.h>
#endif
#if defined(Q_OS_WIN) && (_WIN32_WINNT < 0x0600)
using NETIO_STATUS = LONG;
#endif
static const char PEER_ID[] = "qB";
static const char RESUME_FOLDER[] = "BT_backup";
static const char USER_AGENT[] = "qBittorrent/" QBT_VERSION_2;
@@ -105,6 +114,10 @@ namespace
void torrentQueuePositionTop(const libt::torrent_handle &handle);
void torrentQueuePositionBottom(const libt::torrent_handle &handle);
#ifdef Q_OS_WIN
QString convertIfaceNameToGuid(const QString &name);
#endif
inline SettingsStorage *settings() { return SettingsStorage::instance(); }
QStringMap map_cast(const QVariantMap &map)
@@ -313,6 +326,10 @@ Session::Session(QObject *parent)
sessionSettings.connection_speed = 20; // default is 10
sessionSettings.no_connect_privileged_ports = false;
sessionSettings.seed_choking_algorithm = libt::session_settings::fastest_upload;
// Disk cache pool is rarely tested in libtorrent and doesn't free buffers
// Soon to be deprecated there
// More info: https://github.com/arvidn/libtorrent/issues/2251
sessionSettings.use_disk_cache_pool = false;
configure(sessionSettings);
m_nativeSession->set_settings(sessionSettings);
configureListeningInterface();
@@ -340,6 +357,10 @@ Session::Session(QObject *parent)
pack.set_int(libt::settings_pack::connection_speed, 20); // default is 10
pack.set_bool(libt::settings_pack::no_connect_privileged_ports, false);
pack.set_int(libt::settings_pack::seed_choking_algorithm, libt::settings_pack::fastest_upload);
// Disk cache pool is rarely tested in libtorrent and doesn't free buffers
// Soon to be deprecated there
// More info: https://github.com/arvidn/libtorrent/issues/2251
pack.set_bool(libt::settings_pack::use_disk_cache_pool, false);
configure(pack);
m_nativeSession = new libt::session(pack, 0);
@@ -900,6 +921,10 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
{
Logger* const logger = Logger::instance();
#ifdef Q_OS_WIN
QString chosenIP;
#endif
if (m_listenInterfaceChanged) {
const ushort port = this->port();
std::pair<int, int> ports(port, port);
@@ -929,10 +954,31 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
.arg(ip).arg(port)
, Log::INFO);
settingsPack.set_str(libt::settings_pack::listen_interfaces, interfacesStr);
#ifdef Q_OS_WIN
chosenIP = ip;
#endif
break;
}
}
#ifdef Q_OS_WIN
// On Vista+ versions and after Qt 5.5 QNetworkInterface::name() returns
// the interface's Luid and not the GUID.
// Libtorrent expects GUIDs for the 'outgoing_interfaces' setting.
if (!networkInterface().isEmpty()) {
QString guid = convertIfaceNameToGuid(networkInterface());
if (!guid.isEmpty()) {
settingsPack.set_str(libt::settings_pack::outgoing_interfaces, guid.toStdString());
}
else {
settingsPack.set_str(libt::settings_pack::outgoing_interfaces, chosenIP.toStdString());
LogMsg(tr("Could not get GUID of configured network interface. Binding to IP %1").arg(chosenIP)
, Log::WARNING);
}
}
#else
settingsPack.set_str(libt::settings_pack::outgoing_interfaces, networkInterface().toStdString());
#endif
m_listenInterfaceChanged = false;
}
@@ -998,8 +1044,8 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
settingsPack.set_bool(libt::settings_pack::announce_to_all_trackers, announceToAll);
settingsPack.set_bool(libt::settings_pack::announce_to_all_tiers, announceToAll);
const int cacheSize = diskCacheSize();
settingsPack.set_int(libt::settings_pack::cache_size, (cacheSize > 0) ? cacheSize * 64 : -1);
const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1;
settingsPack.set_int(libt::settings_pack::cache_size, cacheSize);
settingsPack.set_int(libt::settings_pack::cache_expiry, diskCacheTTL());
qDebug() << "Using a disk cache size of" << cacheSize << "MiB";
@@ -1145,8 +1191,8 @@ void Session::configure(libtorrent::session_settings &sessionSettings)
bool announceToAll = announceToAllTrackers();
sessionSettings.announce_to_all_trackers = announceToAll;
sessionSettings.announce_to_all_tiers = announceToAll;
int cacheSize = diskCacheSize();
sessionSettings.cache_size = (cacheSize > 0) ? cacheSize * 64 : -1;
const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1;
sessionSettings.cache_size = cacheSize;
sessionSettings.cache_expiry = diskCacheTTL();
qDebug() << "Using a disk cache size of" << cacheSize << "MiB";
libt::session_settings::io_buffer_mode_t mode = useOSCache() ? libt::session_settings::enable_os_cache
@@ -1715,7 +1761,7 @@ bool Session::findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) c
torrentInfo.renameFile(i, filePath + QB_EXT);
}
if ((i % 100) == 0)
qApp->processEvents();
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
}
return found;
@@ -2216,10 +2262,10 @@ QString Session::networkInterface() const
return m_networkInterface;
}
void Session::setNetworkInterface(const QString &interface)
void Session::setNetworkInterface(const QString &iface)
{
if (interface != networkInterface()) {
m_networkInterface = interface;
if (iface != networkInterface()) {
m_networkInterface = iface;
configureListeningInterface();
}
}
@@ -2412,27 +2458,27 @@ void Session::setAnnounceToAllTrackers(bool val)
}
}
uint Session::diskCacheSize() const
int Session::diskCacheSize() const
{
uint size = m_diskCacheSize;
int size = m_diskCacheSize;
// These macros may not be available on compilers other than MSVC and GCC
#if defined(__x86_64__) || defined(_M_X64)
size = qMin(size, 4096u); // 4GiB
size = qMin(size, 4096); // 4GiB
#else
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
size = qMin(size, 1536u);
size = qMin(size, 1536);
#endif
return size;
}
void Session::setDiskCacheSize(uint size)
void Session::setDiskCacheSize(int size)
{
#if defined(__x86_64__) || defined(_M_X64)
size = qMin(size, 4096u); // 4GiB
size = qMin(size, 4096); // 4GiB
#else
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
size = qMin(size, 1536u);
size = qMin(size, 1536);
#endif
if (size != m_diskCacheSize) {
m_diskCacheSize = size;
@@ -3601,4 +3647,32 @@ namespace
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
}
}
#ifdef Q_OS_WIN
QString convertIfaceNameToGuid(const QString &name)
{
// Under Windows XP or on Qt version <= 5.5 'name' will be a GUID already.
QUuid uuid(name);
if (!uuid.isNull())
return uuid.toString().toUpper(); // Libtorrent expects the GUID in uppercase
using PCONVERTIFACENAMETOLUID = NETIO_STATUS (WINAPI *)(const WCHAR *, PNET_LUID);
PCONVERTIFACENAMETOLUID ConvertIfaceNameToLuid = reinterpret_cast<PCONVERTIFACENAMETOLUID>(::GetProcAddress(::GetModuleHandleW(L"Iphlpapi.dll"), "ConvertInterfaceNameToLuidW"));
if (!ConvertIfaceNameToLuid) return QString();
using PCONVERTIFACELUIDTOGUID = NETIO_STATUS (WINAPI *)(const NET_LUID *, GUID *);
PCONVERTIFACELUIDTOGUID ConvertIfaceLuidToGuid = reinterpret_cast<PCONVERTIFACELUIDTOGUID>(::GetProcAddress(::GetModuleHandleW(L"Iphlpapi.dll"), "ConvertInterfaceLuidToGuid"));
if (!ConvertIfaceLuidToGuid) return QString();
NET_LUID luid;
LONG res = ConvertIfaceNameToLuid(name.toStdWString().c_str(), &luid);
if (res == 0) {
GUID guid;
if (ConvertIfaceLuidToGuid(&luid, &guid) == 0)
return QUuid(guid).toString().toUpper();
}
return QString();
}
#endif
}

View File

@@ -279,8 +279,8 @@ namespace BitTorrent
void setIPFilterFile(QString path);
bool announceToAllTrackers() const;
void setAnnounceToAllTrackers(bool val);
uint diskCacheSize() const;
void setDiskCacheSize(uint size);
int diskCacheSize() const;
void setDiskCacheSize(int size);
uint diskCacheTTL() const;
void setDiskCacheTTL(uint ttl);
bool useOSCache() const;
@@ -508,7 +508,7 @@ namespace BitTorrent
CachedSettingValue<bool> m_isTrackerFilteringEnabled;
CachedSettingValue<QString> m_IPFilterFile;
CachedSettingValue<bool> m_announceToAllTrackers;
CachedSettingValue<uint> m_diskCacheSize;
CachedSettingValue<int> m_diskCacheSize;
CachedSettingValue<uint> m_diskCacheTTL;
CachedSettingValue<bool> m_useOSCache;
CachedSettingValue<bool> m_isAnonymousModeEnabled;

View File

@@ -1330,7 +1330,7 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p)
}
qDebug("Torrent is successfully moved from %s to %s", qPrintable(m_oldPath), qPrintable(m_newPath));
if (m_oldPath == m_session->torrentTempPath(hash())) {
if (QDir(m_oldPath) == QDir(m_session->torrentTempPath(hash()))) {
qDebug() << "Removing torrent temp folder:" << m_oldPath;
Utils::Fs::smartRemoveEmptyFolderTree(m_oldPath);
}

View File

@@ -77,8 +77,8 @@ void Connection::read()
break;
case RequestParser::NoError:
Environment env;
env.clientAddress = m_socket->peerAddress();
const Environment env {m_socket->localAddress(), m_socket->localPort(), m_socket->peerAddress(), m_socket->peerPort()};
Response response = m_requestHandler->processRequest(request, env);
if (acceptsGzipEncoding(request.headers["accept-encoding"]))
response.headers[HEADER_CONTENT_ENCODING] = "gzip";

View File

@@ -43,7 +43,7 @@
#include "connection.h"
static const int KEEP_ALIVE_DURATION = 7; // seconds
static const int KEEP_ALIVE_DURATION = 7 * 1000; // milliseconds
static const int CONNECTIONS_LIMIT = 500;
static const int CONNECTIONS_SCAN_INTERVAL = 2; // seconds
@@ -126,7 +126,7 @@ bool Server::setupHttps(const QByteArray &certificates, const QByteArray &key)
{
QSslKey sslKey(key, QSsl::Rsa);
if (sslKey.isNull())
#ifdef QBT_USES_QT5
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
sslKey = QSslKey(key, QSsl::Ec);
#else
{

View File

@@ -37,20 +37,20 @@
namespace Http
{
const char HEADER_CACHE_CONTROL[] = "Cache-Control";
const char HEADER_CONTENT_ENCODING[] = "Content-Encoding";
const char HEADER_CONTENT_LENGTH[] = "Content-Length";
const char HEADER_CONTENT_SECURITY_POLICY[] = "Content-Security-Policy";
const char HEADER_CONTENT_TYPE[] = "Content-Type";
const char HEADER_DATE[] = "Date";
const char HEADER_CACHE_CONTROL[] = "cache-control";
const char HEADER_CONTENT_ENCODING[] = "content-encoding";
const char HEADER_CONTENT_LENGTH[] = "content-length";
const char HEADER_CONTENT_SECURITY_POLICY[] = "content-security-policy";
const char HEADER_CONTENT_TYPE[] = "content-type";
const char HEADER_DATE[] = "date";
const char HEADER_HOST[] = "host";
const char HEADER_ORIGIN[] = "origin";
const char HEADER_REFERER[] = "referer";
const char HEADER_SET_COOKIE[] = "Set-Cookie";
const char HEADER_X_CONTENT_TYPE_OPTIONS[] = "X-Content-Type-Options";
const char HEADER_SET_COOKIE[] = "set-cookie";
const char HEADER_X_CONTENT_TYPE_OPTIONS[] = "x-content-type-options";
const char HEADER_X_FORWARDED_HOST[] = "x-forwarded-host";
const char HEADER_X_FRAME_OPTIONS[] = "X-Frame-Options";
const char HEADER_X_XSS_PROTECTION[] = "X-XSS-Protection";
const char HEADER_X_FRAME_OPTIONS[] = "x-frame-options";
const char HEADER_X_XSS_PROTECTION[] = "x-xss-protection";
const char CONTENT_TYPE_CSS[] = "text/css; charset=UTF-8";
const char CONTENT_TYPE_GIF[] = "image/gif";
@@ -65,7 +65,11 @@ namespace Http
struct Environment
{
QHostAddress localAddress;
quint16 localPort;
QHostAddress clientAddress;
quint16 clientPort;
};
struct UploadedFile

View File

@@ -439,6 +439,16 @@ void Preferences::setWebUiLocalAuthEnabled(bool enabled)
setValue("Preferences/WebUI/LocalHostAuth", enabled);
}
QString Preferences::getServerDomains() const
{
return value("Preferences/WebUI/ServerDomains", "*").toString();
}
void Preferences::setServerDomains(const QString &str)
{
setValue("Preferences/WebUI/ServerDomains", str);
}
quint16 Preferences::getWebUiPort() const
{
return value("Preferences/WebUI/Port", 8080).toInt();

View File

@@ -175,6 +175,8 @@ public:
void setWebUiEnabled(bool enabled);
bool isWebUiLocalAuthEnabled() const;
void setWebUiLocalAuthEnabled(bool enabled);
QString getServerDomains() const;
void setServerDomains(const QString &str);
quint16 getWebUiPort() const;
void setWebUiPort(quint16 port);
bool useUPnPForWebUIPort() const;

View File

@@ -313,11 +313,24 @@ QString Utils::Misc::pythonVersionComplete()
// Software 'Anaconda' installs its own python interpreter
// and `python --version` returns a string like this:
// `Python 3.4.3 :: Anaconda 2.3.0 (64-bit)`
const QList<QByteArray> verSplit = output.split(' ');
if (verSplit.size() > 1) {
version = verSplit.at(1).trimmed();
const QList<QByteArray> outSplit = output.split(' ');
if (outSplit.size() > 1) {
version = outSplit.at(1).trimmed();
Logger::instance()->addMessage(QCoreApplication::translate("misc", "Python version: %1").arg(version), Log::INFO);
}
// If python doesn't report a 3-piece version e.g. 3.6.1
// then fill the missing pieces with zero
const QStringList verSplit = version.split('.', QString::SkipEmptyParts);
if (verSplit.size() < 3) {
for (int i = verSplit.size(); i < 3; ++i) {
if (version.endsWith('.'))
version.append('0');
else
version.append(".0");
}
Logger::instance()->addMessage(QCoreApplication::translate("misc", "Normalized Python version: %1").arg(version), Log::INFO);
}
}
}
return version;

View File

@@ -190,7 +190,9 @@ void AdvancedSettings::saveAdvancedSettings()
void AdvancedSettings::updateCacheSpinSuffix(int value)
{
if (value <= 0)
if (value == 0)
spin_cache.setSuffix(tr(" (disabled)"));
else if (value < 0)
spin_cache.setSuffix(tr(" (auto)"));
else
spin_cache.setSuffix(tr(" MiB"));
@@ -251,7 +253,7 @@ void AdvancedSettings::loadAdvancedSettings()
labelLibtorrentLink.setText(QString("<a href=\"%1\">%2</a>").arg("http://www.libtorrent.org/reference.html").arg(tr("Open documentation")));
labelLibtorrentLink.setOpenExternalLinks(true);
// Disk write cache
spin_cache.setMinimum(0);
spin_cache.setMinimum(-1);
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes.
// These macros may not be available on compilers other than MSVC and GCC
#if defined(__x86_64__) || defined(_M_X64)
@@ -323,7 +325,6 @@ void AdvancedSettings::loadAdvancedSettings()
// https://github.com/qbittorrent/qBittorrent/pull/5135
if (iface.addressEntries().isEmpty()) continue;
if (iface.flags() & QNetworkInterface::IsLoopBack) continue;
combo_iface.addItem(iface.humanReadableName(), iface.name());
if (!current_iface.isEmpty() && (iface.name() == current_iface)) {
combo_iface.setCurrentIndex(i);

View File

@@ -319,6 +319,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->textTrackers, SIGNAL(textChanged()), this, SLOT(enableApplyButton()));
#ifndef DISABLE_WEBUI
// Web UI tab
connect(m_ui->textServerDomains, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(m_ui->checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(m_ui->spinWebUiPort, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton()));
connect(m_ui->checkWebUIUPnP, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
@@ -603,6 +604,7 @@ void OptionsDialog::saveOptions()
// Web UI
pref->setWebUiEnabled(isWebUiEnabled());
if (isWebUiEnabled()) {
pref->setServerDomains(m_ui->textServerDomains->text());
pref->setWebUiPort(webUiPort());
pref->setUPnPForWebUIPort(m_ui->checkWebUIUPnP->isChecked());
pref->setWebUiHttpsEnabled(m_ui->checkWebUiHttps->isChecked());
@@ -975,6 +977,7 @@ void OptionsDialog::loadOptions()
// End Bittorrent preferences
// Web UI preferences
m_ui->textServerDomains->setText(pref->getServerDomains());
m_ui->checkWebUi->setChecked(pref->isWebUiEnabled());
m_ui->spinWebUiPort->setValue(pref->getWebUiPort());
m_ui->checkWebUIUPnP->setChecked(pref->useUPnPForWebUIPort());

View File

@@ -2605,8 +2605,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>438</width>
<height>543</height>
<width>518</width>
<height>602</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
@@ -2622,6 +2622,28 @@
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<widget class="QLabel" name="labelServerDomains">
<property name="text">
<string>Server domains:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="textServerDomains">
<property name="toolTip">
<string>Whitelist for filtering HTTP Host header values.
In order to defend against DNS rebinding attack,
you should put in domain names used by WebUI server.
Use ';' to split multiple entries. Can use wildcard '*'.</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>

View File

@@ -86,7 +86,7 @@ SpeedWidget::SpeedWidget(PropertiesWidget *parent)
m_graphsMenu->addAction(tr("Tracker Download"));
m_graphsMenuActions = m_graphsMenu->actions();
m_graphsSignalMapper = new QSignalMapper();
m_graphsSignalMapper = new QSignalMapper(this);
for (int id = SpeedPlotView::UP; id < SpeedPlotView::NB_GRAPHS; ++id) {
QAction *action = m_graphsMenuActions.at(id);

View File

@@ -28,6 +28,8 @@
#include "abstractwebapplication.h"
#include <algorithm>
#include <QCoreApplication>
#include <QDateTime>
#include <QDebug>
@@ -91,6 +93,9 @@ AbstractWebApplication::AbstractWebApplication(QObject *parent)
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), SLOT(removeInactiveSessions()));
timer->start(60 * 1000); // 1 min.
reloadDomainList();
connect(Preferences::instance(), SIGNAL(changed()), this, SLOT(reloadDomainList()));
}
AbstractWebApplication::~AbstractWebApplication()
@@ -115,7 +120,7 @@ Http::Response AbstractWebApplication::processRequest(const Http::Request &reque
header(Http::HEADER_CONTENT_SECURITY_POLICY, "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none';");
// block cross-site requests
if (isCrossSiteRequest(request_)) {
if (isCrossSiteRequest(request_) || !validateHostHeader(request_, env, domainList)) {
status(401, "Unauthorized");
return response();
}
@@ -153,6 +158,12 @@ void AbstractWebApplication::removeInactiveSessions()
}
}
void AbstractWebApplication::reloadDomainList()
{
domainList = Preferences::instance()->getServerDomains().split(';', QString::SkipEmptyParts);
std::for_each(domainList.begin(), domainList.end(), [](QString &entry){ entry = entry.trimmed(); });
}
bool AbstractWebApplication::sessionInitialize()
{
if (session_ == 0)
@@ -391,14 +402,14 @@ bool AbstractWebApplication::isCrossSiteRequest(const Http::Request &request) co
&& (left.host() == right.host()));
};
const QString targetOrigin = request.headers.value(Http::HEADER_X_FORWARDED_HOST, request.headers[Http::HEADER_HOST]);
const QString targetOrigin = request.headers.value(Http::HEADER_X_FORWARDED_HOST, request.headers.value(Http::HEADER_HOST));
const QString originValue = request.headers.value(Http::HEADER_ORIGIN);
const QString refererValue = request.headers.value(Http::HEADER_REFERER);
if (originValue.isEmpty() && refererValue.isEmpty()) {
if ((request.path == QLatin1String("/")) || (request.path == QLatin1String("/favicon.ico")))
return false; // normal request
return true;
// owasp.org recommends to block this request, but doing so will inevitably lead Web API users to spoof headers
// so lets be permissive here
return false;
}
// sent with CORS requests, as well as with POST requests
@@ -411,6 +422,44 @@ bool AbstractWebApplication::isCrossSiteRequest(const Http::Request &request) co
return true;
}
bool AbstractWebApplication::validateHostHeader(const Http::Request &request, const Http::Environment &env, const QStringList &domains) const
{
const QUrl hostHeader = QUrl::fromUserInput(request.headers.value(Http::HEADER_HOST));
// (if present) try matching host header's port with local port
const int requestPort = hostHeader.port();
if ((requestPort != -1) && (env.localPort != requestPort))
return false;
// try matching host header with local address
const QString requestHost = hostHeader.host();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
const bool sameAddr = env.localAddress.isEqual(QHostAddress(requestHost));
#else
const auto equal = [](const Q_IPV6ADDR &l, const Q_IPV6ADDR &r) -> bool {
for (int i = 0; i < 16; ++i) {
if (l[i] != r[i])
return false;
}
return true;
};
const bool sameAddr = equal(env.localAddress.toIPv6Address(), QHostAddress(requestHost).toIPv6Address());
#endif
if (sameAddr)
return true;
// try matching host header with domain list
for (const auto &domain : domains) {
QRegExp domainRegex(domain, Qt::CaseInsensitive, QRegExp::Wildcard);
if (requestHost.contains(domainRegex))
return true;
}
return false;
}
QStringMap AbstractWebApplication::initializeContentTypeByExtMap()
{
QStringMap map;
@@ -432,7 +481,7 @@ QStringMap AbstractWebApplication::parseCookie(const Http::Request &request) con
// [rfc6265] 4.2.1. Syntax
QStringMap ret;
const QString cookieStr = request.headers.value(QLatin1String("cookie"));
#ifdef QBT_USES_QT5
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
const QVector<QStringRef> cookies = cookieStr.splitRef(';', QString::SkipEmptyParts);
#else
const QStringList cookies = cookieStr.split(';', QString::SkipEmptyParts);
@@ -442,7 +491,7 @@ QStringMap AbstractWebApplication::parseCookie(const Http::Request &request) con
const int idx = cookie.indexOf('=');
if (idx < 0)
continue;
#ifdef QBT_USES_QT5
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
const QString name = cookie.left(idx).trimmed().toString();
const QString value = Utils::String::unquote(cookie.mid(idx + 1).trimmed())
.toString();

Some files were not shown because too many files have changed in this diff Show More