• Stars
    star
    327
  • Rank 128,686 (Top 3 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated almost 9 years ago

Reviews

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

Repository Details

Run server-side code quickly and securely in the browser.

coderunner

http://coderunner.io

JSbin for server-side languages. Run server-side code quickly and securely in the browser. Automatic dependency installation. Live code execution. Transparent revisioning. Powered by docker.

coderunner

Demo

coderunner

Design Goals

⎈ Secure

Coderunner is designed to be secure. No user script should be able to jump outside its personal sandbox or modify any other script. All scripts run inside an isolated linux container and each package installer runs in a separate, shared linux container.

Fast

Coderunner is designed to provide immediate feedback. Most script runners use VMs to run server-side code securely. VMs are slow and CPU-intensive. Linux containers are fast and light-weight, offering the same kind of security that a VM provides.

❁ Flexible

Many server-side script runners remove features of the language in order to keep the system secure. This makes the language much less powerful. With Coderunner, you have full access to everything the language provides.

Multilingual

Coderunner is designed to support many languages. Currently, Node.js is the only supported language, but it should be trivial to add additional scripting languages like Python, Ruby, PHP, etc.

❖ Extendable

One of the upcoming goals of coderunner is to be more extendable by separating the API from the frontend. This will allow coderunner to support a variety of services.

Development

Local without docker (easy, insecure)

  1. Install coderunner locally

    git clone https://github.com/matthewmueller/coderunner

  2. Change directory into coderunner

    cd ~/coderunner

  3. Install node modules & components:

    make install

  4. Start the server

    node index.js --no-docker

VM with docker (more steps, secure)

In order to develop docker locally, you'll need to install VirtualBox, Vagrant and Git.

  1. Install virtualbox from https://www.virtualbox.org/ (or use your package manager)

  2. Install vagrant from http://www.vagrantup.com/ (or use your package manager)

  3. Install git if you had not installed it before, check if it is installed by running git in a terminal window

  4. Install coderunner locally:

    git clone https://github.com/matthewmueller/coderunner

  5. Change directory to coderunner

    cd coderunner

  6. Run vagrant from coderunner directory

    vagrant up

Vagrant will download and install an ubuntu virtual machine containing:

  • ubuntu 12.04
  • docker
  • git
  • npm
  • node.js
  • coderunner
  1. SSH into VM

    vagrant ssh

  2. Change directory into coderunner

    cd ~/coderunner

  3. Install node modules & components:

    make install

  4. Build all the docker images

    make images

  5. Start the node-installer (using mongroup)

    mongroup start node-installer

  6. Start node server (use node-dev index.js if you want to autorestart on save)

    node index.js

  7. Go to http://localhost:8080

Run code from your project

To add coderunner to your project, you can add the following icon pointing to your script:

[![coderunner](https://i.cloudup.com/m1TVtFGGyk.png)](http://coderunner.io/:id/:revision)

Yielding:

coderunner

Adding other languages

Coderunner makes it easy to add new languages. You will need to create two docker images, one for running and one for installing. The install container needs to be a web server that shares the installations volume (in node, node_modules) with all the runner container instances.

Take a look at images/ for an example of how to add another language.

TODO

This code is still in it's infancy. There's lots to do. Here's a few things I'd like to add:

Docker

  • Better resource limiting in docker (memory, storage, & network)
  • Better docker signal support (hopefully coming in docker 0.7, see here.)
  • Ship coderunner inside docker container (docker inside docker)

Features

  • Easier language interface
  • More languages
  • User support with script history
  • Multiple files
  • Environment variables for easier sharing

License

(The MIT License)

Copyright (c) 2013 Matt Mueller [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

x-ray

The next web scraper. See through the <html> noise.
JavaScript
5,866
star
2

date

Date() for humans
JavaScript
1,474
star
3

joy

A delightful Go to Javascript compiler (ON HOLD)
Go
1,325
star
4

array

A better array for the browser and node.js. Supports events & many functional goodies.
JavaScript
709
star
5

graph.ql

Faster and simpler way to create GraphQL servers
JavaScript
638
star
6

socrates

Small (8kb), batteries-included redux store to reduce boilerplate and promote good habits.
JavaScript
578
star
7

dots

WIP bootstrapping library for osx & ubuntu (and maybe others!)
Shell
545
star
8

next-cookies

Tiny little function for getting cookies on both client & server with next.js.
JavaScript
369
star
9

28kb-react-redux-routing

React + Redux + Routing Stack for just 28kb
JavaScript
245
star
10

vo

Minimalist, yet complete control flow library.
JavaScript
235
star
11

roo

Jump-start your front-end server
JavaScript
104
star
12

component-test

Minimal configuration component test runner supporting browser testing, phantomjs, and saucelabs.
JavaScript
98
star
13

mini-html-parser

Mini HTML parser for webworkers / node. Intended for well-formed HTML.
JavaScript
83
star
14

node-nom

Dead simple site scrapper for Node.js
JavaScript
74
star
15

outliers

Find outliers in a dataset.
JavaScript
56
star
16

next-redirect

Redirect for next.js. Works on both the client and server
JavaScript
52
star
17

try-again

Generic, simple retry module with exponential backoff.
JavaScript
52
star
18

PHPUnit-Test-Report

Browser testing with PHPUnit
PHP
45
star
19

x-ray-crawler

Friendly web crawler for x-ray
JavaScript
44
star
20

pg-bridge

Simple service connecting PostgreSQL notifications to Amazon SNS.
Go
44
star
21

go-datadog

Easily send structured logs to Datadog over TCP.
Go
39
star
22

svg

low-level svg helper
JavaScript
37
star
23

preact-head

Standalone, declarative <Head /> for Preact.
JavaScript
37
star
24

adjust

Position elements next to each other. A light-weight version of HubSpot/tether.
JavaScript
36
star
25

wrap-fn

Low-level wrapper to easily support sync, async, and generator functions.
JavaScript
34
star
26

dom-iterator

Feature-rich, well-tested Iterator for traversing DOM nodes.
JavaScript
34
star
27

normalize-contenteditable

All text in a content-editable block should be wrapped in <p> tag.
JavaScript
34
star
28

ppi

Find the PPI (pixels per inch) of an image.
JavaScript
33
star
29

next-route

Simplified custom routing for next.js.
JavaScript
33
star
30

tipp

Tool tips that just work.
JavaScript
31
star
31

combine-errors

Simple way to combine multiple errors into one.
JavaScript
31
star
32

poss

Slightly better-looking error handling for async/await & generators
JavaScript
28
star
33

autocomplete

Flexible autocomplete component
JavaScript
26
star
34

envobj

Tiny environment variable helper, that I'll use in all my apps.
TypeScript
25
star
35

qr-code

Create QR codes
JavaScript
25
star
36

vcom

Everything you need to create virtual Preact Components with CSS, HTML, and JS.
JavaScript
21
star
37

tiny-store

Tiny immutable store for any value
JavaScript
21
star
38

blocktree

Back to the basics, Hickey-inspired, generic text parser
JavaScript
21
star
39

unmatrix

Parse and normalize the individual values of a css transform
JavaScript
21
star
40

enqueue

seamlessly queue up asynchronous function calls. supports concurrency and timeouts.
JavaScript
20
star
41

string-scanner

scan through strings. supports forwards and backwards scanning.
JavaScript
19
star
42

step.js

My kind of step library. no dependencies. 120 lines of code. 383 lines of tests.
JavaScript
18
star
43

every

human-friendly intervals using http://github.com/matthewmueller/date
JavaScript
17
star
44

json-to-dom

Fill in DOM nodes with JSON. Supports arrays and attributes.
JavaScript
17
star
45

pretty-html

HTML logging that's easy on the eyes.
JavaScript
17
star
46

preact-socrates

preact plugin for socrates.
JavaScript
16
star
47

time-series

simple streaming time series graphs. automatic rescaling as data streams in.
JavaScript
16
star
48

event-debugger

step through events! must be initialized at the top of your scripts.
JavaScript
16
star
49

sun

Simple little virtual DOM node builder for Preact.
JavaScript
15
star
50

x-ray-parse

x-ray's selector parser.
JavaScript
15
star
51

file-pipe

Use gulp plugins on individual files
JavaScript
14
star
52

title-capitalization

Properly capitalize English titles.
JavaScript
14
star
53

atom-standard

An on-save linter and formatter for atom using standard. Supports all the options that standard supports.
JavaScript
14
star
54

express-graph.ql

Express middleware for querying our graphql server built with graph.ql
JavaScript
13
star
55

murmur.js

Small murmur hash implementation.
JavaScript
13
star
56

mergin

Merges files together using a best-effort merge
JavaScript
13
star
57

next-flash

Flash messages for next.js. Works on both the client and the server.
JavaScript
13
star
58

image-search

Pluggable image search
JavaScript
13
star
59

redux-routes

Simple redux history middleware.
JavaScript
13
star
60

io

higher-level engine.io client.
JavaScript
12
star
61

stripe-checkout

Open Stripe Checkout programmatically
JavaScript
12
star
62

remember

Use localstorage to remember input values. Supports textareas and inputs including radio buttons and checkboxes.
JavaScript
12
star
63

internal-old

Internal queue for your public libraries and APIs
JavaScript
11
star
64

preact-rc

Remote control your Preact components
JavaScript
11
star
65

subs

tiny string substitution
JavaScript
10
star
66

lambda-serve

Use koa or express on lambda!
JavaScript
10
star
67

grow

Grow textareas without using a clone or ghost element.
JavaScript
10
star
68

better-error

easier, more colorful, sprintf-style errors
JavaScript
10
star
69

spreadsheet

NOTE: this project is quite old. I won't be maintaining it anymore, but it should still work :-)
JavaScript
10
star
70

debounce

Underscore's debounce method as a component.
JavaScript
10
star
71

typewriter

Animated typing
JavaScript
9
star
72

async-script-promise

Asynchronously load scripts
JavaScript
9
star
73

reverse-regex

flip a regular expression. allows you to efficiently search backwards.
JavaScript
9
star
74

gist

Fluent gist API for node.js.
JavaScript
9
star
75

unyield

allow generators functions to accept callbacks
JavaScript
9
star
76

cheerio-select

Tiny wrapper around FB55's excellent CSSselect library.
JavaScript
9
star
77

terraform-provider-url

Simple little Terraform data source for parsing URLs.
Go
9
star
78

mdb

In-memory key/value store designed for concurrent use
Go
9
star
79

cursors

Collection of Mac's native cursor elements
8
star
80

increment

increment strings. good for keeping slugs unique.
JavaScript
8
star
81

wrapped

Low-level wrapper to provide a consistent interface for sync, async, promises, and generator functions.
JavaScript
8
star
82

yieldly

Conditionally make functions yieldable
JavaScript
8
star
83

events

Stand-alone event bindings as a component based on how Backbone's views handle events.
JavaScript
8
star
84

color

Extremely basic color tinting component
JavaScript
8
star
85

vscode-proofie

Proofie is an experimental proof-reader for VSCode that helps you write better.
TypeScript
8
star
86

plumbing

Pluggable plumbing for your Javascript libraries.
JavaScript
7
star
87

clock

Create a swiss railway inspired clock.
HTML
7
star
88

routematch

simple, functional route matcher for node.js and the browser.
JavaScript
7
star
89

character-iterator

Iterate through text characters in the DOM tree. Handles parent & sibling relationships.
JavaScript
7
star
90

sns.js

Simple publish and parse module for AWS SNS
JavaScript
7
star
91

hex-to-color-name

Tiny module to map hex colors to color names of your choice.
JavaScript
7
star
92

hackernews

Go
7
star
93

css-to-js-object

Experimental: convert css to a JS object.
JavaScript
7
star
94

number-to-letter

Simple utility to convert an arbitrary number to a letter
JavaScript
7
star
95

rework-count

Rework plugin to style elements based on the sibling count.
JavaScript
6
star
96

arg-deps

Statically inspect a function to get the properties of its arguments. Works with minified code.
JavaScript
6
star
97

extend.js

extend objects. extend(obj, obj2, ...)
JavaScript
6
star
98

invisibles

make spaces visible
JavaScript
6
star
99

email

fluent email using sendmail
JavaScript
6
star
100

coderunner-api

API for coderunner
JavaScript
6
star