Skip to content

Commit f66d931

Browse files
committed
- Add support for Debian Bookworm
- Bump worker to .NET Core 7.0 because 5.0 is EOL and isn't available for Bookworm
1 parent aae821c commit f66d931

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ DNSTools is split into two pieces:
88

99
## Website
1010

11-
The website is a C# ASP .NET Core 3.0 website, built using React and SignalR.
11+
The website is a C# ASP .NET Core 7.0 website, built using React and SignalR.
1212

1313
## Worker
1414

15-
The "worker" (or "agent") is a small app that runs on multiple servers around the world. It's a [gRPC](https://grpc.io/) service written in C# using .NET Core 3.0. In production, the workers are a mix of KVM and OpenVZ7 VPSes running Debian Buster (10).
15+
The "worker" (or "agent") is a small app that runs on multiple servers around the world. It's a [gRPC](https://grpc.io/) service written in C# using .NET Core 7.0. In production, the workers are a mix of KVM and OpenVZ7 VPSes running Debian Buster (10), Bullseye (11) or Bookworm (12).
1616

1717
Some workers (such as pings and traceroutes) use the standard `ping` and `traceroute` command-line utilities. Pings can only be sent by root, and reusing existing well-tested code is more secure than creating our own setuid binaries. Other tools (like DNS lookups) are all performed using C# code.
1818

1919
# Development
2020

21-
The `DnsTools.sln` VS2019 solution contains both the website and the worker.
21+
The `DnsTools.sln` Visual Studio 2022 solution contains both the website and the worker.
2222

2323
## Website
2424

ansible/deploy-workers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
set -ex
3-
if [ ! -d ../src/DnsTools.Worker/bin/Release/net5.0/linux-x64/publish/ ]; then
3+
if [ ! -d ../src/DnsTools.Worker/bin/Release/net7.0/linux-x64/publish/ ]; then
44
dotnet.exe publish ../src/DnsTools.Worker --no-self-contained -r linux-x64 -c Release
55
fi
66
ANSIBLE_CONFIG=/mnt/c/src/dnstools.ws/ansible/ansible.cfg ansible-playbook worker.yml --extra-vars '@passwd.yml' --vault-password-file=vault-password

ansible/roles/dnstools-worker/tasks/main.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,24 @@
1212
apt_key:
1313
url: https://packages.microsoft.com/keys/microsoft.asc
1414

15+
- name: .NET Core repository (bookworm)
16+
apt_repository:
17+
repo: deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/12/prod bookworm main
18+
state: present
19+
when: ansible_distribution_release == "bookworm"
20+
1521
- name: .NET Core repository (bullseye)
1622
apt_repository:
1723
repo: deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/11/prod bullseye main
1824
state: present
1925
when: ansible_distribution_release == "bullseye"
2026

27+
- name: Remove Bullseye .NET Core repository from Bookworm
28+
apt_repository:
29+
repo: deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/11/prod buster main
30+
state: absent
31+
when: ansible_distribution_release == "bookworm"
32+
2133
- name: Remove Buster .NET Core repository from Bullseye
2234
apt_repository:
2335
repo: deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/10/prod buster main
@@ -47,15 +59,17 @@
4759
name:
4860
- aspnetcore-runtime-3.1
4961
- dotnet-runtime-3.1
62+
- aspnetcore-runtime-5.0
63+
- dotnet-runtime-5.0
5064
state: absent
5165
when: clean_old_dotnet|bool
5266

5367
- name: Install packages
5468
apt:
5569
name:
56-
- aspnetcore-runtime-5.0
70+
- aspnetcore-runtime-7.0
5771
- certbot
58-
- dotnet-runtime-5.0
72+
- dotnet-runtime-7.0
5973
- htop
6074
- iputils-ping
6175
- mtr-tiny
@@ -116,7 +130,7 @@
116130

117131
- name: Copy worker
118132
synchronize:
119-
src: ../src/DnsTools.Worker/bin/Release/net5.0/linux-x64/publish/
133+
src: ../src/DnsTools.Worker/bin/Release/net7.0/linux-x64/publish/
120134
dest: /opt/dnstools-worker/
121135
rsync_path: "/usr/bin/rsync" # Avoiding sudo for rsync
122136

src/DnsTools.Worker/DnsTools.Worker.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<UserSecretsId>00cb3cca-d2b7-4c88-87e5-e2d2fdd702a5</UserSecretsId>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
<DockerfileContext>..\..</DockerfileContext>

0 commit comments

Comments
 (0)