diff --git a/AUTHORS b/AUTHORS index 6b18f31c..49d437c6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,4 +4,5 @@ Samy Pessé Aaron O'Mullan Cyril MORISSE Julien LEICHER -Mark Achée \ No newline at end of file +Mark Achée +Rob Moran diff --git a/README.md b/README.md index 52f8fab9..04fa18f2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Codebox > "Open source cloud & desktop IDE." -[![Build Status](https://travis-ci.org/CodeboxIDE/codebox.png?branch=master)](https://travis-ci.org/CodeboxIDE/codebox) +[![Build Status](https://travis-ci.org/code-box/codebox.png?branch=master)](https://travis-ci.org/code-box/codebox) [![NPM version](https://badge.fury.io/js/codebox.svg)](http://badge.fury.io/js/codebox) Codebox is a complete and modular Cloud IDE. It can run on any unix-like machine (Linux, Mac OS X). It is an open source component of [codebox.io](https://www.codebox.io) (Cloud IDE as a Service). diff --git a/gulpfile.js b/gulpfile.js index 59401bf9..7b127802 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,7 +5,7 @@ var del = require('del'); var less = require('gulp-less'); var browserify = require('gulp-browserify'); var minifyCSS = require('gulp-minify-css'); -var runSequence = require('gulp-run-sequence'); +var runSequence = require('run-sequence'); var rename = require('gulp-rename'); var uglify = require('gulp-uglify'); var stringify = require('stringify'); diff --git a/lib/configs/default.js b/lib/configs/default.js index fc425013..be9fc609 100644 --- a/lib/configs/default.js +++ b/lib/configs/default.js @@ -23,6 +23,9 @@ module.exports = function(options) { // Secret identifier for the workspace 'secret': null, + // Local user when on desktop + 'desktopuser': null, + // Events reporting 'reporting': { 'timeout': 180 @@ -74,7 +77,7 @@ module.exports = function(options) { }, _.defaults); // Unique id for workspace - options.id = options.id || crc.hex32(crc.crc32(options.root)) + options.id = options.id || crc.crc32(options.root).toString(16); return options; }; diff --git a/lib/index.js b/lib/index.js index c89e973f..ed062654 100644 --- a/lib/index.js +++ b/lib/index.js @@ -116,6 +116,24 @@ var start = function(config) { saveUninitialized: true })); + // Desktop user + app.use(function(req, res, next) { + if (req.session.userId) return next(); + + if (config.desktopuser) { + var user = config.desktopuser; + config.auth.users[user] = user; + return users.auth(user, user, req) + .then(function(user) { + req.user = user; + next(); + }) + .fail(next); + } else { + next(); + } + }); + // Auth by query strings app.use("/", function(req, res, next) { var args = _.extend({}, req.query, req.body); diff --git a/package.json b/package.json index f091b217..6c90a7cb 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,12 @@ "description": "Extensible hybrid IDE", "version": "1.0.0-alpha.5", "author": "FriendCode Inc. ", - "license": "Apache 2", + "license": "Apache-2.0", "preferGlobal": true, "main": "lib/index.js", "repository": { "type": "git", - "url": "https://github.com/CodeboxIDE/codebox.git" + "url": "https://github.com/code-box/codebox.git" }, "keywords": [ "cli", "ide", "server", "desktop", "development", "code", "editor" @@ -30,20 +30,20 @@ "q": "~1.2.0", "lodash": "2.4.1", "pkgm": "3.3.0", - "tmp": "0.0.25", + "tmp": "0.0.26", "express": "4.6.1", "express-session": "1.7.0", "wrench": "1.5.8", "body-parser": "1.0.2", "cookie-parser": "1.0.1", - "sockjs": "0.3.9", + "sockjs": "0.3.15", "eventemitter2": "0.4.14", - "crc": "0.2.1", + "crc": "3.3.0", "request": "2.37.0", - "commander": "2.8.0", + "commander": "2.8.1", "open": "0.0.5", "ini": "1.2.1", - "basic-auth": "1.0.0", + "basic-auth": "1.0.1", "mime": "1.3.4", "busboy": "0.2.9", "uuid": "2.0.1", @@ -56,7 +56,7 @@ "gulp-uglify": "1.1.0", "gulp-less": "3.0.2", "gulp-minify-css": "1.0.0", - "gulp-run-sequence": "0.3.2", + "run-sequence": "1.1.1", "del": "1.1.1", "stringify": "3.1.0", "require-globify": "1.1.0", @@ -79,28 +79,27 @@ "octicons": "2.2.0", "mousetrap": "1.5.2", "moment": "2.9.0", - "sockjs-client": "1.0.0-beta.12", + "sockjs-client": "1.0.0", "axios": "0.5.4", "merge-stream": "0.1.7" }, "packageDependencies": { - "about": "CodeboxIDE/package-about", - "command-palette": "CodeboxIDE/package-command-palette", - "files-tree": "CodeboxIDE/package-files-tree", - "tabs": "CodeboxIDE/package-tabs", - "editor": "CodeboxIDE/package-editor", - "editorsync": "CodeboxIDE/package-editorsync", - "terminal": "CodeboxIDE/package-terminal", - "pkgcontrol": "CodeboxIDE/package-pkgcontrol", - "statusbar": "CodeboxIDE/package-statusbar", - "watcher": "CodeboxIDE/package-watcher", - "panels": "CodeboxIDE/package-panels", - "find": "CodeboxIDE/package-find", - "git": "CodeboxIDE/package-git", - "settings": "CodeboxIDE/package-settings", - "menubar": "CodeboxIDE/package-menubar", - "image": "CodeboxIDE/package-image", - "ctags": "CodeboxIDE/package-ctags" + "about": "code-box/package-about", + "command-palette": "code-box/package-command-palette", + "editor": "code-box/package-editor", + "editorsync": "code-box/package-editorsync", + "files-tree": "code-box/package-files-tree", + "find": "code-box/package-find", + "git": "code-box/package-git", + "image": "code-box/package-image", + "menubar": "code-box/package-menubar", + "panels": "code-box/package-panels", + "pkgcontrol": "code-box/package-pkgcontrol", + "settings": "code-box/package-settings", + "statusbar": "code-box/package-statusbar", + "tabs": "code-box/package-tabs", + "terminal": "code-box/package-terminal", + "watcher": "code-box/package-watcher" }, "scripts": { "test": "export TESTING=true; mocha --reporter list"