A simple service for receiving files throughth HTTP and save them to a local folder
10K+
A simple service for receiving files throughth HTTP and save them to a local folder
This is a straightforward solution to the problem of publishing files trought internet with ease and some level of control. By using a simple http server on a docker container you can easily deliver software to almost everywhere.
First run this command:
docker run -itd -p 8067:8067 --restart \
-e SIMPLE_FILE_RECEPTOR_TOKEN_HEADER="your-token" \
-v "your-root":/files \
coderookieerick/simple-file-receptor:linux-amd64
Where your-token is whatever value you want to set as the required Token header that must be sent when sending a file and your-root is the path to the base folder relative to which files will be created.
Note
Is your responsability to make the host port 8067 (or any other port you decide to use instead of it) TCP reachable. For example, if you're using apache2 as your server and you want to add a route mapped to the host port you'll need to add some ProxyPass and ProxyPassReverse rules to your .conf for it to be visible.
Tip
You may want to use `--restart unless-stopped` when running the container to enhance reliability.
Important
Files will be created using the container user. You may want to set up a different user when running the container. You can do so by adding `--user user-id:group-id`, where `user-id` is the id of the user you want the files to be created with, and `group-id` is the id of the group you want the files to be created with. To know the id of the current user just type `id` and press `[ENTER]`
Let's say whe have a directory like this:
- /folder/file1.txt
- /folder/file2.txt
- /folder/folder/file.txt
...and we want to send everything inside of folder our host machine, we would need to run the following commands:
# Move to the folder
cd ./folder
# Zip everything
zip -r files.zip *
# Curl it to the host
curl -F [email protected] -H "Token: your-token" https://{host}:{host-port}/zip:/folder
Content type
Image
Digest
sha256:418a821f5…
Size
409.7 MB
Last updated
about 10 hours ago
docker pull coderookieerick/simple-file-receptor:linux-amd64