Skip to content

Commit

Permalink
[build] 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
openbullet committed Sep 7, 2024
2 parents 2ab7696 + 8097d9f commit 71654a9
Show file tree
Hide file tree
Showing 41 changed files with 2,666 additions and 1,601 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

# Read the version
- name: Read version
run: echo "VERSION=$(cat OpenBullet2.Web/version.txt)" >> $GITHUB_ENV
run: echo "VERSION=$(head -n 1 OpenBullet2.Web/version.txt)" >> $GITHUB_ENV

# Build using docker
- name: Build using docker
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
file_glob: true
release_name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
overwrite: true
overwrite: false
prerelease: false
make_latest: true
# Show ONLY the commit description in the release (without)
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/build-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ jobs:
- name: Get commit number
run: echo "COMMIT_NUMBER=$(git rev-list --count HEAD)" >> $GITHUB_ENV

# Append the commit number to version.txt of the web client
# Read the version
- name: Read version
run: echo "VERSION=$(head -n 1 OpenBullet2.Web/version.txt)" >> $GITHUB_ENV

# Overwrite the contents of version.txt with $VERSION.$COMMIT_NUMBER
- name: Append commit number to version.txt
run: echo ".$COMMIT_NUMBER" >> OpenBullet2.Web/version.txt
run: echo "${{ env.VERSION }}.${{ env.COMMIT_NUMBER }}" > OpenBullet2.Web/version.txt

# Append the commit number to version.txt of the native client
# Do the same for the native client
- name: Append commit number to version.txt
run: echo ".$COMMIT_NUMBER" >> OpenBullet2.Native/version.txt
run: echo "${{ env.VERSION }}.${{ env.COMMIT_NUMBER }}" > OpenBullet2.Native/version.txt

# Get the commit description
- name: Get commit description
Expand All @@ -50,8 +54,8 @@ jobs:
echo 'EOF' >> $GITHUB_ENV
# Read the version
- name: Read version
run: echo "VERSION=$(cat OpenBullet2.Web/version.txt)" >> $GITHUB_ENV
- name: Read version again
run: echo "VERSION=$(head -n 1 OpenBullet2.Web/version.txt)" >> $GITHUB_ENV

# Build using docker
- name: Build using docker
Expand Down Expand Up @@ -89,7 +93,7 @@ jobs:
file_glob: true
release_name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
overwrite: true
overwrite: false
prerelease: true
make_latest: true
# Show ONLY the commit description in the release (without)
Expand Down
23 changes: 23 additions & 0 deletions Changelog/0.3.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Changelog for version 0.3.2

This release contains some bugfixes and improvements.
Most notably, `CaptchaSharp` has been upgraded to version `2.1.0` and **many new captcha-related blocks and services have been added**.
Check them out in the "RL Settings" and Stacker!

Other changes:

##### RuriLib
- Added support for parsing comma-separated cookies from the `Set-Cookie` and `Set-Cookie2` headers in the `RuriLib.Http` client. *This breaks support for cookie values that contain commas, but [they are disallowed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) by the standard anyway*
- Removed auth constraint from SMTP blocks that send mails, allowing to send mails as an anonymous user on servers that allow it
- Fixed/Added support for the `ListOfStrings` and `DictionaryOfStrings` output variables when using Node.js in the Script block
- Removed support for the CapSolver service upon request from the service owner
- Added missing timeouts to `NoProxyClient`'s `ProxySettings`
- Added elliptic curve support for JWT signature (by GekySan)

##### OpenBullet (Web)
- Fixed missing suggestions in variable-mode input fields
- Removed double labels from some boolean parameters for a cleaner UI
- Added try/catch in `ReadNetworkUsage` due to a macOS issue that caused the program to crash

##### OpenBullet (Native)
- Fixed annoying auto word selection in Windows Forms' RichTextBoxes
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 openbullet
Copyright (c) 2024 openbullet

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 17 additions & 15 deletions OpenBullet2.Core/Repositories/DiskConfigRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,33 +72,35 @@ public async Task<Config> GetAsync(string id)
{
var file = GetFileName(id);

if (File.Exists(file))
if (!File.Exists(file))
{
using var fileStream = new FileStream(file, FileMode.Open, FileAccess.Read);

var config = await ConfigPacker.UnpackAsync(fileStream);
config.Id = id;
return config;
throw new FileNotFoundException();
}

await using var fileStream = new FileStream(file, FileMode.Open, FileAccess.Read);

var config = await ConfigPacker.UnpackAsync(fileStream);
config.Id = id;
return config;

throw new FileNotFoundException();
}

/// <inheritdoc/>
public async Task<byte[]> GetBytesAsync(string id)
{
var file = GetFileName(id);

if (File.Exists(file))
if (!File.Exists(file))
{
using FileStream fileStream = new(file, FileMode.Open, FileAccess.Read);
using var ms = new MemoryStream();
await fileStream.CopyToAsync(ms);

return ms.ToArray();
throw new FileNotFoundException();
}

await using FileStream fileStream = new(file, FileMode.Open, FileAccess.Read);
using var ms = new MemoryStream();
await fileStream.CopyToAsync(ms);

return ms.ToArray();

throw new FileNotFoundException();
}

/// <inheritdoc/>
Expand Down Expand Up @@ -129,7 +131,7 @@ public async Task UploadAsync(Stream stream, string fileName)
else if (extension == ".loli")
{
using var ms = new MemoryStream();
stream.CopyTo(ms);
await stream.CopyToAsync(ms);
ms.Seek(0, SeekOrigin.Begin);
var content = Encoding.UTF8.GetString(ms.ToArray());
var id = Path.GetFileNameWithoutExtension(fileName);
Expand Down
60 changes: 29 additions & 31 deletions OpenBullet2.Native/Converters/BooleanConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,51 @@
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;

namespace OpenBullet2.Native.Converters
namespace OpenBullet2.Native.Converters;

// From https://stackoverflow.com/a/5182660/4332314
public class BooleanConverter<T> : IValueConverter
{
// From https://stackoverflow.com/a/5182660/4332314
public class BooleanConverter<T> : IValueConverter
public BooleanConverter(T trueValue, T falseValue)
{
public BooleanConverter(T trueValue, T falseValue)
{
True = trueValue;
False = falseValue;
}
True = trueValue;
False = falseValue;
}

public T True { get; set; }
public T False { get; set; }
public T True { get; set; }
public T False { get; set; }

public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is bool b && b ? True : False;
public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is bool b && b ? True : False;

public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> value is T convertedValue && EqualityComparer<T>.Default.Equals(convertedValue, True);
}
public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> value is T convertedValue && EqualityComparer<T>.Default.Equals(convertedValue, True);
}

public sealed class BoolToVisibilityConverter : BooleanConverter<Visibility>
public sealed class BoolToVisibilityConverter : BooleanConverter<Visibility>
{
public BoolToVisibilityConverter() :
base(Visibility.Visible, Visibility.Collapsed)
{
public BoolToVisibilityConverter() :
base(Visibility.Visible, Visibility.Collapsed)
{

}
}
}

public sealed class BoolToThicknessConverter : BooleanConverter<Thickness>
public sealed class BoolToThicknessConverter : BooleanConverter<Thickness>
{
public BoolToThicknessConverter() :
base(new Thickness(1), new Thickness(0))
{
public BoolToThicknessConverter() :
base(new Thickness(1), new Thickness(0))
{

}
}
}

public sealed class BoolToTextWrappingConverter : BooleanConverter<TextWrapping>
public sealed class BoolToTextWrappingConverter : BooleanConverter<TextWrapping>
{
public BoolToTextWrappingConverter() :
base(TextWrapping.Wrap, TextWrapping.NoWrap)
{
public BoolToTextWrappingConverter() :
base(TextWrapping.Wrap, TextWrapping.NoWrap)
{

}
}
}
4 changes: 2 additions & 2 deletions OpenBullet2.Native/Services/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class UpdateService : IDisposable
private readonly string versionFile = "version.txt";
private readonly Timer timer;

public Version CurrentVersion { get; private set; } = new(0, 3, 1);
public Version RemoteVersion { get; private set; } = new(0, 3, 1);
public Version CurrentVersion { get; private set; } = new(0, 3, 2);
public Version RemoteVersion { get; private set; } = new(0, 3, 2);
public bool IsUpdateAvailable => RemoteVersion > CurrentVersion;
public string CurrentVersionType => CurrentVersion.Major == 0
? (CurrentVersion.Minor == 0 ? "Alpha" : "Beta")
Expand Down
Loading

0 comments on commit 71654a9

Please sign in to comment.