This service aims to upload medias (images, documents, videos and audios...) to the main cloud storages (aws s3, google storage, digital ocean spaces, cloudinary...). Like a media center
A short description to confgure storage providers
Then create a space
After that fill the env vars
DO_SPACE_ENDPOINT=BUCKET_ENDPOINT
; check your region in the endpoint url
DO_SPACE_REGION='sfo2'
DO_SPACE_NAME=DO_SPACE_NAME
DO_ACCESS_KEY=YOUR_SPACE_ACCESS_KEY
DO_SECRET_KEY=YOUR_SPACE_SECRET_KEY
Create service account with role cloud storage: admin objects
Then generate the credential and save it on your computer
Create a bucket with public access and add allUsers
permissions for get objects
After that fill the env vars
GOOGLE_APPLICATION_CREDENTIALS=YOUR_CREDENTIALS_PATH
GOOGLE_BUCKET_NAME=YOUR_BUCKET_NAME
Locally, I recommend ubuntu
or debian
linux:
- Golang v1.19
- Git
- Docker
- Runs
go mod tidy
- Copy the
.env.sample
and create the.env
file with your credentials
then runs:
go run main http
Docker:
and all you need to run is ...
$ docker-compose up http
For test your application you need to run docker-compose run --rm test
and this command will use the correctly environment