Skip to content

Commit 6289a86

Browse files
committed
add docker-compose example, fix permissions
1 parent 2d3542f commit 6289a86

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

docker-compose.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
nginx:
3+
image: nginx
4+
ports:
5+
- 80:80
6+
volumes:
7+
- html:/usr/share/nginx/html:ro
8+
9+
api-notes:
10+
image: ghcr.io/reddec/api-notes:0.0.1-next-amd64
11+
ports:
12+
- 127.0.0.1:8080:8080
13+
environment:
14+
PUBLIC_URL: http://localhost
15+
16+
volumes:
17+
- html:/data
18+
19+
volumes:
20+
html: {}

internal/storage/local/local.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ func (l *Local) Set(_ context.Context, uid string, content io.Reader) error {
4444
if err := tmp.Close(); err != nil {
4545
return fmt.Errorf("close temp: %w", err)
4646
}
47-
return os.Rename(tmp.Name(), p)
47+
if err := os.Rename(tmp.Name(), p); err != nil {
48+
return fmt.Errorf("rename: %w", err)
49+
}
50+
return os.Chmod(p, 0755)
4851
}
4952

5053
func (l *Local) Delete(_ context.Context, uid string) error {

0 commit comments

Comments
 (0)