Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
e2e4644
Update to latest ISO versions (#78)
antonym Feb 11, 2025
4991567
Remove rounded corners from video stream (#86)
tutman96 Feb 11, 2025
d76e9dc
feat: add ICE servers and local IP address returned by the API to fix…
ym Feb 11, 2025
fd5b9eb
NEXT-ONLY: chore: update README
Nevexo Jan 5, 2025
979a1c6
Feature: Add a metrics endpoint
SuperQ Dec 31, 2024
c3be8fd
feat(ui/ActionBar): add Ctrl + Alt + Del button to Action Bar
Nevexo Jan 4, 2025
da9649a
feat(ui): make Ctrl + Alt + Del button a setting
Nevexo Jan 4, 2025
04a0cb8
feat(display.go): impl setDisplayBrightness()
Nevexo Jan 3, 2025
d7586ef
feat(config): add backlight control settings
Nevexo Jan 3, 2025
8d3b597
feat(display): add automatic dimming & switch off to display
Nevexo Jan 3, 2025
b15728a
feat(rpc): add methods to get and set BacklightSettings
Nevexo Jan 3, 2025
c907e74
WIP: feat(settings): add Max backlight setting
Nevexo Jan 3, 2025
69b0875
chore: use constant for backlight control file
Nevexo Jan 4, 2025
3bbc80e
fix: only attempt to wake the display if it's off
Nevexo Jan 4, 2025
3d93e72
feat(display): wake on touch
Nevexo Jan 4, 2025
93ce4c2
fix: re-use buffer between reads
Nevexo Jan 4, 2025
bda26d3
fix: wakeDisplay() on start to fix warm start issue
Nevexo Jan 4, 2025
8b6d924
chore: various comment & string updates
Nevexo Jan 5, 2025
f258815
fix(net): stop dhcp client and release all v4 addr on linkdown
Nevexo Jan 3, 2025
510f756
Implement plugin upload support and placeholder settings item
tutman96 Jan 1, 2025
82a614f
Add extracting and validating the plugin
tutman96 Jan 1, 2025
91c1287
Write plugin database to tmp file first
tutman96 Jan 4, 2025
f6c78d7
Implement pluginList RPC and associated UI
tutman96 Jan 4, 2025
cdb9bb7
Add enable/disable button
tutman96 Jan 4, 2025
c82ce1a
Add process_manager and subprocess spawning support
tutman96 Jan 4, 2025
a88e034
Handle "errored" condition instead of "stopped"
tutman96 Jan 4, 2025
41649bb
When tar extraction fails, delete extraction folder
tutman96 Jan 4, 2025
3946c32
Fix net Listener interface and implement max process backoff time
tutman96 Jan 5, 2025
ef0c360
Fix bad pointer reference
tutman96 Jan 5, 2025
2fafc4d
NEXT-ONLY: chore: update Makefile
Nevexo Jan 5, 2025
ef18e2c
Add ability to uninstall a plugin
tutman96 Jan 5, 2025
6144390
NEXT-ONLY: chore: update Makefile
Nevexo Jan 5, 2025
a841b70
NEXT-ONLY: chore: add hacky script to deploy next binary
Nevexo Jan 5, 2025
7c7830d
Golang standards :)
tutman96 Jan 5, 2025
8d2cade
Newlines for all things
tutman96 Jan 5, 2025
6c2f926
NEXT-ONLY: chore: update makefile (stop being an idiot)
Nevexo Jan 5, 2025
a57c0d0
NEXT-ONLY: add jetkvm/kvm#27 to README
Nevexo Jan 5, 2025
8705b33
feat: restore EDID on reboot
Nevexo Jan 6, 2025
87c5a64
NEXT-ONLY: introduce https://github.com/jetkvm/kvm/pull/34
Nevexo Jan 6, 2025
5f69a6d
NEXT-ONLY: Fix complete failure at merging config.go
Nevexo Jan 6, 2025
5a69b07
Refactor jsonrpc server into its own package
tutman96 Jan 5, 2025
b8c9250
wip: Plugin RPC with status reporting to the UI
tutman96 Jan 5, 2025
3cd47c7
Handle error conditions better and detect support methods automatically
tutman96 Jan 6, 2025
cb6a2d9
Change wording from TODO to coming soon
tutman96 Jan 6, 2025
af7062e
Better handle install and re-install lifecycle. Also display all the …
tutman96 Jan 6, 2025
af5f02c
NEXT-ONLY: DEBUG: webrtc: add debug statements
Nevexo Jan 6, 2025
60b0cc0
Handle messages async to datachannel receive
tutman96 Jan 6, 2025
b7c42c0
Rename JSONRPCServer to JSONRPCRouter
tutman96 Jan 19, 2025
81973af
fix: set default value for display
Nevexo Jan 20, 2025
08c382b
feat(display.go): use tickers to countdown to dim/off
Nevexo Jan 20, 2025
2660979
fix(rpc.go): use JSONRPCRouter instead of JSONRPCServer after merging…
Nevexo Jan 22, 2025
9988f0a
NEXT-ONLY: add multisession to README
Nevexo Jan 22, 2025
896dffe
chore: update config
Nevexo Jan 27, 2025
6fb4824
feat(display.go): wakeDisplay() force
Nevexo Jan 27, 2025
9b73516
feat(display.go): move tickers into their own method
Nevexo Jan 27, 2025
a46c72b
feat(display.go): stop tickers when auto-dim/auto-off is disabled
Nevexo Jan 27, 2025
a8fe166
feat(rpc): implement display backlight control methods
Nevexo Jan 27, 2025
f896429
feat(ui): implement display backlight control
Nevexo Jan 27, 2025
3d3b151
Fix fullscreen video relative mouse movements
tutman96 Jan 20, 2025
5ffe817
NEXT ONLY: Update README to credit new pulls
Nevexo Jan 27, 2025
86725ce
chore: update variable names
Nevexo Jan 28, 2025
fbbbd31
fix(display): move backlightTicker setup into screen setup goroutine
Nevexo Jan 28, 2025
ae5a119
chore: fix some start-up timing issues
Nevexo Jan 28, 2025
050df2b
fix(display): Don't attempt to start the tickers if the display is di…
Nevexo Jan 28, 2025
f1f4800
fix: wakeDisplay() doesn't need to stop the tickers
Nevexo Jan 28, 2025
86d6591
fix: Don't wake up the display if it's turned off
Nevexo Jan 28, 2025
e844d0f
squashed: jackislanding: Configurable USB IDs
adrianmeraz Jan 24, 2025
973b3d7
NEXT-ONLY: add jackislanding to README
Nevexo Jan 29, 2025
efef38d
Revert "Rename JSONRPCServer to JSONRPCRouter"
Nevexo Jan 30, 2025
26b8407
Revert "fix(rpc.go): use JSONRPCRouter instead of JSONRPCServer after…
Nevexo Jan 30, 2025
9e82e8f
custom-vidpid: fix for initial values being empty
adrianmeraz Jan 30, 2025
48bda2c
Early implementation of different keyboard layouts.
williamjohnstone Jan 29, 2025
ff33893
NEXT-ONLY: fix ctrlaltdel PR to work with custom keymaps
Nevexo Jan 30, 2025
8c84441
NEXT-ONLY: Update README to introduce #116
Nevexo Jan 30, 2025
b2dac6e
feat: add reboot button
Nevexo Jan 30, 2025
b8e3b4b
NEXT-ONLY: Introduce reboot button to README
Nevexo Jan 30, 2025
c5d8c26
Rename JSONRPCServer to JSONRPCRouter
tutman96 Jan 19, 2025
c43a364
Fix jsonrpc references
tutman96 Jan 30, 2025
595b27b
Enable "Boot Interface Subclass" for keyboard and mouse.
andnic Jan 29, 2025
4b0e7ee
NEXT-ONLY: Add andnic USB HID fix to README
Nevexo Jan 30, 2025
c3e99a0
NEXT-ONLY: fix next_deploy
Nevexo Feb 5, 2025
0f10aba
NEXT-ONLY: instructions
Nevexo Feb 5, 2025
18fa6c6
Update xterm dependency to @xterm/xterm and adjust imports accordingly
Feb 13, 2025
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
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
BUILDDATE ?= $(shell date --iso-8601=seconds)
REVISION ?= $(shell git rev-parse HEAD)
VERSION_DEV := 0.3.5-dev$(shell date +%Y%m%d%H%M)
VERSION_NEXT := 0.3.5-$(shell git rev-parse --short HEAD)-$(shell git describe --tags --abbrev=0)
VERSION := 0.3.4

GO_LDFLAGS := \
-s -w \
-X github.com/prometheus/common/version.Branch=$(BRANCH) \
-X github.com/prometheus/common/version.BuildDate=$(BUILDDATE) \
-X github.com/prometheus/common/version.Revision=$(REVISION)

hash_resource:
@shasum -a 256 resource/jetkvm_native | cut -d ' ' -f 1 > resource/jetkvm_native.sha256

build_dev: hash_resource
@echo "Building..."
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w -X kvm.builtAppVersion=$(VERSION_DEV)" -o bin/jetkvm_app cmd/main.go
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="$(GO_LDFLAGS) -X kvm.builtAppVersion=$(VERSION_DEV)" -o bin/jetkvm_app cmd/main.go

frontend:
cd ui && npm ci && npm run build:device
Expand All @@ -19,7 +29,11 @@ dev_release: build_dev

build_release: frontend hash_resource
@echo "Building release..."
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w -X kvm.builtAppVersion=$(VERSION)" -o bin/jetkvm_app cmd/main.go
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="$(GO_LDFLAGS) -X kvm.builtAppVersion=$(VERSION)" -o bin/jetkvm_app cmd/main.go

build_next: frontend hash_resource
@echo "Building jetkvm-next..."
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="$(GO_LDFLAGS) -X kvm.builtAppVersion=$(VERSION_NEXT)" -o bin/next/jetkvm_app cmd/main.go

release:
@if rclone lsf r2://jetkvm-update/app/$(VERSION)/ | grep -q "jetkvm_app"; then \
Expand Down
177 changes: 152 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,173 @@
<div align="center">
<img alt="JetKVM logo" src="https://jetkvm.com/logo-blue.png" height="28">
# jetkvm-next

### KVM
> jetkvm-next is not affiliated with, nor supported by, JetKVM or BuildJet.

[Discord](https://jetkvm.com/discord) | [Website](https://jetkvm.com) | [Issues](https://github.com/jetkvm/cloud-api/issues) | [Docs](https://jetkvm.com/docs)
jetkvm-next is a fork of the JetKVM application with various in-progress features merged in from commnunity
pull requests.

[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/jetkvm.svg?style=social&label=Follow%20%40JetKVM)](https://twitter.com/jetkvm)
This branch isn't meant to be pulled into the upstream, and will almost certainly contain some bugs, it's a
bleeding-edge build of the software that community members can use to try out new features, or for developers to check
their upcoming features don't clash with other in-progress PRs.

</div>
Main repo: https://github.com/jetkvm/kvm

JetKVM is a high-performance, open-source KVM over IP (Keyboard, Video, Mouse) solution designed for efficient remote management of computers, servers, and workstations. Whether you're dealing with boot failures, installing a new operating system, adjusting BIOS settings, or simply taking control of a machine from afar, JetKVM provides the tools to get it done effectively.
## Current Additional Features
The below [in-development features](https://github.com/jetkvm/kvm) are currently included in `jetkvm-next`.
The commits from the developer's working tree and cherry picked into this branch, to check the "version" of the feature,
compare the commit hash on this branch, to the current hash of the commit(s) in the pull request.

## Features
- tutman - [Plugin System](https://github.com/jetkvm/kvm/pull/10)
- SuperQ - [Prometheus Metrics](https://github.com/jetkvm/kvm/pull/6)
- Nevexo - [Force-release IPv4 addresses on Link Down](https://github.com/jetkvm/kvm/pull/16)
- Nevexo - [Display backlight brightness control](https://github.com/jetkvm/kvm/pull/17)
- Nevexo - [CTRL+ALT+DEL Button on Action Bar](https://github.com/jetkvm/kvm/pull/18)
- tutman - [Clean-up jetkvm_native when app exits](https://github.com/jetkvm/kvm/pull/19)
- Nevexo - [Only start WebSocket client when necessary](https://github.com/jetkvm/kvm/pull/27)
- Nevexo - [Restore EDID on Reboot](https://github.com/jetkvm/kvm/pull/34)
- tutman - [Remove Rounded Corners](https://github.com/jetkvm/kvm/pull/86)
- antonym - [Update ISO Versions](https://github.com/jetkvm/kvm/pull/78)
- tutman - [Fix fullscreen video absolute position](https://github.com/jetkvm/kvm/pull/85)
- jackislanding - [Allow configuring USB IDs](https://github.com/jetkvm/kvm/pulls/90)
- williamjohnstone - [Multiple Keyboard Layouts](https://github.com/jetkvm/kvm/pull/116)
- andnic - [USB HID Fix](https://github.com/jetkvm/kvm/pull/113)
- Nevexo - Add Reboot Button (No PR for this as it's not final)

- **Ultra-low Latency** - 1080p@60FPS video with 30-60ms latency using H.264 encoding. Smooth mouse and keyboard interaction for responsive remote control.
- **Free & Optional Remote Access** - Remote management via JetKVM Cloud using WebRTC.
- **Open-source software** - Written in Golang on Linux. Easily customizable through SSH access to the JetKVM device.
If you're looking to try these features out in jetkvm-next, you should go to the PR and read the authors documentation.

## Contributing
## next-multisession
As requested by a few in the [JetKVM Discord](https://jetkvm.com/discord), this tree also includes a branch that enables
support for multiple sessions connecting to the JetKVM.

We welcome contributions from the community! Whether it's improving the firmware, adding new features, or enhancing documentation, your input is valuable. We also have some rules and taboos here, so please read this page and our [Code of Conduct](/CODE_OF_CONDUCT.md) carefully.
It's a bit of a bodge implementation, but shows the multiple sessions can be handled by the JetKVM.

## I need help
Every release of jetkvm-next includes jetkvm-next-multisession in a pre-release, the jetkvm-next-multisession branch is based
off the main jetkvm-next branch, and applies changes to the session handling code.

The best place to search for answers is our [Documentation](https://jetkvm.com/docs). If you can't find the answer there, check our [Discord Server](https://discord.gg/8MaAhua7NW).
next-muiltisession does not include any concept of control authority/mutex, so all users connected will have full control
over the target machine, and you'll be fighting for the cursor with the other user.

## I want to report an issue
## Installation
> You should read this section multiple times before even plugging in the JetKVM device.
> If these instructions don't immediately make sense, then it's probably best to avoid installing
> jetkvm-next, it's incredibly bleeding-edge, and could explode in a million different ways.

If you've found an issue and want to report it, please check our [Issues](https://github.com/jetkvm/kvm/issues) page. Make sure the description contains information about the firmware version you're using, your platform, and a clear explanation of the steps to reproduce the issue.
**DISCLAIMER:** This is very much beta, canary, unstable, software there could be bugs that cause
damage to your JetKVM hardware, such as wearing out the eMMC, breaking the LCD or overheating.

# Development
**On Windows?:** Install WSL now, it makes life much easier.

JetKVM is written in Go & TypeScript. with some bits and pieces written in C. An intermediate level of Go & TypeScript knowledge is recommended for comfortable programming.
### Prepare the KVM
Boot up your KVM, login, and enable SSH access with your SSH public key.

The project contains two main parts, the backend software that runs on the KVM device and the frontend software that is served by the KVM device, and also the cloud.
Test you can login to the KVM with your SSH key, remember the username is `root`.

For most of local device development, all you need is to use the `./dev_deploy.sh` script. It will build the frontend and backend and deploy them to the local KVM device. Run `./dev_deploy.sh --help` for more information.
### Build your own binary
While I provide pre-compiled binaries with every [release](https://github.com/nevexo/jetkvm-kvm/releases), you can (and should) build
the binary yourself, this allows you to analyse the code running on your device, and be familiar with the innerworkings of the JetKVM
software stack, before you have to start debugging it.

## Backend
#### You will need:
- A JavaScript runtime, such as Node.JS ([Bun](https://bun.sh) works fine, but you'll need to adjust the Makefile)
- Git
- Go (and the various compilers for ARMv7)
- make

The backend is written in Go and is responsible for the KVM device management, the cloud API and the cloud web.
#### Get the code
Make yourself a directory to keep jetkvm-next in, and clone the repo:

## Frontend
`git clone https://github.com/nevexo/jetkvm-kvm.git`

The frontend is written in React and TypeScript and is served by the KVM device. It has three build targets: `device`, `development` and `production`. Development is used for development of the cloud version on your local machine, device is used for building the frontend for the KVM device and production is used for building the frontend for the cloud.
(If you're updating, just do `git pull` in the jetkvm-kvm directory.)

As the next branch is the main development branch of jetkvm-next, it may not build as-is, so you should check-out
one of the tags for the version you want to use. At the time of writing, that's next-7, but if I forget to update
the README (I will) you should check [the releases page](https://github.com/nevexo/jetkvm-kvm/releases) for the latest tags.

`git checkout next-7`

If you want multisession, then stick -multisession on the end of the checkout command, but note I usually release multisession
a little bit later than the default.

Your code will now be in line with the code in the binary released.

#### Build the code
This will automatically build both the frontend and the jetkvm-next binary. If you don't have the proper ARM compilers
installed for Go, you'll see some errors, simply Google the package that Go says is missing, and the name of your OS, and you'll
be able to find it. (If you're on WSL, search for the distro you're using, not Windows)

`make build_next`

#### Deploy the binary
**NOTE:** There's a bug in next_deploy.sh for all versions next-7 and older, so if you're building one of those, you'll need to
run these commands first:

```
mkdir -p bin/next
touch bin/jetkvm_app
```
(the script checks if the normal jetkvm_app binary exists, even though it only needs the one in bin/next, oops!)

Run the deployment script:
```
./next_deploy.sh -r [address of kvm]
```

After a moment, you should see `Deployment complete!` - skip to the bottom to see how to launch it.

### Use the provided binary
Again, I highly recommend you get familiar with the innerworkings of the JetKVM stack and build your own binaries.
But, if you can't be bothered with the above:

#### Get the binary
Simply go to the releases page, and download the latest available image, you can choose the multisession version at this stage, if you wish.

Pop the binary somewhere that you can get to with your terminal (on WSL, that's probably /mnt/c/Users/[yourname]/Downloads)

#### Deploy the binary
**NOTE:** The buildroot image on the JetKVM doesn't have support for scp, so this is where it gets interesting.

Use `cat` to send the contents of the jetkvm_app_next binary over to your KVM.

`cat jetkvm_app_next | ssh "root@[IP of JetKVM]" "cat > /userdata/jetkvm/bin/jetkvm_app_next"`

That's it :)

## Run jetkvm-next
**NOTE:** You need to be somewhat quick at doing this as the kernel watchdog timer will reboot the jetkvm
if the jetkvm_app binary hasn't been running for a while. You can turn that off by running `echo 'V' > /dev/watchdog`

To run jetkvm-next now, run:
```
cd /userdata/jetkvm/bin
killall jetkvm_app
killall jetkvm_native
./jetkvm_app_next
```

The app will launch, and you can try out the new features! When you reboot the device, it'll return to jetkvm_app.

### Use jetkvm-next by default
You can rename the jetkvm_app binaries to make the KVM start next by default.

```
cd /userdata/jetkvm/bin
killall jetkvm_app
killall jetkvm_native
mv jetkvm_app jetkvm_app_old
mv jetkvm_app_next jetkvm_app
reboot
```

Your JetKVM is now running jetkvm-next!

### Going back to stable
If you followed the above instructions properly, switching back to stable is easy.

```
cd /userdata/jetkvm/bin
killall jetkvm_app
mv jetkvm_app jetkvm_app_next
mv jetkvm_app_old jetkvm_app
```

If you lost jetkvm_app_old, then [factory reset](https://jetkvm.com/docs/advanced-usage/factory-reset).
11 changes: 8 additions & 3 deletions cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
"fmt"
"net/http"
"net/url"
"github.com/coder/websocket/wsjson"
"time"

"github.com/coder/websocket/wsjson"

"github.com/coreos/go-oidc/v3/oidc"

"github.com/gin-gonic/gin"
"github.com/coder/websocket"
"github.com/gin-gonic/gin"
)

type CloudRegisterRequest struct {
Expand Down Expand Up @@ -192,7 +193,11 @@ func handleSessionRequest(ctx context.Context, c *websocket.Conn, req WebRTCSess
return fmt.Errorf("google identity mismatch")
}

session, err := newSession()
session, err := newSession(SessionConfig{
ICEServers: req.ICEServers,
LocalIP: req.IP,
IsCloud: true,
})
if err != nil {
_ = wsjson.Write(context.Background(), c, gin.H{"error": err})
return err
Expand Down
35 changes: 25 additions & 10 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,32 @@ type WakeOnLanDevice struct {
MacAddress string `json:"macAddress"`
}

type UsbConfig struct {
VendorId string `json:"vendor_id"`
ProductId string `json:"product_id"`
SerialNumber string `json:"serial_number"`
Manufacturer string `json:"manufacturer"`
Product string `json:"product"`
}

type Config struct {
CloudURL string `json:"cloud_url"`
CloudToken string `json:"cloud_token"`
GoogleIdentity string `json:"google_identity"`
JigglerEnabled bool `json:"jiggler_enabled"`
AutoUpdateEnabled bool `json:"auto_update_enabled"`
IncludePreRelease bool `json:"include_pre_release"`
HashedPassword string `json:"hashed_password"`
LocalAuthToken string `json:"local_auth_token"`
LocalAuthMode string `json:"localAuthMode"` //TODO: fix it with migration
WakeOnLanDevices []WakeOnLanDevice `json:"wake_on_lan_devices"`
CloudURL string `json:"cloud_url"`
CloudToken string `json:"cloud_token"`
GoogleIdentity string `json:"google_identity"`
JigglerEnabled bool `json:"jiggler_enabled"`
AutoUpdateEnabled bool `json:"auto_update_enabled"`
KeyboardLayout string `json:"keyboard_layout"`
IncludePreRelease bool `json:"include_pre_release"`
HashedPassword string `json:"hashed_password"`
LocalAuthToken string `json:"local_auth_token"`
LocalAuthMode string `json:"localAuthMode"` //TODO: fix it with migration
WakeOnLanDevices []WakeOnLanDevice `json:"wake_on_lan_devices"`
DisplayMaxBrightness int `json:"display_max_brightness"`
DisplayDimAfterSec int `json:"display_dim_after_sec"`
DisplayOffAfterSec int `json:"display_off_after_sec"`
EdidString string `json:"hdmi_edid_string"`
UsbConfig UsbConfig `json:"usb_config"`
VirtualMediaEnabled bool `json:"virtual_media_enabled"`
}

const configPath = "/userdata/kvm_config.json"
Expand Down
Loading