Skip to content

Commit 15d6a23

Browse files
authored
Merge pull request #1067 from ElectronNET/develop
Release 0.5.0
2 parents e529d09 + c76ce97 commit 15d6a23

118 files changed

Lines changed: 61682 additions & 177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CONTRIBUTING.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,16 @@ TL;DR: Unless there is a technical reason (e.g., a crucial new API not being ava
134134

135135
We pretty much release whenever we have something new (i.e., do fixes such as a 0.1.1, or add new features, such as a 0.2.0) quite quickly.
136136

137-
We will go for a 1.0.0 release of this as early as ~mid of January 2026 (unless we find some critical things or want to extend the beta phase for ElectronNET.Core). This should be sufficient time to get some user input and have enough experience to call it stable.
137+
We will go for a 1.0.0 release of this as early as ~mid of June 2026 (unless we find some critical things or want to extend the beta phase for ElectronNET.Core). This should be sufficient time to get some user input and have enough experience to call it stable.
138+
139+
## Updating Electron Versions
140+
141+
The releases of Electron are found on the [releases.electronjs.org](https://releases.electronjs.org/release?page=1) website.
142+
143+
You can update the `src\ElectronNET\build\ElectronNETRules.Project.xaml` file with new entries using the following script (run it in the browser's console when being on the Electron Releases website):
144+
145+
```js
146+
[...new Set([...document.querySelectorAll('tbody tr a[href^="/release/v"]')].map(m => m.getAttribute('href').replace('/release/v', '')))].map(m => `<EnumValue Name="${m}" DisplayName="${m}" />`).sort().join('\n')
147+
```
148+
149+
Alternatively, use the website's information to feed into an AI agent of your choice.

.github/workflows/Build and Publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build and Publish
22

3-
on: [push]
3+
on:
4+
push:
5+
branches: [main, develop]
46

57
env:
68
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/integration-tests.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ on:
44
workflow_call:
55

66
concurrency:
7-
group: integration-tests-${{ github.ref }}
7+
group: integration-tests-${{ github.workflow }}-${{ github.ref }}
88
cancel-in-progress: true
99

1010
jobs:
1111
tests:
1212
name: ${{ matrix.os }} API-${{ matrix.electronVersion }}
1313
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 25
1415
strategy:
1516
fail-fast: false
1617
matrix:
@@ -42,13 +43,6 @@ jobs:
4243
- name: Checkout
4344
uses: actions/checkout@v4
4445

45-
- name: Random delay (0-20 seconds)
46-
shell: bash
47-
run: |
48-
DELAY=$((RANDOM % 21))
49-
echo "Waiting for $DELAY seconds..."
50-
sleep $DELAY
51-
5246
- name: Setup .NET
5347
uses: actions/setup-dotnet@v4
5448
with:
@@ -79,27 +73,31 @@ jobs:
7973
- name: Run tests (Linux)
8074
if: runner.os == 'Linux'
8175
continue-on-error: true
76+
timeout-minutes: 15
8277
run: |
8378
mkdir -p test-results
8479
xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
8580
-c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} \
8681
--logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" \
8782
--logger "console;verbosity=detailed" \
83+
--blame-hang --blame-hang-timeout 5min \
8884
--results-directory test-results
8985
9086
- name: Run tests (Windows)
9187
if: runner.os == 'Windows'
9288
continue-on-error: true
89+
timeout-minutes: 15
9390
run: |
9491
New-Item -ItemType Directory -Force -Path test-results | Out-Null
95-
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
92+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --blame-hang --blame-hang-timeout 5min --results-directory test-results
9693
9794
- name: Run tests (macOS)
9895
if: runner.os == 'macOS'
9996
continue-on-error: true
97+
timeout-minutes: 15
10098
run: |
10199
mkdir -p test-results
102-
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
100+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --blame-hang --blame-hang-timeout 5min --results-directory test-results
103101
104102
- name: Upload raw test results
105103
if: always()
@@ -114,6 +112,7 @@ jobs:
114112
runs-on: ubuntu-24.04
115113
if: always()
116114
needs: [tests]
115+
timeout-minutes: 10
117116

118117
permissions:
119118
actions: read

.github/workflows/retry-test-jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
echo "Inspecting jobs of workflow run $RUN_ID in $REPO"
2929
30-
jobs_json="$(gh api -R $REPO repos/$REPO/actions/runs/$RUN_ID/jobs)"
30+
jobs_json="$(gh api repos/$REPO/actions/runs/$RUN_ID/jobs)"
3131
3232
echo "Jobs and conclusions:"
3333
echo "$jobs_json" | jq '.jobs[] | {name: .name, conclusion: .conclusion}'

Changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 0.5.0
2+
3+
## ElectronNET.Core
4+
5+
- Updated internal facade from `SocketIoFacade` to `ISocketConnection` (#1037)
6+
- Fixed `HasShadow` is not `true` by default (#1049) @AeonSake
7+
- Fixed missing `ReadAllLines` in MSBuild execution (#1035)
8+
- Fixed serialization of release notes for the updater (#1041)
9+
- Added automatic port selection and secured IPC communication (#1038)
10+
111
# 0.4.1
212

313
## ElectronNET.Core

docs/GettingStarted/Console-App.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Add the Electron.NET configuration to your `.csproj` file:
5454
</PropertyGroup>
5555

5656
<ItemGroup>
57-
<PackageReference Include="ElectronNET.Core" Version="0.4.1" />
57+
<PackageReference Include="ElectronNET.Core" Version="0.5.0" />
5858
</ItemGroup>
5959
```
6060

docs/Using/Secure-Communication.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Secure Communication
2+
3+
By default, the IPC communication between .NET and Node.js is secured on startup. Consequently, multiple instances running on different user accounts (but shared on the same machine) can safely co-exist. However, this protection is not enough to secure the web application behind - or make any security statement w.r.t. a malicious root user.
4+
5+
## Securing the Web Application
6+
7+
You can opt-in to also guard your ASP.NET Core application using the same mechanism that is already used to protected the IPC broker that deals with the .NET to Node.js communication.
8+
9+
The key to opt-in is to provide another service *before* calling `AddElectron` on the service collection.
10+
11+
The following two namespaces are used in the next instructions:
12+
13+
```cs
14+
using ElectronNET.AspNet.Middleware;
15+
using ElectronNET.AspNet.Services;
16+
```
17+
18+
You'll need the following line:
19+
20+
```cs
21+
builder.Services.AddSingleton<IElectronAuthenticationService, ElectronAuthenticationService>();
22+
```
23+
24+
This way, Electron.NET is notified that you want to store and re-use the authentication token that has been negotiated between the .NET and Node.js processes at startup.
25+
26+
With this being set up you can register a middleware to actually deny requests that have originated outside of your Electron.NET application:
27+
28+
```cs
29+
app.UseMiddleware<ElectronAuthenticationMiddleware>();
30+
```
31+
32+
This must be placed above any routing (e.g., before calling `UseRouting` on the web application) in order to properly take effect.

docs/_Sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- [Startup-Methods](Using/Startup-Methods.md)
2525
- [Debugging](Using/Debugging.md)
2626
- [Package Building](Using/Package-Building.md)
27+
- [Secure Communication](Using/Secure-Communication.md)
2728
- [Adding a `custom_main.js`](Using/Custom_main.md)
2829

2930
# API Reference

src/ElectronNET.API/API/Entities/BrowserWindowOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ public class BrowserWindowOptions
215215
/// <summary>
216216
/// Whether window should have a shadow. Default is true.
217217
/// </summary>
218-
public bool HasShadow { get; set; }
218+
[DefaultValue(true)]
219+
public bool HasShadow { get; set; } = true;
219220

220221
/// <summary>
221222
/// Forces using dark theme for the window, only works on some GTK+3 desktop environments. Default is false.

src/ElectronNET.API/API/Entities/UpdateInfo.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
namespace ElectronNET.API.Entities
1+
using System;
2+
using System.Text.Json.Serialization;
3+
using ElectronNET.API.Converter;
4+
5+
namespace ElectronNET.API.Entities
26
{
37
/// <summary>
48
///
@@ -24,7 +28,8 @@ public class UpdateInfo
2428
/// <summary>
2529
/// Gets or sets the release notes.
2630
/// </summary>
27-
public ReleaseNoteInfo[] ReleaseNotes { get; set; } = new ReleaseNoteInfo[0];
31+
[JsonConverter(typeof(ReleaseNotesConverter))]
32+
public ReleaseNoteInfo[] ReleaseNotes { get; set; } = Array.Empty<ReleaseNoteInfo>();
2833

2934
/// <summary>
3035
/// Gets or sets the release date.

0 commit comments

Comments
 (0)