Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Saving Recipients Info #6

Merged
merged 14 commits into from Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
86 changes: 82 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 30 additions & 13 deletions README.md
Expand Up @@ -15,8 +15,10 @@ Share anything with teammates across machines via CLI. Share is a tool for secur
- [Files](#files)
- [Messages](#messages)
- [Configuration](#configuration)
- [Whitelists](#whitelists)
- [Signed Certs](#SignedCertificate)
- [Whitelists](#whitelistsblacklists-ip-addresses)
- [Signed Certs](#signed-certificate)
- [Seed Key](#seeds-seed-key)
- [Recipient Info](#saving-peer-info)
- [Update](#update)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
Expand Down Expand Up @@ -125,28 +127,24 @@ The sender then attempts to send the secret, and if it is successful, `scs` rela

```yaml
port: 5555 #An optional port defaults to 0 if not present
# The folder path to store all items.
# Secrets will be stored at <path>/secrets.json
# Messages at <path>/messages.txt
# Files at <path>/nameoffile
## If "default" is passed, the folder path will be `scs`'s directory in the machine's local folder.
save_path: "default"
secret: #Optional during receive
secret: # Optional during receive
- key: foo
value: bar
- key: baz
value: woo
message: #Optional during receive
message: # Optional during receive
- new message from me
- test message
file: #Optional during receive
file: # Optional during receive
- "./dev_build.sh"
debug: 1 #Compulsory. 0 is for off, and 1 and above for on
debug: 1 # Compulsory. 0 is for off, and 1 and above for on
blacklists:
- 34.138.139.178
whitelists:
- 34.193.14.12
connection: trusted #or self
connection: trusted # or self
seed: "scsiscool"
```

```shell
Expand All @@ -164,6 +162,24 @@ connection: trusted #or self
Receivers can configure `scs` to only allow connections from users using a signed certificate from the CA. or just self-signed certificates.
Add a `connection: trusted` or `connection: self` to the configuration file.

### Seeds (Seed Key)
The backbone of `scs` is `PeerId`. A `PeerId` a randomly generated key whenever a session is started for both the receiver and the sender. As of `v0.1.3` of `scs`, `PeerId`s can now be deterministic, that is, a single `PeerId` can be used for life. To do this, you need to set what is called a "seed". The `PeerId` is generated with respect to this seed. As long as the seed key remains the same, the `PeerId` will remain the same.
The "seed" key is a string of any length lesser than 32. But for ease and optimal configuration, we recommend 4 or 5 letter words as in the above configuration file.


# Saving Peer Info
To make using `scs` easier after the initial setup, `scs` implements a simple mechanism for storing recipients information.
After every session with a new peer, `scs` asks if you'll like to save the information of the connected peer. If you decide to send to that same peer, pass in the name of the peer to the `-n` argument like below
```sh
scs send -n dante -c config.yml
```
Note: For security reasons, we don't save IP addresses of the connected peers on each machine.

To see all saved peers:
```sh
scs list
```

# Contributing

Contributions of any kind are welcome! See the [contributing guide](contributing.md).
Expand All @@ -173,7 +189,8 @@ Contributions of any kind are welcome! See the [contributing guide](contributing
# Roadmap

### Utilities
- [ ] Personalize peer ID + allow saving recipient info (address, port, etc.) and giving a proper name so one can do "scs send dante -m Hello"
- [x] Personalize peer ID.
- [ ] Allow saving recipient info (address, port, etc.) and giving a proper name so one can do "scs send dante -m Hello"
- [ ] Allow to always listen to specific addresses for an accessible data flow.

### Protocols
Expand Down
5 changes: 3 additions & 2 deletions config.yml
@@ -1,4 +1,4 @@
port: 5555 #An optional port defaults to 0 if not present
port: 6666 #An optional port defaults to 0 if not present
# The folder path to store all items.
# Secrets will be stored at <path>/secrets.json
# Messages at <path>/messages.txt
Expand All @@ -18,4 +18,5 @@ file: #Optional during receive
debug: 1 #Compulsory. 0 is for off and 1 and above for on
# blacklists:
# - 127.0.0.1
# - 34.138.139.178
# - 34.138.139.178
seed: "bitter"
3 changes: 3 additions & 0 deletions share/Cargo.toml
Expand Up @@ -30,6 +30,9 @@ request_response = {version = "0.25.0", package = "libp2p-request-response", fea
directories-next = "2.0.0"
tracing-appender = "0.2.2"
serde_yaml = "0.9.24"
rusqlite = { version = "0.29.0", features = ["bundled"] }
time = { version = "0.3.25", features = ["parsing"]}
dialoguer = "0.10.4"

[dev-dependencies]
assert_fs = "1.0.13"
Expand Down