Giter Club home page Giter Club logo

gotty's People

Contributors

artdevjs avatar blakejennings avatar dehorsley avatar denkoren avatar freakhill avatar gitter-badger avatar guywithnose avatar jensenbox avatar jizhilong avatar mattn avatar moul avatar shingt avatar shoz avatar skeltoac avatar tsl0922 avatar uovobw avatar xinsnake avatar yudai avatar zyfdegh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gotty's Issues

Cloudflare blocking Websockets - "Failed to upgrade connection"

2015/08/19 20:56:32 New client connected: <my ip>:26736
2015/08/19 20:56:32 Failed to upgrade connection

Getting this error sometimes, only on Chrome. Firefox runs it well.
Client shows only a blank page.
Yesterday I had tried it out already and everything was fine.

Terminal to Terminal connection

For environments where people use w3m and cannot run hterm,

Terminal A: gotty -w tmux new -A -s foo
Then,
Terminal B gotty -x

It would be great if terminal B sends a broadcast packet and automatically discovers terminal A.

Most secure jailed environment?

Very nice project!

I was planning to try it, and my first idea has been to use it inside Docker, for security reasons.

You suggest to launch docker via gotty, but I think this is a vulnerability.

As discussed in the past on docker security, it might be possible to crash the docker container, allowing to execute commands on the host.

Wouldn't it be better to launch docker, then run gotty INSIDE docker?

Custom Fonts

It would be nice to be able to use custom fonts. I added this with the raw one, it was pretty straight forward if I remember correctly.

Ability to deliver parameters and client info via URL/POST/cookie or similar

I would be nice if it's possible to deliver parameters or information about the client to the command to be executed when client connects to gotty.

Example1:
gotty /opt/cmd
http://hostname:8080/?arg1=foo&arg2=bar => gotty will execute /opt/cmd arg1=foo arg2=bar

In terms of security reasons it would be reasonable if it's possible to limit what arguments should be delivered and what data could be into them (only digits / only A-Z)?

Example2:
gotty /opt/cmd %CLIENT_IP_ADDRESS%
192.168.1.10 connects to http://hostname:8080/ => gotty will execute /opt/cmd 192.168.1.10

possilbity to set authentification for user uid 0

Hi Yudai,

can it be possible to set authentification using the uid 0 user for example.

this could allow Qnap users to log with the admin user (no root on qnap) set on their box, instead to set a custom user/password

I think it could be a good enhancement for Gotty.

Exit gotty server when connection is closed?

Hi, my use case is I'm trying to provide an in-browser SSH client, however I'll be spawning up the gotty process when the request comes in and I want to kill it when the user exits ssh. What I'm using is:

gotty -w ssh [email protected]

The problem currently I'm seeing is, when I go to browser and exit the ssh prompt (with exit command for instance), the gotty process stays alive and keeps accepting connections and new connections cause ssh command above to be restarted.

What I do need instead is, gotty server to quit when user quits by exiting the process so that I can garbage collect resources and next time user visits my service (say, http://example.com/ssh/[email protected]) I will spawn another gotty server.

@yudai does it sound like a good proposal to have an argument that makes the gotty server quit once the executed process quits (rather than staying alive and re-execing the specified command when a new request comes in)?

When running "clear" and another client attaches, the screen refreshes

To reproduce:

$ gotty tmux new -A -s gotty top

Connect via tmux:

tmux att -t gotty
  • Connect to localhost:8080 to view the terminal in a browser
  • Inside tmux, create a new pane and type something
  • Now type clear to clear the terminal buffer
  • Connect with another client
  • -> The contents which were just cleared reappear

Surface IP addresses of connected clients

It would be helpful if the IP addresses of the clients could be part of the logging. Working on an educational application for shared terminal window and it would help with debugging.

Slice bounds out of range in App.generateHandler…→UTF8Reader.Read

Saw a crash when a second client connected to gotty into a tmux session holding htop (i.e., ran via gotty tmux attach -t gotty to show it to a coworker, 'cause this is pretty awesome).

$ tmux new-session -s gotty htop
…
$ gotty tmux attach -t gotty
2015/08/17 07:59:02 Sever is running at :8080, command: tmux attach -t gotty
2015/08/17 07:59:04 New client connected: 10.0.3.89:58751
2015/08/17 07:59:26 New client connected: 10.0.3.211:63808
panic: runtime error: slice bounds out of range

goroutine 5 [running]:
github.com/yudai/utf8reader.(*UTF8Reader).Read(0xc82003ef58, 0xc82021c800, 0x400, 0x400, 0x400, 0x0, 0x0)
    GOPATH/src/github.com/yudai/utf8reader/utf8reader.go:47 +0x2ca
github.com/yudai/gotty/app.(*App).generateHandler.func1.1(0xc8201e1e30, 0xc820032018, 0xc820112460, 0xc8201101e0)
    GOPATH/src/github.com/yudai/gotty/app/app.go:89 +0x1f3
created by github.com/yudai/gotty/app.(*App).generateHandler.func1
    GOPATH/src/github.com/yudai/gotty/app/app.go:103 +0x5d3

… other goroutines behaving normally …

Unfortunately haven't been able to reproduce it, so possibly a fluke. Figured I'd open an issue and if I come up on other details I'll amend the issue.

Alt key is being mapped to meta key

The alt key ("option key") on OS X gets mapped to the meta key, making it impossible to write e.g. "@" (on my keyboard layout "@" is alt+2) and a range of other characters (©, £, $, ∞, §, |, [, ], etc.).

32bit version

Hi,

Is it possible to have a 32 bit binary version in Release archive ?

Thanks

Unprintable Characters disconnect Gotty

When doing dumb stuff like cat /dev/random or cat on binaries which yield unprintable characters (and may screw up a terminal under "normal" circumstances ) lead to a disconnection. This is especially bad when byobu (tmux wrapper) runs in the background, which makes reconnection impossible ;-).

I don't know if this is fixable, but I thought worth mentioning.

Feature: Disable resizing

It would be nice if you could disable the resizing feature. Overlapping areas could be accessed via a scrollbar inside the browser.

settings from .gotty not loading

mbp ~ → gotty -v
gotty version 0.0.9
mbp ~ → cat .gotty
// Listen at port 9000 by default
port = "9000"

// Enable TSL/SSL by default
//enable_tls = true

// hterm preferences
// Smaller font and a little bit bluer background color
preferences {
    font_size = 5,
    background_color = "rgb(16, 16, 32)"
}
mbp ~ → gotty bash
2015/09/01 21:31:19 Loading config file at: /Users/paul/.gotty
2015/09/01 21:31:19 Server is starting with command: bash
2015/09/01 21:31:19 URL: http://[::1]:8080/
2015/09/01 21:31:19 URL: http://127.0.0.1:8080/
2015/09/01 21:31:19 URL: http://[fe80::1]:8080/
2015/09/01 21:31:19 URL: http://[fe80::7a31:c1ff:fed1:584]:8080/
2015/09/01 21:31:19 URL: http://192.168.88.157:8080/
2015/09/01 21:31:19 URL: http://192.168.99.1:8080/
2015/09/01 21:31:19 URL: http://192.168.50.1:8080/
2015/09/01 21:31:19 URL: http://172.16.82.1:8080/
2015/09/01 21:31:19 URL: http://172.16.0.1:8080/

ARM V5 request

Hi Master Yudai

the actual binary release is for ARM6, possible to have ARM5 version, i am sure some qnap user will love your application

thanks a lot ,

Run as a daemon process

Adding a "-d" flag or something similar to run gotty as a daemon process will prevent taking up the terminal.

404 Not Found

gotty --random-url --permit-write top --addr 127.0.0.1

When I go to the page. I get 404 not found.

Windows 7 installation issue

Hi, i am trying to install this app in Windows, but getting the following error :

D:\projects>go get github.com/yudai/gotty
# github.com/kr/pty
D:\go_workspace\src\github.com\kr\pty\ioctl.go:6: undefined: syscall.SYS_IOCTL
D:\go_workspace\src\github.com\kr\pty\ioctl.go:6: not enough arguments in call to syscall.Syscall
D:\go_workspace\src\github.com\kr\pty\run.go:21: unknown syscall.SysProcAttr field 'Setctty' in struct literal
D:\go_workspace\src\github.com\kr\pty\run.go:21: unknown syscall.SysProcAttr field 'Setsid' in struct literal
D:\go_workspace\src\github.com\kr\pty\util.go:26: undefined: syscall.SYS_IOCTL
D:\go_workspace\src\github.com\kr\pty\util.go:28: undefined: syscall.TIOCGWINSZ
D:\go_workspace\src\github.com\kr\pty\util.go:30: not enough arguments in call to syscall.Syscall

Is this a Windows specific issue?

Incomplete unicode support

Unicode symbols are not interpreted correctly during input from the browser, while terminal-to-browser utf output works fine.
gotty-unicode-bug
1st cmd - terminal input
3rd cmd - browser input
osx yosemite, darwin_amd64 gotty pre-release

Feature: Livereload

It would be nice if gotty would tell the webbrowser to automatically reload the page if an old session was finished/killed and a new one was started on the same port. Should be easy to implement on the client side.

Keep up the good work! This package is a big one for me! 👍

Support for URL links

It would be nice if there are URLs in the screen the gotty / JS could convert them into links which will open into new window.

The code should be aware if the URL continues into the next line like (typical situation in chat window):

SomeNick: Check this out: http://www.foo.com/bar/dir/something/inde
x.php
that's so cool!
OtherNick: yes!

Duplicating the command for each client

I've ran into this while showing this tool to my collegue. When ever I would run the command kitchen converge The first few people to connect are actually good, but then at some point every refresh/new connection cause the command the be ran gain.

EDIT: it seems to stop at 2... The first ps is at start with me watching, then the second one is after my collegue joined.

Example

Browsers can't open IPv6 addrs

➜  ~  gotty -w top
2015/08/23 12:20:01 Server is starting with command: top
2015/08/23 12:20:01 URL: http://::1:8080/
2015/08/23 12:20:01 URL: http://127.0.0.1:8080/
2015/08/23 12:20:01 URL: http://fe80::1:8080/
2015/08/23 12:20:01 URL: http://fe80::a65e:60ff:fecc:5cc7:8080/
2015/08/23 12:20:01 URL: http://192.168.0.113:8080/
2015/08/23 12:20:01 URL: http://fe80::6048:20ff:fea9:ec6f:8080/
2015/08/23 12:20:01 URL: http://192.168.99.1:8080/

From what observe on Chrome and Safari on OS X is browsers can't open addrs like http://::1:8080/ or http://fe80::a65e:60ff:fecc:5cc7:8080/ at all. Maybe the program should just print IPv4 ones?

Cannot set Preference color-palette-overrides

When setting 'color-palette-overrides' I get the following error in the javascript debug window (firefox)

[15:34:58.042] "Preference color-palette-overrides is not an array or object: {'0':'#073642','1':'#dc322f','2':'#859900','3':'#b58900','4':'#268bd2','5':'#d33682','6':'#2aa198','7':'#eee8d5','8':'#002b36','9':'#cb4b16','10':'#586e75','11':'#657b83','12':'#839496','13':'#6c71c4','14':'#93a1a1','15':'#fdf6e3'}"

In my .gotty file I intered

color_palette_overrides = "{'0':'#073642','1':'#dc322f','2':'#859900','3':'#b58900','4':'#268bd2','5':'#d33682','6':'#2aa198','7':'#eee8d5','8':'#002b36','9':'#cb4b16','10':'#586e75','11':'#657b83','12':'#839496','13':'#6c71c4','14':'#93a1a1','15':'#fdf6e3'}"

Within the Preference object.

Windows binary/release

  1. Will this ever work with Windows?
  2. If it can, is windows support on the dev path?
  3. What could a "regular Joe" user do to use this on windows right now? Using it in docker is the simplest option?

PS: I'm excited 😄

SSL Support

Default SSL support by the server must be required.

Allow clients to specify commnd

I know, it's dangerous enough.

Option 1

Allow send only arguments like run gotty --permit-arguments tailf then, access http://server.exmple.com:8080/%2Fvar%2Flog%2Fsyslog (/var/log/syslog).
(Need to take care of shell meta characters not to permit using pipe and redirects)

Option 2

Freedom mode like gotty --freedom then, access http://server.example.com:8080/tailf+%2Fvar%2Flog%2Fsyslog.

Proxy through Apache for SSL and Authentication

Has anyone managed to successfully get Gotty working through Apache?

I can't resolve the issue of WebSocket not initializing:

Request URL:wss://.../console/ws
Request Method:GET
Status Code:403 Forbidden

The Gotty log:

2015/08/18 12:46:08 New client connected: 127.0.0.1:33020
2015/08/18 12:46:08 Failed to upgrade connection

The Apache Configuration:

<VirtualHost *:443>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

SSLCertificateFile ...
SSLCertificateKeyFile ...
SSLCertificateChainFile ...

ServerName ...

ProxyPass /console/ws ws://localhost:8075/ws
ProxyPassReverse /console/ws ws://localhost:8075/ws
ProxyPass /console http://localhost:8075
ProxyPassReverse /console http://localhost:8075

<Location /console>
AuthType Basic
AuthName "Console"
AuthUserFile /etc/apache2/console.passwd
Require valid-user
Order allow,deny
Allow from all
</Location>

Any suggestions are welcomed, I tried everything I could think of.

Random URL generation

URL generation for something like an authentication alternative.

Add an option to generate URLs like:

https://host:8080/nairj3gnw5ja39r23

Embedded terminal multiplexer for screencast

The ability for web clients to send input to the gotty'd process is awesome, but it would also be excellent to allow the user who is hosting the gotty process to use STDIN to "screencast" to consumers.

Ideal flow:

gotty nano /tmp/some/file

Gotty starts, and the tty used to start gotty acts exactly as if the command had been run without gotty. The user can "screencast" their input and results to web consumers - without web consumers necessarily being able to control the process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.