Skip to content

Commit f2f042c

Browse files
committed
修改说明
1 parent dc93a64 commit f2f042c

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

.github/workflows/releases.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- 'v*'
7+
workflow_dispatch:
78

89
permissions:
910
contents: write
@@ -25,6 +26,7 @@ jobs:
2526
tar -zcvf dist/pastebin-linux-amd64.tar.gz pastebin
2627
2728
- uses: softprops/action-gh-release@v2
29+
if: ${{ github.event_name != 'workflow_dispatch' }}
2830
env:
2931
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3032
with:

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
# PasteBin
22

3-
支持命令行使用的一个匿名数据分享平台,在这里分享例如一段话,一篇文章,一张图片,一个压缩包,然后将返回的链接发给别人即可
3+
支持命令行使用的一个匿名数据分享平台,分享例如一段话,一篇文章,一张图片,一个压缩包,然后将返回的链接发给别人
44

55
最大限制 100MB
66

77
### 快速上手
88

9-
直接运行即可,默认监听 10002 端口,数据默认位于 pastebin_data 目录中
9+
下载 Releases 中的文件直接运行即可,默认监听 10002 端口,数据默认位于 pastebin_data 目录中
1010

11-
```sh
12-
./pastebin
13-
```
11+
命令行可以接收的参数
12+
13+
参数|默认值|描述
14+
-|-|-
15+
-port|10002|端口号
16+
-dir|pastebin_data|数据目录
1417

1518
配合 systemd 使用 pastebin.service
1619

1720
```ini
1821
[Unit]
19-
Description=Pastebin service
22+
Description=pastebin service
2023
[Service]
2124
ExecStart=/usr/local/pastebin/pastebin
2225
Restart=on-failure
@@ -30,28 +33,26 @@ WantedBy=multi-user.target
3033
make
3134
```
3235

33-
### 使用说明
34-
35-
命令行可以接收的参数
36-
37-
参数|默认值|描述
38-
-|-|-
39-
-port|10002|程序监听的端口号
40-
-dir|pastebin_data|数据目录(相对程序文件的路径)
41-
4236
### API
4337

44-
- ___POST /___
38+
- ___POST /___,返回存储了数据内容的链接
39+
- 表单 f = 文件,上传的文件
40+
- headers
41+
- type: 1/2/3/4,类型(可选)
4542

46-
请求:multipart/form-data,返回存储了数据内容的链接
43+
- ___GET /{uid}___,返回该链接所对应的内容
4744

48-
body `f=@文件` 上传的文件
49-
headers `X-V=0/1` 是否可在浏览器预览(选)
45+
- ___DELETE /{uid}___,删除记录
46+
- headers
47+
- token: xxx,令牌
5048

51-
- ___GET /{uid}___
49+
```sh
50+
cat /etc/hosts | curl -F f=@- 127.0.0.1:10002
5251

53-
返回该链接所对应的内容
52+
curl 127.0.0.1:10002/fgs3
5453

54+
curl -X DELETE 127.0.0.1:10002/fgs3 -H 'token: 2A9B3F692B1715A6'
55+
```
5556
## 许可证
5657

5758
MIT © ZShab Niba

0 commit comments

Comments
 (0)