Skip to content

Commit

Permalink
Merge pull request #9 from felfele/bee-client
Browse files Browse the repository at this point in the history
Support Bee instead of Swarm
  • Loading branch information
agazso authored Aug 13, 2020
2 parents 7a0a8cd + a214c31 commit 41326d9
Show file tree
Hide file tree
Showing 18 changed files with 4,874 additions and 2,850 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.vscode
build
dist
dist/index.js
dist-html-only
38 changes: 5 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SwapChat

SwapChat is a disposable, end-to-end encrypted, decentralized web app built on [Swarm](https://swarm.ethereum.org/). It uses ephemeral identities generated on the fly and then it does a Diffie-Hellman key exchange to create a shared secret for reasonable security and privacy.
SwapChat is a disposable, end-to-end encrypted, decentralized web app built on [Ethereum Swarm Bee](https://github.com/ethersphere/bee). It uses ephemeral identities generated on the fly and then it does a Diffie-Hellman key exchange to create a shared secret for reasonable security and privacy.

The project was initally done as a Swarm Hackweek Madrid 2019 project as a collaboration between [@nolash](https://github.com/nolash) from the [Swarm team](https://swarm.ethereum.org/) and [@significance](https://github.com/significance) from [Fair Data Society](https://github.com/fairDataSociety) and [@agazso](https://github.com/agazso) from [Felfele](https://github.com/felfele).

Expand All @@ -17,15 +17,15 @@ First, install the dependencies:
Then build the app:

```
$ npm run pack
$ npm run pack-html-only
```

This builds the app in the `dist` directory. You can upload it to Swarm with the `upload.sh` command:
This builds the app in a single html file in the `dist` directory. You can upload it to Bee with the `upload.sh` command:

```
$ ./upload.sh https://swarm-gateways.net
$ ./upload.sh http://localhost:8080
```
You can specify any Swarm gateways as an argument. After the upload was successful the script will write out a link to the uploaded website. Copy that link to your browser to open it.
You can specify any Bee gateways as an argument. After the upload was successful the script will write out a link to the uploaded website. Copy that link to your browser to open it.

### Testing

Expand All @@ -34,31 +34,3 @@ To test the connection logic:
1. run ts-node ./src/index.ts in terminal 1, and while running...
1. look for `tmp priv: <HASH>` in the output, and copy the hash
1. run ts-node ./src/index.ts <HASH> in terminal 2

### NGINX configuration for deployment

Here is an nginx configuration snippet if you want to deploy the application to your server with a proper DNS name (in this example `swapchat.felfele.com`).

First of all, we will need a fixed address that can be used in the webserver configuration. Therefore the app needs to be deployed to a feed and we will need the address of the manifest of that feed (in this example `014a3ad...38922a`).

Then you will need two `location` directives. The first one is responsible for forwarding the all `bzz` requests to passed to a Swarm node. The second one is responsible for serving static content from a certain manifest. This is where the app is deployed.

```
server {
server_name swapchat.felfele.com;
location ~ ^\/(bzz.*)$ {
proxy_pass http://localhost:8500$request_uri;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ ^\/(.*)$ {
proxy_pass http://localhost:8500/bzz:/014a3adaed777c7c621fdafe4b59eb32e82c50eb5a242a5ed475aa2a8138922a/$1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
```
1 change: 1 addition & 0 deletions dist/DOS.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ textarea {
}
}

@font-face {
/*@font-face {
font-family: 'DOS';
font-style: normal;
font-weight: normal;
src: url('fonts/Fixedsys500c.eot');
src: local('☺'), url('fonts/Fixedsys500c.woff') format('woff'), url('fonts/Fixedsys500c.ttf') format('truetype'), url('fonts/Fixedsys500c.svg') format('svg');
}
}*/

body {
margin: 0;
Expand Down
Loading

0 comments on commit 41326d9

Please sign in to comment.