All Projects → nicksherron → Bashhub Server

nicksherron / Bashhub Server

Licence: apache-2.0
Private cloud shell history. Open source server for bashhub https://github.com/rcaloras/bashhub-client

Programming Languages

go
31211 projects - #10 most used programming language
bash
514 projects

Projects that are alternatives of or similar to Bashhub Server

Bashhub Client
☁️ Bash history in the cloud. Indexed and searchable.
Stars: ✭ 858 (+353.97%)
Mutual labels:  cloud, terminal, zsh, history
Sultan
Sultan: Command and Rule over your Shell
Stars: ✭ 625 (+230.69%)
Mutual labels:  cli, terminal, zsh
Nve
Run any command on specific Node.js versions
Stars: ✭ 531 (+180.95%)
Mutual labels:  cli, terminal, server
Nord Iterm2
An arctic, north-bluish clean and elegant iTerm2 color scheme.
Stars: ✭ 651 (+244.44%)
Mutual labels:  cli, terminal, zsh
Cw
The best way to tail AWS CloudWatch Logs from your terminal
Stars: ✭ 368 (+94.71%)
Mutual labels:  cli, terminal, zsh
Dstask
Single binary terminal-based TODO manager with git-based sync + markdown notes per task
Stars: ✭ 431 (+128.04%)
Mutual labels:  cli, terminal, zsh
Autocomplete
Autocomplete for terminals on MacOS
Stars: ✭ 569 (+201.06%)
Mutual labels:  cli, terminal, zsh
Cross Platform Node Guide
📗 How to write cross-platform Node.js code
Stars: ✭ 1,161 (+514.29%)
Mutual labels:  cli, terminal, server
Nord Konsole
An arctic, north-bluish clean and elegant Konsole color scheme.
Stars: ✭ 56 (-70.37%)
Mutual labels:  cli, terminal, zsh
Crossline
A small, self-contained, zero-config, MIT licensed, cross-platform, readline and libedit replacement.
Stars: ✭ 53 (-71.96%)
Mutual labels:  cli, terminal, history
Nord Dircolors
An arctic, north-bluish clean and elegant dircolors theme.
Stars: ✭ 328 (+73.54%)
Mutual labels:  cli, terminal, zsh
Nord Termite
An arctic, north-bluish clean and elegant Termite color theme.
Stars: ✭ 104 (-44.97%)
Mutual labels:  cli, terminal, zsh
Caporal.js
A full-featured framework for building command line applications (cli) with node.js
Stars: ✭ 3,279 (+1634.92%)
Mutual labels:  cli, terminal, zsh
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+2485.19%)
Mutual labels:  cloud, cli, terminal
Nord Gnome Terminal
An arctic, north-bluish clean and elegant GNOME Terminal color theme.
Stars: ✭ 258 (+36.51%)
Mutual labels:  cli, terminal, zsh
Hstr
bash and zsh shell history suggest box - easily view, navigate, search and manage your command history.
Stars: ✭ 2,909 (+1439.15%)
Mutual labels:  cli, zsh, history
Nord Xresources
An arctic, north-bluish clean and elegant Xresources color theme.
Stars: ✭ 210 (+11.11%)
Mutual labels:  cli, terminal, zsh
Geo
🌎 A Bash utility for easy wan, lan, router, dns, mac address, and geolocation output, with clean stdout for piping
Stars: ✭ 225 (+19.05%)
Mutual labels:  cli, terminal, zsh
Nord Guake
An arctic, north-bluish clean and elegant Guake color theme.
Stars: ✭ 20 (-89.42%)
Mutual labels:  cli, terminal, zsh
Nord Terminator
An arctic, north-bluish clean and elegant Terminator color theme.
Stars: ✭ 78 (-58.73%)
Mutual labels:  cli, terminal, zsh

bashhub-server

Go Report Card Build Status Join the chat at https://gitter.im/bashhub_server/community

bashhub-server is a private cloud alternative for bashhub-client with some added features like regex search.

Features

  • Very simple drop in replacement for bashhub.com server and easy to install and get running with existing bashhub-client and bh command.
  • All the benefits of bashhub without having to send your shell history to a third-party
  • Regex search
  • Import old history from bashhub.com
  • Quickly connect any client with access to your server bashhub-sever address/port.
  • Written in Go so it's fast and is actively maintained
  • Salt hashed password encryption and jwt authentication protected endpoints

Why?

I love the idea behind bashhub. Having my shell history centralized and queryable from various systems whether it be my home computer or from an ssh session on a server is great. However, even with encryption, I was a little leary of sending my shell commands to a third-party server, so bashhub-server was created.

Installation

Homebrew or Linuxbrew

$ brew install bashhub-server/latest/bashhub-server

Docker

$ docker pull nicksherron/bashhub-server

Go

go modules are required

$ GO111MODULE=on go get -u github.com/nicksherron/bashhub-server

Releases

Binaries for various os and architectures can be found in releases. If your system is not listed just submit an issue requesting your os and architecture.

Usage

$ bashhub-server --help

Usage:
   [flags]
   [command]

Available Commands:
  help        Help about any command
  transfer    Transfer bashhub history from one server to another
  version     Print the version number and build info

Flags:
  -a, --addr string   Ip and port to listen and serve on. (default "http://0.0.0.0:8080")
      --db string     db location (sqlite or postgres)
  -h, --help          help for this command
      --log string    Set filepath for HTTP log. "" logs to stderr.

Use " [command] --help" for more information about a command.

Running

Just run the server

$ bashhub-server

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


2020/02/10 03:04:11 Listening and serving HTTP on http://0.0.0.0:8080

or on docker (backend database files are persisted in container volume /data)

$ docker run -d -p 8080:8080 --name bashhub-server  nicksherron/bashhub-server 

Then add export BH_URL=http://localhost:8080 (or whatever you set your bashhub-server address to) to your .zshrc or .bashrc

$ echo "export BH_URL=http://localhost:8080" >> ~/.bashrc

or

$ echo "export BH_URL=http://localhost:8080" >> ~/.zshrc

Thats it! Restart your shell and re-run bashhub setup.

$ $SHELL && bashhub setup

Changing default db

By default the backend db uses sqlite, with the location for each os shown below.

os default
Unix $XDG_CONFIG_HOME/bashhub-server/data.db OR $HOME/.config/bashhub-server/data.db
Darwin $HOME/Library/Application Support/bashhub-server/data.db
Windows %AppData%\bashhub-server\data.db
Plan 9 $home/lib/bashhub-server/data.db

To set a different sqlite db file to use, run

$ bashhub-server --db path/to/file.db

Postgresql is also supported by bashhub-server. To use postgres specify the postgres uri in the --db flag with the following format

$ bashhub-server --db "postgres://user:[email protected]:5432?sslmode=disable"

Using Regex

bashhub-server supports regex queries sent by the bh command (bashhub-client)

Without regex

$ bh bash

bashhub setup
docker pull nicksherron/bashhub-server
bin/bashhub-server version
untar bashhub-server_v0.1.0_darwin_amd64.tar.gz
cd bashhub-server_v0.1.0_darwin_amd64
./bashhub-server version
make build && bin/bashhub-server
cd bashhub-server
brew install bashhub-server/latest/bashhub-server
bashhub-server version
bashhub-server --help

With regex

$ bh "^bash"

bashhub setup
bashhub-server version
bashhub-server --help

all commands with only 6 letters

$ bh "^[a-zA-Z]{6}$"

whoami
ggpush
goland
ggpull

Transferring history from bashhub.com

You can transfer your command history from one server to another with then bashhub-server transfer command.

$ bashhub-server transfer \
    --src-user 'user' \
    --src-pass 'password' \
    --dst-user 'user' \
    --dst-pass 'password' 

transferring 872 / 8909 [-->____________________] 9.79% 45 inserts/sec

If you're transferring from Bashhub.com they have a rate limit of 10 requests a seconds and you are limited to your last 10,000 commands.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].