Coder Social home page Coder Social logo

Comments (13)

kolaente avatar kolaente commented on May 24, 2024 3

While the docker daemon runs as root, Vikunja itself does not. Vikunja runs as 1000:1000 so if it wants to store files somewhere they have to be accessible to that user. I think you got the gist of it 🙂
There's a bit more info about docker's permission model here: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

I'm going to close this issue as your problem got resolved. Feel free to open a new one if you have other issues or check out the forum.

from vikunja.

kolaente avatar kolaente commented on May 24, 2024 1

Sir, I am sorry for my bad English and my bad expression, "try" is try, it is your website, so I could not know the server logs.

Nothing to worry about, I'm not a native english speaker myself so I know that very well 🙂

I've looked at the list and task you created on try and the attachment was uploaded just fine. I can access it when clicking on it in the list, embedding works as well when adding a ! in front of the generated markdown code when uploading through the editor (That's an upstream bug in the editor itself).

Sir, I followed your instruct, and I update all vikunja images(vikunja/api:latest + vikunja/frontend:latest) and the issue still exists;

The configuration looks fine to me. It looks like you're able to access the frontend and upload files even though uploading itself fails. That means the caddy configuration is working fine.

About the permission error: The files folder you mounted to store the attachments (and other things) needs to be accessible to the user and group with the id 1000 for Vikunja to have access to it. Try running chown 1000:1000 ./files -R in the directory where the compose file is stored. After that, restart the container and try uploading an attachment again.

You can could change the uid and gid to match the value of some other user on your host system: https://vikunja.io/docs/install-backend/#files-volume

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024 1

I found something in vikunja/api Dockerfile:

ENV PUID 1000
ENV PGID 1000

I guess it is the answer, I am wrong before, it associate docker usergroup and host usergroup;
thank you, Sir : )

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024

PS: this error msg is circulate print in browser console

from vikunja.

kolaente avatar kolaente commented on May 24, 2024

Hi :)

What Vikunja version is that? (There should be a message in the browser console)

Can you reproduce this on try?

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024

Hello Sir:
This is the frontend version: Vikunja frontend version 0.17.0+47-34ded051d1,
Sir, when I upload image file to "try", I found a error existed, show below:
image
image
Thanks for response : )

from vikunja.

kolaente avatar kolaente commented on May 24, 2024

That's odd - works for me on try (at least for tasks).

Does the error also occur in a private tab with all caches cleared?

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024

I just retest it on "try", it worked, I guess maybe some static asset load error yesterday, the same time, I found a small issue, I add a list called: "test_list", and add a item called: "test_image_upload", when I click the attachment, it looks like miss token in request header so the api call is rejected by api server

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024

"e is not defined" error message still exist in my environment, I guess maybe I did something wrong, I follow majority of your instruct on vikunja website: "nginx -> (api + frontend)", but I add a layer, "caddy -> nginx -> (api + frontend)", I just use caddy point to nginx's port, just like: nginx associate local 127.0.0.1:8000, and caddy as a reverse proxy point to 127.0.0.1:8000(because caddy had very easy let's encrypt certificate apply and I had some app use caddy, I want make all of them in one place), I will visit nginx only as reverse proxy and try it later

from vikunja.

kolaente avatar kolaente commented on May 24, 2024

it looks like miss token in request header so the api call is rejected by api server

Anything in the server logs? Is the file created correctly in the db and on disk?

I had some app use caddy, I want make all of them in one place), I will visit nginx only as reverse proxy and try it later

If you're running with docker behind caddy, you might want to check out the caddy proxy examples.

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024

Anything in the server logs? Is the file created correctly in the db and on disk?

Sir, I am sorry for my bad English and my bad expression, "try" is try, it is your website, so I could not know the server logs.

If you're running with docker behind caddy, you might want to check out the caddy proxy examples.

Thanks, Sir, I will follow your instruct to check out "the caddy proxy examples"

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024

If you're running with docker behind caddy, you might want to check out the caddy proxy examples.

Thanks, Sir, I will follow your instruct to check out "the caddy proxy examples"

Sir, I followed your instruct, and I update all vikunja images(vikunja/api:latest + vikunja/frontend:latest) and the issue still exists;
my docker-compose yml:

version: '3'

services:
  db:
    image: mysql:8.0.25
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: ******
      MYSQL_DATABASE: vikunja
    volumes:
      - ./db:/var/lib/mysql
    restart: unless-stopped
  api:
    image: vikunja/api
    environment:
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: ******
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: root
      VIKUNJA_DATABASE_DATABASE: vikunja
    volumes: 
      - ./files:/app/vikunja/files
    depends_on:
      - db
    restart: unless-stopped
    ports:
      - "127.0.0.1:11000:3456"
  frontend:
    image: vikunja/frontend
    restart: unless-stopped
    ports:
      - "127.0.0.1:11001:80"

my Caddyfile is:

vikunja.fenr.men {
    reverse_proxy /api/* 127.0.0.1:11000
    reverse_proxy /.well-known/* 127.0.0.1:11000
    reverse_proxy /dav/* 127.0.0.1:11000
    reverse_proxy 127.0.0.1:11001
}

While upload images failed, the vikunja/api log is:

image
because I enable the firefox's resist browser fingerprint option, so the request header is wrong.
I guess the issue is when file create, vikunja/api face a permission question, but why it happend? I don't know : (

almost everything works fine, except upload images, if you need more log, please tell me, thanks Sir : )

from vikunja.

rogerBridge avatar rogerBridge commented on May 24, 2024

Wow, it worked, Thanks, Sir, and I have a question, I had add docker to sudo group, so if its permisson group is: root:root, it should has permission to store file in my home directory, why it can't? did it say: docker usergroup is just docker usergroup, it is not root:root, it is just docker:docker and equal to user:user, not equal to root:root, so it has not permission to store file in user:user's folder, is it right? if so, why vikunja/db can store file in my home directory? I can't understand it 😂
ps: just a irrelavant question

from vikunja.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.