Skip to content

Commit

Permalink
2.21.8
Browse files Browse the repository at this point in the history
  • Loading branch information
AirVPN committed May 26, 2022
1 parent 9795909 commit 1c5e45f
Show file tree
Hide file tree
Showing 34 changed files with 127 additions and 144 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### Eddie - OpenVPN UI
### Eddie - OpenVPN/WireGuard UI with additional user-friendly features. Open-Source, GPLv3, Developed by AirVPN

Refer to https://eddie.website for any information about this project (including instructions on usage, compilation and installation).
Binary file removed deploy/linux_aarch64/libayatana-appindicator.so.1
Binary file not shown.
Binary file removed deploy/linux_aarch64/libayatana-indicator.so.7
Binary file not shown.
Binary file removed deploy/linux_aarch64/libdbusmenu-gtk.so.4
Binary file not shown.
Binary file removed deploy/linux_armv7l/libayatana-appindicator.so.1
Binary file not shown.
Binary file removed deploy/linux_armv7l/libayatana-indicator.so.7
Binary file not shown.
Binary file removed deploy/linux_armv7l/libdbusmenu-gtk.so.4
Binary file not shown.
Binary file removed deploy/linux_x64/libayatana-appindicator.so.1
Binary file not shown.
Binary file removed deploy/linux_x64/libayatana-indicator.so.7
Binary file not shown.
Binary file removed deploy/linux_x64/libdbusmenu-gtk.so.4
Binary file not shown.
Binary file removed deploy/linux_x86/libayatana-appindicator.so.1
Binary file not shown.
Binary file removed deploy/linux_x86/libayatana-indicator.so.7
Binary file not shown.
Binary file removed deploy/linux_x86/libdbusmenu-gtk.so.4
Binary file not shown.
1 change: 0 additions & 1 deletion repository/linux_arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Based on work by Uncle Hunto <unclehunto äτ ÝãΗ00 Ð0τ ÇÖΜ> and Beini <bane aτ iki dot fi>

# Current issues:
# - eddie-tray don't build, depend on Community package libappindicator-gtk2
# - msbuild vs xbuild
# - target framework not v4.8

Expand Down
7 changes: 3 additions & 4 deletions repository/linux_arch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ CONFIG=Release
SCRIPTDIR=$(dirname $(realpath -s $0))
ARCH=$($SCRIPTDIR/../linux_common/get-arch.sh)
VERSION=$($SCRIPTDIR/../linux_common/get-version.sh)
#VERSIONSTABLE="2.18.9"
VERSIONSTABLE=$(curl --silent "https://api.github.com/repos/AirVPN/Eddie/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')

TARGETDIR=/tmp/eddie_deploy/eddie-${PROJECT}_${VERSION}_linux_${ARCH}_arch
Expand Down Expand Up @@ -51,7 +50,7 @@ function arch_env() {
sed -i "s|{@pkgdepends}|(mono openvpn sudo)|g" PKGBUILD
else
sed -i "s|{@pkgdesc}|Eddie - VPN tunnel - UI - prebuilt|g" PKGBUILD
sed -i "s|{@pkgdepends}|(mono openvpn sudo desktop-file-utils libnotify libappindicator-gtk2 patchelf)|g" PKGBUILD
sed -i "s|{@pkgdepends}|(mono openvpn sudo desktop-file-utils libnotify libayatana-appindicator patchelf)|g" PKGBUILD
fi
sed -i "s|{@source}|git+file:///$2/|g" PKGBUILD
sed -i "s|cd \"Eddie-\$pkgver\"|cd \"eddie-air\"|g" PKGBUILD
Expand All @@ -74,7 +73,7 @@ function arch_env() {
sed -i "s|{@pkgdepends}|(mono openvpn sudo)|g" PKGBUILD
else
sed -i "s|{@pkgdesc}|Eddie - VPN tunnel - UI - beta|g" PKGBUILD
sed -i "s|{@pkgdepends}|(mono openvpn sudo desktop-file-utils libnotify libappindicator-gtk2 patchelf)|g" PKGBUILD
sed -i "s|{@pkgdepends}|(mono openvpn sudo desktop-file-utils libnotify libayatana-appindicator patchelf)|g" PKGBUILD
fi
sed -i "s|{@source}|git+https://github.com/AirVPN/Eddie.git|g" PKGBUILD
sed -i "s|cd \"Eddie-\$pkgver\"|cd \"Eddie\"|g" PKGBUILD
Expand All @@ -97,7 +96,7 @@ function arch_env() {
sed -i "s|{@pkgdepends}|(mono openvpn sudo)|g" PKGBUILD
else
sed -i "s|{@pkgdesc}|Eddie - VPN tunnel - UI|g" PKGBUILD
sed -i "s|{@pkgdepends}|(mono openvpn sudo desktop-file-utils libnotify libappindicator-gtk2 patchelf)|g" PKGBUILD
sed -i "s|{@pkgdepends}|(mono openvpn sudo desktop-file-utils libnotify libayatana-appindicator patchelf)|g" PKGBUILD
fi
sed -i "s|{@source}|https://github.com/AirVPN/Eddie/archive/${VERSIONSTABLE}.tar.gz|g" PKGBUILD
if test -f "${SCRIPTDIR}/../signing/aur.key.password.txt"; then # Staff AirVPN
Expand Down
7 changes: 4 additions & 3 deletions repository/linux_debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/hummingbird
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/stunnel
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libgdiplus.so.0
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libMonoPosixHelper.so
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libayatana-appindicator.so.1
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libayatana-indicator.so.7
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libayatana-appindicator3.so.1
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libayatana-indicator3.so.7
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libdbusmenu-glib.so.4
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libdbusmenu-gtk.so.4
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libdbusmenu-gtk3.so.4
rm -f "${TARGETDIR}"/usr/lib/eddie-${PROJECT}/libayatana-ido3-0.4.so.0

# Owner and Permissions
echo Step: Owner and Permissions
Expand Down
2 changes: 1 addition & 1 deletion repository/linux_debian/bundle/eddie-ui/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Maintainer: Eddie <[email protected]>
Priority: optional
Architecture: {@architecture}
Installed-Size: 8192
Depends: libc6 (>= 2.3.2), sudo, curl, libnotify-bin, mono-runtime, mono-utils, libmono-system-core4.0-cil, libmono-system-windows-forms4.0-cil, openvpn, stunnel4, curl, libsecret-tools, libayatana-appindicator1
Depends: libc6 (>= 2.3.2), sudo, curl, libnotify-bin, mono-runtime, mono-utils, libmono-system-core4.0-cil, libmono-system-windows-forms4.0-cil, openvpn, stunnel4, curl, libsecret-tools, libayatana-appindicator3
Breaks: airvpn (<< 2.14.4)
Replaces: airvpn (<< 2.14.4)
Homepage: https://eddie.website/
Expand Down
8 changes: 5 additions & 3 deletions src/App.CLI.Windows.Elevated/src/iwindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ std::string IWindows::GetLastErrorAsString()
FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, (sizeof(buf) / sizeof(wchar_t)), NULL);
std::string message = StringWStringToUTF8(buf);

return message;
return StringTrim(message);
}

IWindows::t_shellinfo IWindows::ExecStart(const std::string& path, const std::vector<std::string>& args)
Expand Down Expand Up @@ -1809,9 +1809,11 @@ void IWindows::WintunAdapterAdd(const std::wstring& pool, const std::wstring& na
BOOL needReboot = false;

WINTUN_ADAPTER_HANDLE hAdapter = funcWintunCreateAdapter(pool.c_str(), name.c_str(), NULL, &needReboot);

if (hAdapter == 0)
ThrowException("wintun.dll WintunCreateAdapter fail");
{
ThrowException("wintun.dll WintunCreateAdapter fail, pool:'" + StringWStringToUTF8(pool) +"', name:'" + StringWStringToUTF8(name) + "', nr:" + (needReboot ? "Y":"N") + ", error : '" + GetLastErrorAsString() + "'");
}
else
WintunAdapterClose(hAdapter);
}
Expand Down
2 changes: 1 addition & 1 deletion src/App.Cocoa.MacOS/WindowPreferencesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ void ReadOptions()
GuiUtils.SetCheck(ChkHummingbirdPrefer, o.GetBool("tools.hummingbird.preferred"));
TxtHummingbirdPath.StringValue = o.Get("tools.hummingbird.path");

if (Core.Platform.Instance.GetVersion().VersionUnder("10.14")) // Hummingbird require Mojave
if (Core.Platform.Instance.GetVersion().VersionUnder("10.13")) // Hummingbird require High Sierra
{
GuiUtils.SetEnabled(ChkHummingbirdPrefer, false);
GuiUtils.SetCheck(ChkHummingbirdPrefer, false);
Expand Down
66 changes: 35 additions & 31 deletions src/Lib.Core/ConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ public bool HasWarningsErrors()
return false;
}

public bool HasWarnings()
{
lock (Warnings)
return Warnings.Count > 0;
}

public bool CanConnect()
{
if (Engine.Instance.Options.GetBool("connections.allow_anyway"))
Expand Down Expand Up @@ -205,40 +211,38 @@ public int UsersPerc()

public int Score()
{
lock (Warnings)
if (HasWarningsErrors())
return 99998;
if (HasWarnings())
return 99997;

if (Ping == -1)
return 99995;
else
{
if (HasWarningsErrors())
return 99998;
else if (Warnings.Count > 0)
return 99997;
else if (Ping == -1)
return 99995;
else
string scoreType = Engine.Instance.Options.GetLower("servers.scoretype");

double x = Users;
double x2 = UsersPerc();

double PenalityB = Penality * Convert.ToDouble(Provider.GetKeyValue("penality_factor", "1000"));
double PingB = Ping * Convert.ToDouble(Provider.GetKeyValue("ping_factor", "1"));
double LoadB = LoadPerc() * Convert.ToDouble(Provider.GetKeyValue("load_factor", "1"));
double UsersB = UsersPerc() * Convert.ToDouble(Provider.GetKeyValue("users_factor", "1"));
double ScoreB = ScoreBase;
if (scoreType == "speed")
{
ScoreB = ScoreB / Convert.ToDouble(Provider.GetKeyValue("speed_factor", "1"));
LoadB = LoadB / Convert.ToDouble(Provider.GetKeyValue("speed_load_factor", "1")); // 2.18.7
UsersB = UsersB / Convert.ToDouble(Provider.GetKeyValue("speed_users_factor", "1")); // 2.18.7
}
else if (scoreType == "latency")
{
string scoreType = Engine.Instance.Options.GetLower("servers.scoretype");

double x = Users;
double x2 = UsersPerc();

double PenalityB = Penality * Convert.ToDouble(Provider.GetKeyValue("penality_factor", "1000"));
double PingB = Ping * Convert.ToDouble(Provider.GetKeyValue("ping_factor", "1"));
double LoadB = LoadPerc() * Convert.ToDouble(Provider.GetKeyValue("load_factor", "1"));
double UsersB = UsersPerc() * Convert.ToDouble(Provider.GetKeyValue("users_factor", "1"));
double ScoreB = ScoreBase;
if (scoreType == "speed")
{
ScoreB = ScoreB / Convert.ToDouble(Provider.GetKeyValue("speed_factor", "1"));
LoadB = LoadB / Convert.ToDouble(Provider.GetKeyValue("speed_load_factor", "1")); // 2.18.7
UsersB = UsersB / Convert.ToDouble(Provider.GetKeyValue("speed_users_factor", "1")); // 2.18.7
}
else if (scoreType == "latency")
{
ScoreB = ScoreB / Convert.ToDouble(Provider.GetKeyValue("latency_factor", "500"));
LoadB = LoadB / Convert.ToDouble(Provider.GetKeyValue("latency_load_factor", "10")); // 2.18.7
UsersB = UsersB / Convert.ToDouble(Provider.GetKeyValue("latency_users_factor", "10")); // 2.18.7
}
return Conversions.ToInt32(PenalityB + PingB + LoadB + ScoreB + UsersB);
ScoreB = ScoreB / Convert.ToDouble(Provider.GetKeyValue("latency_factor", "500"));
LoadB = LoadB / Convert.ToDouble(Provider.GetKeyValue("latency_load_factor", "10")); // 2.18.7
UsersB = UsersB / Convert.ToDouble(Provider.GetKeyValue("latency_users_factor", "10")); // 2.18.7
}
return Conversions.ToInt32(PenalityB + PingB + LoadB + ScoreB + UsersB);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Lib.Core/ConnectionTypes/IConnectionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public virtual void SetupRoutes()
throw new Exception("Unsupported route catch-all mode");
}

AddRoute(EntryIP, "net_gateway", "EntryIP");
AddRoute(EntryIP, "net_gateway", "Entry IP");
RouteEntryIp = false;
}

Expand All @@ -243,9 +243,9 @@ public virtual void SetupRoutes()
AddRoute(ip, "vpn_gateway", "For Checking Route");
}

if (Platform.Instance.GetUseOpenVpnRoutes() == false)
if (Platform.Instance.GetUseOpenVpnRoutes() == false) // WIP, remove in 2.22.0
AddRoute(EntryIP, "net_gateway", "IP Entry");

string routes = Engine.Instance.Options.Get("routes.custom");
string[] routes2 = routes.Split(';');
foreach (string route in routes2)
Expand Down
5 changes: 3 additions & 2 deletions src/Lib.Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public static class Constants
public static string PasswordIfEmpty = "e6552ddf3ac5c8755a82870d91273a63eab0da1e";
public static string WintunPool = "Eddie";
public static string Thanks = "Clodo, PJ, reiandrea, ProMIND, Berserker, OpenSourcerer, zhang888, LZ1, giganerd, Uncle Hunto, go558a83nk, sheivoko, NaDre, pfSense_fan, x0wllaar";
public static int VersionInt = 282;
public static string VersionDesc = "2.21.7"; // Used by deploy system also to generate filenames
public static int VersionInt = 283;
public static string VersionDesc = "2.21.8"; // Used by deploy system also to generate filenames
public static bool VersionBeta = false;
public static string Domain = "eddie.website";
public static string WebSite = "https://eddie.website";
Expand All @@ -43,6 +43,7 @@ public static class Constants
public static int ElevatedServicePort = 9349;

// Feature activation at compilation-time
public static bool OurRoutesInWin7 = true;
public static bool FeatureAlpha = false; // Nothing here right now
}
}
60 changes: 24 additions & 36 deletions src/Lib.Core/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ public void MarkAreasListUpdated()

public void UpdateConnectedStatus(bool connected)
{
lock (this)
// lock (this) // TOCLEAN, removed in 2.21.8
{
if (connected)
WaitMessageClear();
Expand All @@ -875,7 +875,7 @@ public void WaitMessageSet(string message, bool allowCancel)
throw new Exception("Unexpected status.");
}

lock (this)
// lock (this) // TOCLEAN, removed in 2.21.8
{
m_mainStatusMessage = message;
m_mainStatusCancel = allowCancel;
Expand Down Expand Up @@ -970,29 +970,26 @@ public virtual void OnLog(LogEntry l)

if (Options != null)
{
lock (Options)
if (Options.GetBool("log.file.enabled"))
{
if (Options.GetBool("log.file.enabled"))
try
{
try
{
string logPath = Options.Get("log.file.path").Trim();
Encoding encoding = Options.GetEncoding("log.file.encoding");

List<string> paths = Logs.ParseLogFilePath(logPath);
foreach (string path in paths)
{
Directory.CreateDirectory(Path.GetDirectoryName(path));
string text = Platform.Instance.NormalizeString(lines + "\n");
Platform.Instance.FileContentsAppendText(path, text, encoding);
}
}
catch (Exception ex)
string logPath = Options.Get("log.file.path").Trim();
Encoding encoding = Options.GetEncoding("log.file.encoding");

List<string> paths = Logs.ParseLogFilePath(logPath);
foreach (string path in paths)
{
Logs.Log(LogType.Warning, LanguageManager.GetText("LogsDisabledForError", ex.Message));
Options.SetBool("log.file.enabled", false);
Directory.CreateDirectory(Path.GetDirectoryName(path));
string text = Platform.Instance.NormalizeString(lines + "\n");
Platform.Instance.FileContentsAppendText(path, text, encoding);
}
}
catch (Exception ex)
{
Logs.Log(LogType.Warning, LanguageManager.GetText("LogsDisabledForError", ex.Message));
Options.SetBool("log.file.enabled", false);
}
}
}
}
Expand Down Expand Up @@ -1454,10 +1451,10 @@ public ConnectionInfo PickConnectionByName(string name)
if (s.DisplayName == name)
return s;
}

Engine.Instance.Logs.Log(LogType.Fatal, LanguageManager.GetText("ServerByNameNotFound", name));
return null;
}

Engine.Instance.Logs.Log(LogType.Fatal, LanguageManager.GetText("ServerByNameNotFound", name));
return null;
}

public ConnectionInfo PickConnection()
Expand All @@ -1474,12 +1471,12 @@ public ConnectionInfo PickConnection(string preferred)
if (m_connections.ContainsKey(preferred))
return m_connections[preferred];
}

List<ConnectionInfo> list = GetConnections(false);
if (list.Count > 0)
return list[0];
}

List<ConnectionInfo> list = GetConnections(false);
if (list.Count > 0)
return list[0];

return null;
}

Expand Down Expand Up @@ -2041,15 +2038,6 @@ public void GenerateManifest()
jVersion["text"].Value = GetVersionShow();
jVersion["int"].Value = Constants.VersionInt;

/* // TOCLEAN
Json jUI = new Json();
Manifest["ui"].Value = jUI;
if (m_webserver != null)
jUI["url"].Value = m_webserver.ListenUrl;
*/

//Manifest["options"].Value = Options.GetJsonForManifest();

Manifest["languages"].Value = LanguageManager.GetJsonForManifest();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lib.Core/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public void EnsureDefaults()
SetDefaultInt("advanced.manifest.refresh", -1, NotInMan);
SetDefaultBool("advanced.providers", false, NotInMan);

SetDefault("bootstrap.urls", "text", "", NotInMan); // ClodoTemp: move to provider level
SetDefault("bootstrap.urls", "text", "", NotInMan); // WIP: move to provider level

SetDefaultBool("advanced.skip_tun_detect", false, NotInMan); // Skip TUN driver detection.
SetDefaultBool("advanced.skip_alreadyrun", false, NotInMan); // Continue even if openvpn is already running.
Expand Down
7 changes: 4 additions & 3 deletions src/Lib.Core/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ public virtual void FlushDNS()

public void Route(Json jRoute, string action)
{
string iface = jRoute["interface"].ValueString;
string iface = jRoute["interface"].ValueString;
string ifaceFriendly = Platform.Instance.GetFriendlyInterfaceName(iface);
IpAddress ip = jRoute["destination"].ValueString;
if (ip.Valid == false)
Expand Down Expand Up @@ -860,11 +860,12 @@ public void Route(Json jRoute, string action)
else
msg = LanguageManager.GetText("RouteDelFailed", ip.ToCIDR(true), ifaceFriendly, ex.Message);

throw new Exception(msg);
if (action == "add") // 2.21.8 - Throw exception only on ADD
throw new Exception(msg);
}
}

// Old Recovery // CLODOTEMP
// Old Recovery // WIP
/*
lock (m_routes)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Lib.Core/Providers/IProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public virtual void ClearCredentials()
Storage.DocumentElement.SetAttributeString("password", "");
}

public virtual bool ApplyCredentials(ConnectionTypes.IConnectionType connectionActive) // ClodoTemp to move
public virtual bool ApplyCredentials(ConnectionTypes.IConnectionType connectionActive) // WIP to move
{
if (connectionActive.NeedCredentials())
{
Expand Down
2 changes: 1 addition & 1 deletion src/Lib.Core/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ public Json RouteCompute(ConnectionRoute route)
}
else
{
// ClodoTemp: Unsupported on Windows for now, we need the interface.
// WIP: Unsupported on Windows for now, we need the interface.
IpAddress ip = new IpAddress(route.Gateway);
if (ip.Valid == false)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Lib.Core/UI/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void OpenStats(string key)
}
else if (key == "pinger")
{
// ClodoTemp must be InvalidatePinger(), but check Refresh.Full steps
// WIP must be InvalidatePinger(), but check Refresh.Full steps
Engine.Instance.InvalidateConnections();
}
else if (key == "discovery")
Expand Down
Loading

0 comments on commit 1c5e45f

Please sign in to comment.