upload-server

command module
v0.0.0-...-8c29e3f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL