Coder Social home page Coder Social logo

FILE_DIR error? about send HOT 7 OPEN

timvisee avatar timvisee commented on July 18, 2024 1
FILE_DIR error?

from send.

Comments (7)

RainerZufahl avatar RainerZufahl commented on July 18, 2024 1

Update

I have been able to fix, or rather circumvent, this issue. After lots of investigation I found that inside the container, the /uploads folder (from the volume) is mounted with rwxr-xr-x permissions, with owner/group ID 0. Since the Send service launches and runs under user ID 1000, obviously it cannot write data into /uploads.
I couldn't find any way to manipulate the permissions of the mounted folder to allow user ID 1000 to write into it. So instead I forced Send to launch with ID 0 by changing my compose.yml like this:

services:
  send:
    user: "0"
    volumes: 
    - files:/uploads

(content reduced to relevant data)

Now, send runs as user ID 0 and is perfectly able to r/w in the /uploads folder, and encrypted files appear in the volumes' folder on the host as expected, even when using the production environment.

But, I am unsure if there are security or functionality implications with this approach. After a very short and dirty test, all seems to be working fine, but I will investigate more. I'd much appreciate some input from @timvisee if this is a stupid idea or not. For now, I'll leave it running as is.

from send.

gechandesu avatar gechandesu commented on July 18, 2024

I am able to get Send to work, but I noticed that my instance isn't using the volume I specified in the docker_compose.yml file.

Make sure that the owner of the uploads directory on the host is the user with UID 1000. Inside the container, the Send is launched on behalf of the user "app" with this UID. The user in the container must have write access to the /uploads.

Basically, I just want to know where my files are going in this current setup because I cannot find the uploaded files anywhere in my bin/sh.

I ran into a similar problem and also didn’t understand where the files that didn’t end up in /uploads go.
Judging by the fact that the links to them stopped working before the download and time limits expired, I can assume that they were lost.

from send.

Death-Pact avatar Death-Pact commented on July 18, 2024

I ran into a similar problem and also didn’t understand where the files that didn’t end up in /uploads go. Judging by the fact that the links to them stopped working before the download and time limits expired, I can assume that they were lost.

I just recently found tmp files in the /var/lib/docker/overlay2 folder of the files I have been uploading. I am still wondering why this compose file isn't using the file directory I specify... any ideas?

from send.

timvisee avatar timvisee commented on July 18, 2024

Send does currently not support using a local directory for uploads when running in production mode (NODE_ENV=production). You may switch to NODE_ENV=development instead to use FILE_DIR as configured. This limitation was introduced by Mozilla years back.

If you're experiencing permission errors, make sure to set proper directory permissions on your host for the mounted directory.

from send.

RainerZufahl avatar RainerZufahl commented on July 18, 2024

I'm currently setting up Send and am encountering the same issue as OP. When the env FILE_DIR is defined, uploading files causes the same error as in the OP. Leaving it undefined allowed up- and downloading, but now I have no idea where the uploaded files go.
I've used a customized version of the docker-compose script to set up send and redis:

services:
  send:
    image: registry.gitlab.com/timvisee/send:latest
    restart: unless-stopped
    container_name: send
    env_file: send.env
    volumes:
      - files:/uploads
    networks:
      - default
      - nginx_default

  redis:
    image: 'redis:alpine'
    container_name: send-redis
    restart: unless-stopped
    volumes:
      - redis:/data
    networks:
      - default

volumes:
  files:
  redis:

networks:
  nginx_default:
    external: true
  default:

as well as the environment variables in a separate send.env file:

#Backend Config
VIRTUAL_HOST=send.web.site
VIRTUAL_PORT=1234
DHPARAM_GENERATION=false
NODE_ENV=production
BASE_URL=https://send.web.site
PORT=1234
#FILE_DIR=/uploads

since im new to docker and self hosting, i dont know how to check the write permissions for the data folder inside the volume. but as other containers are perfectly capable to r/w into them, i'd assume this isnt a permission issue.

i would love if send would use the assigned volume, but dont know how to get it to work. do i have to switch to the dev mode as mentioned in your previous comment to get this to work? or are there other workarounds that would allow the use of the specified volume?

from send.

fcki1984 avatar fcki1984 commented on July 18, 2024

it's work for me.

  • find uid=1000's user
nano /etc/passwd
  • The user of UID = 1000 is admin on my server
chown -R admin:admin path-you-local-map-folder (./uploads)
  • docker-compose.yaml
    volumes:
      - ./uploads:/uploads

      ......

      # For local uploads storage
      - FILE_DIR=/uploads

from send.

arkprocession avatar arkprocession commented on July 18, 2024

it's work for me.

* find `uid=1000`'s user
nano /etc/passwd
* The user  of  `UID = 1000` is `admin`  on my server
chown -R admin:admin path-you-local-map-folder (./uploads)
* docker-compose.yaml
    volumes:
      - ./uploads:/uploads

      ......

      # For local uploads storage
      - FILE_DIR=/uploads

Hi, do you know how would it be for windows?

from send.

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.