Skip to content

Commit

Permalink
Merge pull request #49 from EspressoSystems/open-source
Browse files Browse the repository at this point in the history
add MIT license
  • Loading branch information
clu8 authored Aug 7, 2024
2 parents 398b77f + 406022d commit 264bc16
Show file tree
Hide file tree
Showing 71 changed files with 436 additions and 1 deletion.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Espresso Systems

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ It requires installation of `KeyDB` or `Redis`.
## License
### Copyright
**(c) 2024 Espresso Systems**.
`Push-CDN` was developed by Espresso Systems. While we plan to adopt an open source license, we have not yet selected one. As such, all rights are reserved for the time being. Please reach out to us if you have thoughts on licensing.
`Push-CDN` was developed by Espresso Systems.
6 changes: 6 additions & 0 deletions cdn-broker/benches/broadcast.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! Benchmarks for allocating and sending broadcast messages.
//! If run with `--profile-time=N seconds`, it will output a flamegraph.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/benches/direct.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! Benchmarks for allocating and sending direct messages.
//! If run with `--profile-time=N seconds`, it will output a flamegraph.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/binaries/bad-broker.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! `bad-broker` is a simple binary that starts a broker with a random key and
//! attempts to start a broker every 100ms. This is useful for testing the
//! broker's ability to handle multiple brokers connecting to it.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/binaries/broker.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! The following is the main `Broker` binary, which just instantiates and runs
//! a `Broker` object.
use cdn_broker::{Broker, Config};
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/connections/broadcast/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This is where we define routing for broadcast messages.
mod relational_map;
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/connections/broadcast/relational_map.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

use std::{
collections::{HashMap, HashSet},
hash::Hash,
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/connections/direct/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This is where we define routing for direct messages.
use cdn_proto::{connection::UserPublicKey, discovery::BrokerIdentifier};

Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/connections/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This module defines almost all of the connection lookup, addition,
//! and removal process.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/connections/versioned_map.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This map defines our implementation of a map for making use
//! of versioned vectors. This lets us become eventually consistent
//! over connected user data.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This file contains the implementation of the `Broker`, which routes messages
//! for the Push CDN.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! Here is where we define broker-specific metrics that we need.
//! They are lazily loaded during runtime.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/reexports.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This module defines re-exports that the broker uses and that
//! a downstream user may want to use.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/broker/handler.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This file defines the broker connection handler.
use std::{sync::Arc, time::Duration};
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/broker/heartbeat.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! The heartbeat task periodically posts our state to either Redis or an embeddable file DB.
use std::{collections::HashSet, sync::Arc, time::Duration};
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/broker/listener.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! The broker listener task listens and handles connections from new brokers.
use std::sync::Arc;
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/broker/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

pub mod handler;
pub mod heartbeat;
pub mod listener;
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/broker/sender.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

use std::sync::Arc;

use cdn_proto::{connection::Bytes, def::RunDef, discovery::BrokerIdentifier};
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/broker/sync.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! The sync task syncs both users and topics to other brokers.
use std::{sync::Arc, time::Duration};
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This file defines the different types of tasks we have implemented
//! for `Arc<Inner<>>`.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/user/handler.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This file defines the user handler module, wherein we define connection handlers for
//! `Arc<Inner>`.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/user/listener.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! The user listener tasks listens and deals with user connections.
use std::sync::Arc;
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/user/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

pub mod handler;
pub mod listener;
pub mod sender;
6 changes: 6 additions & 0 deletions cdn-broker/src/tasks/user/sender.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

use std::sync::Arc;

use cdn_proto::connection::UserPublicKey;
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tests/broadcast.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! Deterministic tests for sending and receiving broadcast messages.
//! Asserts they all go to the right place.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tests/direct.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! Deterministic tests for sending and receiving direct messages.
//! Asserts they all go to the right place.
Expand Down
6 changes: 6 additions & 0 deletions cdn-broker/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! Commonalities for deterministic (non-networked) testing of our broker.
//! This is not guarded by `![cfg(test)]` because we use the same functions
//! when running benchmarks.
Expand Down
6 changes: 6 additions & 0 deletions cdn-client/src/binaries/bad-connector.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! "Bad connector" is a simple example of a client that connects to the broker every
//! 200ms. This is useful for testing the broker's ability to handle many connections.
Expand Down
6 changes: 6 additions & 0 deletions cdn-client/src/binaries/bad-sender.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! "Bad sender" is a simple example of a client that continuously sends a message to itself.
//! This is useful for testing the broker's ability to handle many messages.
Expand Down
6 changes: 6 additions & 0 deletions cdn-client/src/binaries/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! The following is an example of a Push CDN client implementation.
//! In this example, we send messages to ourselves via broadcast and direct
//! systems.
Expand Down
6 changes: 6 additions & 0 deletions cdn-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! In here we define an API that is a little more higher-level and ergonomic
//! for end users. It is a light wrapper on top of a `Retry` connection.
Expand Down
6 changes: 6 additions & 0 deletions cdn-client/src/reexports.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This module defines re-exports that the client uses and that
//! a downstream user may want to use.
Expand Down
6 changes: 6 additions & 0 deletions cdn-client/src/retry.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This file provides a `Retry` connection, which allows for reconnections
//! on top of a normal connection.
//!
Expand Down
6 changes: 6 additions & 0 deletions cdn-marshal/src/binaries/marshal.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! The following is the main `Marshal` binary, which just instantiates and runs
//! a `Marshal` object.
Expand Down
6 changes: 6 additions & 0 deletions cdn-marshal/src/handlers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

use std::time::Duration;

use cdn_proto::{
Expand Down
6 changes: 6 additions & 0 deletions cdn-marshal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! This file contains the implementation of the `Marshal`, which the user
//! connects to before a broker. It is used to "marshal" a user to the broker
//! (right now) with the least amount of connections. It's basically a load
Expand Down
6 changes: 6 additions & 0 deletions cdn-proto/benches/protocols.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

//! Benchmarks for network protocols [Quic/TCP]
use cdn_proto::{
Expand Down
6 changes: 6 additions & 0 deletions cdn-proto/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024 Espresso Systems (espressosys.com)
// This file is part of the Push-CDN repository.

// You should have received a copy of the MIT License
// along with the Push-CDN repository. If not, see <https://mit-license.org/>.

use std::{env, fs, path::Path};

use rcgen::{CertificateParams, IsCa, KeyPair, PKCS_ECDSA_P256_SHA256};
Expand Down
Loading

0 comments on commit 264bc16

Please sign in to comment.