Code Monkey home page Code Monkey logo

send's Introduction

Firefox Send

CircleCI

NOTICE - May 2021

Mozilla discontinued the Firefox Send service in September 2021. For more information about this, please see the Mozilla Blog.

Please note that the Mozilla Public License 2.0 does not "grant any rights in the trademarks, service marks, or logos of any Contributor." You may fork and modify the source code for Firefox Send pursuant to the Mozilla Public License, but you may not create a version of the service that uses Mozilla trademarks or logos.

This repository is archived. In May 2021, Mozilla removed Mozilla trademarks from some of the files in this repository so that developers using this code are less likely to inadvertently infringe Mozilla's trademarks and confuse users. You are welcome to copy and modify this code under its open source license, but please ensure that all use complies with Mozilla's trademark policy. In other words, if you create a new version of Firefox Send you must remove all "Mozilla" and "Firefox" branding to ensure that users are not confused about who is providing the service.

Docs: FAQ, Encryption, Build, Docker, Metrics, More


Table of Contents


What it does

A file sharing experiment which allows you to send encrypted files to other users.


Requirements


Development

To start an ephemeral development server, run:

npm install
npm start

Then, browse to http://localhost:8080


Commands

Command Description
npm run format Formats the frontend and server code using prettier.
npm run lint Lints the CSS and JavaScript code.
npm test Runs the suite of mocha tests.
npm start Runs the server in development configuration.
npm run build Builds the production assets.
npm run prod Runs the server in production configuration.

Configuration

The server is configured with environment variables. See server/config.js for all options and docs/docker.md for examples.


Localization

Firefox Send localization is managed via Pontoon, not direct pull requests to the repository. If you want to fix a typo, add a new language, or simply know more about localization, please get in touch with the existing localization team for your language or Mozilla’s l10n-drivers for guidance.

see also docs/localization.md


Contributing

Pull requests are always welcome! Feel free to check out the list of "good first issues".


Testing

ENVIRONMENT URL
Production https://send.firefox.com/
Stage https://stage.send.nonprod.cloudops.mozgcp.net/
Development https://send2.dev.lcip.org/

Deployment

see also docs/deployment.md


Android

The android implementation is contained in the android directory, and can be viewed locally for easy testing and editing by running ANDROID=1 npm start and then visiting http://localhost:8080. CSS and image files are located in the android/app/src/main/assets directory.


License

Mozilla Public License Version 2.0


send's People

Contributors

abelardo-py avatar abhinadduri avatar ag12r avatar andy-moz avatar bald3 avatar dannycoates avatar dnarcese avatar emily-hou1 avatar enolp avatar ericawright avatar fjoerfoks avatar flodolo avatar fzzzy avatar jnunezf96 avatar johngruen avatar jsyanis avatar jurajcigan avatar karm46 avatar koehlermichael avatar kyoshino avatar manxmensch avatar marceloghelman avatar milupo avatar padsanma avatar pdehaan avatar petercpg avatar rodrigommc avatar selimsumlu avatar theochevalier avatar yaitelmouden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

send's Issues

Fail better when Redis isn't installed

I don't have Redis installed locally, but when I type npm start things go a bit silly.
Not sure if we should fail hard[er] if the Redis connection fails.

➜  something-awesome git:(master) npm start

> [email protected] start /Users/pdehaan/dev/github/mozilla/something-awesome
> watchify frontend/src/main.js -o public/bundle.js -d | node server/portal_server.js

Portal app listening on port 3000!

{ Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1136:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379 }

{ Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1136:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379 }

...

Review V1 metrics

Two weeks after launch ensure we've reviewed and made adjustments to V2.

Design server architecture

So webrtc is known to have connection issues in the real world. We've decided we don't want those issues to be a factor in this experiment. A more traditional client-server model should be more reliable but has a different set of challenges for our use case.

I would like to be able to revisit a P2P architecture in the future if this experiment proves successful. I think there's several benefits to P2P for both the users and us if the tech is reliable enough. With that in mind I'd like to keep the UX and service architecture to be "P2P compatible".

Here's what I imagine that to be:

  1. Sender makes a request to the server that creates a link to share
  2. Sender opens a websocket or xhr long poll to the server to wait for the Receiver to connect
  3. Receiver visits the link triggering a handshake with the Sender
  4. Via websockets or xhr a secure handshake and crypto happens 👋
  5. Sender starts uploading the encrypted data
  6. Receiver starts downloading the data
    a. Meanwhile the server is not storing the data anywhere
  7. The transfer completes and session is closed

What I like about it:

  • The flow and UX is the same as webrtc with TURN
    • could allow us to do webrtc testing with a server fallback transparently
    • could swap for webrtc when its solid
  • Saves us from storing data
  • Greatly (I think) simplifies the encryption implementation
    • key exchange happens live vs IDKWTF

Possible downsides:

  • Both parties must still be connected at the same/whole time
    • price of P2P compatibility

Thoughts?

Check previous uploads

We should check the previous uploads list against the server to see if they're still available. This should have it's own server endpoint that the frontend can use.

Implement basic webrtc peer connection

Create the functionality that allows a sender to visit a page and generate a link that can be shared with a receiver. When the receiver visits the link the two parties should connect via webrtc.

Add /__version__ route?

Re: https://p2p.dev.lcip.org

Speaking of interesting challenges, creating a /__version__ route which lets us (friendly neighborhood QA) know exactly what code (Git SHA) is deployed on the dev/stage/prod server and would be pretty useful [eventually].

Currently https://p2p.dev.lcip.org/__version__ returns a 404 (as expected).

Here's a sample of what we get back from something like TestPilot prod server (https://testpilot.firefox.com/__version__):

{
  "commit": "c4639a25b938bd4717aadc3ead840e80f0a0f059",
  "version": "2017-05-04",
  "source": "https://github.com/mozilla/testpilot"
}

Add /heartbeat/ route

Should return a 200 if the service is healthy, and a 500 otherwise. This should check dependent services like the database connection to ensure that they are healthy.

Any other page content is allowed, although keep it short, simple, and quick loading as this will get hit all the time.

add /lbheartbeat/ route

Should respond 200 if the service is up, 500 otherwise. This is for load balancer checks and should not check dependent services.

Any other page content is allowed, although keep it short, simple, and quick loading as this will get hit all the time.

Read previous uploads from localstorage

To show the list of previous uploads on the main page after a page reload we should read the list from localstorage. We may want to change the way items are stored so we don't need to iterate over all the keys.

Integrate with the Share menu on mobile platforms

When a "Share" menu on Android or iOS detects that the shareable content is a file, we should have an item appear in the share menu to send the file via the service.
(If "is this a file?" is not possible, consider a whitelist.)

Whatever the flow for uploading, we could conclude with the option to copy to clipboard (though consider autocopy) and another share option for the URL, allowing users to send the URL straight to someone via email/text/whatever.

Show file size limit in UI

If a user chooses a file with a size > 2GB the upload currently silently fails. We should check the file size before loading it with the FileReader and tell the user the file is too big.

Optimize images

Randomly spotted while trolling your repo:

➜  something-awesome git:(master) ls -lash public/resources
total 5280
5160 -rw-r--r--  1 pdehaan  staff   2.5M Jun  7 22:03 background.png
  40 -rw-r--r--  1 pdehaan  staff    20K Jun  7 22:03 link_expired.png
  48 -rw-r--r--  1 pdehaan  staff    22K Jun  7 22:03 share.png
  32 -rw-r--r--  1 pdehaan  staff    13K Jun  7 22:03 upload.svg

Note that the public/resources/background.png is 2.5 MB. But we'll probably want to try running all the images through imagemin and/or svgo.

Improve Readme

To start:
Describe the project.
Step by step instructions on how to run.

Let's talk about scaling and limits

Off the top of my head (there are probably more):

  • How many users are we expecting?
  • How many users at the same time?
  • Is there a filesize limit?
  • Is there a total size limit per "account"?

Hosted app still mentions localhost server

Per: Host something on AWS #2, we now have a https://p2p.dev.lcip.org/ dev server. But when I try uploading/downloading files, I still see some references to "localhost".

We'll need to try determining the environment at runtime to distinguish between local and dev server stuffs.


Other than that, everything worked and looked great! Awesome work, @abhinadduri!

UI tests

framework, etc, needs discussion

Safari & IE support

At a minimum they use prefixes on the window.crypto.subtle API. There may be other issues as well.

As far as I know Safari uses window.crypto.webkitSubtle and IE uses window.msCrypto.subtle

Rename everything to "Send"

What's it going to be? (Spoiler alert: "Send")


TODOs:

  • Rename repo (#171)
  • Remove any references to something-awesome (PR #182)
  • Remove any references to portal
  • Tweak README.md (PR #182)
  • Update package.json (PR #182)
  • Update contribute.json PR (#148) after repo/URL is updated (PR #182)
  • Update dev and stage server URLs (#166)
  • Update docker image names? (PR #167; "build docker image with new name")
  • Update Circle-CI

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.