bashhub-server icon indicating copy to clipboard operation
bashhub-server copied to clipboard

Provide guidance on Bashhub credentials

Open andrew-morris opened this issue 5 years ago • 2 comments

$ 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

andrew-morris avatar Feb 16 '20 04:02 andrew-morris

Once I created a user, it worked like a charm. Thanks!

$ bashhub setup
          ____            _     _           _
         |  _ \          | |   | |         | |
         | |_) | __ _ ___| |__ | |__  _   _| |__   ___ ___  _ __ ___
         |  _ < / _` / __| '_ \| '_ \| | | | '_ \ / __/ _ \| '_ ` _  \
         | |_) | (_| \__ \ | | | | | | |_| | |_) | (_| (_) | | | | | |
         |____/ \__,_|___/_| |_|_| |_|\__,_|_.__(_)___\___/|_| |_| |_|


Welcome to bashhub setup!
Are you a new user? [Y/n] Y
What's your email? [email protected]
What username would you like? andrew
What password?

Email: [email protected] Username: andrew
Are these correct? [Y/n] y
Registered new user andrew

What do you want to call this system? For example Home, File Server, ect. [ip-192-168-1-9.ec2.internal]: felix
Registered a new system felix

The API is now returning 200s and I'm able to search successfully. Thanks!

andrew-morris avatar Feb 16 '20 04:02 andrew-morris

Re-opening so that you can track this as a TODO until docs are updated to reflect ^^^

andrew-morris avatar Feb 16 '20 04:02 andrew-morris