nicksherron / bashhub-server Goto Github PK
View Code? Open in Web Editor NEWPrivate cloud shell history. Open source server for bashhub https://github.com/rcaloras/bashhub-client
License: Apache License 2.0
Private cloud shell history. Open source server for bashhub https://github.com/rcaloras/bashhub-client
License: Apache License 2.0
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.
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
Request build/docker image for arm32v7 - qnap/linux
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
Builds are docker hub are not matching what is released.
I feel github actions are better for running tests primarily because the job log is in the repo. If anyone wants to take a stab at this PRs are much welcome!
https://github.com/nicksherron/bashhub-server#transferring-history-from-bashhubcom
...as they get left in your... uh.... Bash history. Which might.... go to someone else's computer.
Since this is less likely to be scripted, it is probably okay to either authenticate with a separate command or simply force the user to interactively type their credentials in on the transfer command.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
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.
$ 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]
$ 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
Great work :) Very excited to get this up and running
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
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!
Add unit tests for server routes for both sqlite and postgres.
I've created a package for Arch, just fyi.
https://aur.archlinux.org/packages/bashhub-server-git
I'd be happy to hear your comments on it.
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.
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.
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:
cd
to the Path
, reedit the original Command
before running it, and so on.I also filed a feature request here.
Regards,
HY
I would like to host bashhub-server via Docker on a Raspberry Pi, which is based on ARM. It would be really cool if you add docker support for ARM.
Hello,
I would love to run this service on my NAS, which is always turned on anyway.
Thank you!
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.