Skip to content

Commit f4bfbd4

Browse files
committed
add Readme
1 parent 398d843 commit f4bfbd4

File tree

7 files changed

+98
-1
lines changed

7 files changed

+98
-1
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 yllhwa
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<h1 align="center">FileWorker</h1>
2+
3+
FileWorker 是一个轻量级的文件管理和在线剪贴板,基于 Cloudflare Pages 和 R2。
4+
5+
## ✏️部署
6+
7+
1. Fork 本仓库
8+
2. 部署 Pages
9+
10+
Cloudflare DashBoard -> Workers & Pages -> Create application -> Pages ->
11+
12+
Connect to Git -> 选择 Fork 的仓库 ->
13+
14+
设置 `Build command`: `npm run build`
15+
16+
设置 `Build output directory`: `dist`
17+
18+
点击 `Save and Deploy`
19+
20+
3. 创建 R2 存储桶
21+
22+
Cloudflare DashBoard -> R2 -> Create Bucket
23+
24+
4. 获取 R2 存储桶的信息
25+
26+
Cloudflare DashBoard -> R2 -> Manage R2 API Tokens -> Create API token
27+
28+
选择 Object Read & Write 或者 Admin Read & Write。
29+
30+
创建后记录 `Access Key ID``Secret Access Key`
31+
以及存储桶的`Endpoint`(格式为:`https://{account_id}.r2.cloudflarestorage.com`
32+
33+
这些信息不会再次显示。
34+
35+
5. 设置环境变量
36+
37+
Cloudflare DashBoard -> {Your Worker} -> Settings -> Environment Variables -> (Production)Add variables
38+
39+
添加以下环境变量:
40+
41+
1. S3 地区,对于 R2 存储桶可以直接设置为 `auto`
42+
43+
> REGION=auto
44+
45+
2. 存储桶名称
46+
47+
> BUCKET=store
48+
49+
3. 存储桶的 Endpoint
50+
51+
> ENDPOINT=https://{account_id}.r2.cloudflarestorage.com
52+
53+
4. Access Key ID
54+
55+
> ACCESS_KEY_ID=31415926535897932384626433832795
56+
57+
5. Secret Access Key
58+
59+
> SECRET_ACCESS_KEY=3141592653589793238462643383279502884197169399375105820974944592
60+
61+
6. 访问密码(自己设置)
62+
> PASSWORD=123456
63+
64+
6. 重新部署
65+
66+
Cloudflare DashBoard -> {Your Worker} -> Deployments -> All deployments -> Retry deployment
67+
68+
## 💡使用
69+
70+
![index](README/index.png)
71+
72+
![clip](README/clip.png)
73+
74+
![file](README/file.png)
75+
76+
![manage](README/manage.png)

README/clip.png

10 KB
Loading

README/file.png

21.3 KB
Loading

README/index.png

47.2 KB
Loading

README/manage.png

19.5 KB
Loading

src/store/clip.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ref } from 'vue'
44
const useClipStore = defineStore(
55
'clip',
66
() => {
7-
const visibility = ref("private");
7+
const visibility = ref("public");
88
function setVisibility(newVisibility: string) {
99
visibility.value = newVisibility
1010
}

0 commit comments

Comments
 (0)