Private cloud shell history. Open source server for bashhub

栏目: IT技术 · 发布时间: 4年前

内容简介:bashhub-server is a private cloud alternative forI 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 encryptio

bashhub-server

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
  • Quickly connect any client with access to your server bashhub-sever address/port.
  • Written in Go so it's fast and is actively maintained

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 weary 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

Releases

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

Usage

$ bashhub-server --help

Usage:
   [flags]
   [command]

Available Commands:
  help        Help about any command
  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.1.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

$ 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" >> ~/.zshr

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:password@localhost: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

以上所述就是小编给大家介绍的《Private cloud shell history. Open source server for bashhub》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

计算机动画的算法基础

计算机动画的算法基础

鲍虎军 金小刚 彭群生 / 浙江大学出版社 / 2000-12 / 60.00元

《计算机应用技术前沿丛书:计算机动画的算法基础》主要内容简介:20世纪是一个科技、经济空前发展的时代,从世纪初相对论、量子理论的创立到今天以信息产业为龙头的高科技产业成为经济发展的第一支柱,人类社会发生了根本性的变革。而在这场以科学技术为社会发展直接动因的变革中,意义最深远、影响最广泛的就是计算机及其相关技术的发展和应用。在过去的50年里,计算机已从最初的协助人类进行精密和复杂运算的单一功能的运算......一起来看看 《计算机动画的算法基础》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具