Giter Site home page Giter Site logo

sync-engine's Introduction

Sync Engine CircleCI

This is a fork of the Nylas sync-engine project. For those looking for a hosted email syncing service, check out their current offerings.

Installation and Setup

TODO: Add Docker steps

Auth an account via the commandline to start syncing:

bin/inbox-auth [email protected]

The inbox-auth command will walk you through the process of obtaining an authorization token from Google or another service for syncing your mail. Your credentials are stored to the local MySQL database for simplicity.

The sync engine will automatically begin syncing your account with the underlying provider. The inbox-sync command allows you to manually stop or restart the sync by running inbox-sync stop [YOUR_ACCOUNT]@example.com or inbox-sync start [YOUR_ACCOUNT]@example.com. Note that an initial sync can take quite a while depending on how much mail you have.

API Service

The API service provides a REST API for interacting with your data. To start it in your development environment, run the command below:

$ bin/inbox-api

This will start the API Server on port 5555. At this point You're now ready to make requests! If you're using VirtualBox or VMWare fusion with Vagrant, port 5555 has already been forwarded to your host machine, so you can hit the API from your regular web browser.

You can get a list of all connected accounts by requesting http://localhost:5555/accounts. This endpoint requires no authentication.

For subsequent requests to retreive mail, contacts, and calendar data, your app should pass the account_id value from the previous step as the "username" parameter in HTTP Basic auth. For example:

curl --user 'ACCOUNT_ID_VALUE_HERE:' http://localhost:5555/threads

If you are using a web browser and would like to clear your cached HTTP Basic Auth values, simply visit http://localhost:5555/logout and click "Cancel".

Security

For the sake of simplicity and setup speed, the development environment does not include any authentication or permission. For developing with sensitive data, we encourage developers to add their own protection, such as only running sync-engine on a local machine or behind a controlled firewall. Note that passwords and OAuth tokens are stored unencrypted in the local MySQL data store on disk. This is intentional, for the same reason as above.

Running tests

To run the test suite execute the following command: docker-compose run app pytest

If you wish to run it on different Python version pass PYTHON_VERSION to build, i.e. docker-compose build --build-arg PYTHON_VERSION=3.9 app. The list of supported Python versions can be found here: https://github.com/closeio/sync-engine/blob/master/.circleci/config.yml#L37

License

This code is free software, licensed under the The GNU Affero General Public License (AGPL). See the LICENSE file for more details.

sync-engine's People

Contributors

aidanhs avatar alecrosenbaum avatar bengotow avatar brettgerry avatar dggreenbaum avatar dlitz avatar dregitsky avatar drewler avatar eagles2f avatar emfree avatar ethanblackburn avatar filipposironi avatar gnprice avatar grinich avatar jennielees avatar jhurwitz avatar jimmy-nylas avatar jkemp101 avatar jstejada avatar kav-ya avatar khamidou avatar logandavis avatar mhahnenberg avatar nylasbot avatar pfista avatar sm-smalls avatar spang avatar squeaky-pl avatar systemizer avatar thomasst 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.