diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03fe0f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +tmp +pids +logs +results + +npm-debug.log +node_modules/* \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..ab9b1af --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,37 @@ +module.exports = function (grunt) { + + require('load-grunt-tasks')(grunt); + + var config = { + mkdir: { + tmp: { + options: { + create: ['tmp'] + } + } + }, + gitclone: { + hterm: { + options: { + cwd: './tmp', + repository: 'https://chromium.googlesource.com/apps/libapps' + } + } + }, + shell: { + build_hterm: { + command: 'LIBDOT_SEARCH_PATH=$(pwd) ./libdot/bin/concat.sh -i ./hterm/concat/hterm_all.concat -o ../../public/wetty/hterm_all.js', + options: { + execOptions: { + cwd: './tmp/libapps' + } + } + } + }, + clean: ['./tmp'] + }; + + grunt.initConfig(config); + + grunt.registerTask('update-hterm', ['mkdir:tmp', 'gitclone:hterm', 'shell:build_hterm', 'clean']); +}; diff --git a/README.md b/README.md index c26ef80..c4c895f 100644 --- a/README.md +++ b/README.md @@ -80,11 +80,6 @@ Else if you are running `app.js` as a regular user you have to use: **Note that if your Nginx is configured for HTTPS you should run wetty without SSL.** -Issues ------- - -Does not work on Firefox as hterm was written for ChromeOS. So works well on Chrome. - Dockerized Version ------------------ @@ -94,8 +89,23 @@ whatever you want! Just do: ``` -docker run --name term -p 3000 -dt nathanleclaire/wetty + docker run --name term -p 3000 -dt nathanleclaire/wetty ``` Visit the appropriate URL in your browser (`[localhost|$(boot2docker ip)]:PORT`). The username is `term` and the password is `term`. + +Run wetty as a service daemon +----------------------------- + +Install wetty globally with -g option: + +```bash + $ sudo npm install wetty -g + $ sudo cp /usr/local/lib/node_modules/wetty/bin/wetty.conf /etc/init + $ sudo start wetty +``` + +This will start wetty on port 3000. If you want to change the port or redirect stdout/stderr you should change the last line in `wetty.conf` file, something like this: + + exec sudo -u root wetty -p 80 >> /var/log/wetty.log 2>&1 diff --git a/bin/wetty.conf b/bin/wetty.conf new file mode 100644 index 0000000..2dd627f --- /dev/null +++ b/bin/wetty.conf @@ -0,0 +1,13 @@ +# Upstart script +# /etc/init/wetty.conf + +description "Web TTY" +author "Wetty" + +start on started mountall +stop on shutdown + +respawn +respawn limit 20 5 + +exec sudo -u root wetty -p 3000 diff --git a/bin/wetty.js b/bin/wetty.js new file mode 100644 index 0000000..16e2dea --- /dev/null +++ b/bin/wetty.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require("../app"); diff --git a/package.json b/package.json index 7ae305d..59207bb 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,35 @@ { - "name": "wetty", - "version": "0.0.8", - "dependencies": { - "express": "3.5.1", - "websocket": "", - "pty.js": "git+https://github.com/terryschen/pty.js", - "optimist": "", - "waitpid": "" - }, - "description": "Wetty = Web + tty. Terminal access in browser over http/https ", - "main": "app.js", - "devDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/krishnasrinivas/wetty.git" - }, - "author": "Krishna Srinivas (https://github.com/krishnasrinivas)", - "license": "MIT", - "bugs": { - "url": "https://github.com/krishnasrinivas/wetty/issues" - }, - "homepage": "https://github.com/krishnasrinivas/wetty" + "name": "wetty", + "version": "0.0.9", + "dependencies": { + "express": "3.5.1", + "websocket": "^1.0", + "pty.js": "git+https://github.com/terryschen/pty.js", + "optimist": "^0.6", + "waitpid": "^0.1" + }, + "devDependencies": { + "load-grunt-tasks": "^3.0", + "grunt": "^0.4", + "grunt-shell": "^1.1", + "grunt-mkdir": "^0.1", + "grunt-git": "^0.3", + "grunt-contrib-clean": "^0.6" + }, + "description": "Wetty = Web + tty. Terminal access in browser over http/https ", + "main": "app.js", + "repository": { + "type": "git", + "url": "git://github.com/krishnasrinivas/wetty.git" + }, + "author": "Krishna Srinivas (https://github.com/krishnasrinivas)", + "license": "MIT", + "bugs": { + "url": "https://github.com/krishnasrinivas/wetty/issues" + }, + "homepage": "https://github.com/krishnasrinivas/wetty", + "preferGlobal": "true", + "bin": { + "wetty": "./bin/wetty.js" + } } diff --git a/public/index.html b/public/index.html index 00281a9..72f8d7e 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,6 @@ Wetty - The WebTTY Terminal Emulator -