Add usage documentation

This commit is contained in:
Lena Fuhrimann 2020-05-04 10:33:23 +02:00
parent 5e8194e760
commit b76a60f6a6
3 changed files with 19 additions and 9 deletions

View file

@ -6,9 +6,22 @@
A Web GUI written in Go to manage S3 buckets from any provider. A Web GUI written in Go to manage S3 buckets from any provider.
![Screenshot](https://raw.githubusercontent.com/mastertinner/s3manager/master/screenshot.png)
## Usage
The application can be configured with the following environment variables:
- `ENDPOINT`: The endpoint of your S3 server (defaults to `s3.amazonaws.com`)
- `ACCESS_KEY_ID`: Your S3 access key ID (required)
- `SECRET_ACCESS_KEY`: Your S3 secret access key (required)
- `PORT`: The port the app should listen on (defaults to `8080`)
Then simply run the binary.
## Build and Run Locally ## Build and Run Locally
1. Run `make` 1. Run `make build`
1. Execute the created binary and visit <http://localhost:8080> 1. Execute the created binary and visit <http://localhost:8080>
## Run Tests ## Run Tests
@ -21,7 +34,7 @@ The image is available on [Docker Hub](https://hub.docker.com/r/mastertinner/s3m
1. Run `make build-docker` 1. Run `make build-docker`
## Run on Cloud Foundry ## Deploy to Cloud Foundry
1. Modify `deployments/cf/*` to your liking 1. Modify `deployments/cf/*` to your liking
1. Run `make deploy-cf` 1. Run `make deploy-cf`

View file

@ -14,26 +14,23 @@ import (
) )
func main() { func main() {
endpoint, ok := os.LookupEnv("ENDPOINT")
if !ok {
endpoint = "s3.amazonaws.com"
}
accessKeyID, ok := os.LookupEnv("ACCESS_KEY_ID") accessKeyID, ok := os.LookupEnv("ACCESS_KEY_ID")
if !ok { if !ok {
log.Fatal("please provide ACCESS_KEY_ID") log.Fatal("please provide ACCESS_KEY_ID")
} }
secretAccessKey, ok := os.LookupEnv("SECRET_ACCESS_KEY") secretAccessKey, ok := os.LookupEnv("SECRET_ACCESS_KEY")
if !ok { if !ok {
log.Fatal("please provide SECRET_ACCESS_KEY") log.Fatal("please provide SECRET_ACCESS_KEY")
} }
port, ok := os.LookupEnv("PORT") port, ok := os.LookupEnv("PORT")
if !ok { if !ok {
port = "8080" port = "8080"
} }
endpoint, ok := os.LookupEnv("ENDPOINT")
if !ok {
endpoint = "s3.amazonaws.com"
}
tmplDir := filepath.Join("web", "template") tmplDir := filepath.Join("web", "template")
// Set up S3 client // Set up S3 client

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB