Giter Club home page Giter Club logo

workspace-sync's Introduction

Workspace Sync

NOTE: I wrote this package for my own needs, so it may not generalize well. Feel free to create issues and PRs, but I may be slow to get to them.

Workplace sync is a tool that allows you to write code in one place and automatically keep a remote copy of the code in sync. fsnotify is used to watch the local copy and Pion Data Channels are used to send a copy of the updated file to the remote when a change is detected.

Setup

Download the appropriate binary to your local machine and the remote. If one is not provided, compile using

GOOS=<os> GOARCH=<architecture> go build -o sync cmd/workspace-sync/main.go

Usage - Remote

The remote end must be started first because it runs an HTTP server for the local end to send requests. The remote end is configured using the config.json file which must be located at the root of the directory where you want updates to be sent. An example json config is shown below:

{
    "port": ":50000",
    "iceURL": "stun:stun.l.google.com:19302"
}

Start the remote end first:

./linux-workspace-sync --endpoint remote  // if remote end is linux

NOTE: the connection is established via HTTP over localhost. If remote is a server which you SSH into, make sure to forward the port from config.json.

Usage - Local

The local end is configured using a similar config.json containing a few extra fields. An example is shown below:

{
    "directories": "./",
    "ignore": [".git"],
    "port": ":50000",
    "iceURL": "stun:stun.l.google.com:19302",
}

This this config will recursively watch the current directory and all subdirectories, excluding any paths containing .git. Start the local end with:

./macos-workspace-sync --endpoint local  // if local end is mac

workspace-sync's People

Contributors

tmitchel avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

isgasho karolisl

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.