hedgedoc / hedgedoc

HedgeDoc - Ideas grow better together

Home Page:https://hedgedoc.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't paste image

Beulu opened this issue · comments

Description

I copy any image from the web in clipboard or importing one from a file and it not appearing in my note

Steps to reproduce

import picture
or copy/paste

Expected behaviour

Seeing pictures in my notes of course x)

Logs

No response

Config

No response

Your Setup

Docker and latest Hedgedoc

Additional context

No response

Can you please elobarate a bit on the details?

Which browser are you using? Which operating system? Does the upload fail (take a look at the logs) or isn't there no upload action on pasting? From where did you copy the image, especially in which format is it? Does it work on demo.hedgedoc.org?

Please understand, that we can't help without any more context or reproducability.

Sorry, I don't have habit to reports things.

Firefox 124.0.2 (64 bits)
Windows 10
Using HedgeDoc with Docker on my server.

log :

2024-04-04T13:50:03.942Z error: Error while moving file: EACCES: permission denied, copyfile '/tmp/hedgedoc-o9m2rg/07fd4077-93c2-4ce8-a387-516fd4fd3497.jpg' -> '/hedgedoc/public/uploads/07fd4077-93c2-4ce8-a387-516fd4fd3497.jpg

The note is "editable"

the docker-compose :

services:
  database:
    image: postgres:13.4-alpine
    environment:
      - POSTGRES_USER=*
      - POSTGRES_PASSWORD=*
      - POSTGRES_DB=*
    volumes:
      - ./database:/var/lib/postgresql/data
    restart: always
  app:

    image: quay.io/hedgedoc/hedgedoc:latest
    healthcheck:
      interval: 1m
    environment:
      - CMD_DB_URL=postgres://hedgedoc:password@database:5432/hedgedoc
      - CMD_DOMAIN="ip-of-localhost"
      - CMD_URL_ADDPORT=true
    volumes:
      - ./uploads:/hedgedoc/public/uploads
    ports:
      - "3000:3000"
    restart: always
    depends_on:
      - database
volumes:
  database:
  uploads:

Stars are for hiding datas.
I see the upload folder. Usually I don't have anything to do to have permission to write in folders.

In your definitions of the volumes per app, you use local directories (e.g. ./database and ./uploads). This means that the local directory (relative to your docker-compose file) should be owned by the same user as the process in the docker container. The HedgeDoc container for example uses uid 10000 by default.
The better way would be to use docker volumes, our example compose file actually does so, and your file includes the definitions for the volumes too. You'd just need to change the ./uploads: to uploads:.

It works perfectly ! Thanks ^^