├── .gitignore ├── docs ├── src │ ├── encryption │ │ ├── hashing │ │ │ └── index.md │ │ ├── symmetric │ │ │ └── index.md │ │ ├── asymmetric │ │ │ └── index.md │ │ ├── signatures │ │ │ └── index.md │ │ └── index.md │ ├── transports │ │ ├── ntcp2.md │ │ ├── index.md │ │ └── ssu.md │ ├── SUMMARY.md │ ├── netdb.md │ ├── introduction.md │ └── i2np.md └── book.toml ├── src ├── netdb │ ├── mod.rs │ └── netdb.rs ├── daemon │ ├── mod.rs │ ├── config.rs │ ├── program_arguments.rs │ └── daemon.rs └── main.rs ├── AUTHORS.md ├── tests └── example_test.rs ├── CHANGELOG.md ├── .github ├── dependabot.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ ├── gh-pages.yml │ ├── devskim.yml │ └── ci-cd.yml ├── Cargo.toml ├── .ri2p.config.toml ├── SECURITY.md ├── CONTRIBUTING.md ├── README.md ├── CODE_OF_CONDUCT.md ├── Cargo.lock └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | docs/book/ 3 | -------------------------------------------------------------------------------- /docs/src/encryption/hashing/index.md: -------------------------------------------------------------------------------- 1 | # Hashing 2 | 3 | **Coming soon. ™** 4 | -------------------------------------------------------------------------------- /src/netdb/mod.rs: -------------------------------------------------------------------------------- 1 | #[allow(clippy::module_inception)] 2 | pub mod netdb; 3 | -------------------------------------------------------------------------------- /docs/src/encryption/symmetric/index.md: -------------------------------------------------------------------------------- 1 | # Symmetric 2 | 3 | **Coming soon. ™** 4 | -------------------------------------------------------------------------------- /docs/src/encryption/asymmetric/index.md: -------------------------------------------------------------------------------- 1 | # Asymmetric 2 | 3 | **Coming soon. ™** 4 | -------------------------------------------------------------------------------- /docs/src/encryption/signatures/index.md: -------------------------------------------------------------------------------- 1 | # Signatures 2 | 3 | **Coming soon. ™** 4 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # Major Authors & Contributors 2 | 3 | - Christopher R. Bilger <> 4 | -------------------------------------------------------------------------------- /tests/example_test.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn should_always_assert_true() { 3 | assert_eq!(true, true); 4 | } 5 | -------------------------------------------------------------------------------- /src/daemon/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod config; 2 | #[allow(clippy::module_inception)] 3 | pub mod daemon; 4 | pub mod program_arguments; 5 | -------------------------------------------------------------------------------- /src/daemon/config.rs: -------------------------------------------------------------------------------- 1 | use serde_derive::{Deserialize, Serialize}; 2 | 3 | #[derive(Clone, Deserialize, Serialize)] 4 | pub struct Config { 5 | pub reseed_hosts: Vec, 6 | } 7 | -------------------------------------------------------------------------------- /docs/src/encryption/index.md: -------------------------------------------------------------------------------- 1 | # Encryption 2 | 3 | ri2p supports multiple encryption methods simultaneously. These are the four major categories: 4 | 5 | - [Symmetric](./symmetric/index.md) 6 | - [Asymmetric](./asymmetric/index.md) 7 | - [Signatures](./signatures/index.md) 8 | - [Hashing](./hashing/index.md) 9 | -------------------------------------------------------------------------------- /src/daemon/program_arguments.rs: -------------------------------------------------------------------------------- 1 | use clap::Parser; 2 | 3 | #[derive(Parser)] 4 | #[clap(about, version, author)] 5 | pub struct ProgramArguments { 6 | /// The filename for ri2p configurations 7 | #[clap(short, long, default_value = ".ri2p.config.toml")] 8 | pub config_filename: String, 9 | } 10 | -------------------------------------------------------------------------------- /src/netdb/netdb.rs: -------------------------------------------------------------------------------- 1 | use std::{thread, time::Duration}; 2 | 3 | use crate::daemon::config::Config; 4 | 5 | pub struct NetDB { 6 | pub config: Config, 7 | } 8 | 9 | impl NetDB { 10 | pub fn start(&self) { 11 | // https://github.com/PurpleI2P/i2pd/blob/openssl/libi2pd/NetDb.cpp#L49 12 | thread::sleep(Duration::from_millis(1000)); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["../AUTHORS.md"] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | title = "ri2p Documentation" 7 | 8 | [output.html] 9 | git-repository-url = "https://github.com/ChristopherBilg/ri2p" 10 | edit-url-template = "https://github.com/ChristopherBilg/ri2p/edit/master/docs/{path}" 11 | site-url = "/ri2p/" 12 | cname = "chrisbilger.com/ri2p/" 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | > ri2p uses [keep a changelog](https://keepachangelog.com/en/1.0.0/) for separation of resposibility between the changelog itself and git logs, and [semantic versioning](https://semver.org/) for software version management. 4 | 5 | **0.1.0:** 6 | - Added AUTHORS.md and CHANGELOG.md files. 7 | - Updated mdBook documentation to point to the new AUTHORS.md file 8 | - Made first entry in CHANGELOG.md file 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Please see the documentation for all configuration options: 2 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 3 | 4 | version: 2 5 | updates: 6 | - package-ecosystem: "cargo" 7 | directory: "/" 8 | schedule: 9 | interval: "weekly" 10 | # ignore: 11 | # - dependency-name: "clap" 12 | rebase-strategy: "disabled" 13 | target-branch: "master" 14 | -------------------------------------------------------------------------------- /docs/src/transports/ntcp2.md: -------------------------------------------------------------------------------- 1 | # NTCP2 2 | 3 | The NIO Transmission Control Protocol v2 (NTCP2) is a key-exchange protocol for TCP traffic, that improves upon the security and resilience of NTCP. 4 | 5 | > "As with other I2P transports, NTCP2 is defined solely for point-to-point (router-to-router) transport of I2NP messages. It is not a general-purpose data pipe." [1] 6 | 7 | ## Supplemental Information 8 | 9 | 1. [geti2p.net NTCP2 Technical Specification](https://geti2p.net/spec/ntcp2) 10 | -------------------------------------------------------------------------------- /docs/src/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | - [Introduction](./introduction.md) 4 | - [NetDB](./netdb.md) 5 | - [I2NP](./i2np.md) 6 | - [Transports](./transports/index.md) 7 | - [SSU](./transports/ssu.md) 8 | - [NTCP2](./transports/ntcp2.md) 9 | - [Encryption](./encryption/index.md) 10 | - [Symmetric](./encryption/symmetric/index.md) 11 | - [Asymmetric](./encryption/asymmetric/index.md) 12 | - [Signatures](./encryption/signatures/index.md) 13 | - [Hashing](./encryption/hashing/index.md) 14 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ri2p" 3 | description = "Rust implementation of the i2p client/server/router protocols" 4 | version = "0.1.0" 5 | license-file = "LICENSE.md" 6 | authors = ["AUTHORS.md"] 7 | readme = "README.md" 8 | edition = "2021" 9 | homepage = "https://chrisbilger.com/ri2p/" 10 | repository = "https://github.com/ChristopherBilg/ri2p" 11 | documentation = "https://chrisbilger.com/ri2p/" 12 | 13 | [[bin]] 14 | name = "ri2p" 15 | 16 | [dependencies] 17 | clap = { version = "4.0.27", features = ["derive"] } 18 | env_logger = "0.10.0" 19 | log = "0.4.17" 20 | serde = "1.0.152" 21 | serde_derive = "1.0.152" 22 | toml = "0.5.11" 23 | -------------------------------------------------------------------------------- /docs/src/transports/index.md: -------------------------------------------------------------------------------- 1 | # Transports 2 | 3 | > "A "transport" in I2P is a method for direct, point-to-point communication between two routers. Transports must provide confidentiality and integrity against external adversaries while authenticating that the router contacted is the one who should receive a given message." [1] 4 | 5 | ri2p supports multiple transports simultaneously. These are the two transports currently supported: 6 | 7 | - [Secure Semireliable UDP (SSU)](./ssu.md) 8 | - [NIO Transmission Control Protocol (NTCP2)](./ntcp2.md) 9 | 10 | ## Supplemental Information 11 | 12 | 1. [geti2p.net Transports in I2P](https://geti2p.net/en/docs/transport) 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /src/daemon/daemon.rs: -------------------------------------------------------------------------------- 1 | use log::info; 2 | use std::thread; 3 | 4 | use crate::daemon::config::Config; 5 | use crate::netdb::netdb::NetDB; 6 | 7 | pub struct Daemon { 8 | pub config: Config, 9 | } 10 | 11 | impl Daemon { 12 | pub fn start(&self) { 13 | // Start the Network Database (NetDB) 14 | info!("Starting NetDB on its own thread."); 15 | let net_db = NetDB { 16 | config: self.config.clone(), 17 | }; 18 | let net_db_thread = thread::spawn(move || { 19 | net_db.start(); 20 | }); 21 | 22 | // Wait for all threads to finish execution before returning 23 | net_db_thread 24 | .join() 25 | .expect("The NetDB thread has panicked."); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: mdBook 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | concurrency: 12 | group: ${{ github.workflow }}-${{ github.ref }} 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Build mdBook and cargo docs 16 | uses: peaceiris/actions-mdbook@v1 17 | with: 18 | mdbook-version: 'latest' 19 | - run: | 20 | mdbook build docs/ 21 | cargo doc --target-dir ./docs/book/doc 22 | - name: Deploy mdBook and cargo doc to GitHub Pages 23 | uses: peaceiris/actions-gh-pages@v3 24 | with: 25 | github_token: ${{ secrets.GITHUB_TOKEN }} 26 | publish_dir: ./docs/book 27 | -------------------------------------------------------------------------------- /docs/src/netdb.md: -------------------------------------------------------------------------------- 1 | # NetDB 2 | 3 | The i2p networking database (NetDB) is a specialized distributed database, also known as a [distributed hash table](https://en.wikipedia.org/wiki/Distributed_hash_table) (DHT). 4 | 5 | All data that lives inside of the NetDB must be cryptographically signed and all data that is retrieved from the NetDB must be cryptographically verified for authenticity. This data also has information regarding the timeframe that it is healthy to be inside of the database. 6 | 7 | The NetDb is distributed using a "floodfill". A portion of all i2p routers, aptly named "floodfill routers", maintain the NetDB DHT. 8 | 9 | ## Supplemental Information 10 | 11 | 1. [geti2p.net NetDB Overview Documentation](https://geti2p.net/en/docs/how/network-database) 12 | 2. [geti2p.net NetDB Historical Discussion](https://geti2p.net/en/docs/discussions/netdb) 13 | -------------------------------------------------------------------------------- /.github/workflows/devskim.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | 6 | name: DevSkim 7 | 8 | on: 9 | push: 10 | branches: [ master ] 11 | pull_request: 12 | branches: [ master ] 13 | schedule: 14 | - cron: '0 0 * * 1' 15 | 16 | jobs: 17 | lint: 18 | name: DevSkim 19 | runs-on: ubuntu-20.04 20 | permissions: 21 | actions: read 22 | contents: read 23 | security-events: write 24 | steps: 25 | - name: Checkout code 26 | uses: actions/checkout@v2 27 | 28 | - name: Run DevSkim scanner 29 | uses: microsoft/DevSkim-Action@v1 30 | 31 | - name: Upload DevSkim scan results to GitHub Security tab 32 | uses: github/codeql-action/upload-sarif@v1 33 | with: 34 | sarif_file: devskim-results.sarif 35 | -------------------------------------------------------------------------------- /docs/src/transports/ssu.md: -------------------------------------------------------------------------------- 1 | # SSU 2 | 3 | Secure Semireliable UDP (SSU) is a transport layer, for UDP messages, that is: "secured" via end-to-end encryption, and "semireliable" via unacknowledged message retransmissions. 4 | 5 |
6 | 7 | Like the NTCP transport, SSU provides reliable, encrypted, connection-oriented, point-to-point data transport. Unique to SSU, it also provides IP detection and NAT traversal services, including: 8 | 9 | - Cooperative NAT/Firewall traversal using introducers 10 | - Local IP detection by inspection of incoming packets and peer testing 11 | - Communication of firewall status and local IP, and changes to either to NTCP 12 | - Communication of firewall status and local IP, and changes to either, to the router and the user interface 13 | 14 | [1] 15 |
16 | 17 | ## Supplemental Information 18 | 19 | 1. [geti2p.net SSU Transport Documentation](https://geti2p.net/en/docs/transport/ssu) 20 | 2. [geti2p.net SSU Technical Specification](https://geti2p.net/spec/ssu) 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /docs/src/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | ri2p (Rust-i2p) is a free and open-source project that aims to implement the [i2p specifications](https://geti2p.net/spec) in a minimal, lightweight and memory safe program. 4 | 5 | ri2p is written in the Rust systems programming language in order to gain the benefits that Rust provides such as; memory management, memory and type safety, systems-level performance, native cross-compiling support, and an easy-to-use dependency (package) [registry](https://crates.io/). 6 | 7 | This website is created using the mdBooks Rust crate, and allows documentation to be transpiled from Markdown to static HTML. 8 | 9 | There is another portion of the documentation website, located at [chrisbilger.com/ri2p/doc/doc/ri2p](https://chrisbilger.com/ri2p/doc/doc/ri2p/), that is built from Rust's native `cargo doc` feature. That portion of the documentation is for other developers to quickly read about the Rust codebase for ri2p. 10 | 11 | Click [here](https://github.com/ChristopherBilg/ri2p/) to quickly go to the ri2p Git repository. 12 | -------------------------------------------------------------------------------- /docs/src/i2np.md: -------------------------------------------------------------------------------- 1 | # I2NP 2 | 3 | The Invisible Internet Network Protocol (I2NP) is a networking layer that resides above the I2P Transport Protocol layer. The I2NP layer manages the routing of inter-router communications, as well as self determining which transport protocol to use if there are multiple transport protocols to choose from. 4 | 5 | > "I2NP (I2P Network Protocol) messages can be used for one-hop, router-to-router, point-to-point messages. By encrypting and wrapping messages in other messages, they can be sent in a secure way through multiple hops to the ultimate destination." [1] 6 | 7 | > "All routers must publish their I2NP protocol version in the "router.version" field in the RouterInfo properties. This version field is the API version, indiciating the level of support for various I2NP protocol features, and is not necessarily the actual router version." [2] 8 | 9 | ## Supplemental Information 10 | 11 | 1. [geti2p.net I2NP Protocol Documentation](https://geti2p.net/en/docs/protocol/i2np) 12 | 2. [geti2p.net I2NP Technical Specification](https://geti2p.net/spec/i2np) 13 | -------------------------------------------------------------------------------- /.ri2p.config.toml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # ri2p Configuration File # 3 | # # 4 | # Note: This configuration file contains all user-modifiable configuration # 5 | # options. Each configuration option is prepended with comments that # 6 | # explain how the configuration option is used, along with it's # 7 | # default value. # 8 | ################################################################################ 9 | 10 | # Details: i2p reseed hosts.txt files. 11 | # Default value: [ "http://reg.i2p/hosts.txt", "http://identiguy.i2p/hosts.txt", "http://stats.i2p/cgi-bin/newhosts.txt", "http://i2p-projekt.i2p/hosts.txt" ] 12 | reseed_hosts = [ 13 | "http://reg.i2p/hosts.txt", 14 | "http://identiguy.i2p/hosts.txt", 15 | "http://stats.i2p/cgi-bin/newhosts.txt", 16 | "http://i2p-projekt.i2p/hosts.txt" 17 | ] 18 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | --------- | ------------------ | 7 | | 1.x.x | :x: | 8 | | < 1.0.0 | :white_check_mark: | 9 | 10 | ## Reporting a Vulnerability 11 | 12 | In order to report a security vulnerability in safe manner, please send an email to [christopherbilg@gmail.com](mailto:christopherbilg@gmail.com) with the subject line: **ri2p Security Vulnerability Found** 13 | 14 | The body of the email should contain information such as; ri2p version number, steps to reproduce the vulnerability (if there are any), a potential change to the codebase to remove the security vulnerability, system information (such as OS), etc. 15 | 16 | You should expect to receive a response to your inquiry within 48 business hours, although this number will be closer to "within 24 business hours" in most cases. 17 | 18 | If your security vulnerability is accepted, then you will be notified accordingly and work will begin to remedy the situation. 19 | 20 | If your security vulnerability is not accepted, then you will be notified accordingly and no further actions will be asked of you. 21 | -------------------------------------------------------------------------------- /.github/workflows/ci-cd.yml: -------------------------------------------------------------------------------- 1 | name: CI-CD 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: actions-rs/toolchain@v1 14 | with: 15 | toolchain: stable 16 | - uses: actions-rs/cargo@v1 17 | with: 18 | command: build 19 | override: true 20 | args: --release 21 | test: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - uses: actions-rs/toolchain@v1 26 | with: 27 | toolchain: stable 28 | override: true 29 | - uses: actions-rs/cargo@v1 30 | with: 31 | command: test 32 | args: --no-fail-fast 33 | format: 34 | runs-on: ubuntu-latest 35 | steps: 36 | - uses: actions/checkout@v2 37 | - uses: actions-rs/toolchain@v1 38 | with: 39 | toolchain: stable 40 | components: rustfmt 41 | override: true 42 | - uses: mbrobbel/rustfmt-check@master 43 | with: 44 | token: ${{ secrets.GITHUB_TOKEN }} 45 | clippy: 46 | runs-on: ubuntu-latest 47 | steps: 48 | - uses: actions/checkout@v2 49 | - uses: actions-rs/toolchain@v1 50 | with: 51 | toolchain: stable 52 | components: clippy 53 | override: true 54 | - uses: actions-rs/clippy-check@v1 55 | with: 56 | token: ${{ secrets.GITHUB_TOKEN }} 57 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod daemon; 2 | mod netdb; 3 | 4 | use clap::Parser; 5 | use log::{error, info}; 6 | use std::fs; 7 | 8 | fn main() { 9 | // Initialize the logger utility 10 | match env_logger::try_init() { 11 | Ok(_) => info!("Successfully initialized logger."), 12 | Err(error) => { 13 | error!("Failed to initialize logger."); 14 | error!("{}", error.to_string()); 15 | std::process::exit(1); 16 | } 17 | }; 18 | 19 | // Parse the derived program arguments (CLI) 20 | let program_args = daemon::program_arguments::ProgramArguments::parse(); 21 | info!("Successfully parsed program arguments."); 22 | 23 | // Load in configuration files 24 | let config_toml_filename = program_args.config_filename; 25 | 26 | let config_toml_data = match fs::read_to_string(config_toml_filename) { 27 | Ok(data) => { 28 | info!("Successfully read configuration file."); 29 | data 30 | } 31 | Err(error) => { 32 | error!("Failed to read configuration file."); 33 | error!("{}", error.to_string()); 34 | std::process::exit(1); 35 | } 36 | }; 37 | 38 | let config = match toml::from_str(&config_toml_data) { 39 | Ok(data) => { 40 | info!("Successfully parsed configuration file."); 41 | data 42 | } 43 | Err(error) => { 44 | error!("Failed to parse configuration file."); 45 | error!("{}", error.to_string()); 46 | std::process::exit(1); 47 | } 48 | }; 49 | 50 | // Initialize and start daemon 51 | let daemon = daemon::daemon::Daemon { config }; 52 | 53 | info!("Starting daemon."); 54 | daemon.start(); 55 | 56 | info!("Shutdown all services.") 57 | } 58 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to ri2p 2 | 3 | We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: 4 | 5 | - Reporting a bug 6 | - Discussing the current state of the code 7 | - Submitting a fix 8 | - Proposing new features 9 | - Becoming a maintainer 10 | 11 | ## We Develop with Github 12 | 13 | We use github to host code, to track issues and feature requests, as well as accept pull requests. 14 | 15 | ## We Use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow), So All Code Changes Happen Through Pull Requests 16 | 17 | Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow)). We actively welcome your pull requests: 18 | 19 | 1. Fork the repo and create your branch from `master`. 20 | 2. If you've added code that should be tested, add tests. 21 | 3. If you've changed APIs, update the documentation. 22 | 4. Ensure the test suite passes. 23 | 5. Make sure your code lints. 24 | 6. Issue that pull request! 25 | 26 | ## Any contributions you make will be under the Software License 27 | 28 | In short, when you submit code changes, your submissions are understood to be under the same [License](./LICENSE.md) that covers the project. Feel free to contact the maintainers if that's a concern. 29 | 30 | ## Report bugs using Github's [issues](https://github.com/ChristopherBilg/ri2p/issues) 31 | 32 | We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/ChristopherBilg/ri2p/issues); it's that easy! 33 | 34 | ## Write bug reports with detail, background, and sample code 35 | 36 | **Great Bug Reports** tend to have: 37 | 38 | - A quick summary and/or background 39 | - Steps to reproduce 40 | - Be specific! 41 | - Give sample code if you can. 42 | - What you expected would happen 43 | - What actually happens 44 | - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) 45 | 46 | People *love* thorough bug reports. I'm not even kidding. 47 | 48 | ## Use a Consistent Coding Style 49 | 50 | We use [rustfmt](https://github.com/rust-lang/rustfmt) and [clippy](https://github.com/rust-lang/rust-clippy) for all Rust code. 51 | 52 | ## License 53 | 54 | By contributing, you agree that your contributions will be licensed under its [License](./LICENSE.md). 55 | 56 | ## References 57 | 58 | This document was adapted from the open-source contribution guidelines made by [briandk](https://gist.github.com/ChristopherBilg/90f2ae79ecb6af5aa138bf0daee26dc1) 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ri2p 2 | 3 | Rust implementation of the i2p client/server/router protocols 4 | 5 | ## Status 6 | 7 | ![ci-cd](https://github.com/ChristopherBilg/ri2p/actions/workflows/ci-cd.yml/badge.svg) 8 | ![mdBook](https://github.com/ChristopherBilg/ri2p/actions/workflows/gh-pages.yml/badge.svg) 9 | ![devskim](https://github.com/ChristopherBilg/ri2p/actions/workflows/devskim.yml/badge.svg) 10 | ![pages-build-deployment](https://github.com/ChristopherBilg/ri2p/actions/workflows/pages/pages-build-deployment/badge.svg) 11 | 12 | ## Common Commands 13 | 14 | - `cargo build`: Builds the ri2p binary 15 | - `cargo run`: Runs the ri2p binary 16 | - `cargo test`: Runs all test functions, in the ./tests directory, that contain the #[test] attribute 17 | - `cargo doc [--open]`: Builds the automatically generated ri2p Rust documentation, and optionally opens it in a web browser 18 | 19 | - `cargo fmt`: Standard formatter for Rust codestyle 20 | - `cargo clippy [--fix]`: Standard linter for Rust, and optionally will automatically fix linted issues 21 | 22 | - `mdbook build`: Builds the ri2p mdbook locally 23 | - `mdbook serve`: Serves the ri2p mdbook at http://localhost:3000, and rebuilds it on changes 24 | 25 | ## CI/CD Information 26 | 27 | GitHub is the central CI/CD platform for the ri2p project. CI/CD will occur only when modifications are made (pull-requests) to the **master** branch. 28 | 29 | ## Additional Important Information 30 | 31 | - [Code of Conduct Guidelines](./CODE_OF_CONDUCT.md) 32 | - [Contributing Guidelines](./CONTRIBUTING.md) 33 | - [Open Source License](./LICENSE.md) 34 | - [Security (Vulnerability) Policy](./SECURITY.md) 35 | - [Major Authors & Contributors](./AUTHORS.md) 36 | - [Changelog (SemVer)](./CHANGELOG.md) 37 | 38 | ## Developers 39 | 40 | If you would like to work on this project, please feel free to check the [issues](https://github.com/ChristopherBilg/ri2p/issues) for a list of the current items that we need to be worked on. If you would like to work on any of them, please contact ri2p in the [discussions](https://github.com/ChristopherBilg/ri2p/discussions) area and I will mark a task for you. 41 | 42 | ### Documentation 43 | 44 | Developers can find documentation for ri2p in the [docs/](./docs/) directory, or hosted online at [chrisbilger.com/ri2p/](https://chrisbilger.com/ri2p/). 45 | 46 | The `cargo doc` documentation that is automatically generated by Cargo can be viewed by running `cargo doc --open`, or hosted online at [chrisbilger.com/ri2p/doc/doc/ri2p](https://chrisbilger.com/ri2p/doc/doc/ri2p). 47 | 48 | ## Roadmap & Goals 49 | 50 | ### v1.0.0 51 | 52 | Minimally viable i2p router. 53 | 54 | ### v2.0.0 55 | 56 | Add in router UI. (This will probably be a web server that serves a static site and periodic data refreshes.) 57 | 58 | ### v3.0.0 59 | 60 | Remove all unnecessary dependencies in order to reduce attack-surface. This also includes re-reading all source code in order to pinpoint potential security vulnerabilities. 61 | 62 | ### v4.0.0+ 63 | 64 | TBD. Versions at this level will be feature additions and possibly a "module" system that allows the addition of external modules for additional/enhanced features and functionality. 65 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | christopherbilg@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "0.7.18" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "bitflags" 16 | version = "1.3.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 19 | 20 | [[package]] 21 | name = "cc" 22 | version = "1.0.77" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" 25 | 26 | [[package]] 27 | name = "cfg-if" 28 | version = "1.0.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 31 | 32 | [[package]] 33 | name = "clap" 34 | version = "4.0.27" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "0acbd8d28a0a60d7108d7ae850af6ba34cf2d1257fc646980e5f97ce14275966" 37 | dependencies = [ 38 | "bitflags", 39 | "clap_derive", 40 | "clap_lex", 41 | "is-terminal", 42 | "once_cell", 43 | "strsim", 44 | "termcolor", 45 | ] 46 | 47 | [[package]] 48 | name = "clap_derive" 49 | version = "4.0.21" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" 52 | dependencies = [ 53 | "heck", 54 | "proc-macro-error", 55 | "proc-macro2", 56 | "quote", 57 | "syn", 58 | ] 59 | 60 | [[package]] 61 | name = "clap_lex" 62 | version = "0.3.1" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" 65 | dependencies = [ 66 | "os_str_bytes", 67 | ] 68 | 69 | [[package]] 70 | name = "env_logger" 71 | version = "0.10.0" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" 74 | dependencies = [ 75 | "humantime", 76 | "is-terminal", 77 | "log", 78 | "regex", 79 | "termcolor", 80 | ] 81 | 82 | [[package]] 83 | name = "errno" 84 | version = "0.2.8" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" 87 | dependencies = [ 88 | "errno-dragonfly", 89 | "libc", 90 | "winapi", 91 | ] 92 | 93 | [[package]] 94 | name = "errno-dragonfly" 95 | version = "0.1.2" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 98 | dependencies = [ 99 | "cc", 100 | "libc", 101 | ] 102 | 103 | [[package]] 104 | name = "heck" 105 | version = "0.4.0" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 108 | 109 | [[package]] 110 | name = "hermit-abi" 111 | version = "0.2.6" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 114 | dependencies = [ 115 | "libc", 116 | ] 117 | 118 | [[package]] 119 | name = "humantime" 120 | version = "2.1.0" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 123 | 124 | [[package]] 125 | name = "io-lifetimes" 126 | version = "1.0.2" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "e394faa0efb47f9f227f1cd89978f854542b318a6f64fa695489c9c993056656" 129 | dependencies = [ 130 | "libc", 131 | "windows-sys", 132 | ] 133 | 134 | [[package]] 135 | name = "is-terminal" 136 | version = "0.4.0" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "aae5bc6e2eb41c9def29a3e0f1306382807764b9b53112030eff57435667352d" 139 | dependencies = [ 140 | "hermit-abi", 141 | "io-lifetimes", 142 | "rustix", 143 | "windows-sys", 144 | ] 145 | 146 | [[package]] 147 | name = "libc" 148 | version = "0.2.137" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" 151 | 152 | [[package]] 153 | name = "linux-raw-sys" 154 | version = "0.1.3" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" 157 | 158 | [[package]] 159 | name = "log" 160 | version = "0.4.17" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 163 | dependencies = [ 164 | "cfg-if", 165 | ] 166 | 167 | [[package]] 168 | name = "memchr" 169 | version = "2.4.1" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 172 | 173 | [[package]] 174 | name = "once_cell" 175 | version = "1.12.0" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" 178 | 179 | [[package]] 180 | name = "os_str_bytes" 181 | version = "6.0.0" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" 184 | 185 | [[package]] 186 | name = "proc-macro-error" 187 | version = "1.0.4" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 190 | dependencies = [ 191 | "proc-macro-error-attr", 192 | "proc-macro2", 193 | "quote", 194 | "syn", 195 | "version_check", 196 | ] 197 | 198 | [[package]] 199 | name = "proc-macro-error-attr" 200 | version = "1.0.4" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 203 | dependencies = [ 204 | "proc-macro2", 205 | "quote", 206 | "version_check", 207 | ] 208 | 209 | [[package]] 210 | name = "proc-macro2" 211 | version = "1.0.49" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" 214 | dependencies = [ 215 | "unicode-ident", 216 | ] 217 | 218 | [[package]] 219 | name = "quote" 220 | version = "1.0.15" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 223 | dependencies = [ 224 | "proc-macro2", 225 | ] 226 | 227 | [[package]] 228 | name = "regex" 229 | version = "1.5.6" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" 232 | dependencies = [ 233 | "aho-corasick", 234 | "memchr", 235 | "regex-syntax", 236 | ] 237 | 238 | [[package]] 239 | name = "regex-syntax" 240 | version = "0.6.26" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" 243 | 244 | [[package]] 245 | name = "ri2p" 246 | version = "0.1.0" 247 | dependencies = [ 248 | "clap", 249 | "env_logger", 250 | "log", 251 | "serde", 252 | "serde_derive", 253 | "toml", 254 | ] 255 | 256 | [[package]] 257 | name = "rustix" 258 | version = "0.36.3" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e" 261 | dependencies = [ 262 | "bitflags", 263 | "errno", 264 | "io-lifetimes", 265 | "libc", 266 | "linux-raw-sys", 267 | "windows-sys", 268 | ] 269 | 270 | [[package]] 271 | name = "serde" 272 | version = "1.0.152" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" 275 | 276 | [[package]] 277 | name = "serde_derive" 278 | version = "1.0.152" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" 281 | dependencies = [ 282 | "proc-macro2", 283 | "quote", 284 | "syn", 285 | ] 286 | 287 | [[package]] 288 | name = "strsim" 289 | version = "0.10.0" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 292 | 293 | [[package]] 294 | name = "syn" 295 | version = "1.0.107" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" 298 | dependencies = [ 299 | "proc-macro2", 300 | "quote", 301 | "unicode-ident", 302 | ] 303 | 304 | [[package]] 305 | name = "termcolor" 306 | version = "1.1.2" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" 309 | dependencies = [ 310 | "winapi-util", 311 | ] 312 | 313 | [[package]] 314 | name = "toml" 315 | version = "0.5.11" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" 318 | dependencies = [ 319 | "serde", 320 | ] 321 | 322 | [[package]] 323 | name = "unicode-ident" 324 | version = "1.0.6" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" 327 | 328 | [[package]] 329 | name = "version_check" 330 | version = "0.9.4" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 333 | 334 | [[package]] 335 | name = "winapi" 336 | version = "0.3.9" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 339 | dependencies = [ 340 | "winapi-i686-pc-windows-gnu", 341 | "winapi-x86_64-pc-windows-gnu", 342 | ] 343 | 344 | [[package]] 345 | name = "winapi-i686-pc-windows-gnu" 346 | version = "0.4.0" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 349 | 350 | [[package]] 351 | name = "winapi-util" 352 | version = "0.1.5" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 355 | dependencies = [ 356 | "winapi", 357 | ] 358 | 359 | [[package]] 360 | name = "winapi-x86_64-pc-windows-gnu" 361 | version = "0.4.0" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 364 | 365 | [[package]] 366 | name = "windows-sys" 367 | version = "0.42.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 370 | dependencies = [ 371 | "windows_aarch64_gnullvm", 372 | "windows_aarch64_msvc", 373 | "windows_i686_gnu", 374 | "windows_i686_msvc", 375 | "windows_x86_64_gnu", 376 | "windows_x86_64_gnullvm", 377 | "windows_x86_64_msvc", 378 | ] 379 | 380 | [[package]] 381 | name = "windows_aarch64_gnullvm" 382 | version = "0.42.0" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" 385 | 386 | [[package]] 387 | name = "windows_aarch64_msvc" 388 | version = "0.42.0" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" 391 | 392 | [[package]] 393 | name = "windows_i686_gnu" 394 | version = "0.42.0" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" 397 | 398 | [[package]] 399 | name = "windows_i686_msvc" 400 | version = "0.42.0" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" 403 | 404 | [[package]] 405 | name = "windows_x86_64_gnu" 406 | version = "0.42.0" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" 409 | 410 | [[package]] 411 | name = "windows_x86_64_gnullvm" 412 | version = "0.42.0" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" 415 | 416 | [[package]] 417 | name = "windows_x86_64_msvc" 418 | version = "0.42.0" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" 421 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------