Code Monkey home page Code Monkey logo

bashhub-server's People

Contributors

exic avatar machawk1 avatar nicksherron 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

bashhub-server's Issues

Make simple search cap-insensitive by default

Right now the search functionality is cap-sensitive. This makes sense when a user is providing a regex, but for simple/quick search, it makes more sense to make search terms cap-insensitive

go/pkg/mod/github.com/nicksherron/[email protected]/internal/db.go:74:5: undefined: sqlite3.SQLiteDriver

On Ubuntu 20.04.2 LTS, I try to install bashhub-server but encountered the following problem:

$ go version
go version devel go1.17-fd3612e433 Sat Apr 17 00:02:01 2021 +0000 linux/amd64

$ go get -u github.com/nicksherron/bashhub-server
go: downloading github.com/spf13/cobra v1.2.1
go: downloading github.com/cheggaaa/pb v1.0.29
go: downloading github.com/jinzhu/gorm v1.9.16
go: downloading github.com/lib/pq v1.10.2
go: downloading github.com/fatih/color v1.12.0
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/appleboy/gin-jwt v1.0.1
go: downloading github.com/appleboy/gin-jwt/v2 v2.6.4
go: downloading github.com/gin-gonic/gin v1.7.4
go: downloading github.com/cheggaaa/pb/v3 v3.0.8
go: downloading github.com/appleboy/gin-jwt v2.5.0+incompatible
go: downloading github.com/mattn/go-isatty v0.0.13
go: downloading github.com/json-iterator/go v1.1.7
go: downloading github.com/mattn/go-runewidth v0.0.13
go: downloading github.com/VividCortex/ewma v1.2.0
go: downloading github.com/json-iterator/go v1.1.11
go: downloading gopkg.in/go-playground/validator.v9 v9.31.0
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/ugorji/go/codec v1.2.6
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/leodido/go-urn v1.2.1
go: downloading github.com/go-playground/universal-translator v0.18.0
go: downloading github.com/go-playground/locales v0.14.0
go: downloading github.com/ugorji/go v1.2.6
go: downloading golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
go: downloading github.com/go-playground/validator/v10 v10.4.1
go: downloading google.golang.org/protobuf v1.26.0
go: downloading github.com/go-playground/validator v9.31.0+incompatible
go: downloading github.com/go-playground/validator/v10 v10.9.0
go: downloading google.golang.org/protobuf v1.27.1
go: downloading golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
go: downloading golang.org/x/text v0.3.7
go: downloading github.com/dgrijalva/jwt-go v1.0.2
go: downloading github.com/mattn/go-sqlite3 v1.14.8
go get: installing executables with 'go get' in module mode is deprecated.
	Use 'go install pkg@version' instead.
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.
# github.com/nicksherron/bashhub-server/internal
go/pkg/mod/github.com/nicksherron/[email protected]/internal/db.go:74:5: undefined: sqlite3.SQLiteDriver

Any hints for fixing this problem?

Regards,
HY

Feature request: environment variable for sqlite or postgres for docker image

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.
A docker image that has an environment variable one can set for using sqlite or postgres as database when the docker image runs.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Provide guidance on Bashhub credentials

$ export BH_URL=http://localhost:8080
$ bashhub setup
          ____            _     _           _
         |  _ \          | |   | |         | |
         | |_) | __ _ ___| |__ | |__  _   _| |__   ___ ___  _ __ ___
         |  _ < / _` / __| '_ \| '_ \| | | | '_ \ / __/ _ \| '_ ` _  \
         | |_) | (_| \__ \ | | | | | | |_| | |_) | (_| (_) | | | | | |
         |____/ \__,_|___/_| |_|_| |_|\__,_|_.__(_)___\___/|_| |_| |_|


Welcome to bashhub setup!
Are you a new user? [Y/n] n
Please enter your bashhub credentials
Username: andrew
Password:
{"code":401,"message":"incorrect Username or Password"}

Please enter your bashhub credentials
Username: andrew
Password:
{"code":401,"message":"incorrect Username or Password"}

Server running successfully:

go run .
go: downloading github.com/fatih/color v1.9.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/cheggaaa/pb/v3 v3.0.4
go: downloading golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd
go: downloading github.com/jinzhu/gorm v1.9.12
go: downloading github.com/appleboy/gin-jwt/v2 v2.6.3
go: downloading github.com/lib/pq v1.3.0
go: extracting github.com/fatih/color v1.9.0
go: downloading gopkg.in/yaml.v2 v2.2.7
go: extracting github.com/spf13/pflag v1.0.5
go: extracting github.com/jinzhu/gorm v1.9.12
go: downloading github.com/mattn/go-isatty v0.0.11
go: extracting github.com/appleboy/gin-jwt/v2 v2.6.3
go: extracting github.com/cheggaaa/pb/v3 v3.0.4
go: extracting github.com/lib/pq v1.3.0
go: extracting gopkg.in/yaml.v2 v2.2.7
go: extracting github.com/mattn/go-isatty v0.0.11
go: downloading github.com/mattn/go-runewidth v0.0.7
go: downloading github.com/mattn/go-colorable v0.1.4
go: downloading github.com/mattn/go-sqlite3 v2.0.1+incompatible
go: downloading github.com/VividCortex/ewma v1.1.1
go: extracting golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd
go: extracting github.com/mattn/go-colorable v0.1.4
go: extracting github.com/mattn/go-runewidth v0.0.7
go: extracting github.com/VividCortex/ewma v1.1.1
go: extracting github.com/mattn/go-sqlite3 v2.0.1+incompatible
go: finding github.com/cheggaaa/pb/v3 v3.0.4
go: finding github.com/VividCortex/ewma v1.1.1
go: finding github.com/fatih/color v1.9.0
go: finding github.com/mattn/go-colorable v0.1.4
go: finding github.com/mattn/go-isatty v0.0.11
go: finding github.com/mattn/go-runewidth v0.0.7
go: finding github.com/appleboy/gin-jwt/v2 v2.6.3
go: finding gopkg.in/yaml.v2 v2.2.7
go: finding github.com/jinzhu/gorm v1.9.12
go: finding github.com/lib/pq v1.3.0
go: finding github.com/mattn/go-sqlite3 v2.0.1+incompatible
go: finding golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd
go: finding github.com/spf13/pflag v1.0.5

 _               _     _           _
| |             | |   | |         | |           version:
| |__   __ _ ___| |__ | |__  _   _| |           address: http://0.0.0.0:8080
| '_ \ / _' / __| '_ \| '_ \| | | | '_ \
| |_) | (_| \__ \ | | | | | | |_| | |_) |
|_.__/ \__,_|___/_| |_|_| |_|\__,_|_.__/
 ___  ___ _ ____   _____ _ __
/ __|/ _ \ '__\ \ / / _ \ '__|
\__ \  __/ |   \ V /  __/ |
|___/\___|_|    \_/ \___|_|


2020/02/15 22:57:32 Listening and serving HTTP on http://0.0.0.0:8080

[BASHHUB-SERVER] 2020/02/15 - 22:57:39 | 401 |     147.986µs |             ::1 | POST     /api/v1/command
[BASHHUB-SERVER] 2020/02/15 - 22:57:46 | 401 |      67.882µs |             ::1 | POST     /api/v1/command
[BASHHUB-SERVER] 2020/02/15 - 22:57:53 | 401 |      51.323µs |             ::1 | GET      /api/v1/command/search?query=he&unique=true
[BASHHUB-SERVER] 2020/02/15 - 22:57:55 | 401 |      44.631µs |             ::1 | POST     /api/v1/command
[BASHHUB-SERVER] 2020/02/15 - 22:58:02 | 401 |      45.956µs |             ::1 | POST     /api/v1/command
[BASHHUB-SERVER] 2020/02/15 - 22:58:06 | 401 |     106.862µs |             ::1 | GET      /api/v1/command/search?query=Andrew&unique=true
[BASHHUB-SERVER] 2020/02/15 - 22:58:11 | 401 |      57.164µs |             ::1 | POST     /api/v1/command
[BASHHUB-SERVER] 2020/02/15 - 22:59:20 | 401 |      57.202µs |             ::1 | POST     /api/v1/command
failed
[BASHHUB-SERVER] 2020/02/15 - 22:59:41 | 401 |    1.007846ms |             ::1 | POST     /api/v1/login
failed
[BASHHUB-SERVER] 2020/02/15 - 22:59:46 | 401 |     144.438µs |             ::1 | POST     /api/v1/login

On the following commit:

$ git rev-parse HEAD
79de0d7d49de58ba3b66dea7926b3b8009416b9c

OS: OS X 10.15.2
Go: go1.13.7 darwin/amd64

Feature request: Support G-Suite/LDAP/SSO for login

I would like to roll out Bashhub server for my entire company. We use Google/G-suite for SSO. It would be incredible to be able to authenticate using LDAP or G-Suite SSO.

Thanks again for writing this!

Suggestion: Allow disabling user registrations

Is your feature request related to a problem? Please describe.
As a server administrator, I get very nervous if just anyone can register a new account against a service I'm running for personal use.

As a server administrator, I want to prevent new users from creating new accounts, because once I've created an account I don't want to create another one.

Describe the solution you'd like
I imagine a solution like a command-line argument such as --no-registrations or something. It would completely disable the new user registration system.

Describe alternatives you've considered
I've considered running a bashhub-server instance behind a VPN, but this doesn't help me when I'm out and about - and it's cumbersome to setup an entire VPN just to save & retrieve shell history.

I've also considered reverse-proxying bashhub-server and inserting HTTP Basic authentication, but I would guess that this would break the bashhub-client.

Additional context
I've like to avoid any potential abuse from people creating spam accounts & filing up the disk / monopolising system resources etc.

Also supply a bashhub-client with some possible feature enhancements.

I noticed this wonderful project recently. It would be better if another client could have the following functions in addition to the official client functions:

  • Regexp based search, which has been implemented by bashhub-server.
  • Search with a specific directory pathname instead of only supporting the current directory.
  • Supply more options on the command detailed information panel shown in interactive search, e.g., cd to the Path, reedit the original Command before running it, and so on.

I also filed a feature request here.

Regards,
HY

tests in cmd/transfer_test.go are no longer passing

I'm making a release soon to address security vulnerability in gin, and may not have time to look through my god-awful test code to figure out why it's no longer passing. Well at least without fighting the urge to rewrite everything which I don't have time for, this will happen soon though; so in the meantime, if anyone wants to take a stab at it be my guest.

Feature Request : Authentication

Support authentication.

Token base would be fine.

I use jwilder/nginx-proxy and jrcs/letsencrypt-nginx-proxy-companion for SSL offloading so that could handle the encryption via https

Sorry, registering a new user failed

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Version and build info
Please include the output of running the command bashhub-server version.

Additional context
Add any other context about the problem here.

Testing

Add unit tests for server routes for both sqlite and postgres.

Make fails due to failed tests/lack of tests

$ make
go test ./...
# github.com/nicksherron/bashhub-server/cmd
cmd/root.go:122:3: Println arg list ends with redundant newline
?       github.com/nicksherron/bashhub-server   [no test files]
make: *** [test] Error 2

The Println error can be fixed by merging the following PR: #10

New error from make after making this change is:

$ make
go test ./...
?       github.com/nicksherron/bashhub-server   [no test files]
?       github.com/nicksherron/bashhub-server/cmd       [no test files]
?       github.com/nicksherron/bashhub-server/internal  [no test files]

Bug: bashhub status results in 404 error

Everything is working great so far. Found that running bashhub status returns the following on the client:

Sorry, an error occurred communicating with Bashhub. Response Code: 404

On the server I see the following in the logs:

/api/v1/client-view/status?processId=21596&startTime=1581357553000

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.