Skip to content

Alick09/upload-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go gin micro server for uploading files

How to run

Running with docker CLI

docker run \
	--env TOKEN=seCreTt0keN \
	--env MAX_MB=2 \
	--name test-uploader \
	--publish 8080:8080/tcp \
	--volume "$(pwd)/test:/data" \
	0009000/go-upload-server

Running through docker-compose

services:
  upload-server:
    image: 0009000/go-upload-server
    container_name: upload-server
    environment:
      - TOKEN=seCreTt0keN 
      - MAX_MB=2
    ports:
      - 8080:8080
    volumes:
      - '/srv/data:/data'

How to use

Once your docker is running you can upload files to the server making simple request

curl \
  -H "Token: seCreTt0keN" \
  -F "path=dump/folder" \
  -F "upload=@/home/root/file.txt" \
  -F "upload=@/home/root/another_file.png" \
  localhost:8080/upload

Environment variables

There are 2 optional environment variables:

  1. TOKEN can be used to make service a bit more safe. If not set, it will not be checked at all.
  2. MAX_MB configuration property for gin's MaxMultipartMemory. Default is 32

About

Tiny server for file uploading

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published