File tree Expand file tree Collapse file tree 2 files changed +24
-21
lines changed Expand file tree Collapse file tree 2 files changed +24
-21
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
tags :
6
6
- ' v*'
7
+ workflow_dispatch :
7
8
8
9
permissions :
9
10
contents : write
25
26
tar -zcvf dist/pastebin-linux-amd64.tar.gz pastebin
26
27
27
28
- uses : softprops/action-gh-release@v2
29
+ if : ${{ github.event_name != 'workflow_dispatch' }}
28
30
env :
29
31
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30
32
with :
Original file line number Diff line number Diff line change 1
1
# PasteBin
2
2
3
- 支持命令行使用的一个匿名数据分享平台,在这里分享例如一段话 ,一篇文章,一张图片,一个压缩包,然后将返回的链接发给别人即可
3
+ 支持命令行使用的一个匿名数据分享平台,分享例如一段话 ,一篇文章,一张图片,一个压缩包,然后将返回的链接发给别人
4
4
5
5
最大限制 100MB
6
6
7
7
### 快速上手
8
8
9
- 直接运行即可 ,默认监听 10002 端口,数据默认位于 pastebin_data 目录中
9
+ 下载 Releases 中的文件直接运行即可 ,默认监听 10002 端口,数据默认位于 pastebin_data 目录中
10
10
11
- ``` sh
12
- ./pastebin
13
- ```
11
+ 命令行可以接收的参数
12
+
13
+ 参数|默认值|描述
14
+ -|-|-
15
+ -port|10002|端口号
16
+ -dir|pastebin_data|数据目录
14
17
15
18
配合 systemd 使用 pastebin.service
16
19
17
20
``` ini
18
21
[Unit]
19
- Description =Pastebin service
22
+ Description =pastebin service
20
23
[Service]
21
24
ExecStart =/usr/local/pastebin/pastebin
22
25
Restart =on-failure
@@ -30,28 +33,26 @@ WantedBy=multi-user.target
30
33
make
31
34
```
32
35
33
- ### 使用说明
34
-
35
- 命令行可以接收的参数
36
-
37
- 参数|默认值|描述
38
- -|-|-
39
- -port|10002|程序监听的端口号
40
- -dir|pastebin_data|数据目录(相对程序文件的路径)
41
-
42
36
### API
43
37
44
- - ___ POST /___
38
+ - ___ POST /___ ,返回存储了数据内容的链接
39
+ - 表单 f = 文件,上传的文件
40
+ - headers
41
+ - type: 1/2/3/4,类型(可选)
45
42
46
- 请求:multipart/form-data,返回存储了数据内容的链接
43
+ - ___ GET /{uid} ___ ,返回该链接所对应的内容
47
44
48
- body ` f=@文件 ` 上传的文件
49
- headers ` X-V=0/1 ` 是否可在浏览器预览(选)
45
+ - ___ DELETE /{uid}___ ,删除记录
46
+ - headers
47
+ - token: xxx,令牌
50
48
51
- - ___ GET /{uid}___
49
+ ``` sh
50
+ cat /etc/hosts | curl -F f=@- 127.0.0.1:10002
52
51
53
- 返回该链接所对应的内容
52
+ curl 127.0.0.1:10002/fgs3
54
53
54
+ curl -X DELETE 127.0.0.1:10002/fgs3 -H ' token: 2A9B3F692B1715A6'
55
+ ```
55
56
## 许可证
56
57
57
58
MIT © ZShab Niba
You can’t perform that action at this time.
0 commit comments