diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cb52dff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI +on: [push] +jobs: + lint: + name: lint + runs-on: ubuntu-22.04 + steps: + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt, clippy + + - name: checkout code + uses: actions/checkout@v1 + + - name: lint + run: make lint + + tests: + name: tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-13, ubuntu-22.04] + toolchain: ["stable", "nightly"] + + steps: + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - name: checkout code + uses: actions/checkout@v1 + + - name: test + run: make test diff --git a/.gitignore b/.gitignore index 6985cf1..196e176 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,8 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb + + +# Added by cargo + +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a6e7bc2 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "tailchat" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0db7099 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +.PHONY: test +test: + cargo test + +.PHONY: lint +lint: + cargo fmt --check + cargo clippy + +.PHONY: lint/fix +lint/fix: + cargo clippy --fix + +.PHONY: fmt +fmt: + cargo fmt diff --git a/README.md b/README.md index d60be54..fb43a2d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,50 @@ # tailchat -tailchat is a minimal/non scalable/crazy/possibly fun take on p2p chatting + +tailchat is a minimal/non scalable/crazy/possibly fun take on p2p chatting. + +This is an experiment mostly for fun and to explore the possibilities when you +have a secure small network and want to chat with people inside it. + +Not a novel idea... We know... but we also want to play around with some Rust :-). + +The major architectural constraints are: + + 1. Communication is always peer to peer + 2. Any storage (if any) is stored only on the peers participating on the conversation + 3. The network is secure (protocols will be plain text/binary, no TLS) + 4. Peer to peer communication is always possible + +The constraints and the overall design are inspired on the ideas by [Remembering the LAN](https://crawshaw.io/blog/remembering-the-lan), +a time where building networked software was easy and simple (we are that old): + +``` +The LAN was a magical place to learn about computers. +Besides the physical aspect of assembling and disassembling machines, +I could safely do things unthinkable on the modern internet: permission-less file sharing, +experimental servers with no security, shared software where any one machine could easily bring down +the network by typing in an innocuous command. +Even when I did bring down the network the impact never left the building. +I knew who I had to apologise to. + +With our LAN easy things were easy, and some hard things were possible. +``` + +Technology like wireguard/tailscale helps us go back to those simpler times by building "LANs" on top +of the Internet. We want to explore building things on top of this model, where application code +can just trust other peers and doesn't need to deal with the hassle of making peer-to-peer communication +work (NAT traversal is solved by the network layer, or NAT is not an issue for you like in a LAN). + +In general the project should work fine in a mesh VPN like Tailscale, but would also work fine in an actual LAN. + +## Installing + +TODO + +## Basic usage + +TODO + +## User Discovery + +TODO +At some point document different methods of user discovery ? For now start with adding IP/Hosts manually and all good :-). diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..319bc8c --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,3 @@ +pub fn run() { + println!("tailchat!!!"); +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..1a2635b --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + tailchat::run(); +}