mirror of
https://github.com/seejohnrun/haste-client.git
synced 2025-12-12 23:05:56 +00:00
Fix readme
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,4 +3,4 @@
|
|||||||
*.gem
|
*.gem
|
||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
.rspec
|
.rspec
|
||||||
.DS_STORE
|
.DS_STORE
|
||||||
|
|||||||
41
README.md
41
README.md
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Haste-client is a simple client for uploading data to `Haste` server. All you need to do is to pipe data in STDIN:
|
Haste-client is a simple client for uploading data to `Haste` server. All you need to do is to pipe data in STDIN:
|
||||||
|
|
||||||
`cat file | haste`
|
`cat file | HASTE_SERVER_TOKEN=mytoken haste`
|
||||||
|
|
||||||
And once the output makes it to the server, it will print the `Haste` share page URL to STDOUT.
|
And once the output makes it to the server, it will print the `Haste` share page URL to STDOUT.
|
||||||
|
|
||||||
@@ -24,12 +24,12 @@ gem install haste
|
|||||||
Most of the configuration is controlled by env variables. Here is the all environment variables that you can use.
|
Most of the configuration is controlled by env variables. Here is the all environment variables that you can use.
|
||||||
|
|
||||||
```
|
```
|
||||||
HASTE_SERVER
|
HASTE_SERVER: Haste server domain url
|
||||||
HASTE_SERVER_TOKEN
|
HASTE_SERVER_TOKEN: Github authentication token
|
||||||
HASTE_SHARE_SERVER
|
HASTE_SHARE_SERVER: Haste share server domain url
|
||||||
HASTE_USER
|
HASTE_USER: Basic authentication user name
|
||||||
HASTE_PASS
|
HASTE_PASS: Basic authentication user pass
|
||||||
HASTE_SSL_CERTS
|
HASTE_SSL_CERTS: SSL certs path
|
||||||
```
|
```
|
||||||
|
|
||||||
To add these environment variables, you should simply add them to your ~.bash_profile:
|
To add these environment variables, you should simply add them to your ~.bash_profile:
|
||||||
@@ -41,7 +41,7 @@ export VARIABLE="value"
|
|||||||
### Authentication
|
### Authentication
|
||||||
|
|
||||||
If you are using default `HASTE_SERVER`, you need to have an GitHub authentication token.
|
If you are using default `HASTE_SERVER`, you need to have an GitHub authentication token.
|
||||||
You can get the information about authentication and how to generate token here. `https://www.toptal.com/developers/hastebin/documentation`
|
You can get the information about authentication and how to generate token [here](https://www.toptal.com/developers/hastebin/documentation)
|
||||||
|
|
||||||
After you have generated your token, you should add it to your ~.bash_profile:
|
After you have generated your token, you should add it to your ~.bash_profile:
|
||||||
|
|
||||||
@@ -49,6 +49,12 @@ After you have generated your token, you should add it to your ~.bash_profile:
|
|||||||
export HASTE_SERVER_TOKEN="mytoken"
|
export HASTE_SERVER_TOKEN="mytoken"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or you can add token to your command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cat file | HASTE_SERVER_TOKEN=mytoken haste`
|
||||||
|
```
|
||||||
|
|
||||||
If your `Haste` installation requires http authentication, add the following to your ~.bash_profile:
|
If your `Haste` installation requires http authentication, add the following to your ~.bash_profile:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -62,32 +68,20 @@ if you are using SSL, you will need to supply your certs path
|
|||||||
export HASTE_SSL_CERTS="/System/Library/OpenSSL/certs"
|
export HASTE_SSL_CERTS="/System/Library/OpenSSL/certs"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
If you supply a valid file path as an argument to the client, it will be uploaded:
|
If you supply a valid file path as an argument to the client, it will be uploaded:
|
||||||
|
|
||||||
``` bash
|
```bash
|
||||||
# equivalent
|
# equivalent
|
||||||
cat file | haste
|
cat file | haste
|
||||||
haste file
|
haste file
|
||||||
```
|
```
|
||||||
|
|
||||||
### Share page
|
### Different Haste server
|
||||||
|
|
||||||
Once you have run `haste` command and your bin is uploaded, `Haste` share page URL will be printed to STDOUT.
|
|
||||||
|
|
||||||
In share page:
|
|
||||||
|
|
||||||
- You can see the content of the bin
|
|
||||||
- You can download bin as a raw file
|
|
||||||
- You can create a new bin
|
|
||||||
- You can duplicate the bin
|
|
||||||
|
|
||||||
|
|
||||||
By default, `Haste` share page will point at `https://hastebin.com`.
|
By default, `Haste` share page will point at `https://hastebin.com`.
|
||||||
You can change this by setting the value of `ENV['HASTE_SHARE_SERVER']` to the URL of your `Haste` server.
|
If you have haste-server configured to serve bins on a separate domain, you also need to set ENV['HASTE_SHARE_SERVER'] value to that domain.
|
||||||
|
|
||||||
To set the value of share server, you can add the following to your ~.bash_profile:
|
To set the value of share server, you can add the following to your ~.bash_profile:
|
||||||
|
|
||||||
@@ -95,7 +89,6 @@ To set the value of share server, you can add the following to your ~.bash_profi
|
|||||||
export HASTE_SHARE_SERVER="myshareserver"
|
export HASTE_SHARE_SERVER="myshareserver"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Different Haste server
|
### Different Haste server
|
||||||
|
|
||||||
By default, haste server will point at `https://hastebin.com`.
|
By default, haste server will point at `https://hastebin.com`.
|
||||||
|
|||||||
Reference in New Issue
Block a user