diff --git a/Dockerfile b/Dockerfile index 4683584..14abdab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13-alpine +FROM golang:1.14-alpine LABEL maintainer="rzrbld " @@ -9,10 +9,9 @@ ENV GOPROXY https://proxy.golang.org RUN \ apk add --no-cache git && \ - git clone https://github.com/minio/minio && cd minio/ && git checkout d4dcf1d7225a38ecf94abe7cbe7c69a93dc7c0b0 && cd pkg/madmin/examples/ && \ git clone https://github.com/rzrbld/adminio-api && go build adminio-api/src/main.go && cp main /go/bin/adminio - -FROM alpine:3.9 + +FROM alpine:3.11 EXPOSE 8080 diff --git a/Dockerfile.dev b/Dockerfile.dev index 57424ef..e6a5c72 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM golang:1.13-alpine +FROM golang:1.14-alpine LABEL maintainer="rzrbld " @@ -7,15 +7,11 @@ ENV CGO_ENABLED 0 ENV GO111MODULE on ENV GOPROXY https://proxy.golang.org -RUN \ - apk add --no-cache git && \ - git clone https://github.com/minio/minio && cd minio/ && git checkout d4dcf1d7225a38ecf94abe7cbe7c69a93dc7c0b0 && cd pkg/madmin/examples/ +ADD src /src/ -COPY src/main.go minio/pkg/madmin/examples/ +RUN cd /src/ && go build main.go && cp main /go/bin/adminio -RUN cd minio/pkg/madmin/examples && go build main.go && cp main /go/bin/adminio - -FROM alpine:3.9 +FROM alpine:3.11 EXPOSE 8080 diff --git a/README.md b/README.md index 1aef84c..0f92a9f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,19 @@ # Adminio-api -This is a simple admin "REST" API for [minio](https://min.io/) s3 server. +This is a simple admin "REST" API for [minio](https://min.io/) s3 server. Here is a Web UI for this API - [adminio-ui](https://github.com/rzrbld/adminio-ui) +### Breaking changes in 0.9 version + + - env renamed: API_HOST_PORT > ADMINIO_HOST_PORT + - API version v1 is depicated and soon will be removed. + ### Run full stack demo obtain [docker-compose.yml](https://raw.githubusercontent.com/rzrbld/adminio-ui/master/docker-compose.yml) from [adminio-ui](https://github.com/rzrbld/adminio-ui) repository. And run it: `` docker-compose -f docker-compose.yml up `` it will bring up: - - minio server on 9000 port + - minio server on 9000 port - adminio API on 8080 port - adminio UI on 80 port @@ -25,10 +30,41 @@ after that you can go to `` http://localhost `` and try out ### Env variables | Variable | Description | Default | |--------------|:-----------------------:|-----------:| -| API_HOST_PORT | which host and port API should listening. This is Iris based API, so you will need to provide 0.0.0.0:8080 for listening on all interfaces | localhost:8080 | -| MINIO_HOST_PORT | provide a minio server host and port | localhost:9000 | -| MINIO_SSL | enable or disable ssl | false | -| MINIO_REGION | set minio region | us-east-1 | -| MINIO_ACCESS | set minio Access Key | test | -| MINIO_SECRET | set minio Secret Key | testtest123 | -| ADMINIO_CORS_DOMAIN | set adminio-api CORS policy domain | * | +| `ADMINIO_HOST_PORT` | which host and port API should listening. This is Iris based API, so you will need to provide 0.0.0.0:8080 for listening on all interfaces | localhost:8080 | +| `MINIO_HOST_PORT` | provide a minio server host and port | localhost:9000 | +| `MINIO_SSL` | enable or disable ssl | false | +| `MINIO_REGION` | set minio region | us-east-1 | +| `MINIO_ACCESS` | set minio Access Key | test | +| `MINIO_SECRET` | set minio Secret Key | testtest123 | +| `ADMINIO_CORS_DOMAIN` | set adminio-api CORS policy domain | * | +| `ADMINIO_OAUTH_ENABLE` | enable oauth over supported providers | false | +| `ADMINIO_OAUTH_PROVIDER` | oauth provider, for more information see the full list of supported providers | github | +| `ADMINIO_OAUTH_CLIENT_ID` | oauth app client id | my-github-oauth-app-client-id | +| `ADMINIO_OAUTH_CLIENT_SECRET` | oauth app secret | my-github-oauth-app-secret | +| `ADMINIO_OAUTH_CALLBACK` | oauth callback, default listener on /auth/callback | http://"+ADMINIO_HOST_PORT+"/auth/callback | +| `ADMINIO_OAUTH_CUSTOM_DOMAIN` | oauth custom domain, for supported providers (auth0\wso2) | - | +| `ADMINIO_COOKIE_HASH_KEY` | hash key for session cookies. AES only supports key sizes of 16, 24 or 32 bytes | NRUeuq6AdskNPa7ewZuxG9TrDZC4xFat | +| `ADMINIO_COOKIE_BLOCK_KEY` | block key for session cookies. AES only supports key sizes of 16, 24 or 32 bytes | bnfYuphzxPhJMR823YNezH83fuHuddFC | +| `ADMINIO_COOKIE_NAME` | name for the session cookie | adminiosessionid | +| `ADMINIO_AUDIT_LOG_ENABLE` | enable audit log, mae sense if oauth is enabled, othervise set to false | false | +| `ADMINIO_METRICS_ENABLE` | enable default iris\golang metrics and bucket sizes metric on /metric/ uri path | false | + +### Supported oauth providers + + - amazon + - auth0 + - bitbucket + - box + - digitalocean + - dropbox + - github + - gitlab + - heroku + - onedrive + - salesforce + - slack + - wso2 + + ### example config +prometheus config: `examples/prometheus.yml` +bucket policy: `examples/policy.xml` diff --git a/examples/policy.xml b/examples/policy.xml new file mode 100644 index 0000000..e596988 --- /dev/null +++ b/examples/policy.xml @@ -0,0 +1,13 @@ + + + expire-bucket + Enabled + + + + + + 1 + + + diff --git a/examples/prometheus.yml b/examples/prometheus.yml new file mode 100644 index 0000000..025b088 --- /dev/null +++ b/examples/prometheus.yml @@ -0,0 +1,6 @@ +scrape_configs: +- job_name: adminio + metrics_path: /metrics + scheme: http + static_configs: + - targets: ['adminio-host:8080']