Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions broker/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Role of this process: should be `broker` for the relay server
ROLE=broker

# Shared secret generated by the broker bootstrap.
# Paste this value into sender and viewer `.env` files so all three match.
SHARED_SECRET=change-me-generate-a-long-random-secret

# TLS listen port (where the broker accepts client connections)
LISTEN_PORT=7000
# Comma-separated list of allowed sender agentIds (each max 16 chars).

# Comma-separated list of allowed `SENDER_ID` values (e.g. laptop-01,laptop-02).
# Empty or missing = ALL senders are blocked. There is no wildcard mode.
# Example: ALLOWED_SENDERS=laptop-01,desktop-02
ALLOWED_SENDERS=laptop-01

# Paths to the broker TLS certificate and private key
TLS_CERT_PATH=../certs/server-cert.pem
TLS_KEY_PATH=../certs/server-key.pem

# Log verbosity: debug | info | warn | error
LOG_LEVEL=info
18 changes: 18 additions & 0 deletions sender/.env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# Role of this process: should be `sender` for machines being controlled
ROLE=sender

# Unique identifier for this sender (must be listed in the broker's ALLOWED_SENDERS)
SENDER_ID=laptop-01

# Shared secret used for HMAC challenge-response.
# MUST match the broker's `SHARED_SECRET` (copy the value printed by broker bootstrap)
SHARED_SECRET=change-me-must-match-broker

# Broker address (IP or hostname) and TLS port
BROKER_HOST=192.168.x.x
BROKER_PORT=7000

# Path to the CA certificate used to verify the broker TLS cert
# Copy `ca-cert.pem` from the broker into this path
TLS_CA_PATH=../certs/ca-cert.pem

# Capture settings
# Frames per second to capture (default: 30)
TARGET_FPS=30

# Encoder selection: jpeg | qsv | nvenc
ENCODER=jpeg

# JPEG quality (1-100). Used when ENCODER=jpeg
JPEG_QUALITY=75
8 changes: 8 additions & 0 deletions viewer/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Role of this process: use `receiver` for the viewer (control machine)
ROLE=receiver

# Shared secret — MUST match the broker's `SHARED_SECRET` (copy from broker bootstrap)
SHARED_SECRET=change-me-must-match-broker

# Broker IP or hostname and TLS port
BROKER_HOST=192.168.x.x
BROKER_PORT=7000

# Path to the CA certificate used to verify the broker TLS cert
# Copy `ca-cert.pem` from the broker into this path
TLS_CA_PATH=../certs/ca-cert.pem
10 changes: 10 additions & 0 deletions viewer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ protected override async void OnStartup(StartupEventArgs e)
var version = asm != null
? FileVersionInfo.GetVersionInfo(asm.Location).ProductVersion ?? asm.GetName().Version?.ToString()
: "0.0.0";
// WinExe has no console by default; attach to parent terminal so output is visible
AttachConsole(-1);
Console.WriteLine($"SelfDesk Viewer v{version}");
Console.Out.Flush();
FreeConsole();
Shutdown();
return;
}
Expand Down Expand Up @@ -78,4 +82,10 @@ protected override async void OnExit(ExitEventArgs e)

private static string GetEnv(string key, string def) =>
Environment.GetEnvironmentVariable(key) is { Length: > 0 } v ? v : def;

[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern bool AttachConsole(int dwProcessId);

[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern bool FreeConsole();
}
Loading