Skip to content

Commit

Permalink
v2.14.6
Browse files Browse the repository at this point in the history
  • Loading branch information
bernerdad committed Feb 24, 2025
1 parent b477b15 commit ad39f6d
Show file tree
Hide file tree
Showing 23 changed files with 98 additions and 68 deletions.
23 changes: 21 additions & 2 deletions backend/mac/helper/firewallcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ bool FirewallController::enable(const std::string &rules, const std::string &tab
write(fd, rules.c_str(), rules.length());
close(fd);

enabled_ = true;

if (table.empty() && group.empty()) {
Utils::executeCommand("/sbin/pfctl", {"-v", "-F", "all", "-f", "/etc/windscribe/pf.conf"});
Utils::executeCommand("/sbin/pfctl", {"-e"});
updateDns();
} else if (!table.empty()) {
Utils::executeCommand("/sbin/pfctl", {"-T", "load", "-f", "/etc/windscribe/pf.conf"});
} else if (!group.empty()) {
Utils::executeCommand("/sbin/pfctl", {"-a", group.c_str(), "-f", "/etc/windscribe/pf.conf"});
}

enabled_ = true;
return true;
}

Expand Down Expand Up @@ -69,4 +71,21 @@ bool FirewallController::enabled()

Utils::executeCommand("/sbin/pfctl", {"-si"}, &output);
return (output.find("Status: Enabled") != std::string::npos);
}
}

void FirewallController::setVpnDns(const std::string &dns)
{
spdlog::info("Setting VPN dns: {}", dns.empty() ? "empty" : dns);
windscribeDns_ = dns;
updateDns();
}

void FirewallController::updateDns()
{
if (enabled_ && !windscribeDns_.empty()) {
std::string rules = "table <windscribe_dns> persist { " + windscribeDns_ + "}\n";
enable(rules, "windscribe_dns", "");
} else {
Utils::executeCommand("/sbin/pfctl", {"-T", "windscribe_dns", "flush"});
}
}
3 changes: 3 additions & 0 deletions backend/mac/helper/firewallcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ class FirewallController
bool enabled();
void disable(bool keepPfEnabled = false);
void getRules(const std::string &table, const std::string &group, std::string *outRules);
void setVpnDns(const std::string &dns);

private:
FirewallController();
~FirewallController();
void updateDns();

bool enabled_;
std::string windscribeDns_;
};
8 changes: 1 addition & 7 deletions backend/mac/helper/process_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,7 @@ CMD_ANSWER sendConnectStatus(boost::archive::text_iarchive &ia)
CMD_SEND_CONNECT_STATUS cmd;
ia >> cmd;

// We need to add/remove the Connected DNS server to the firewall
if (cmd.isConnected) {
std::string pf = "table <windscribe_dns> persist { " + cmd.vpnAdapter.dnsServers.front() + "}\n";
FirewallController::instance().enable(pf, "windscribe_dns", "");
} else {
Utils::executeCommand("pfctl", {"-T", "windscribe_dns", "flush"});
}
FirewallController::instance().setVpnDns(cmd.isConnected ? cmd.vpnAdapter.dnsServers.front() : "");
RoutesManager::instance().setConnectStatus(cmd);

answer.executed = 1;
Expand Down
6 changes: 0 additions & 6 deletions backend/mac/splittunnelextension/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,3 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../provisioning_profile/splittunnelextens
add_custom_command(TARGET com.windscribe.client.splittunnelextension POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/../provisioning_profile/splittunnelextension.provisionprofile" $<TARGET_FILE_DIR:com.windscribe.client.splittunnelextension>/../embedded.provisionprofile)
endif()

# Install rules
install(TARGETS com.windscribe.client.splittunnelextension
BUNDLE DESTINATION .
COMPONENT Runtime
)
4 changes: 2 additions & 2 deletions backend/mac/splittunnelextension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>SYSX</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>1.0.1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NetworkExtension</key>
Expand Down
1 change: 1 addition & 0 deletions backend/windows/windscribe_install_helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ add_compile_options("$<$<CONFIG:Release>:/Zi>")
add_link_options("$<$<CONFIG:Release>:/DEBUG>" "$<$<CONFIG:Release>:/OPT:REF>" "$<$<CONFIG:Release>:/OPT:ICF>")

add_executable(WindscribeInstallHelper ${SOURCES})
set_property(TARGET WindscribeInstallHelper PROPERTY LINK_FLAGS "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"")

target_include_directories(WindscribeInstallHelper
PRIVATE
Expand Down
17 changes: 17 additions & 0 deletions client/common/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2.14.6 (24/02/2025)
All:
* Added extended cleanup logs in wsnet. #1250
* Improved initialization and preferences animations. #1260
* Improved the log frequency [wsnet]. #1269
* Fixed inconsistent behavior when starting app and 'close to tray' is enabled. #1280
* Fixed window size after dismissing alert at the login window. #1282
Windows:
* Fixed Windows error message box may be displayed when reinstalling deleted/disabled Windscribe service. #1266
MacOS:
* Fixed split tunnel extension versioning. #45
* Fixed DNS no longer allowed by firewall if toggled while connected. #1277
Linux:
* Fixed split tunnel rule in exclusive mode. #1267
* Fixed window size is incorrect after expanding then collapsing preferences. #1271


2.14.5 (12/02/2025)
All:
* Fixed mangled ar/fa translations. #1268
Expand Down
5 changes: 5 additions & 0 deletions client/common/utils/log/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ void Logger::myMessageHandler(QtMsgType type, const QMessageLogContext &context,
}
}

#ifdef Q_OS_WIN
// Uncomment this line if you want to see app output in the debugger.
//::OutputDebugString(qUtf16Printable(s + '\n'));
#endif

std::string escapedMsg = log_utils::escape_string(s.toStdString());
static const std::string fmt = "\"mod\": \"{}\", \"msg\": \"{}\"";
if (type == QtDebugMsg)
Expand Down
2 changes: 1 addition & 1 deletion client/common/utils/log/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ QString paths::serviceLogLocation(bool previous)

QString paths::wireguardServiceLogLocation(bool previous)
{
#if defined(Q_OS_WINDOWS)
#if defined(Q_OS_WIN)
return qApp->applicationDirPath() + addPreviousSuffix("/wireguard_service.log", previous);
#else
return "";
Expand Down
2 changes: 1 addition & 1 deletion client/common/version/windscribe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#define WINDSCRIBE_MAJOR_VERSION 2
#define WINDSCRIBE_MINOR_VERSION 14
#define WINDSCRIBE_BUILD_VERSION 5
#define WINDSCRIBE_BUILD_VERSION 6

// only one of these should be enabled; neither -> stable
//#define WINDSCRIBE_IS_BETA
Expand Down
4 changes: 2 additions & 2 deletions client/engine/engine/helper/installhelper_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ bool executeInstallHelperCmd()
sinfo.cbSize = sizeof(SHELLEXECUTEINFO);
sinfo.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_NOCLOSEPROCESS;
sinfo.hwnd = NULL;
sinfo.lpFile = installHelperExe.toStdWString().c_str();
sinfo.lpFile = qUtf16Printable(installHelperExe);
sinfo.lpParameters = L"/InstallService";
sinfo.lpVerb = L"runas";
sinfo.lpVerb = L"open";
sinfo.nShow = SW_HIDE;

if (ShellExecuteEx(&sinfo)) {
Expand Down
8 changes: 4 additions & 4 deletions client/gui/application/singleappinstance.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "singleappinstance.h"
#include "singleappinstance_p.h"

#if defined(Q_OS_WINDOWS)
#if defined(Q_OS_WIN)
#include <tchar.h>
#include "utils/winutils.h"
#else
Expand All @@ -26,7 +26,7 @@ SingleAppInstancePrivate::~SingleAppInstancePrivate()

bool SingleAppInstancePrivate::activateRunningInstance()
{
#if defined(Q_OS_WINDOWS)
#if defined(Q_OS_WIN)

HWND hwnd = WinUtils::appMainWindowHandle();
if (hwnd) {
Expand Down Expand Up @@ -72,7 +72,7 @@ bool SingleAppInstancePrivate::activateRunningInstance()

bool SingleAppInstancePrivate::isRunning()
{
#if defined(Q_OS_WINDOWS)
#if defined(Q_OS_WIN)

if (!appSingletonObj_.isValid())
{
Expand Down Expand Up @@ -125,7 +125,7 @@ bool SingleAppInstancePrivate::isRunning()

void SingleAppInstancePrivate::release()
{
#if defined(Q_OS_WINDOWS)
#if defined(Q_OS_WIN)
appSingletonObj_.closeHandle();
#else
localServer_.close();
Expand Down
4 changes: 2 additions & 2 deletions client/gui/application/singleappinstance_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <QObject>

#if defined(Q_OS_WINDOWS)
#if defined(Q_OS_WIN)
#include "utils/win32handle.h"
#else
#include <QLockFile>
Expand All @@ -27,7 +27,7 @@ class SingleAppInstancePrivate : public QObject
void anotherInstanceRunning();

private:
#if defined(Q_OS_WINDOWS)
#if defined(Q_OS_WIN)
wsl::Win32Handle appSingletonObj_;
#else
QString socketName_;
Expand Down
5 changes: 3 additions & 2 deletions client/gui/commongraphics/resizablewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ int ResizableWindow::maximumHeight()
return preferences_->appSkin() == APP_SKIN_VAN_GOGH ? maxHeight_ - kVanGoghOffset : maxHeight_;
}

void ResizableWindow::setHeight(int height)
void ResizableWindow::setHeight(int height, bool ignoreMinimum)
{
if (height < minimumHeight()*G_SCALE) {
// Callers may set ignoreMinimum to true for transient animations.
if (!ignoreMinimum && height < minimumHeight()*G_SCALE) {
height = minimumHeight()*G_SCALE;
} else if (height > maximumHeight()*G_SCALE) {
height = maximumHeight()*G_SCALE;
Expand Down
2 changes: 1 addition & 1 deletion client/gui/commongraphics/resizablewindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ResizableWindow : public ScalableGraphicsObject
void setMaximumHeight(int height);
int maximumHeight();
void setXOffset(int x);
void setHeight(int height);
void setHeight(int height, bool ignoreMinimum = false);
void setScrollBarVisibility(bool on);
void updateScaling() override;
int scrollPos();
Expand Down
24 changes: 0 additions & 24 deletions client/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,34 +457,10 @@ void MainWindow::showAfterLaunch()
bool showAppMinimized = false;

if (backend_ && backend_->getPreferences()->isStartMinimized()) {
showAppMinimized = true;
}
#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
else if (backend_ && backend_->getPreferences()->isMinimizeAndCloseToTray()) {
QCommandLineParser cmdParser;
cmdParser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
QCommandLineOption osRestartOption("os_restart");
cmdParser.addOption(osRestartOption);
cmdParser.process(*WindscribeApplication::instance());
if (cmdParser.isSet(osRestartOption)) {
showAppMinimized = true;
}
}
#endif

if (showAppMinimized) {
// Set active state to false; this affects the first click of the dock icon after launch if the app is docked.
// This state is 'true' by default, and if left as is, the first click of the dock icon will not activate the app.
activeState_ = false;
#ifdef Q_OS_WIN
// showMinimized, as of Qt 6.3.1, on Windows does not work. The app is displayed (shown)
// and all user input is disabled until ones clicks on the taskbar icon or alt-tabs back
// to the app.
show();
QTimer::singleShot(50, this, &MainWindow::onMinimizeClick);
#else
showMinimized();
#endif
}
else {
show();
Expand Down
24 changes: 14 additions & 10 deletions client/gui/mainwindowcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ void MainWindowController::gotoLoginWindow()
loginWindow_->setClickable(true);
loginWindow_->setFocus();
isAtomicAnimationActive_ = false;
updateMainAndViewGeometry(true);
handleNextWindowChange();
});

Expand Down Expand Up @@ -2344,7 +2345,7 @@ void MainWindowController::expandPreferencesFromLogin()
animResize->setEndValue(target);
animResize->setDuration(EXPAND_PREFERENCES_RESIZE_DURATION);
connect(animResize, &QVariantAnimation::valueChanged, [this](const QVariant &value) {
preferencesWindow_->setHeight(value.toInt());
preferencesWindow_->setHeight(value.toInt(), true);
updateMainAndViewGeometry(false);
shadowManager_->changeRectangleSize(ShadowManager::SHAPE_ID_PREFERENCES,
QRect(0, childWindowShadowOffsetY(true), preferencesWindow_->boundingRect().width(),
Expand Down Expand Up @@ -2414,7 +2415,7 @@ void MainWindowController::expandWindow(ResizableWindow *window)
}
}
int target = windowSizeManager_->windowHeight(window)*G_SCALE;
window->setHeight(start);
window->setHeight(start, true);

window->setScrollBarVisibility(false);
window->setOpacity(0.0);
Expand Down Expand Up @@ -2445,7 +2446,7 @@ void MainWindowController::expandWindow(ResizableWindow *window)
animResize->setEndValue(target);
animResize->setDuration(windowSizeManager_->resizeDurationMs(window));
connect(animResize, &QVariantAnimation::valueChanged, [this, window](const QVariant &value) {
window->setHeight(value.toInt());
window->setHeight(value.toInt(), true);
updateMainAndViewGeometry(false);
shadowManager_->changeRectangleSize(windowSizeManager_->shapeId(window),
QRect(0,
Expand Down Expand Up @@ -2575,7 +2576,7 @@ void MainWindowController::collapsePreferencesFromLogin()
animResize->setEndValue((int)loginWindow_->boundingRect().height());
animResize->setDuration(EXPAND_PREFERENCES_RESIZE_DURATION);
connect(animResize, &QVariantAnimation::valueChanged, [this](const QVariant &value) {
preferencesWindow_->setHeight(value.toInt());
preferencesWindow_->setHeight(value.toInt(), true);
shadowManager_->changeRectangleSize(ShadowManager::SHAPE_ID_NEWS_FEED,
QRect(0, childWindowShadowOffsetY(true), preferencesWindow_->boundingRect().width(),
preferencesWindow_->boundingRect().height() - childWindowShadowOffsetY(false)));
Expand Down Expand Up @@ -2651,7 +2652,7 @@ void MainWindowController::collapseWindow(ResizableWindow *window, bool bSkipBot
animResize->setEndValue(target);
animResize->setDuration(windowSizeManager_->resizeDurationMs(window));
connect(animResize, &QVariantAnimation::valueChanged, [this, window](const QVariant &value) {
window->setHeight(value.toInt());
window->setHeight(value.toInt(), true);
updateMainAndViewGeometry(false);
shadowManager_->changeRectangleSize(windowSizeManager_->shapeId(window),
QRect(0,
Expand Down Expand Up @@ -3056,7 +3057,7 @@ void MainWindowController::updateMainAndViewGeometry(bool updateShadow)
getGraphicsRegionWidthAndHeight(width, height, addHeightToGeometry);

int shadowSize = shadowManager_->getShadowMargin();
int widthWithShadow = width + shadowSize * 2;
int widthWithShadow = width + shadowSize * 2;
int heightWithShadow = height + shadowSize * 2 + addHeightToGeometry;

QRect geo = QRect(mainWindow_->pos().x(), mainWindow_->pos().y(), widthWithShadow, heightWithShadow);
Expand Down Expand Up @@ -3107,16 +3108,17 @@ void MainWindowController::updateMainAndViewGeometry(bool updateShadow)

}

// qDebug() << "Updating mainwindow geo: " << geo;
mainWindow_->setGeometry(geo);
#ifdef Q_OS_LINUX
// This is a workaround for #930. In some DEs on Linux, if the window is completely occluded by another,
// the above setGeometry() does not actually resize the window. Force the window to resize by setting a minimum size.
// the below setGeometry() does not actually resize the window. Force the window to resize by setting a minimum size.
// Only do this if updateShadow is true, since doing this on every animation frame may make it seem jittery.
if (updateShadow) {
mainWindow_->setMinimumSize(geo.width(), geo.height());
}
#endif

// qDebug() << "Updating mainwindow geo: " << geo;
mainWindow_->setGeometry(geo);
updateViewAndScene(width, height, shadowSize, updateShadow);
}

Expand Down Expand Up @@ -3284,7 +3286,9 @@ void MainWindowController::keepWindowInsideScreenCoordinates()
bottom = std::max(bottom, screen->availableGeometry().bottom());
}

if (rcWindow.bottom() > bottom) {
// Subtract the shadow margin to match how taskbarAwareDockedGeometry_win calculates it.
// If we don't subtract the shadow margin, the window will move up slightly after being shown.
if (rcWindow.bottom() - shadowManager_->getShadowMargin() > bottom) {
// qDebug() << "KEEPING MAINWINDOW INSIDE SCREEN COORDINATES";
rcWindow.moveBottom(bottom);
mainWindow_->setGeometry(rcWindow);
Expand Down
2 changes: 0 additions & 2 deletions installer/linux/common/etc/windscribe/cgroups-up
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ if [ ! -f "$net_cls_root/windscribe/net_cls.classid" ]; then
echo "$netclass" > "$net_cls_root/windscribe/net_cls.classid"
fi

if [ "$mode" == "inclusive" ]; then
# Allow IP rules to consult main routing table first, ignoring /0 or /1 routes
ip rule add priority 16383 table main suppress_prefixlength 1
priority="`ip rule show | grep 51820 | cut -d ":" -f1`" # priority of WireGuard rule, if it exists
Expand All @@ -76,7 +75,6 @@ else
# For non-WG protocols, remove rule forcing other traffic into the tunnel
ip rule del priority 16385 table windscribe_include
fi
fi

# make sure to exit with code 0 since an above command may fail if we are adding a duplicate rule or
# deleting a non-existent rule; these are not errors
Expand Down
2 changes: 2 additions & 0 deletions libs/wsnet/src/dnsresolver/dnsresolver_cares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ DnsResolver_cares::DnsResolver_cares() : curRequestId_(0)

DnsResolver_cares::~DnsResolver_cares()
{
g_logger->info("DnsResolver_cares destructor started");
finish_ = true;
condition_.notify_all();
thread_.join();
g_logger->info("DnsResolver_cares destructor finished");
}

bool DnsResolver_cares::init()
Expand Down
Loading

0 comments on commit ad39f6d

Please sign in to comment.