Compare commits

..

34 Commits

Author SHA1 Message Date
Nicolas Dorier
f7ad0e57aa
Make install-arch.sh idempotent
Some checks failed
CI / win-x64 (push) Has been cancelled
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / osx-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2026-05-06 16:07:10 +09:00
Nicolas Dorier
4a393f2bfe
Update Release
Some checks failed
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / osx-x64 (push) Has been cancelled
CI / win-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2026-05-06 15:50:18 +09:00
Nicolas Dorier
7ce3af4209
Add maintainer script in bash 2026-05-06 15:46:50 +09:00
Nicolas Dorier
d93abb5f15
bump hwi 2026-05-06 15:43:51 +09:00
Nicolas Dorier
434051d059
bump .net10.0 and libs 2026-05-06 15:30:30 +09:00
Nicolas Dorier
f631f59ae4
Remove udev rules uneeded in new systemd 2026-05-06 15:18:19 +09:00
Nicolas Dorier
a7ba63fc8f Add arch instructions
Some checks failed
CI / osx-x64 (push) Has been cancelled
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / win-x64 (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2025-12-10 19:44:44 +09:00
nicolas.dorier
946bbf5111
bump
Some checks failed
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / osx-x64 (push) Has been cancelled
CI / win-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2025-10-22 10:17:00 +09:00
nicolas.dorier
0ca3d5fd87
Add libicu 74 or 76 deps to deb package (fix #90) 2025-10-22 10:15:12 +09:00
nicolas.dorier
2924eb58da
Fix build
Some checks failed
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / osx-x64 (push) Has been cancelled
CI / win-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2025-07-16 14:14:31 +09:00
nicolas.dorier
f39a1ec369
Update mac instructions 2025-07-15 15:48:35 +09:00
nicolas.dorier
5fde8f1a7d
Update Release notes 2025-06-26 17:09:29 +09:00
nicolas.dorier
0c330b19e4
bump version 2025-06-26 16:24:25 +09:00
nicolas.dorier
1e3329884c
Bump HWI to 3.1.0 2025-06-26 16:23:30 +09:00
nicolas.dorier
ecf0fec03b
bump 2025-04-21 15:35:41 +09:00
nicolas.dorier
e9107c589c
bump 2025-04-21 14:52:17 +09:00
nicolas.dorier
fee92fd70c
bump 2025-04-21 14:51:40 +09:00
nicolas.dorier
eaff86e75d
Returns raw data of enumerated devices 2025-04-21 14:51:03 +09:00
nicolas.dorier
e83947d811
Support DisplayAddress on taproot86 2025-04-17 10:12:56 +09:00
nicolas.dorier
dcff6ce715
Bump HWI
Some checks failed
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / osx-x64 (push) Has been cancelled
CI / win-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2024-07-04 09:56:13 +09:00
nicolas.dorier
12e442910b
Bump version
Some checks failed
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / osx-x64 (push) Has been cancelled
CI / win-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2024-01-23 11:00:26 +09:00
nicolas.dorier
e4202d11de
Update RELEASE 2024-01-23 10:55:41 +09:00
nicolas.dorier
6999b96588
bump libs 2024-01-23 10:54:49 +09:00
nicolas.dorier
4735c541ce
Fix: Impossible to sign big transactions on windows (#77) 2024-01-23 10:53:38 +09:00
nicolas.dorier
5a34f56c46
Make apple sign faster 2023-12-08 16:42:52 +09:00
nicolas.dorier
c8457c35f9
bump
Some checks failed
CI / debian-x64 (push) Has been cancelled
CI / linux-x64 (push) Has been cancelled
CI / osx-x64 (push) Has been cancelled
CI / win-x64 (push) Has been cancelled
CI / applesign (push) Has been cancelled
CI / pgpsign (push) Has been cancelled
CI / makerelease (push) Has been cancelled
2023-12-08 16:19:46 +09:00
nicolas.dorier
39b2e4e0a0
Fix warnings 2023-12-08 16:18:34 +09:00
nicolas.dorier
3e25d227b0
bump CI dotnet version 2023-12-07 16:40:12 +09:00
Jumar Macato
90c36153e6 use the official way of getting platform handles in v11 2023-12-06 20:58:37 +08:00
Jumar Macato
77ae2be45c add simple theme 2023-12-06 20:58:02 +08:00
Jumar Macato
db9c8ec9a5 remove old 0.10.x hacks 2023-12-06 20:57:49 +08:00
Jumar Macato
cf5fa5467e update OnClosing parameters 2023-12-06 20:57:32 +08:00
Jumar Macato
5df7ca949e Update to DrawingImage. 2023-12-06 20:57:19 +08:00
Jumar Macato
d7a5957949 reuse the existing service provider rather than using Avalonia's internal locator (it's deprecated for public use) 2023-12-06 20:56:52 +08:00
42 changed files with 257 additions and 117 deletions

View File

@ -20,7 +20,7 @@ jobs:
name: debian-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./Build/CI/build.sh
env:
RID: debian-x64
@ -30,7 +30,7 @@ jobs:
name: linux-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./Build/CI/build.sh
env:
RID: linux-x64
@ -39,7 +39,7 @@ jobs:
name: osx-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./Build/CI/build.sh
env:
RID: osx-x64
@ -48,7 +48,7 @@ jobs:
name: win-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./Build/CI/build.sh
env:
RID: win-x64
@ -61,7 +61,7 @@ jobs:
needs: [osx-x64]
if: startsWith( github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./Build/CI/applesign.sh
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
@ -76,7 +76,7 @@ jobs:
needs: [win-x64, osx-x64, linux-x64, debian-x64, applesign]
if: ${{ always() }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./Build/CI/pgpsign.sh
env:
PGP_KEY: ${{ secrets.PGP_KEY }}
@ -87,7 +87,7 @@ jobs:
needs: [pgpsign, applesign]
if: startsWith( github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./Build/CI/makerelease.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -17,12 +17,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.203" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NBitcoin" Version="7.0.31" />
<PackageReference Include="NBitcoin" Version="10.0.3" />
</ItemGroup>
</Project>

View File

@ -80,7 +80,52 @@ namespace BTCPayServer.Hwi.Deployment
}
};
public static HwiVersion Latest => v2_1_1;
public static HwiVersion v3_0_0 { get; } = new HwiVersion()
{
Windows = new HwiDownloadInfo()
{
Link = "https://github.com/bitcoin-core/HWI/releases/download/3.0.0/hwi-3.0.0-windows-x86_64.zip",
Hash = "38b3f02374c300516b4583a1195ffe1cac1159f9885b8ab434fd450e290c907a",
Extractor = new ZipExtractor()
},
Linux = new HwiDownloadInfo()
{
Link = "https://github.com/bitcoin-core/HWI/releases/download/3.0.0/hwi-3.0.0-linux-x86_64.tar.gz",
Hash = "9b70aab37a1265457de4aaa242bd24a0abef5056357d8337bd79232e9b85bc1c",
Extractor = new TarExtractor()
},
Mac = new HwiDownloadInfo()
{
Link = "https://github.com/bitcoin-core/HWI/releases/download/3.0.0/hwi-3.0.0-mac-x86_64.tar.gz",
Hash = "d05c046d5718bf92b348a786aad15cb0f0132fcccf57a646758610240327a977",
Extractor = new TarExtractor()
}
};
public static HwiVersion v3_2_0 { get; } = new HwiVersion()
{
Version = "3.2.0",
Windows = new HwiDownloadInfo()
{
Link = "https://github.com/bitcoin-core/HWI/releases/download/{0}/hwi-{0}-windows-x86_64.zip",
Hash = "e068d91b664597425a8ead02d7b86a02ad6c4b72746c42961f58a58b08f9fd79",
Extractor = new ZipExtractor()
},
Linux = new HwiDownloadInfo()
{
Link = "https://github.com/bitcoin-core/HWI/releases/download/{0}/hwi-{0}-linux-x86_64.tar.gz",
Hash = "d9cc65de95e3cf93fd3c953d589184a00180624ffc5ad17aade97616a8919fa6",
Extractor = new TarExtractor()
},
Mac = new HwiDownloadInfo()
{
Link = "https://github.com/bitcoin-core/HWI/releases/download/{0}/hwi-{0}-mac-x86_64.tar.gz",
Hash = "b3764a530b635e7a7348c9185e09e74b389f5f585094fe316f700eec7c761875",
Extractor = new TarExtractor()
}
};
public static HwiVersion Latest => v3_2_0;
}
public class HwiVersion
@ -98,6 +143,8 @@ namespace BTCPayServer.Hwi.Deployment
throw new NotSupportedException();
}
}
public string Version { get; set; }
}
public class HwiDownloadInfo
@ -133,8 +180,9 @@ namespace BTCPayServer.Hwi.Deployment
download:
if (!File.Exists(processFullPath))
{
var data = await HttpClient.GetStreamAsync(Link);
var downloadedFile = Path.Combine(destinationDirectory, Link.Split('/').Last());
var link = HwiVersions.Latest.Version is null ? Link : Link.Replace("{0}", HwiVersions.Latest.Version);
var data = await HttpClient.GetStreamAsync(link);
var downloadedFile = Path.Combine(destinationDirectory, link.Split('/').Last());
try
{
using (var fs = File.Open(downloadedFile, FileMode.Create, FileAccess.ReadWrite))

View File

@ -113,6 +113,9 @@ namespace BTCPayServer.Hwi
case ScriptPubKeyType.SegwitP2SH:
commandArguments.Add("sh_wit");
break;
case ScriptPubKeyType.TaprootBIP86:
commandArguments.Add("tap");
break;
}
var response = await SendCommandAsync(

View File

@ -16,6 +16,7 @@ namespace BTCPayServer.Hwi
public bool? NeedsPassphraseSent { get; }
public string Error { get; }
public HwiErrorCode? Code { get; }
public JObject RawData { get; }
public DeviceSelector DeviceSelector { get; }
@ -34,7 +35,8 @@ namespace BTCPayServer.Hwi
bool? needsPinSent,
bool? needsPassphraseSent,
string error,
HwiErrorCode? code)
HwiErrorCode? code,
JObject rawData)
{
Model = model;
Path = path;
@ -44,6 +46,7 @@ namespace BTCPayServer.Hwi
NeedsPassphraseSent = needsPassphraseSent;
Error = error;
Code = code;
RawData = rawData;
DeviceSelector = fingerprint is HDFingerprint fp ? DeviceSelectors.FromFingerprint(fp) :
DeviceSelectors.FromDeviceType(Model, path);
}

View File

@ -189,7 +189,8 @@ namespace BTCPayServer.Hwi
needsPinSent: needsPinSent,
needsPassphraseSent: needsPassphraseSent,
error: errorString,
code: code);
code: code,
json);
}
public static string NormalizeRawDevicePath(string rawPath)

View File

@ -109,6 +109,13 @@ namespace BTCPayServer.Hwi.Process
process.BeginErrorReadLine();
}
if (processSpec.Stdin is not null)
{
foreach (var l in processSpec.Stdin)
process.StandardInput.WriteLine(l);
process.StandardInput.Close();
}
await processState.Task;
exitCode = process.ExitCode;
@ -133,6 +140,7 @@ namespace BTCPayServer.Hwi.Process
WorkingDirectory = processSpec.WorkingDirectory,
RedirectStandardOutput = processSpec.IsOutputCaptured,
RedirectStandardError = processSpec.IsErrorCaptured,
RedirectStandardInput = processSpec.Stdin is not null
}
};
@ -276,6 +284,7 @@ namespace BTCPayServer.Hwi.Process
public bool IsErrorCaptured => ErrorCapture != null;
public CancellationToken CancelOutputCapture { get; set; }
public string[] Stdin { get; set; }
public sealed class ProcessSpecEnvironmentVariables : Dictionary<string, string>
{

View File

@ -11,6 +11,8 @@ using NBitcoin.Logging;
using Microsoft.Extensions;
using BTCPayServer.Hwi.Process;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
namespace BTCPayServer.Hwi.Transports
{
@ -43,7 +45,15 @@ namespace BTCPayServer.Hwi.Transports
Executable = fileName,
OutputCapture = new OutputCapture(),
};
processSpec.Arguments = new ReadOnlyCollection<string>(arguments);
if (arguments.Contains("signtx", StringComparer.OrdinalIgnoreCase))
{
processSpec.Arguments = new ReadOnlyCollection<string>(new string[] { "--stdin" });
processSpec.Stdin = arguments.Concat(new[] { string.Empty }).ToArray();
}
else
{
processSpec.Arguments = new ReadOnlyCollection<string>(arguments);
}
try
{

View File

@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>2.0.3</Version>
<Version>2.0.6</Version>
</PropertyGroup>
</Project>

View File

@ -1,23 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>12</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
</ItemGroup>
<ItemGroup>

View File

@ -5,15 +5,12 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.DependencyInjection;
using NBitcoin;
using Xunit;
using Xunit.Abstractions;
using BTCPayServer.Hwi;
using BTCPayServer.Hwi.Transports;
using System.Collections.Generic;
using System.Net;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.AspNetCore.Builder;
using BTCPayServer.Vault;
namespace BTCPayServer.Vault.Tests
{

View File

@ -1,19 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.Logging;
using Xunit.Abstractions;
using Xunit;
namespace BTCPayServer.Vault.Tests
{
class XUnitLoggerFactory : ILoggerFactory
class XUnitLoggerFactory(ITestOutputHelper testOutput) : ILoggerFactory
{
public XUnitLoggerFactory(ITestOutputHelper testOutput)
{
TestOutput = testOutput;
}
public ITestOutputHelper TestOutput { get; }
public ITestOutputHelper TestOutput { get; } = testOutput;
public void AddProvider(ILoggerProvider provider)
{

View File

@ -2,8 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="BTCPayServer.Vault.App">
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>
<SimpleTheme />
<StyleInclude Source="avares://BTCPayServer.Vault/Styles.xaml" />
</Application.Styles>
</Application>

View File

@ -18,7 +18,7 @@ namespace BTCPayServer.Vault
{
}
public IServiceProvider ServiceProvider { get; private set; }
public IHostApplicationLifetime HostApplicationLifetime { get; private set; }
public IHost Host { get; private set; }
public IClassicDesktopStyleApplicationLifetime Desktop { get; private set; }
@ -30,15 +30,14 @@ namespace BTCPayServer.Vault
}
public override void OnFrameworkInitializationCompleted()
{
ServiceProvider = AvaloniaLocator.CurrentMutable.GetService<IServiceProvider>();
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
Desktop = desktop;
Desktop.MainWindow = ServiceProvider.GetRequiredService<MainWindow>();
Desktop.MainWindow = Program.CurrentServiceProvider.GetRequiredService<MainWindow>();
Desktop.Exit += Desktop_Exit;
Desktop.Startup += Desktop_Startup;
HostApplicationLifetime = ServiceProvider.GetRequiredService<IHostApplicationLifetime>();
Host = ServiceProvider.GetRequiredService<IHost>();
HostApplicationLifetime = Program.CurrentServiceProvider.GetRequiredService<IHostApplicationLifetime>();
Host = Program.CurrentServiceProvider.GetRequiredService<IHost>();
}
base.OnFrameworkInitializationCompleted();
}

View File

@ -39,7 +39,7 @@ namespace BTCPayServer.Vault
if (ReferenceEquals(platformImpl, null))
return;
var platformHandle = platformImpl.Handle;
var platformHandle = window.TryGetPlatformHandle();
if (ReferenceEquals(platformHandle, null))
return;
@ -65,7 +65,7 @@ namespace BTCPayServer.Vault
if (ReferenceEquals(platformImpl, null))
return;
var platformHandle = platformImpl.Handle;
var platformHandle = window.TryGetPlatformHandle();
if (ReferenceEquals(platformHandle, null))
return;
var handle = platformHandle.Handle;

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<OutputType Condition=" '$(Configuration)' == 'Release' ">WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>12</LangVersion>
<Company>The BTCPayServer Team</Company>
<Title>BTCPayServer Vault</Title>
@ -17,14 +17,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" />
<PackageReference Include="BTCPayServer.NTag424.PCSC" Version="1.0.15" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.14" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.3.14" />
<PackageReference Include="BTCPayServer.NTag424.PCSC" Version="1.0.22" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.203" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.6" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Avalonia" Version="11.3.14" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.7" />
<PackageReference Include="NicolasDorier.RateLimits" Version="1.1.0" />
</ItemGroup>
@ -60,4 +61,10 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<SelfContained>true</SelfContained>
</PropertyGroup>
<ItemGroup Condition="'$(GithubDistrib)' == 'true'">
<TrimmerRootAssembly Include="BTCPayServer.Vault" />
<TrimmerRootAssembly Include="Avalonia.Themes.Simple" />
<TrimmerRootAssembly Include="Avalonia.Base" />
<TrimmerRootAssembly Include="Avalonia.FreeDesktop" />
</ItemGroup>
</Project>

View File

@ -23,8 +23,6 @@ namespace BTCPayServer.Vault
{
public static void AddAvalonia<TApp>(this IServiceCollection services) where TApp : Application, new()
{
bool useGpuLinux = true;
var result = AppBuilder.Configure<TApp>();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
@ -33,36 +31,17 @@ namespace BTCPayServer.Vault
.UseWin32()
.UseSkia();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
if (DetectLLVMPipeRasterizer())
{
useGpuLinux = false;
}
result.UsePlatformDetect();
}
else
{
result.UsePlatformDetect();
}
// TODO remove this overriding of RenderTimer when Avalonia 0.9 is released.
// fixes "Thread Leak" issue in 0.8.1 Avalonia.
var old = result.WindowingSubsystemInitializer;
result.UseWindowingSubsystem(() =>
{
old();
AvaloniaLocator.CurrentMutable.Bind<IRenderTimer>().ToConstant(new DefaultRenderTimer(60));
});
var title = GetTitle();
result = result
.With(new Win32PlatformOptions { AllowEglInitialization = true, UseDeferredRendering = true })
.With(new X11PlatformOptions { UseGpu = useGpuLinux, WmClass = title })
.With(new AvaloniaNativePlatformOptions { UseDeferredRendering = true, UseGpu = true })
.With(new Win32PlatformOptions())
.With(new X11PlatformOptions { WmClass = title })
.With(new AvaloniaNativePlatformOptions())
.With(new MacOSPlatformOptions { ShowInDock = true });
services.AddSingleton(result);
services.AddSingleton<MainWindow>();

View File

@ -18,14 +18,14 @@
<DockPanel>
<TextBlock DockPanel.Dock="Left" FontSize="18">The vault is now ready to be used by web applications</TextBlock>
<StackPanel DockPanel.Dock="Right" IsVisible="{Binding IsLoading}" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal">
<DrawingPresenter Drawing="{DynamicResource spinner}"></DrawingPresenter>
<Image Source="{DynamicResource spinner}"/>
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding CurrentOperation}"></TextBlock>
</StackPanel>
</DockPanel>
<StackPanel IsVisible="{Binding IsVisible}" Margin="0,15,0,0">
<Separator HorizontalAlignment="Left" Height="3" Background="{DynamicResource btcpay-color-primary}" Width="128" Margin="0,0,0,15"></Separator>
<DockPanel>
<DrawingPresenter DockPanel.Dock="Left" Height="128" Width="128" VerticalAlignment="Center" HorizontalAlignment="Center" Drawing="{DynamicResource warning}" />
<Image DockPanel.Dock="Left" Height="128" Width="128" VerticalAlignment="Center" HorizontalAlignment="Center" Source="{DynamicResource warning}" />
<StackPanel IsVisible="{Binding HWIVisible}" Margin="10,0,0,0" VerticalAlignment="Center">
<TextBlock>A website is requesting access to your hardware wallets.</TextBlock>
<TextBlock>If you accept, the website will be able to:</TextBlock>

View File

@ -27,8 +27,7 @@ namespace BTCPayServer.Vault
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
Context = AvaloniaSynchronizationContext.Current as AvaloniaSynchronizationContext;
if (AvaloniaLocator.CurrentMutable?.GetService<IServiceProvider>() is IServiceProvider serviceProvider)
if (Program.CurrentServiceProvider is { } serviceProvider)
{
ServiceProvider = serviceProvider;
Indicator = ServiceProvider.GetRequiredService<IRunningIndicator>();
@ -55,7 +54,7 @@ namespace BTCPayServer.Vault
}
}
protected override void OnClosing(CancelEventArgs e)
protected override void OnClosing(WindowClosingEventArgs e)
{
base.OnClosing(e);
if (Indicator != null)
@ -94,7 +93,7 @@ namespace BTCPayServer.Vault
public IServiceProvider ServiceProvider { get; private set; }
public IRunningIndicator Indicator { get; private set; }
AvaloniaSynchronizationContext Context;
AvaloniaSynchronizationContext Context = new AvaloniaSynchronizationContext();
internal async Task<bool> Authorize(OriginReason originReason)
{

View File

@ -47,12 +47,17 @@ namespace BTCPayServer.Vault
#endif
})
.Build();
CurrentServiceProvider = host.Services;
host.Services.GetRequiredService<AppBuilder>()
.With(host.Services)
.With(host)
.StartWithClassicDesktopLifetime(args);
}
public static IServiceProvider CurrentServiceProvider { get; private set; }
private static bool TestPortFree()
{
TcpListener listener = new TcpListener(IPAddress.Loopback, HttpTransport.LocalHwiDefaultPort);

View File

@ -3,16 +3,16 @@
<Style>
<Style.Resources>
<SolidColorBrush x:Key="btcpay-color-primary">#329f80</SolidColorBrush>
<DrawingGroup x:Key="warning">
<DrawingGroup.Children>
<DrawingImage x:Key="warning">
<DrawingGroup>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M7.7246,15.9219C1.6086,14.1719,0.6986,7.3389,1.0726,3.9709L1.1316,3.4369 7.9996,-9.99999999997669E-05 14.8686,3.4369 14.9276,3.9709C15.3016,7.3389,14.3916,14.1719,8.2756,15.9219L7.9996,15.9999z" />
<GeometryDrawing Brush="#FFFFCC00" Geometry="F1M9,9L7,9 7,4 9,4z M9,12L7,12 7,10 9,10z M13.951,4L8,1 2.049,4C2.049,4 1.058,13 8,15 14.942,13 13.951,4 13.951,4" />
<GeometryDrawing Brush="#FF000000" Geometry="F1M7,12L9,12 9,10 7,10z M7,4L9,4 9,9 7,9z" />
</DrawingGroup.Children>
</DrawingGroup>
<DrawingGroup x:Key="spinner">
<DrawingGroup.Children>
</DrawingGroup>
</DrawingImage>
<DrawingImage x:Key="spinner">
<DrawingGroup>
<GeometryDrawing Brush="#329f80">
<GeometryDrawing.Geometry>
<EllipseGeometry Rect="0 0 20 20"></EllipseGeometry>
@ -23,8 +23,8 @@
<EllipseGeometry Rect="2.5 2.5 15 15"></EllipseGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingGroup>
</DrawingImage>
</Style.Resources>
</Style>
<Style Selector="TextBlock">

View File

@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>2.0.7</Version>
<Version>3.0.0</Version>
</PropertyGroup>
</Project>

View File

@ -44,7 +44,7 @@ cer_file="developerID_application.cer"
pem_file="developerID_application.pem"
cert_output_file="developerID_application.p12"
openssl x509 -in "$cer_file" -inform DER -out "$pem_file" -outform PEM
openssl pkcs12 -export -inkey "$rsa_key_file" -in "$pem_file" -out "$cert_output_file"
openssl pkcs12 -export -inkey "$rsa_key_file" -in "$pem_file" -legacy -out "$cert_output_file"
```
Now enter a password, don't pick an empty one as the rest would fail.

View File

@ -99,6 +99,7 @@ sudo xcrun notarytool submit --apple-id "$APPLE_ID" --password "$APPLE_ID_PASSWO
sudo xcrun stapler staple "$dmg_file"
echo "Installing az..."
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update
brew install azure-cli || true
BLOB_NAME="$DIRECTORY_NAME/$dmg_file"

View File

@ -27,6 +27,6 @@ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
echo "$PGP_KEY" | base64 --decode | gpg --import --no-tty
echo "PGP keys correctly imported"
gpg --digest-algo sha256 --clearsign SHA256SUMS
gpg --no-tty --digest-algo sha256 --clearsign SHA256SUMS
az storage blob upload -f "SHA256SUMS.asc" -c "$AZURE_STORAGE_CONTAINER" -n "$DIRECTORY_NAME/SHA256SUMS.asc"
rm SHA256SUMS

View File

@ -1,6 +1,7 @@
## Changelog
* Allows connection to local smart card readers
* Bump HWI 2.3.1
* Update to HWI 3.2.0
* Update to .NET 10.0
* Simplify setup for arch linux
You may want to follow the [documented](https://github.com/btcpayserver/BTCPayServer.Vault/blob/master/docs/HowToVerify.md) process to verify that the binaries are built by Nicolas Dorier.

View File

@ -1,10 +1,12 @@
#!/bin/bash
BUILD_ARGS="--runtime $RUNTIME -p:Configuration=Release -p:GithubDistrib=true"
FRAMEWORK="net6.0"
DOTNET_RUNTIME=${DOTNET_RUNTIME:-$RUNTIME}
BUILD_ARGS="--runtime $DOTNET_RUNTIME -p:Configuration=Release -p:GithubDistrib=true"
FRAMEWORK="net10.0"
DIST="/source/dist"
RESOURCES="/source/Build/${RUNTIME}"
RESOURCES_COMMON="/source/Build/common"
RESOURCES_LINUX="/source/Build/linux-x64"
PROJECT_FILE="/source/BTCPayServer.Vault/BTCPayServer.Vault.csproj"
VERSION_FILE="/source/BTCPayServer.Vault/Version.csproj"
LICENSE="$(cat $PROJECT_FILE | sed -n 's/.*<PackageLicenseExpression>\(.*\)<\/PackageLicenseExpression>.*/\1/p')"
@ -14,7 +16,7 @@ TITLE="$(cat $PROJECT_FILE | sed -n 's/.*<Title>\(.*\)<\/Title>.*/\1/p')"
if [ -f "$VERSION_FILE" ]; then
VERSION="$(cat $VERSION_FILE | sed -n 's/.*<Version>\(.*\)<\/Version>.*/\1/p')"
fi
PUBLISH_FOLDER="/source/BTCPayServer.Vault/bin/Release/$FRAMEWORK/$RUNTIME/publish"
PUBLISH_FOLDER="/source/BTCPayServer.Vault/bin/Release/$FRAMEWORK/$DOTNET_RUNTIME/publish"
EXECUTABLE="$(cat $PROJECT_FILE | sed -n 's/.*<TargetName>\(.*\)<\/TargetName>.*/\1/p')"
mkdir -p "$DIST"

View File

@ -1,13 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS builder
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder
# Optimize docker cache, do not make it one layer
RUN apt-get update
RUN apt-get install -y --no-install-recommends imagemagick
###
RUN wget -qO /tmp/hwi.tar.gz https://github.com/bitcoin-core/HWI/releases/download/2.3.1/hwi-2.3.1-linux-x86_64.tar.gz && \
RUN wget -qO /tmp/hwi.tar.gz https://github.com/bitcoin-core/HWI/releases/download/3.2.0/hwi-3.2.0-linux-x86_64.tar.gz && \
tar -zxvf /tmp/hwi.tar.gz -C /tmp hwi && \
echo "9519023b3a485b68668675db8ab70be2e338be100fd2731eeddd6d34fc440580 /tmp/hwi" | sha256sum -c - && \
echo "d9cc65de95e3cf93fd3c953d589184a00180624ffc5ad17aade97616a8919fa6 /tmp/hwi" | sha256sum -c - && \
rm /tmp/hwi.tar.gz
SHELL ["/bin/bash", "-c"]
@ -15,8 +15,10 @@ ARG PGP_KEY=""
RUN ! [[ "${PGP_KEY}" ]] || apt-get install -y debsigs
WORKDIR /source
ENV DOTNET_RUNTIME "linux-x64"
ENV RUNTIME "debian-x64"
COPY "Build/common" "Build/common"
COPY "Build/linux-x64" "Build/linux-x64"
ENV EXPORT_VARIABLES "source Build/common/export-variables.sh"
COPY BTCPayServer.Vault/BTCPayServer.Vault.csproj BTCPayServer.Vault/BTCPayServer.Vault.csproj
COPY BTCPayServer.Hwi/BTCPayServer.Hwi.csproj BTCPayServer.Hwi/BTCPayServer.Hwi.csproj
@ -28,6 +30,7 @@ RUN $EXPORT_VARIABLES && dotnet_publish && mv /tmp/hwi "$PUBLISH_FOLDER/"
COPY "Build/${RUNTIME}" "Build/${RUNTIME}"
COPY BTCPayServerVault.png BTCPayServerVault.png
RUN $EXPORT_VARIABLES && \
find "$PUBLISH_FOLDER" -type f -exec chmod 644 {} \; && \
find "$PUBLISH_FOLDER" -type f \( -name 'hwi' -o -name "$EXECUTABLE" \) -exec chmod +x {} \; && \
@ -49,7 +52,7 @@ RUN $EXPORT_VARIABLES && \
cp "$RESOURCES/BTCPayServer.Vault.desktop" "$debiandir/usr/share/applications/" && \
replaceProjectVariables "$debiandir/usr/share/applications/BTCPayServer.Vault.desktop" && \
mkdir -p "$debiandir/lib/udev/rules.d" && \
cp $RESOURCES/udev/* "$debiandir/lib/udev/rules.d/" && \
cp $RESOURCES_LINUX/udev/* "$debiandir/lib/udev/rules.d/" && \
sizeinkb="$(du -k --max-depth=0 $debiandir | cut -f 1)" && \
sed -i "s/{SIZEINKB}/$sizeinkb/g" "$debiandir/DEBIAN/control" && \
dpkg --build "$debiandir" && mv /tmp/debian.deb "$DIST/BTCPayServerVault-$VERSION.deb" && \

View File

@ -7,6 +7,6 @@ Vcs-Git: git://github.com/btcpayserver/BTCPayServer.Vault.git
Vcs-Browser: https://github.com/btcpayserver/BTCPayServer.Vault
Architecture: amd64
License: Open Source (MIT)
Depends: libgcc1, libicu | libicu72 | libicu71 | libicu70 | libicu69 | libicu68 | libicu67 | libicu66 | libicu65 | libicu63 | libicu60 | libicu57 | libicu55 | libicu52, libc6, libssl1.0.0 | libssl1.0.2 | libssl1.1 | libssl3, zlib1g, libstdc++6, libgssapi-krb5-2, libpcsclite1
Depends: libgcc1, libicu | libicu76 | libicu74 | libicu72 | libicu71 | libicu70 | libicu69 | libicu68 | libicu67 | libicu66 | libicu65 | libicu63 | libicu60 | libicu57 | libicu55 | libicu52, libc6, libssl1.0.0 | libssl1.0.2 | libssl1.1 | libssl3, zlib1g, libstdc++6, libgssapi-krb5-2, libpcsclite1
Installed-Size: {SIZEINKB}
Description: {DESCRIPTION}

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=BTCPayServer Vault
Exec=/usr/local/bin/BTCPayServer.Vault
Icon=BTCPayServerVault
Categories=Utility;

View File

@ -1,13 +1,18 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS builder
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder
RUN wget -qO /tmp/hwi.tar.gz https://github.com/bitcoin-core/HWI/releases/download/2.1.1/hwi-2.1.1-linux-amd64.tar.gz && \
RUN wget -qO /tmp/hwi.tar.gz https://github.com/bitcoin-core/HWI/releases/download/3.2.0/hwi-3.2.0-linux-x86_64.tar.gz && \
tar -zxvf /tmp/hwi.tar.gz -C /tmp hwi && \
echo "7f4cbe4e5c2cd1ac892f9bd8ac35fb1f837b6a547b528b61aca895a212a90062 /tmp/hwi" | sha256sum -c - && \
echo "d9cc65de95e3cf93fd3c953d589184a00180624ffc5ad17aade97616a8919fa6 /tmp/hwi" | sha256sum -c - && \
rm /tmp/hwi.tar.gz
RUN apt-get update && \
apt-get install -y --no-install-recommends imagemagick && \
rm -rf /var/lib/apt/lists/*
WORKDIR /source
ENV RUNTIME "linux-x64"
COPY "Build/common" "Build/common"
COPY "Build/linux-x64" "Build/linux-x64"
ENV EXPORT_VARIABLES "source Build/common/export-variables.sh"
COPY BTCPayServer.Vault/BTCPayServer.Vault.csproj BTCPayServer.Vault/BTCPayServer.Vault.csproj
COPY BTCPayServer.Hwi/BTCPayServer.Hwi.csproj BTCPayServer.Hwi/BTCPayServer.Hwi.csproj
@ -18,10 +23,17 @@ COPY BTCPayServer.Hwi BTCPayServer.Hwi
COPY BTCPayServer.Vault BTCPayServer.Vault
RUN $EXPORT_VARIABLES && dotnet_publish && mv /tmp/hwi "$PUBLISH_FOLDER/"
COPY "BTCPayServerVault.png" "BTCPayServerVault.png"
RUN $EXPORT_VARIABLES && \
cp -r "$RESOURCES_LINUX/udev" "$PUBLISH_FOLDER/" && \
cp -r $RESOURCES_LINUX/install-*.sh "$PUBLISH_FOLDER/" && \
cp -r "$RESOURCES_LINUX/BTCPayServerVault.desktop" "$PUBLISH_FOLDER/" && \
convert -background none -resize "64x64" "BTCPayServerVault.png" "/tmp/BTCPayServerVault.png" && \
cp "/tmp/BTCPayServerVault.png" "$PUBLISH_FOLDER/" && \
find "$PUBLISH_FOLDER" -type f -exec chmod 644 {} \; && \
find "$PUBLISH_FOLDER" -type f \( -name 'hwi' -o -name "$EXECUTABLE" \) -exec chmod +x {} \; && \
find "$PUBLISH_FOLDER" -type f \( -name 'hwi' -o -name "$EXECUTABLE" -o -name '*.sh' \) -exec chmod +x {} \; && \
# We need to cd in "$PUBLISH_FOLDER", because tar's -C option always add a root folder to the tar otherwise
cd "$PUBLISH_FOLDER" && tar -czf "$DIST/BTCPayServerVault-Linux-$VERSION.tar.gz" *
ENTRYPOINT [ "/bin/bash", "-c", "$EXPORT_VARIABLES && cp $DIST/* /opt/dist/" ]
ENTRYPOINT [ "/bin/bash", "-c", "$EXPORT_VARIABLES && cp -a $DIST/* /opt/dist/" ]

28
Build/linux-x64/install-arch.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
set -euo pipefail
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root." >&2
exit 1
fi
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
RULES_DIR="$SCRIPT_DIR/udev"
install -Dm644 "$SCRIPT_DIR/BTCPayServerVault.desktop" /usr/share/applications/BTCPayServerVault.desktop
install -Dm644 "$SCRIPT_DIR/BTCPayServerVault.png" /usr/share/icons/hicolor/64x64/apps/BTCPayServerVault.png
rm -rf /opt/BTCPayServer.Vault
mkdir -p /opt/BTCPayServer.Vault
cp -r "$SCRIPT_DIR"/. "/opt/BTCPayServer.Vault/"
chmod +x /opt/BTCPayServer.Vault/BTCPayServer.Vault
echo "/opt/BTCPayServer.Vault created"
ln -sfnT /opt/BTCPayServer.Vault/BTCPayServer.Vault /usr/local/bin/BTCPayServer.Vault
chmod +x /usr/local/bin/BTCPayServer.Vault
echo "/usr/local/bin/BTCPayServer.Vault created"
echo "If the Vault cannot access your hardware wallet, you may need to restart your computer."

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS builder
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder
# Optimize docker cache, do not make it one layer
RUN apt-get update
@ -7,9 +7,9 @@ RUN apt-get install -y --no-install-recommends imagemagick
RUN apt-get install -y --no-install-recommends git icnsutils
RUN wget -qO /tmp/hwi.tar.gz https://github.com/bitcoin-core/HWI/releases/download/2.3.1/hwi-2.3.1-mac-x86_64.tar.gz && \
RUN wget -qO /tmp/hwi.tar.gz https://github.com/bitcoin-core/HWI/releases/download/3.2.0/hwi-3.2.0-mac-x86_64.tar.gz && \
tar -zxvf /tmp/hwi.tar.gz -C /tmp hwi && \
echo "9059b8f7cf6fe42f6e37cd8015cd11cb8fb736650797b25da849c625ed61ea62 /tmp/hwi" | sha256sum -c - && \
echo "b3764a530b635e7a7348c9185e09e74b389f5f585094fe316f700eec7c761875 /tmp/hwi" | sha256sum -c - && \
rm /tmp/hwi.tar.gz
WORKDIR /source

11
Build/push-new-tag.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
version_file="$script_dir/../BTCPayServer.Vault/Version.csproj"
ver="$(grep -oPm1 '(?<=<Version>)[^<]+' "$version_file")"
tag="Vault/v$ver"
git tag -a "$tag" -m "$tag"
git push origin "$tag"

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS builder
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder
# Optimize docker cache, do not make it one layer
RUN apt-get update
@ -6,9 +6,9 @@ RUN apt-get install -y --no-install-recommends imagemagick
###
RUN apt-get install -y --no-install-recommends nsis unzip wine xxd osslsigncode openssl
RUN wget -qO "/tmp/hwi.zip" https://github.com/bitcoin-core/HWI/releases/download/2.3.1/hwi-2.3.1-windows-x86_64.zip && \
RUN wget -qO "/tmp/hwi.zip" https://github.com/bitcoin-core/HWI/releases/download/3.2.0/hwi-3.2.0-windows-x86_64.zip && \
unzip "/tmp/hwi.zip" -d "/tmp" && \
echo "460c8b83a9d8888ad769ffdc34dbe3ad7ecd27b22035494bdeb268d943be1791 /tmp/hwi.exe" | sha256sum -c - && \
echo "e068d91b664597425a8ead02d7b86a02ad6c4b72746c42961f58a58b08f9fd79 /tmp/hwi.exe" | sha256sum -c - && \
rm "/tmp/hwi.zip" && \
# Need to setup with rcedit because https://github.com/dotnet/sdk/issues/3943
# I prebuild the binaries with VS 2019 on commit b807b34a644c86c0b0d89c7f073967e79202731a

View File

@ -32,6 +32,37 @@ You can use brew:
brew install btcpayserver-vault
```
### On Arch Linux
Download the tarball on our [release page](https://github.com/btcpayserver/BTCPayServer.Vault/releases/latest)
```bash
tar -xvf <tarball.tar.gz>
sudo ./install-arch.sh
```
If BTCPay Server fails to detect your hardware wallet, you may need to restart.
Check if you try to run the `hwi` executable. If not, install python9 dependencies, and run
```bash
ln -s /usr/lib/libcrypt.so.2 /usr/lib/libcrypt.so.1
```
### On Debian
Download the `.deb` package on our [release page](https://github.com/btcpayserver/BTCPayServer.Vault/releases/latest)
```bash
sudo apt install <package.deb>
```
### Other linux
Inspire you from [install-arch.sh](Build/linux-x64/install-arch.sh).
We provide the udev rules and desktop entries in the tarball.
## How does BTCPayServer Vault work
When running the BTCPayServer Vault, a local webserver is hosted on `http://127.0.0.1:65092` which web applications, via your local browser, can connect to in order to interact with your hardware wallet.