Skip to content

Commit df5fcc2

Browse files
MaciekMaciej WójcikAdam Ciarciński
authored
chore: prepare initial crate release (#14)
* update crate metadata * update readme * update docs * add a release workflow * bump version --------- Co-authored-by: Maciej Wójcik <wojcik91@gmail.com> Co-authored-by: Adam Ciarciński <aciarcinski@teonite.com>
1 parent 1f5e3f4 commit df5fcc2

File tree

19 files changed

+204
-59
lines changed

19 files changed

+204
-59
lines changed

.github/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
categories:
6+
- title: Breaking Changes 🛠
7+
labels:
8+
- Semver-Major
9+
- breaking-change
10+
- title: Exciting New Features 🎉
11+
labels:
12+
- Semver-Minor
13+
- enhancement
14+
- title: Other Changes
15+
labels:
16+
- "*"

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Create a new GitHub release
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
7+
jobs:
8+
create-release:
9+
runs-on: self-hosted
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: Create release
14+
uses: softprops/action-gh-release@v1
15+
if: startsWith(github.ref, 'refs/tags/')
16+
with:
17+
draft: true
18+
generate_release_notes: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
.idea/

Cargo.lock

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
[package]
2-
name = "wireguard_rs"
3-
version = "0.1.0"
2+
name = "defguard_wireguard_rs"
3+
version = "0.2.0"
44
edition = "2021"
5-
5+
description = "A unified multi-platform high-level API for managing WireGuard interfaces"
6+
license = "Apache-2.0"
7+
readme = "README.md"
8+
homepage = "https://github.com/DefGuard/wireguard-rs"
9+
repository = "https://github.com/DefGuard/wireguard-rs"
10+
keywords = ["wireguard", "network", "vpn"]
11+
categories = ["network-programming"]
612

713
[dependencies]
814
base64 = "0.21"

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src="docs/header.png" alt="defguard">
33
</p>
44

5-
**wireguard-rs** is a Rust library providing a unified high-level API for managing WireGuard interfaces using native OS kernel and userspace WireGuard protocol implementations.
5+
**defguard_wireguard_rs** is a multi-platform Rust library providing a unified high-level API for managing WireGuard interfaces using native OS kernel and userspace WireGuard protocol implementations.
66
It can be used to create your own [WireGuard:tm:](https://www.wireguard.com/) VPN servers or clients for secure and private networking.
77

88
It was developed as part of [defguard](https://github.com/defguard/defguard) security platform and used in the [gateway/server](https://github.com/defguard/gateway) as well as [desktop client](https://github.com/defguard/client).
@@ -18,6 +18,11 @@ It was developed as part of [defguard](https://github.com/defguard/defguard) sec
1818
- macOS
1919
- FreeBSD
2020

21+
### Note on `wireguard-go`
22+
If you intend to use the userspace WireGuard implementation you should note that currently the library assumes
23+
that the `wireguard-go` binary will be available at runtime. There are some sanity checks when instantiating the API,
24+
but installing it is outside the scope of this project.
25+
2126
## Examples
2227

2328
* Client: https://github.com/DefGuard/wireguard-rs/blob/main/examples/client.rs

docs/header.png

-37 Bytes
Loading

examples/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{net::SocketAddr, str::FromStr};
22

3-
use wireguard_rs::{
4-
wgapi::WGApi, InterfaceConfiguration, IpAddrMask, Key, Peer, WireguardInterfaceApi,
3+
use defguard_wireguard_rs::{
4+
host::Peer, key::Key, net::IpAddrMask, InterfaceConfiguration, WGApi, WireguardInterfaceApi,
55
};
66
use x25519_dalek::{EphemeralSecret, PublicKey};
77

examples/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::str::FromStr;
22

3-
use wireguard_rs::{
4-
wgapi::WGApi, InterfaceConfiguration, IpAddrMask, Key, Peer, WireguardInterfaceApi,
3+
use defguard_wireguard_rs::{
4+
host::Peer, key::Key, net::IpAddrMask, InterfaceConfiguration, WGApi, WireguardInterfaceApi,
55
};
66
use x25519_dalek::{EphemeralSecret, PublicKey};
77

examples/userspace.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
use defguard_wireguard_rs::{
2+
host::Peer, key::Key, net::IpAddrMask, InterfaceConfiguration, WireguardApiUserspace,
3+
WireguardInterfaceApi,
4+
};
15
use std::{
26
io::{stdin, stdout, Read, Write},
37
net::SocketAddr,
48
str::FromStr,
59
};
6-
use wireguard_rs::{
7-
InterfaceConfiguration, IpAddrMask, Key, Peer, WireguardApiUserspace, WireguardInterfaceApi,
8-
};
910
use x25519_dalek::{EphemeralSecret, PublicKey};
1011

1112
fn pause() {

0 commit comments

Comments
 (0)