Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

derekbekoe/spot

Repository files navigation

🚧 This project has been archived

Read about Cloud Hosted Developer Environments in this blog post - Intelligent Productivity and Collaboration, from Anywhere.


Spot Host: The host that powers the VS Code extension

This repository is for the Spot Host.

The Spot Host powers the Spot VS Code extension.

  • Node.js server (packaged using pkg)
  • Runs on a specified PORT with a set INSTANCE_TOKEN
  • All endpoints require valid token otherwise 401 Unauthorized
  • HTTP & HTTPS available

Image1: Spot host running Spot Host Image2: Connecting to host in browser Spot Host connected to with browser Image3: Connecting to host in VS Code Spot Host connected to VS Code

Quickstart

A few steps to get you started right away:

Download latest Spot Host

# For linux
wget https://github.com/derekbekoe/spot/releases/download/v0.2.0/spot-host
wget https://github.com/derekbekoe/spot/releases/download/v0.2.0/pty.node

Start the host

chmod +x spot-host
export PORT=8080
export INSTANCE_TOKEN=mySecretToken
./spot-host

Configuration

The following environment variables can be configured:

Name Description
PORT The port to run the host on.
INSTANCE_TOKEN The token required to connect to the Spot Host.
USE_SSL (optional) '1' if SSL should be used otherwise, don't use SSL.
C_DOMAIN (optional) The domain that SSL is provided for. Used in /etc/letsencrypt/live/C_DOMAIN/[privkey.pem,fullchain.pem] to find the certs.
SPOT_FILE_WATCH_IGNORE_DOT_FILES (optional) Set this to ignore .dotfiles for the file watcher. This hides those files from the VS Code file list. By default, no files are ignored.
SPOT_FILE_WATCH_PATH (optional) The path to watch and show in the VS Code file list.

Developer Setup

Looking to contribute or debug yourself?

  1. Clone the repository
  2. Run npm install
  3. Run export PORT=3000
  4. Run export INSTANCE_TOKEN=mySecretToken
  5. Run node app.js

Packaging

Fix up pty.node

In node_modules/node-pty/lib/unixTerminal.js, search for pty.node and modify that line:

var pty = process.pkg ? require(path.join(path.dirname(process.execPath), 'pty.node')) : require(path.join('..', 'build', 'Release', 'pty.node'));

This will allow the server to work after being packaged with pkg.

Copy pty.node from node_modules/node-pty/build/Release/pty.node to the same directory as the spot host (see pkg native-addons).

Build

Build package: node_modules/.bin/pkg --out-path build package.json

Run

Set the required environment variables.

Run the Spot Host: ./build/spot-host-macos or ./build/spot-host-linux

Release History

See GitHub Releases.

License

MIT