mirror of
https://github.com/htrefil/rkvm.git
synced 2025-01-18 10:26:12 +01:00
Merge branch 'master' into rpmbuild
This commit is contained in:
commit
0f9acf8f42
6 changed files with 91 additions and 22 deletions
28
.github/workflows/release.yml
vendored
Normal file
28
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
name: Release
|
||||
|
||||
on: [push]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Test
|
||||
run: cargo test --release
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
- name: Upload portable executable
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: release
|
||||
path: |
|
||||
target/release/*.exe
|
||||
|
71
README.md
71
README.md
|
@ -13,25 +13,68 @@ Switching between different clients is done by a configurable keyboard shortcut.
|
|||
- Rust 1.48 and higher
|
||||
|
||||
## Linux requirements
|
||||
- The uinput Linux kernel module, enabled by default in most distros
|
||||
- libevdev
|
||||
- The uinput Linux kernel module, enabled by default in most distros. You can confirm that it's enabled in your distro by checking that `/dev/uinput` exists.
|
||||
- libevdev development files (`sudo apt install libevdev-dev` on Debian/Ubuntu)
|
||||
- OpenSSL
|
||||
- Clang/LLVM (`sudo apt install clang` on Debian/Ubuntu)
|
||||
|
||||
## Building
|
||||
Run `cargo build --release`.
|
||||
Note that you need to have libevdev installed on your system, otherwise the build will fail.
|
||||
## Installation
|
||||
1. First, build the project.
|
||||
|
||||
## Generating certificates
|
||||
The repo contains a simple Rust program, `certificate-gen`, to aid certificate generation.
|
||||
Run `cargo run --bin certificate-gen -- --help` to see and usage.
|
||||
$ cargo build --release
|
||||
|
||||
## Setting up
|
||||
First, build the project and generate certificates. Client accepts certificates both in PEM and DER formats.
|
||||
On Linux, you either need to run either of the programs as root or make `/dev/uinput` accessible by the user it runs as.
|
||||
Note that you need to have libevdev installed on your system, otherwise the build will fail.
|
||||
|
||||
By default, the programs reads their config files from /etc/rkvm/{server,client}.toml on Linux and C:/rkvm/{server,client}.toml on Windows, this can be changed by passing the path as the first command line parameter.
|
||||
2. Generate server certificates. The repo contains a simple Rust program, `certificate-gen`, to aid certificate generation. To see usage, run:
|
||||
|
||||
$ cargo run --bin certificate-gen -- --help
|
||||
|
||||
For example, where your server is *my-server-name* and your local network is *example.lan*, you might generate certificates with:
|
||||
|
||||
$ mkdir cert/
|
||||
$ target/release/certificate-gen cert/my-server-name.p12 \
|
||||
cert/my-server-name_cert.pem \
|
||||
cert/my-server-name_key.pem \
|
||||
--dns-names my-server-name.example.lan
|
||||
|
||||
3. Install the release to its destination directory. `/opt/rkvm` is a good choice for Linux:
|
||||
|
||||
$ sudo cp -r target/release /opt/rkvm
|
||||
|
||||
4. On Linux, you either need to run the programs as root or make `/dev/uinput` accessible by the user it runs as. For example, if the user belongs to the *rkvm* group, you could set `/dev/uinput` writeable by it:
|
||||
|
||||
$ sudo chgrp rkvm /dev/uinput
|
||||
$ sudo chmod g+rw /dev/uinput
|
||||
|
||||
5. Create config files. By default, the program reads their config files from /etc/rkvm/{server,client}.toml on Linux and C:/rkvm/{server,client}.toml on Windows. This can be changed by passing the path as the first command line parameter.
|
||||
|
||||
The [example](example) directory contains example configurations and systemd service files. If you are going to save your certificates in the same directory as the configuration, you will need to specify their full path in the config files.
|
||||
|
||||
6. Put the certificates in place. For example, on the server:
|
||||
|
||||
$ sudo cp cert/* /etc/rkvm/
|
||||
|
||||
Make sure the identify file is readable by the user that the server is running as.
|
||||
|
||||
On a client:
|
||||
|
||||
$ scp cert/my-server-name_cert.pem my-client1-name.example.lan:/etc/rkvm/
|
||||
|
||||
7. You are ready to go! Start the server with:
|
||||
|
||||
$ /opt/rkvm/server
|
||||
|
||||
Start the client with:
|
||||
|
||||
$ /opt/rkvm/client
|
||||
|
||||
Info-level logging is logged to the console.
|
||||
|
||||
8. If you want to start rkvm automatically, you can place the relevant systemd service file in /etc/systemd/system/. For example, on the server:
|
||||
|
||||
$ sudo cp example/rkvm-server.service /etc/systemd/system/
|
||||
$ sudo chmod +x /etc/systemd/system/rkvm-server.service
|
||||
|
||||
The [example](example) directory contains example configurations and systemd service files.
|
||||
|
||||
## Why rkvm and not Barrier/Synergy?
|
||||
The author of this program had a lot of problems with said programs, namely his keyboard layout (Czech) not being supported properly, which stems from the fact that the programs send characters which it then attempts to translate back into keycodes. rkvm takes a different approach to solving this problem and doesn't assume anything about your keyboard layout -- it sends raw keycodes only.
|
||||
|
@ -57,4 +100,4 @@ Regardless, if you want a working and stable solution for crossplatform keyboard
|
|||
All contributions, that includes both PRs and issues, are very welcome.
|
||||
|
||||
## License
|
||||
[MIT](LICENSE)
|
||||
[MIT](LICENSE)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "certificate-gen"
|
||||
name = "rkvm-certificate-gen"
|
||||
version = "0.1.0"
|
||||
authors = ["htrefil <8711792+htrefil@users.noreply.github.com>"]
|
||||
edition = "2018"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
[package]
|
||||
name = "client"
|
||||
description = "A tool for sharing keyboard and mouse across multiple Linux and Windows machines, the client"
|
||||
name = "rkvm-client"
|
||||
license = "MIT"
|
||||
version = "0.2.0"
|
||||
authors = ["Jan Trefil <8711792+htrefil@users.noreply.github.com>"]
|
||||
|
@ -21,7 +20,7 @@ tokio-native-tls = "0.3.0"
|
|||
anyhow = "1.0.33"
|
||||
|
||||
[package.metadata.rpm]
|
||||
package = "client"
|
||||
package = "rkvm-client"
|
||||
|
||||
[package.metadata.rpm.cargo]
|
||||
buildflags = ["--release"]
|
||||
|
|
|
@ -13,7 +13,7 @@ fn main() {
|
|||
println!("cargo:rerun-if-changed=glue/glue.h");
|
||||
|
||||
let library = Config::new()
|
||||
.atleast_version("1.9.1")
|
||||
.atleast_version("1.9.0")
|
||||
.probe("libevdev")
|
||||
.unwrap();
|
||||
let args = library
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
[package]
|
||||
name = "server"
|
||||
description = "A tool for sharing keyboard and mouse across multiple Linux and Windows machines, the server"
|
||||
name = "rkvm-server"
|
||||
license = "MIT"
|
||||
version = "0.2.0"
|
||||
authors = ["Jan Trefil <8711792+htrefil@users.noreply.github.com>"]
|
||||
|
@ -21,7 +20,7 @@ tokio-native-tls = "0.3.0"
|
|||
anyhow = "1.0.33"
|
||||
|
||||
[package.metadata.rpm]
|
||||
package = "server"
|
||||
package = "rkvm-server"
|
||||
|
||||
[package.metadata.rpm.cargo]
|
||||
buildflags = ["--release"]
|
||||
|
|
Loading…
Reference in a new issue