diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..85edd8b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: Build + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: -Dwarnings + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Run rustfmt + run: cargo fmt --all -- --check + - name: Run clippy + run: cargo clippy --all-targets + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb117fd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Cargo.lock +target \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b8068c6 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "nexy" +version = "0.1.0" +edition = "2024" +license = "MIT" +readme = "README.md" +description = "Multi-network server for the Nex protocol" +keywords = ["nex", "protocol", "tcp", "socket", "server"] +categories = ["network-programming"] +repository = "https://github.com/YGGverse/nexy" + +[dependencies] +anyhow = "1.0" +clap = { version = "4.5", features = ["derive"] } +urlencoding = "2.1" diff --git a/README.md b/README.md new file mode 100644 index 0000000..5e2c970 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# Nexy - Multi-network server for the [Nex protocol](https://nex.nightfall.city/nex/info/specification.txt) + +![Build](https://github.com/yggverse/server/actions/workflows/build.yml/badge.svg) +[![Dependencies](https://deps.rs/repo/github/yggverse/server/status.svg)](https://deps.rs/repo/github/yggverse/nexy) +[![crates.io](https://img.shields.io/crates/v/nexy)](https://crates.io/crates/nexy) + +Run server accessible to Internet IPv4/IPv6, [Yggdrasil](https://yggdrasil-network.github.io/), [Mycelium](https://github.com/threefoldtech/mycelium), and other networks simultaneously, as many as desired. + +## Install + +1. `git clone https://github.com/yggverse/nexy.git && cd nexy` +2. `cargo build --release` +3. `sudo install target/release/nexy /usr/local/bin/nexy` + +## Usage + +``` bash +nexy -p /path/to/public +``` +* by default, server starts on localhost; change it with the `--bind` option(s) + +### Options + +``` bash +-b, --bind + Bind server(s) `host:port` to listen incoming connections + + * use `[host]:port` notation for IPv6 + + [default: 127.0.0.1:1900 [::1]:1900] + +-d, --debug + Debug level + + * `e` - error * `i` - info + + [default: ei] + +-t, --template