fix docker permission denied

This commit is contained in:
lyx0 2023-12-19 23:16:53 +01:00
parent 4422e49ea0
commit f8e157fe91
2 changed files with 5 additions and 2 deletions

View file

@ -55,7 +55,7 @@ func (app *application) ConvertAndSave(fName, link string, msg twitch.PrivateMes
return return
} }
//app.Send(target, "Downloaded.", msg) //app.Send(target, "Downloaded.", msg)
fileName := fmt.Sprintf("%s.%s", uuid_og, rExt) fileName := fmt.Sprintf("/public/uploads/%s.%s", uuid_og, rExt)
f, err := os.Create(fileName) f, err := os.Create(fileName)
//app.Send(target, fmt.Sprintf("Filename: %s", fileName), msg) //app.Send(target, fmt.Sprintf("Filename: %s", fileName), msg)
if err != nil { if err != nil {
@ -86,8 +86,10 @@ func (app *application) ConvertAndSave(fName, link string, msg twitch.PrivateMes
Output(out). Output(out).
OverWriteOutput().ErrorToStdOut().Run() OverWriteOutput().ErrorToStdOut().Run()
defer os.Remove(fileName)
app.Send(msg.Channel, fmt.Sprintf("https://bot.noury.is/uploads/%s.mp4", fName), msg) app.Send(msg.Channel, fmt.Sprintf("https://bot.noury.is/uploads/%s.mp4", fName), msg)
} }
func (app *application) ConvertToMP4(link string, msg twitch.PrivateMessage) { func (app *application) ConvertToMP4(link string, msg twitch.PrivateMessage) {
goutubedl.Path = "yt-dlp" goutubedl.Path = "yt-dlp"
uuid_og := uuid.NewString() uuid_og := uuid.NewString()

View file

@ -10,12 +10,13 @@ services:
volumes: volumes:
- data:/var/lib/postgresql/data - data:/var/lib/postgresql/data
nourybot: nourybot:
user: "1000:1000"
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
env_file: .env env_file: .env
volumes: volumes:
- "./public/uploads:/public/uploads" - "./public/uploads/:/public/uploads"
ports: ports:
- "127.0.0.1:42069:8080" - "127.0.0.1:42069:8080"
depends_on: depends_on: