Skip to content

Commit d2d63a5

Browse files
committed
update readme
1 parent a59807d commit d2d63a5

File tree

9 files changed

+53
-14
lines changed

9 files changed

+53
-14
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN apk add --no-cache \
3232
# -ldflags="-w -s": strips debug information and symbol tables, further reducing binary size
3333
# GOOS=linux: ensures the binary is compiled for Linux, regardless of the host OS
3434
# GOARCH=amd64: ensures the binary is compiled for amd64 architecture
35-
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o fileshare .
35+
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o fileshare-server cmd/bin/server/main.go
3636

3737
# Stage 2: Runner
3838
# Use a minimal base image like scratch or alpine for the final image
@@ -50,7 +50,7 @@ RUN apk add --no-cache sqlite-libs
5050
WORKDIR /app
5151

5252
# Copy the built binary from the 'builder' stage to the final image
53-
COPY --from=builder /app/fileshare .
53+
COPY --from=builder /app/fileshare-server .
5454

5555
COPY config.yml .
5656
# Expose the port your Go application listens on
@@ -61,4 +61,4 @@ EXPOSE 8080
6161
ENV LOG="debug"
6262

6363
# Define the command to run your application
64-
CMD ["/app/fileshare", "server"]
64+
CMD ["/app/fileshare-server", "server"]

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Fileshare records upload, linkgen, download actions at server side, allows admin
1010
Fileshare also provides web api for monitoring sqlite data, see [examples](#web-apis) below
1111

1212
# Features
13+
## Easy to use ui
14+
![ui](./docs/pictures/wails-ui.png)
15+
1316
## Self host fileserver, easy to deploy
1417
fileshare has docker images in release, it is quite easy to deploy by yourself with docker
1518

@@ -252,5 +255,5 @@ And download binary from `fileshare.tar.gz`, extract to fileshare
252255

253256
Then run following commands:
254257
``` sh
255-
docker run -d --name fileshare -p 60011:60011 -p 8080:8080 fileshare:0.1.6.1
258+
docker run -d --name fileshare -p 60011:60011 -p 8080:8080 fileshare:0.1.7
256259
```

app.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,11 @@ func (a *App) OpenFileSelectionDialog() (string, error) {
5454
func (a *App) UploadFile(args []string) {
5555
fileshare.Upload(context.TODO(), args)
5656
}
57+
58+
func (a *App) LinkGen(args []string) {
59+
fileshare.LinkGen(context.TODO(), args)
60+
}
61+
62+
func (a *App) Download(args []string) {
63+
fileshare.Download(context.TODO(), args)
64+
}

docs/cn/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Fileshare还会在服务侧记录所有的上传,下载和链接生成的动
1111
Fileshare同时提供了web接口用于监管sqlite存储的数据,详情参照[下文示例](#示例输出)
1212

1313
# fileshare的一些特点
14+
## 简单易用的ui
15+
![ui](../pictures/wails-ui.png)
16+
1417
## 可以个人搭建的文件服务器,容易部署
1518
fileshare在release界面有打包好的镜像,使用docker可以很轻松的部署
1619

docs/pictures/wails-ui.png

574 KB
Loading

frontend/src/App.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function App() {
2727
UploadFile([selectedFilePath]);
2828
};
2929

30+
const handleDownload = async () => {};
31+
32+
const handleLinkGen = async () => {};
33+
3034
return (
3135
<div className="App">
3236
<header className="App-header">
@@ -42,6 +46,14 @@ function App() {
4246
<div className="card">
4347
<button onClick={handleUpload}>Upload This File</button>
4448
</div>
49+
50+
<div className="card">
51+
<button onClick={handleLinkGen}>Linkgen This File</button>
52+
</div>
53+
54+
<div className="card">
55+
<button onClick={handleDownload}>Download This File</button>
56+
</div>
4557
</header>
4658
</div>
4759
);

frontend/wailsjs/go/main/App.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
22
// This file is automatically generated. DO NOT EDIT
33

4+
export function Download(arg1:Array<string>):Promise<void>;
5+
6+
export function LinkGen(arg1:Array<string>):Promise<void>;
7+
48
export function OpenFileSelectionDialog():Promise<string>;
59

610
export function UploadFile(arg1:Array<string>):Promise<void>;

frontend/wailsjs/go/main/App.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
33
// This file is automatically generated. DO NOT EDIT
44

5+
export function Download(arg1) {
6+
return window['go']['main']['App']['Download'](arg1);
7+
}
8+
9+
export function LinkGen(arg1) {
10+
return window['go']['main']['App']['LinkGen'](arg1);
11+
}
12+
513
export function OpenFileSelectionDialog() {
614
return window['go']['main']['App']['OpenFileSelectionDialog']();
715
}

scripts/build.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ TAG=$1
1212
mkdir -p bin
1313

1414
# linux
15-
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o bin/fileshare .
16-
tar -cvf "fileshare-$TAG-linux.tar.gz" bin/fileshare
17-
18-
# windows
19-
export CC=x86_64-w64-mingw32-gcc
20-
export CXX=x86_64-w64-mingw32-g++
21-
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -ldflags="-w -s" -o bin/fileshare.exe .
22-
tar -cvf "fileshare-$TAG-windows.tar.gz" bin/fileshare.exe
15+
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o bin/fileshare-server cmd/bin/server/main.go
16+
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o bin/fileshare-cli cmd/bin/server/main.go
17+
wails build
18+
tar -cvf "fileshare-$TAG-linux.tar.gz" bin/fileshare-server bin/fileshare-cli
19+
20+
# # windows
21+
# export CC=x86_64-w64-mingw32-gcc
22+
# export CXX=x86_64-w64-mingw32-g++
23+
# CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o bin/fileshare-server.exe cmd/bin/server/main.go
24+
# CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o bin/fileshare-cli.exe cmd/bin/server/main.go
25+
# tar -cvf "fileshare-$TAG-windows.tar.gz" bin/fileshare-server.exe bin/fileshare-cli.exe
2326

2427
unset CC
2528
unset CXX
2629

27-
rm bin/fileshare bin/fileshare.exe
28-
2930
echo "Building docker image"
3031

3132
docker build -t fileshare:$TAG .

0 commit comments

Comments
 (0)