An easy file/message transfer tool using http file server.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cmd/hoi
.gitignore
.travis.yml Use go modules. Oct 1, 2018
LICENSE
Makefile
README.md
config.go
go.mod
go.sum
hoi.go
hoi_test.go
notifier.go
notifier_test.go
option.go
server.go
server_test.go
wercker.yml

README.md

Hoi

An easy file/message transfer tool using http file server.

Installation

Developer

$ go get github.com/monochromegane/hoi/...

User

Download from the following url.

Or, you can use Homebrew (Only MacOSX).

$ brew tap monochromegane/hoi
$ brew install hoi

Usage

Send file

You can build a download url.

$ hoi hoge.txt
http://192.168.0.100:8081/tx1lrmkkqenh5fy0izbassidb9t9l1na/hoge.txt

hoi links the file to ~/.hoi/temp_public/random, and it's document root directory for hoi server.

Send message

$ hoi message1 message2
http://192.168.0.100:8081/tx1lrmkkqenh5fy0izbassidb9t9l1na/message.txt

hoi create a message file to ~/.hoi/temp_public/random, and it's document root directory for hoi server.

Notify

You can notify the url to Slack account.

$ hoi file|message @user
http://192.168.0.100:8081/tx1lrmkkqenh5fy0izbassidb9t9l1na/message.txt
Message sent successfully to @user

Hoi supports Slack API and takosan (a simple web interface to Slack).

Configuration

hoi allows to change port number for hoi server

~/.hoi/conf.json

{
  "port": 8082
}

if you want to use notification for Slack:

{
  "notification": {
    "from":  "YOUR SLACK ACCOUNT",
    "to":    "slack",
    "token": "YOUR SLACK API TOKEN"
  }
}

or takosan:

{
  "notification": {
    "from": "YOUR SLACK ACCOUNT",
    "to":   "takosan",
    "host": "TAKOSAN HOST NAME",
    "port": TAKOSAN PORT NUMBER,
  }
}

Clear public directory

$ hoi --clear

Tasks

  • Add hoi server commands. (start|stop|status)
  • Add scheduler that clear public directory every some minutes.

Code status

wercker status

Build Status

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request