Skip to content

Commit

Permalink
WIP: force disable proxy on sockets
Browse files Browse the repository at this point in the history
Checking if this changes anything about the problems in #1360. Only
building the Windows 64 bit portable ZIP here for testing purposes.
  • Loading branch information
askmeaboutlo0m committed Aug 14, 2024
1 parent c55d90b commit f9b271c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 294 deletions.
248 changes: 0 additions & 248 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,207 +43,6 @@ jobs:
# There's ways to deduplicate these includes, but any mistake causes
# utterly confounding errors, so just explicitly specify each target.
include:
- os: ubuntu-20.04
cross_os: ''
component: ''
qt: 5.15.14
arch: x86_64
sccache_triplet: x86_64-unknown-linux-musl
build_flags: -DINITSYS=systemd -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja
build_type: Release
collect_symbols: false
# This causes the AppImage to be generated, instead of just creating
# the portable tree, because there seems to be no way to separate
# these steps with linuxdeploy
# Even though the svg component is linked explicitly,
# linuxdeploy-plugin-qt does not seem to notice and so does not
# export the iconengine if it is not told that we really, really
# want svg plugins please
packager: >-
EXTRA_QT_PLUGINS="svg;"
VERSION="${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe)' }}"
cmake --install build --config Release
# The runner has multiple clang versions installed and CMake/Qt gets
# confused about which one to pick for some reason, so this also
# sets Clang_ROOT during the Qt build
qt_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev
libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev
libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev
libxext-dev libxfixes-dev libxrender-dev libx11-dev
libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev
libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev
libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev
libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev
libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev
libxcb-util-dev libinput-dev libvulkan-dev
libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev
libasound2-dev libpulse-dev libcups2-dev libssl-dev
libfontconfig1-dev &&
echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV
ffmpeg_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
nasm yasm
other_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
libsecret-1-dev
- os: ubuntu-20.04
cross_os: Android
component: ''
qt: 5.15.14
arch: arm64
sccache_triplet: x86_64-unknown-linux-musl
build_type: Release
collect_symbols: false
packager: cmake --install build --config Release --prefix .
cross_qt_args: >-
"-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
"-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT"
"-DANDROID_HOST_PATH=$GITHUB_WORKSPACE/.github/deps/qt"
-DANDROID_ABI=arm64-v8a
cross_ffmpeg_args: >-
"-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake"
"-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
"-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT"
-DANDROID_PLATFORM=android-23
-DANDROID_ABI=arm64-v8a
cross_other_args: >-
"-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake"
"-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
"-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT"
-DANDROID_PLATFORM=android-23
-DANDROID_ABI=arm64-v8a
build_flags: >-
"-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake"
-DANDROID_PLATFORM=android-23
-DANDROID_ABI=arm64-v8a
-DANDROID_SDK_PLATFORM=android-31
-DANDROID_SDK_BUILD_TOOLS_REVISION=34.0.0
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH
# The runner has multiple clang versions installed and CMake/Qt gets
# confused about which one to pick for some reason, so this also
# sets Clang_ROOT during the Qt build
qt_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev
libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev
libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev
libxext-dev libxfixes-dev libxrender-dev libx11-dev
libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev
libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev
libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev
libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev
libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev
libxcb-util-dev libinput-dev libvulkan-dev
libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev
libasound2-dev libpulse-dev libcups2-dev libssl-dev
libfontconfig1-dev &&
echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV
ffmpeg_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
yasm
other_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
libsecret-1-dev
- os: ubuntu-20.04
cross_os: Android
component: ''
qt: 5.15.14
arch: arm32
sccache_triplet: x86_64-unknown-linux-musl
build_type: Release
collect_symbols: false
packager: cmake --install build --config Release --prefix .
cross_qt_args: >-
"-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
"-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT"
"-DANDROID_HOST_PATH=$GITHUB_WORKSPACE/.github/deps/qt"
-DANDROID_ABI=armeabi-v7a
cross_ffmpeg_args: >-
"-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake"
"-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
"-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT"
-DANDROID_PLATFORM=android-23
-DANDROID_ABI=armeabi-v7a
cross_other_args: >-
"-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake"
"-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
"-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT"
-DANDROID_PLATFORM=android-23
-DANDROID_ABI=armeabi-v7a
build_flags: >-
"-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake"
-DANDROID_PLATFORM=android-23
-DANDROID_ABI=armeabi-v7a
-DANDROID_SDK_PLATFORM=android-31
-DANDROID_SDK_BUILD_TOOLS_REVISION=34.0.0
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH
# The runner has multiple clang versions installed and CMake/Qt gets
# confused about which one to pick for some reason, so this also
# sets Clang_ROOT during the Qt build
qt_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev
libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev
libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev
libxext-dev libxfixes-dev libxrender-dev libx11-dev
libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev
libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev
libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev
libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev
libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev
libxcb-util-dev libinput-dev libvulkan-dev
libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev
libasound2-dev libpulse-dev libcups2-dev libssl-dev
libfontconfig1-dev &&
echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV
ffmpeg_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
yasm
other_pre_build: >
sudo apt-get update &&
sudo apt-get install --no-install-recommends
libsecret-1-dev
- os: macos-13
cross_os: ''
component: ''
qt: 6.7.2
arch: x86_64
build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja
build_type: Release
collect_symbols: false
sccache_triplet: x86_64-apple-darwin
packager: cpack --verbose --config build/CPackConfig.cmake -C Release

- os: macos-14
cross_os: ''
component: ''
qt: 6.7.2
arch: arm64
build_flags: -DBUILD_PACKAGE_SUFFIX=arm64 -G Ninja
build_type: Release
collect_symbols: false
sccache_triplet: aarch64-apple-darwin
packager: cpack --verbose --config build/CPackConfig.cmake -C Release

- os: windows-latest
cross_os: ''
component: ''
Expand All @@ -252,30 +51,6 @@ jobs:
sccache_triplet: x86_64-pc-windows-msvc
build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja
build_type: RelWithDebInfo
collect_symbols: true
qt_pre_build: >
choco install gperf jom winflexbison3 &&
New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe &&
New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe
ffmpeg_pre_build: >
choco install yasm
# Copying files is a disgusting hack because windeployqt does not
# search PATH to find DLLs and it gets confused by QtKeychain having
# a Qt prefix and thinks it is part of Qt and tries to process it
# and fails if it is not in the Qt bin directory with the rest of
# them
packager: >
cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin &&
cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo
- os: windows-latest
cross_os: ''
component: 'Tools'
qt: 5.15.14
arch: x86_64
sccache_triplet: x86_64-pc-windows-msvc
build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja
build_type: RelWithDebInfo
collect_symbols: false
qt_pre_build: >
choco install gperf jom winflexbison3 &&
Expand All @@ -292,29 +67,6 @@ jobs:
cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin &&
cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo
- os: windows-latest
qt: 5.15.14
arch: x86
sccache_triplet: x86_64-pc-windows-msvc
build_flags: -DCARGO_TRIPLE=i686-pc-windows-msvc -DBUILD_PACKAGE_SUFFIX=x86 -G Ninja
build_type: RelWithDebInfo
collect_symbols: false
qt_pre_build: >
choco install gperf jom winflexbison3 &&
New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe &&
New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe
ffmpeg_pre_build: >
choco install yasm
# Copying files is a disgusting hack because windeployqt does not
# search PATH to find DLLs and it gets confused by QtKeychain having
# a Qt prefix and thinks it is part of Qt and tries to process it
# and fails if it is not in the Qt bin directory with the rest of
# them
packager: >
cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin &&
cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
47 changes: 1 addition & 46 deletions cmake/DrawpilePackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,7 @@ elseif(WIN32)
# work with CPack
set(CPACK_MONOLITHIC_INSTALL TRUE)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
if(CLIENT)
set(CPACK_GENERATOR ZIP WIX)
set(CPACK_WIX_UPGRADE_GUID DC47B534-E365-4054-85F0-2E7C6CCB76CC)
set(CPACK_WIX_PRODUCT_ICON "${PROJECT_SOURCE_DIR}/src/desktop/icons/drawpile.ico")
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT ${PROJECT_HOMEPAGE_URL})
set(CPACK_WIX_PROPERTY_ARPURLUPDATEINFO ${PROJECT_HOMEPAGE_URL}/download/)
set(CPACK_WIX_PROPERTY_ARPHELPLINK ${PROJECT_HOMEPAGE_URL}/help/)

# CMake didn't set the install scope properly. They "fixed" this in
# version 3.29. Unfortunately, this causes the installer to no longer
# be compatible with previous installs, leading to updates becoming
# impossible! It'll check if the application is already installed,
# notice that the existing install is per-user while the new one is
# per-machine and then MSI in all its wisdom will just install the
# application halfway a second time and not replace any files, leading
# to the user having multiple desktop shortcuts and start menu entries
# and aaargh it hurts. I don't know if there's a way around this, but
# for now, we're reverting to the old, now-deprecated behavior, because
# that actually works. Yeah it won't create start menu shortcuts
# properly if you have multiple users on your machine, but that's such
# a niche use case that supporting it really doesn't matter. See
# https://gitlab.kitware.com/cmake/cmake/-/issues/20962
set(CPACK_WIX_INSTALL_SCOPE NONE)

include(DrawpileFileExtensions)
get_wix_extensions("${PROJECT_NAME}" "drawpile.exe" WIX_DRAWPILE_PROGIDS)
if(MSVC)
math(EXPR WIX_DRAWPILE_TOOLSET_VERSION_MAJOR "${MSVC_TOOLSET_VERSION} / 10")
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CPACK_WIX_ARCHITECTURE x86)
else()
set(CPACK_WIX_ARCHITECTURE x64)
endif()
message(STATUS "Configuring ${CPACK_WIX_ARCHITECTURE} installer")
configure_file("pkg/installer-${CPACK_WIX_ARCHITECTURE}.wix.in" pkg/installer.wix)

set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/pkg/installer.wix")
if(HAVE_CODE_SIGNING)
message(STATUS "Will sign installer executable")
set(CPACK_POST_BUILD_SCRIPTS "${PROJECT_SOURCE_DIR}/pkg/SignWindowsInstaller.cmake")
endif()
else()
set(CPACK_GENERATOR ZIP)
endif()
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_COMPONENTS_ALL drawpile drawpile-srv tools i18n)
endif()
Expand Down
2 changes: 2 additions & 0 deletions src/libclient/net/tcpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "libshared/net/tcpmessagequeue.h"
#include "libshared/util/qtcompat.h"
#include <QDebug>
#include <QNetworkProxy>
#include <QSslConfiguration>
#include <QSslSocket>

Expand All @@ -14,6 +15,7 @@ TcpServer::TcpServer(int timeoutSecs, Client *client)
: Server(client)
{
m_socket = new QSslSocket(this);
m_socket->setProxy(QNetworkProxy::NoProxy);
m_socket->setSocketOption(QAbstractSocket::LowDelayOption, true);

QSslConfiguration sslconf = m_socket->sslConfiguration();
Expand Down
2 changes: 2 additions & 0 deletions src/libserver/sslserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "libserver/sslserver.h"
#include <QFile>
#include <QFileInfo>
#include <QNetworkProxy>
#include <QSslCipher>
#include <QSslConfiguration>
#include <QSslSocket>
Expand Down Expand Up @@ -182,6 +183,7 @@ void SslServer::incomingConnection(qintptr handle)
}

QSslSocket *socket = new QSslSocket(this);
socket->setProxy(QNetworkProxy::NoProxy);
socket->setSocketOption(QAbstractSocket::LowDelayOption, true);
socket->setSocketDescriptor(handle);
socket->setLocalCertificateChain(m_certchain);
Expand Down

0 comments on commit f9b271c

Please sign in to comment.