Comparing version 0.4.8 to 0.4.9
# Change Log | ||
## Unreleased | ||
* Add server logs in the browser. | ||
* Bundle icons to make them available without network access. | ||
## 0.4.8 | ||
@@ -4,0 +9,0 @@ |
@@ -19,3 +19,20 @@ 'use strict'; | ||
router.get('/output/:id', sse, function (req, res) { | ||
var id = req.params.id; | ||
var mon = servers.get(id); | ||
if (!mon) return res.sendStatus(404); | ||
function sendOutput(data) { | ||
res.json({ | ||
output: data.toString() | ||
}); | ||
} | ||
mon.on('stdout', sendOutput); | ||
mon.on('stderr', sendOutput); | ||
sendOutput(''); | ||
}); | ||
return router; | ||
}; |
@@ -16,2 +16,5 @@ 'use strict'; | ||
console.log('Exiting'); | ||
console.log('Stop daemon'); | ||
proxy.close(); | ||
server.close(); | ||
console.log('Remove pid file'); | ||
@@ -33,2 +36,12 @@ pidFile.remove(); | ||
proxy.on('proxyReq', function (proxyReq, req) { | ||
req._proxyReq = proxyReq; | ||
}); | ||
proxy.on('error', function (err, req) { | ||
if (req.socket.destroyed && err.code === 'ECONNRESET') { | ||
req._proxyReq.abort(); | ||
} | ||
}); | ||
proxy.listen(conf.port + 1); | ||
@@ -35,0 +48,0 @@ |
@@ -45,3 +45,3 @@ 'use strict'; | ||
util.log('Add server id: ' + id + ' cmd: ' + opts.cmd + ' port: ' + opts.env.PORT); | ||
util.log('Add server id: ' + id + ' cmd: ' + server.cmd + ' port: ' + opts.env.PORT); | ||
@@ -55,2 +55,5 @@ var logFile = void 0; | ||
// Init tail | ||
mon.tail = ''; | ||
// On start reset logfile and mon.tail | ||
@@ -86,4 +89,5 @@ var onStart = function onStart() { | ||
function updateServer(group, file) { | ||
addServer(group, file); | ||
group.restart(getId(file)); | ||
group.stop(getId(file), function () { | ||
addServer(group, file); | ||
}); | ||
} | ||
@@ -90,0 +94,0 @@ |
@@ -14,11 +14,3 @@ 'use strict'; | ||
var msg = 'Can\'t connect to server on port ' + PORT + '.\n'; | ||
msg += 'Server crashed or timeout of ' + timeout + 'ms exceeded. Retry or check logs.\n'; | ||
msg += '<pre><code>'; | ||
msg += command; | ||
msg += '\n\n'; | ||
msg += tail; | ||
msg += '</code></pre>'; | ||
return msg; | ||
return '\nCan\'t connect to server on PORT=<a href="http://localhost:' + PORT + '">' + PORT + '</a>.\nPossible causes:\n- Server crashed or timeout of ' + timeout + 'ms exceeded.\n- Server isn\'t listening on PORT environment variable.\'\nTry to reload or check logs.\n<pre><code>\n' + command + '\n\n' + tail + '\n</code></pre>\n'; | ||
}; |
{ | ||
"name": "hotel", | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"description": "Easily start, stop and access your servers from the browser", | ||
@@ -13,11 +13,11 @@ "main": "lib", | ||
"test": "mocha && standard", | ||
"start": "npm run babel:watch & npm run webpack:watch & npm run nodemon & wait", | ||
"prepublish": "npm test && npm run babel:build && npm run webpack:build", | ||
"start": "npm run nodemon & npm run watch:webpack & wait", | ||
"prepublish": "npm run build", | ||
"uninstall": "node bin/uninstall.js", | ||
"precommit": "npm test", | ||
"nodemon": "nodemon lib/daemon --ignore lib/daemon/public", | ||
"babel:build": "babel src --out-dir lib --copy-files --loose all --ignore src/client", | ||
"babel:watch": "npm run babel:build -- --watch", | ||
"webpack:build": "webpack --colors", | ||
"webpack:watch": "npm run webpack:build -- --watch" | ||
"nodemon": "nodemon -- src/daemon", | ||
"watch:webpack": "webpack -d --watch", | ||
"build": "npm run build:webpack && npm run build:babel", | ||
"build:babel": "babel src -d lib --copy-files --ignore src/daemon/public/bundle.js", | ||
"build:webpack": "webpack -p --output-path lib/daemon/public" | ||
}, | ||
@@ -63,3 +63,2 @@ "repository": { | ||
"vhost": "^3.0.2", | ||
"vue": "^1.0.16", | ||
"yargs": "^3.29.0" | ||
@@ -69,4 +68,4 @@ }, | ||
"babel-cli": "^6.1.2", | ||
"babel-core": "^6.5.1", | ||
"babel-loader": "^6.2.2", | ||
"babel-core": "^6.7.4", | ||
"babel-loader": "^6.2.4", | ||
"babel-plugin-transform-object-assign": "^6.1.18", | ||
@@ -78,10 +77,18 @@ "babel-plugin-transform-runtime": "^6.5.0", | ||
"css-loader": "^0.23.1", | ||
"file-loader": "^0.8.5", | ||
"font-awesome": "^4.5.0", | ||
"husky": "^0.11.3", | ||
"mocha": "^2.4.2", | ||
"mock-fs": "^3.6.0", | ||
"node-sass": "^3.4.2", | ||
"nodemon": "^1.8.1", | ||
"sass-loader": "^3.2.0", | ||
"sinon": "^1.17.3", | ||
"standard": "^4.5.4", | ||
"style-loader": "^0.13.1", | ||
"supertest": "^0.15.0", | ||
"uid": "0.0.2", | ||
"untildify": "^2.1.0", | ||
"url-loader": "^0.5.7", | ||
"vue": "^1.0.18", | ||
"vue-hot-reload-api": "^1.3.2", | ||
@@ -91,2 +98,3 @@ "vue-html-loader": "^1.1.0", | ||
"vue-style-loader": "^1.0.0", | ||
"vuex": "^0.6.2", | ||
"webpack": "^1.12.13", | ||
@@ -93,0 +101,0 @@ "whatwg-fetch": "^0.11.0" |
@@ -1,4 +0,4 @@ | ||
# hotel [![Mac/Linux Build Status](https://img.shields.io/travis/typicode/hotel/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/typicode/hotel) [![](https://badge.fury.io/js/hotel.svg)](https://www.npmjs.com/package/hotel) | ||
# hotel [![Mac/Linux Build Status](https://img.shields.io/travis/typicode/hotel/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/typicode/hotel) [![Windows Build status](https://img.shields.io/appveyor/ci/typicode/hotel/master.svg?label=Windows)](https://ci.appveyor.com/project/typicode/hotel/branch/master) [![](https://badge.fury.io/js/hotel.svg)](https://www.npmjs.com/package/hotel) | ||
> No need to worry about ports, remember commands, manage terminal tabs, ... access and start your servers from the browser. You can even use local `.dev` domains or any other tld, and it works everywhere (OS X, Linux, Windows) :+1: | ||
> No need to worry about ports, remember commands, manage terminal tabs, mess with /etc/hosts ... access and start your servers from the browser. You can even use local `.dev` domains or any other tld, and it works everywhere (OS X, Linux, Windows) :+1: | ||
@@ -14,7 +14,8 @@ ![](http://i.imgur.com/dAhxGMj.gif) | ||
* __Servers are only started when you access them__ | ||
* __Random or fixed ports__ | ||
* Works with any server (Node, Ruby, PHP, ...) | ||
* Cross-platform (OS X, Linux and Windows) | ||
* Plays nice with other servers (Apache, Nginx, ...) | ||
* No port 80 or admin/root privileges needed | ||
* No port 80, /etc/hosts or admin/root privileges needed | ||
* Random or fixed ports | ||
* See Roadmap for upcoming features :) | ||
@@ -29,2 +30,4 @@ _* Local `.dev` domains are optional. To use them, configure your network or browser to use hotel's proxy auto-config file (`proxy.pac`). See instructions [here](https://github.com/typicode/hotel/blob/master/docs/README.md)._ | ||
If you don't have Node installed, use [brew](http://brew.sh/) or [nvm](https://github.com/creationix/nvm). | ||
## Quick start | ||
@@ -137,4 +140,9 @@ | ||
## Roadmap | ||
- [ ] In-browser logs | ||
- [ ] Sub-domains support | ||
## License | ||
MIT - [Typicode](https://github.com/typicode) |
@@ -15,4 +15,4 @@ const fs = require('fs') | ||
// Set request timeout to 10 seconds instead of 5 seconds for slower CI servers | ||
conf.timeout = 10000 | ||
// Set request timeout to 20 seconds instead of 5 seconds for slower CI servers | ||
conf.timeout = 20000 | ||
@@ -19,0 +19,0 @@ const serverKey = path.join(__dirname, '../../src/daemon/certs/server.key') |
module.exports = { | ||
entry: './src/client/main.js', | ||
output: { | ||
path: './lib/daemon/public', | ||
filename: 'build.js' | ||
path: './src/daemon/public', | ||
filename: 'bundle.js' | ||
}, | ||
@@ -10,4 +10,21 @@ module: { | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel' | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue' | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
loaders: ['style', 'css', 'sass'] | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loaders: ['style', 'css'] | ||
}, | ||
{ | ||
test: /\.(eot|svg|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/, | ||
loader: 'url' | ||
} | ||
@@ -14,0 +31,0 @@ ] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1250484
21
54
146
23
11
32
5819
- Removedvue@^1.0.16
- Removedacorn@5.7.4(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedast-types@0.9.6(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase62@1.2.8(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommoner@0.10.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddetective@4.7.1(transitive)
- Removedenvify@3.4.1(transitive)
- Removedesprima@3.1.3(transitive)
- Removedesprima-fb@15001.1.0-dev-harmony-fb(transitive)
- Removedglob@5.0.15(transitive)
- Removedinflight@1.0.6(transitive)
- Removedjstransform@11.0.3(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedobject-assign@2.1.1(transitive)
- Removedprivate@0.1.8(transitive)
- Removedq@1.5.1(transitive)
- Removedrecast@0.11.23(transitive)
- Removedsource-map@0.4.4(transitive)
- Removedthrough@2.3.8(transitive)
- Removedvue@1.0.28(transitive)