Skip to content

Commit

Permalink
Merge remote-tracking branch 'JohnMcLear/master'
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
  • Loading branch information
theoryshaw committed May 20, 2015
2 parents 5d89be9 + c856475 commit 122eb73
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 779 deletions.
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Developer Guidelines
(Please talk to people on the mailing list before you change this page, see our section on [how to get in touch](https://github.com/ether/etherpad-lite#get-in-touch))

## Important note for pull requests
**Pull requests should issued against the develop branch**. We never pull directly into master.

Expand All @@ -12,7 +9,7 @@ To make sure everybody is going in the same direction:
* easy to integrate into other apps, but also usable as standalone
* using less resources on server side
* extensible, as much functionality should be extendable with plugins so changes don't have to be done in core
Also, keep it maintainable. We don't wanna end ob as the monster Etherpad was!
Also, keep it maintainable.

## How to work with git?
* Don't work in your master branch.
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,24 @@

[sketch.openingdesign.com](http://sketch.openingdesign.com/)

Installation
------------
1. Install Requirements. ``sudo apt-get update && sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++``
2. Install EtherDraw `` git clone git://github.com/JohnMcLear/draw.git ``
3. Enter the EtherDraw folder `` cd draw ``
4. Run EtherDraw `` bin/run.sh ``
5. Make a drawing! Open your browser and visit `` http://127.0.0.1:9002 ``

Requirements
------------
* [NodeJS > v12] (http://nodejs.org/)
* Lib Cairo
* Lib Jpeg
* Lib Gif
* Chuck Norris dreams in fists

Thanks to..
-----------
* [John McLear](https://github.com/JohnMcLear)
* Isaac et al @ Node Team (Joyent)
* Guillermo et al @ SocketIO Team (Automattic)
* Canvas Team
Expand Down
15 changes: 0 additions & 15 deletions bin/installDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ hash npm > /dev/null 2>&1 || {
exit 1
}

#check npm version
NPM_VERSION=$(npm --version)
if [ ! $(echo $NPM_VERSION | cut -d "." -f 1) = "1" ]; then
echo "You're running a wrong version of npm, you're using $NPM_VERSION, we need 1.x" >&2
exit 1
fi

#check node version
#NODE_VERSION=$(node --version)
#NODE_V_MINOR=$(echo $NODE_VERSION | cut -d "." -f 1-2)
#if [ ! $NODE_V_MINOR = "v0.8" ] && [ ! $NODE_V_MINOR = "v0.10" ]; then
# echo "You're running a wrong version of node, you're using $NODE_VERSION, we need v0.8.x or v0.10.x" >&2
# exit 1
#fi

#Get the name of the settings file
settings="settings.json"
a='';
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"type" : "git",
"url" : "http://github.com/JohnMcLear/draw.git"
},
"version": "0.1.0",
"version": "0.1.2",
"engines": {
"node": ">=0.6.x"
"node": ">=0.12.x"
},
"dependencies": {
"express": "~3.5.1",
"socket.io": "~1.0.0",
"async": "~0.6.2",
"ueberDB": "~0.2.1",
"canvas": "1.1.6",
"paper": "0.9.20",
"canvas": "1.2.1",
"paper": "0.9.22",
"jsonminify":"~0.2.3"
}
}
37 changes: 30 additions & 7 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,38 @@ var settings = require('./src/util/Settings.js'),
projects = require('./src/util/projects.js'),
db = require('./src/util/db.js'),
express = require("express"),
app = express(),
paper = require('paper'),
socket = require('socket.io'),
async = require('async'),
fs = require('fs');
fs = require('fs'),
http = require('http'),
https = require('https');

/**
* SSL Logic and Server bindings
*/
if(settings.ssl){
console.log("SSL Enabled");
console.log("SSL Key File" + settings.ssl.key);
console.log("SSL Cert Auth File" + settings.ssl.cert);

var options = {
key: fs.readFileSync(settings.ssl.key),
cert: fs.readFileSync(settings.ssl.cert)
};
var app = express(options);
var server = https.createServer(options, app).listen(settings.port);
}else{
var app = express();
var server = app.listen(settings.port);
}

/**
* A setting, just one
/**
* Build Client Settings that we will send to the client
*/
var port = settings.port;
var clientSettings = {
"tool": settings.tool
}

// Config Express to server static files from /
app.configure(function(){
Expand Down Expand Up @@ -71,11 +93,11 @@ app.use("/static", express.static(__dirname + '/src/static'));


// LISTEN FOR REQUESTS
var server = app.listen(port);
var io = socket.listen(server);

io.sockets.setMaxListeners(0);

console.log("Access Etherdraw at http://127.0.0.1:"+settings.port);

// SOCKET IO
io.sockets.on('connection', function (socket) {
socket.on('disconnect', function () {
Expand Down Expand Up @@ -195,6 +217,7 @@ function loadFromMemory(room, socket) {
socket.emit('loading:start');
var value = project.exportJSON();
socket.emit('project:load', {project: value});
socket.emit('settings', clientSettings);
socket.emit('loading:end');
}

Expand Down
21 changes: 16 additions & 5 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
//IP and port which etherpad should bind at
"ip": "0.0.0.0",
"ip" : "0.0.0.0",
"port" : 9002,

//The Type of the database. You can choose between dirty, postgres, sqlite and mysql
Expand All @@ -15,16 +15,27 @@
//the database specific settings
"dbSettings" : {
"filename" : "var/dirty.db"
}
},

/* An Example of MySQL Configuration
"dbType" : "mysql",
"dbSettings" : {
"user" : "root",
"host" : "localhost",
"password": "",
"database": "store"
}
"database": "etherdraw"
},
*/

/* The default selected tool - 'pencil', 'brush', 'select' */
"tool": "brush",

/* Example SSL Configuration
"ssl" : {
"key": "/path/to/key.key",
"cert": "/path/to/cert.crt"
}
*/

}

Loading

0 comments on commit 122eb73

Please sign in to comment.