Code Monkey home page Code Monkey logo

winden's Introduction

Winden Logo

Be aware, this is a Beta version, which might have some issues or not work as expected in all browsers.

Winden - Magic Wormhole web application

Winden is a free web application for secure, fast, and easy file transfers between devices in real-time. Winden is identity-free, meaning that senders and receivers don’t need to know each other’s identity to use it, or to reveal their identity to us.

We do not require people to sign up or log in and we cannot access any files you send, as they are end-to-end encrypted. Files are never stored on our servers and transfers happen in real-time. While these aspects ensure the app is more private and secure, it means that both the sender and receiver need to be online at the same time. Learn more about how Winden works in our FAQ.

Based on the Magic Wormhole protocol, Winden was developed to scale the protocol without compromising its security and make it ready for web-usage. Part of this work was funded by the European Union’s Next Generation Internet program (NGI_Trust).

Try it out at winden.app.

Development Setup

Follow these steps to get the whole setup running on a local computer for easy development and debugging.

Cloning

git clone [email protected]:LeastAuthority/winden.git
cd winden
git submodule init
git submodule update --recursive

or you can do it in one step:

git clone --recurse-submodules [email protected]:LeastAuthority/winden.git

System Prerequisites

  • npm
  • docker
  • docker compose

Set up docker images

docker compose build
docker compose run client npm i
docker compose run client ./scripts/setup.sh
docker compose -f docker-compose.yml -f docker-compose.e2e.yml run client-e2e npm i

Set up pre-commit hooks

npm i

Run development environment

Start the client service. This will run development server on port 8080.

docker compose up -d client

Note: the server will serve HTTPS using a self-signed certificate, so you must visit https://localhost:8080, using https instead of http. You must set up your browser to allow the certificate on port localhost:8080 as well as localhost:35729 for live reloading to work.

View logs

docker compose logs -f

Email from Feedback API

We use a dummy SMTP server to log emails sent from feedback-api. To view the emails, run the following command:

docker compose logs -f dummy-smtp-server

Stop development environment

docker compose down

Storybook

docker compose run -p 6006:6006 client npm run storybook

Format code

Winden uses prettier for code formatting. When code is pushed to this repo, a git hook will run to verify that the code is formatted. The push will be rejected if the check fails. In order to successfully push, format the code with the following command:

docker compose run client npm run format

Testing

Setup

The e2e tests run on the selenium docker containers. They will run the test against the client running on the host. To get the containers to connect to be able to connect to the host, we need to add the host's local IP to the environment:

  1. Copy the file ./.env.example to ./.env.
  2. Inside ./.env, insert HOST_IP=<YOUR_IP_HERE> (you could find your local IP through ifconfig or similar)

Running tests

Run the unit and integration tests using the following:

# run tests once
docker compose run client npm run test
# or automatically re-run tests when editing a file
docker compose run client npm run test -- --watch

# or run individual tests
docker compose run client npm run test -- client/src/app/components/CodeInput.test.tsx

Run the end-to-end tests with the following

# Run the tests. This would also start the selenium hub if it's not running yet.
docker compose -f docker-compose.yml -f docker-compose.e2e.yml run --rm client-e2e
# If running on ARM64, you must use the e2e-arm64 override instead.
docker compose -f docker-compose.yml -f docker-compose.e2e-arm64.yml run --rm client-e2e

# Once you're done working with the e2e tests, stop the containers running the selenium hub.
docker compose --profile e2e down

Debugging end-to-end tests

See https://github.com/SeleniumHQ/docker-selenium#debugging And https://webdriver.io/docs/api/browser/debug/

If you run the WDIO testrunner make sure you increase the timeout property of the test framework you are using (e.g. Mocha or Jasmine) in order to prevent test termination due to a test timeout. Also avoid executing the command with multiple capabilities running at the same time.

Building

  • Create client/.env if it does not exist already
  • Fill it with the following for:

(Playground environment)

MAILBOX_URL="wss://<mailbox server>/v1"
RELAY_URL="wss:///<relay server>"
# Use the following line for a development build
NODE_ENV=development

(Production environment)

# Production
MAILBOX_URL="wss://<mailbox server>/v1"
RELAY_URL="wss:///<relay server>"
# Or use the following line instead for a production build
NODE_ENV=production

Deploying

  • Create client/.env if it does not exist already
  • Fill it with the following: (Replace placeholders in angle brackets with the appropriate values)
S3_BUCKET=<URL>
CDF_DISTRIBUTION_ID=<ID>

MAILBOX_URL="wss://<mailbox server>/v1"
RELAY_URL="wss://<relay server>"
NODE_ENV=production # or `development` if deploying to playground

Now you can deploy by running the following:

docker-compose run client npm run deploy

Note that this will also create a new build of the app.

Codebase Architecture

See ARCHITECTURE.md for an in-depth look at the codebase structure.

winden's People

Contributors

justusft avatar donpui avatar wuan avatar dependabot[bot] avatar on-ba avatar vu3rdd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.