transfer.sh icon indicating copy to clipboard operation
transfer.sh copied to clipboard

No default `/tmp` volume/directory in docker container

Open LinusCDE opened this issue 3 years ago • 7 comments

By default, /tmp is used for tmpfiles. This directory is not created by default and might break some existing deployments, since this requirement seems new.

Origin: https://github.com/dutchcoders/transfer.sh/pull/389#issuecomment-1008686228

LinusCDE avatar Jan 10 '22 10:01 LinusCDE

In addition to this issue, changing the directory as a workaround doesn't do the trick anymore :

# docker run -d --restart always --publish 8080:8080 -v "/home/transfer:/transfer" dutchcoders/transfer.sh:latest --provider local --basedir=/transfer

[transfer.sh]2022/02/03 18:00:19 Transfer.sh server started.
using temp folder: /tmp/

Enohriel avatar Feb 03 '22 18:02 Enohriel

--temp-path is the param for the temp folder

paolafrancesca avatar Feb 03 '22 18:02 paolafrancesca

The easiest fix for docker containers likely is to create the directory in the Dockerfile. The other approach is to set the mentioned path to the current working dir. What would you prefer?

stefanbenten avatar Apr 03 '22 18:04 stefanbenten

--temp-path doesn't seem to change this anyway, seems like the folder should just exist regardless?

2022-04-18 22:46:32.404635+00:00using temp folder: /temporary/
2022-04-18 22:46:32.404639+00:00using storage provider: local
2022-04-18 22:46:32.404642+00:00[transfer.sh]2022/04/18 22:46:32 listening on port: :8080
2022-04-18 22:46:32.404651+00:00[transfer.sh]2022/04/18 22:46:32 ---------------------------
2022-04-18 22:47:58.667058+00:00[transfer.sh]2022/04/18 22:47:58 open /tmp/multipart-1790426455: no such file or directory

gwigz avatar Apr 18 '22 22:04 gwigz

the flag is --temp-path not --tmp-path

paolafrancesca avatar Apr 18 '22 23:04 paolafrancesca

typo

gwigz avatar Apr 19 '22 20:04 gwigz

@gwigz what version are you using?

there's no explicit saving of a multipart preìfix temporary file in the code, I vaguely remember there was once, but I'm not sure

if I set --temp-path to /dir/not/exists this the output:

[transfer.sh]2022/04/20 22:50:29 Transfer.sh server started.
using temp folder: /dir/not/exists/
using storage provider: local
[transfer.sh]2022/04/20 22:50:29 listening on port: :8080
[transfer.sh]2022/04/20 22:50:29 ---------------------------
[transfer.sh]2022/04/20 22:50:38 open /dir/not/exists/transfer-292564794: no such file or directory

but that's rather expected and there is a match between tempo folder and the message on temp file creation

paolafrancesca avatar Apr 20 '22 13:04 paolafrancesca