• Stars
    star
    302
  • Rank 138,030 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WebSync is a document editing tool similar to Google Drive or Office 365.

WebSync

WebSync is a document editing tool similar to Google Drive or Microsoft Skydrive.

Priority Issues Idea Issues Build Status Gem Status Code Climate Codacy Badge Ruby Documentation Coverage Join the chat at https://gitter.im/d4l3k/WebSync

Features

WebSyn.ca has a more up to date list of features. These might be incomplete:

  • End-to-End Encryption powered by OpenPGP.
  • Multi-user editing
  • Notebook, Document, Spreadsheet, and Presentation editing and viewing.
  • Document sharing
  • Tables and Charts
  • Resizable Images & Tables
  • User support
    • Icons and display names via Gravatar.
  • In document chat between users
  • Revert changes to edited documents
  • Persistent JSON object synced between clients
  • Open source
  • Self Hostable

Dependencies

  • WebSync requires Ruby, and Node.JS
  • WebSync uses PostgreSQL for datastorage and redis for temporary data & pub/sub capabilities.
  • Libre Office, unoconv and poppler is required for file upload & download.
  • You probably need Java for the Closure javascript compressor (send me a message if it works without it).

Ruby Version Manager is a great tool for handling multiple versions of Ruby. WebSync is automatically tested against Ruby 2.0.0 and Ruby 2.1.2.

In addition to the previously mentioned dependencies, some global dependencies are needed as well.

gem install rubygems-bundler

sudo npm install -g bower
sudo npm install -g grunt-cli
sudo npm install -g pm2

To install project local dependencies for Ruby, Node.JS and bower, just run:

bundle install
npm install
bower install

Some things (like databases and initial javascript assets) can be configured in "config.json" but a majority will require source changes.

Development Instance

Once the dependencies are installed and running, you should be able to run a development server by running:

rackup
bin/backend.js

This launches the main site on port 9292 and the web socket server on 4568.

To add an admin type:

rake "admin:add[[email protected]]"

and to remove:

rake "admin:remove[[email protected]]"

Once the site is running you need to go into the admin panel and configure the script groups. Most of these are preconfigured from config.json

Configuration

The configuration files are located in the config folder. Most of the configuration options are located in config.json. This configures the database connections and assets.

OAuth

WebSync uses OmniAuth for authenticating against other resources. OmniAuth provides an easy way to authenticate against dozens of outside services. The only ones that are packaged with WebSync are Facebook and Google, but it's fairly easy to add new ones. To use OAuth with any of these services you need to acquire API keys and add them on the command line. For example:

GPLUS_KEY="kasdlflasdfasdf.apps.googleusercontent.com" GPLUS_SECRET="jfasdjl923n3n" unicorn ...

The built in options are GPLUS_KEY, GPLUS_SECRET, FACEBOOK_KEY and FACEBOOK_SECRET.

The OmniAuth providers are defined in config/omniauth-providers.rb. A list of available providers can be viewed on the OmniAuth Wiki. To enable a provider you need to add the gem (eg. omniauth-facebook) to the Gemfile and configure in config/omniauth-providers.rb as follows. This is the Facebook provider configuration:

# OmniAuth configuration:
provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']

# WebSync styling:
# style <provider>, <button color>, <button label>
style    :facebook, "#3b5998", "Facebook"

Production

Docker

Docker is a lightweight Linux container tool that allows for easy deployment. The first step is to install by following the instructions on Docker's site. I've had issues with the Ubuntu Docker image on Digital Ocean (for some reason you couldn't access /src) and because of it WebSyn.ca doesn't use it anymore. The Docker images on Digital Ocean are out of date.

Second, modify WebSync/config/personal-docker/config.json with the production database information. The WebSync container does not include any databases. You need to configure Redis and PostgreSQL seperately.

Then you need to build the docker container with your changes. There are a few helper scripts in the personal-docker folder. To pull the d4l3k/WebSync:latest image and build your configuration:

sudo ./build.sh

You can then launch WebSync by running:

sudo ./run.sh websync-start

Or, enter an interactive shell by running:

sudo ./run.sh bash

Manual

The production environment is currently setup for use with https://websyn.ca but should be fairly straight forward to set up with anything else.

In production, WebSync loads static asset files and documentation. These need to be compiled by running the following. Warning: This may take a long time.

rake assets:precompile

To clean them up:

rake assets:clean

Front End

You have two options for the front end, Unicorn and Thin.

Unicorn

The WebSync Docker container uses Unicorn because it's faster and uses Unix sockets so there is only one exposed port.

You can launch Unicorn on port 4569 by running:

unicorn -c config/unicorn.rb
Thin

The configuration for the front end is located in thin.yaml and by default launches 4 workers on ports 3000-3003. NOTE: There is no built in load balancer for the front end. You should use something like haproxy or nginx to balance between the worker threads.

You can launch the front end by running:

thin start -C config/thin.yaml

Backend

For the backend, it's recommended you install pm2 (npm install -g pm2) and run the command:

pm2 start bin/backend.js -i 4

which launches four worker threads that all listen on port 4568.

If you want to avoid pm2, you can just run bin/backend.js or node node/backend.js to get a single worker on port 4568.

Troubleshooting

rake aborted!
LoadError: cannot load such file -- sprockets/sass/importer

If you get the above error, or something similar, make sure you've installed the proper dependencies by running bundle. If the problem persists, try prefixing commands with bundle exec ....

To make bundle exec unneeded please see https://rvm.io/integration/bundler

Contributing

TODO

WebSync uses Waffle.IO for issues. Waffle.IO is just a nice way of organizing the GitHub issues and you can just look at those instead.

Source Documentation

WebSync Annotated Source Documentation

JavaScript Documentation

Ruby Documentation

To generate the documentation you can run rake documentation or rake assets:precompile. Every WebSync server has the documentation available at http://<server>:<port>/documentation, assuming it has been generated. All production servers will have the documentation.

Here's a pretty graph of the setup on WebSyn.ca that I made for a talk. WebSync

License

Copyright (c) 2015 Tristan Rice

WebSync is licensed under the MIT License.

More Repositories

1

go-pry

An interactive REPL for Go that allows you to drop into your code at any point.
Go
2,976
star
2

messagediff

A library for doing diffs of arbitrary Golang structs.
Go
256
star
3

go-sct

A color temperature setting library and CLI that operates in a similar way to f.lux and Redshift. Supports Wayland, X and Windows
C
123
star
4

talib

A Go(lang) wrapper for TA-Lib
Go
111
star
5

go-electrum

A pure Go (golang) electrum bitcoin wallet library.
Go
59
star
6

go-bayesopt

A library for doing Bayesian Optimization using Gaussian Processes (blackbox optimizer) in Go/Golang.
Go
47
star
7

driverender

Repo for visualizing self driving models and data
JavaScript
31
star
8

skeletondb

SkeletonDB is a lock-less thread safe in memory MVCC store written in Go.
Go
21
star
9

go-highlight

A Go (Golang) code syntax highlighting library.
Go
20
star
10

starry

A starbound server manager with an API for remote administration.
Go
16
star
11

sketchy-url-shortener

A sketchy URL shortener that uses keywords from selectable lists.
Go
10
star
12

go-csp-engine

Content Security Policy engine for Go/Golang. Unit test your CSP rules!
Go
9
star
13

fn.lc

fn.lc landing page
HTML
9
star
14

wikigopher

Wikipedia DB Dump Server + wikitext parser in Go/Golang
Go
9
star
15

friday

A real world application of pytorch, transfer learning and edge TPU to detect when my dog uses the restroom.
Python
8
star
16

overwatch

Go
7
star
17

turtle

A simple Go(lang) implementation of a Turtle (Terse RDF Triple Language) parser.
Go
7
star
18

torchdrive

torch primitives for BEV style perception models for self driving tasks
Python
7
star
19

quic

An attempt at QUIC in Go(lang). Probably will go nowhere. :|
Go
6
star
20

cs213

CPSC 213: Introduction to Computer Systems
C
6
star
21

campus

A interactive map for UBC.
Go
5
star
22

webrtc-lobby

A lobby service for webrtc.
Go
5
star
23

opentetrisarena

An open source webrtc based implementation of Tetris Arena
TypeScript
4
star
24

cs420

Go
3
star
25

go-censor

A go library for censoring bad/offensive words.
Go
3
star
26

ffi-tox

Ruby FFI bindings to Tox.
Ruby
3
star
27

ubc-food-safety

UBC Restaurant Food Safety Scraper
Go
3
star
28

ficrecommend

A FanFiction story recommendation service.
Go
3
star
29

rewriting-webextension

JavaScript
3
star
30

go-lbsql

Go library for doing client side SQL load balancing.
Go
3
star
31

ticker

simple stock ticker using a e-paper display and an esp8266
C
2
star
32

opendropbike

This is an open source (MIT licensed) reimplementation of the DropBike app since the official one is terrible.
JavaScript
2
star
33

consensus-slides

This is a tool designed to allow people to determine engagement during a lecture or presentation.
HTML
2
star
34

flytrap

A simple HTTP server for recording requests and serving static files.
Go
2
star
35

comic-rocket-api

A repository collating all of the information on the internal Comic Rocket API.
Ruby
2
star
36

SL-RubyScript

Allows scripting with Ruby to Second Life.
Ruby
2
star
37

go-caffe2

caffe2 bindings for Go
Go
2
star
38

upass

Renew your UPass automatically every month!
HTML
2
star
39

ServerInitProxy

A proxy that the server initializes for the client to connect to. Designed to connect to a private minecraft server behind a firewall. NOTE: New version has bugs.
Ruby
2
star
40

RubyLink

An advanced sign based system for mechanisms in Minecraft (Bukkit). Written in Ruby.
Ruby
2
star
41

config-files

My config files
Shell
2
star
42

polymer-react

Use React in Polymer 3 elements.
TypeScript
2
star
43

dominos.ca-coupons

A program to fetch all the dominos.ca coupons that are in the 1000-10000 range.
Go
2
star
44

go-bfloat16

Bfloat16 conversion utilities for Go/Golang
Go
1
star
45

transformer-example

Python
1
star
46

tensorflowops

A golang library that allows the user to access the registered tensorflow operations.
Go
1
star
47

cs304

HTML
1
star
48

chesms

Chess over SMS.
JavaScript
1
star
49

ourgraph

Go
1
star
50

cs221

CPSC 221: Basic Algorithms and Data Structures
C++
1
star
51

gh-notify

Go
1
star
52

etcdummy

Simple reimplementation of etcd for testing purposes
Go
1
star
53

bypass

bypass is an incredibly unsafe Go package that allows you to inspect private parts of go objects.
Go
1
star
54

comic-starship

A better comic viewer for Comic Rocket.
HTML
1
star
55

Bukkit-Miniplugs

Small Bukkit plugins (and scripts) that add various functionality. Written in ruby.
Ruby
1
star
56

confusednn-slicer

An experimental 3D model slicer using a combination of a CNN for processing a slice of the model and an RNN for generating gcode.
Python
1
star
57

Link

Advanced Sign Based Operations in Minecraft
Java
1
star
58

webrtc-lobby-elements

Polymer elements/webcomponents for interacting with the webrtc-lobby service.
JavaScript
1
star
59

RTerraria

Terraria server written in Ruby.
Ruby
1
star
60

dropbike-visualizer

A visualizer for dropbike trips.
HTML
1
star
61

monarch-api

Unofficial Monarch Python client
Python
1
star
62

gotorch

A WIP wrapper for pytorch / TorchScript
Go
1
star
63

axe

A simple graph partitioning algorithm written in Go. Designed for use for partitioning neural networks across multiple devices which has an added cost when crossing device boundaries.
Go
1
star
64

go-internetarchive

A Go API to the Internet Archive
Go
1
star
65

dnd-assistant

DND Assistant is an attempt to make a better DND helper app.
JavaScript
1
star
66

Ruby2LSL

A Symbolic-Expression to LSL converter. Right now it only converts ruby, however it is easy to extend.
Ruby
1
star
67

bridgesim-assets

An asset pack to use with aomarks/bridgesim .
1
star
68

ricela

Tesla stats and charging service. Exports car statistics to Prometheus as well as automatically starting and stopping ChargePoint chargers.
Go
1
star
69

cs425

https://www.cs.ubc.ca/~madooei/cpsc425/
Python
1
star