-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from rzrbld/feature/next-release
Feature/next release
- Loading branch information
Showing
24 changed files
with
1,596 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.13-alpine | ||
FROM golang:1.14-alpine | ||
|
||
LABEL maintainer="rzrbld <[email protected]>" | ||
|
||
|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.13-alpine | ||
FROM golang:1.14-alpine | ||
|
||
LABEL maintainer="rzrbld <[email protected]>" | ||
|
||
|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<LifecycleConfiguration> | ||
<Rule> | ||
<ID>expire-bucket</ID> | ||
<Status>Enabled</Status> | ||
<Filter> | ||
<And></And> | ||
<Tag></Tag> | ||
</Filter> | ||
<Expiration> | ||
<Days>1</Days> | ||
</Expiration> | ||
</Rule> | ||
</LifecycleConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
scrape_configs: | ||
- job_name: adminio | ||
metrics_path: /metrics | ||
scheme: http | ||
static_configs: | ||
- targets: ['adminio-host:8080'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package audit | ||
|
||
import ( | ||
iris "github.com/kataras/iris/v12" | ||
"github.com/markbates/goth" | ||
cnf "github.com/rzrbld/adminio-api/config" | ||
log "log" | ||
) | ||
|
||
func DefaultAuditLog(user goth.User, ctx iris.Context) { | ||
ctx.ViewData("", user) | ||
if cnf.AuditLogEnable { | ||
log.Print("userNickName: ", user.NickName, "; userID: ", user.UserID, "; method:", ctx.RouteName()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package clients | ||
|
||
import ( | ||
minio "github.com/minio/minio-go/v6" | ||
madmin "github.com/minio/minio/pkg/madmin" | ||
cnf "github.com/rzrbld/adminio-api/config" | ||
"log" | ||
) | ||
|
||
var MadmClnt, MadmErr = madmin.New(cnf.Server, cnf.Maccess, cnf.Msecret, cnf.Ssl) | ||
var MinioClnt, MinioErr = minio.New(cnf.Server, cnf.Maccess, cnf.Msecret, cnf.Ssl) | ||
|
||
func main() { | ||
if MadmErr != nil { | ||
log.Fatal("Error while connecting via admin client ", MadmErr) | ||
} | ||
|
||
if MinioErr != nil { | ||
log.Fatal("Error while connecting via minio client ", MinioErr) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package config | ||
|
||
import ( | ||
"os" | ||
strconv "strconv" | ||
) | ||
|
||
var ( | ||
Server = getEnv("MINIO_HOST_PORT", "localhost:9000") | ||
Maccess = getEnv("MINIO_ACCESS", "test") | ||
Msecret = getEnv("MINIO_SECRET", "testtest123") | ||
Region = getEnv("MINIO_REGION", "us-east-1") | ||
Ssl, _ = strconv.ParseBool(getEnv("MINIO_SSL", "false")) | ||
ServerHostPort = getEnv("ADMINIO_HOST_PORT", "localhost:8080") | ||
AdminioCORS = getEnv("ADMINIO_CORS_DOMAIN", "*") | ||
// AES only supports key sizes of 16, 24 or 32 bytes. | ||
// You either need to provide exactly that amount or you derive the key from what you type in. | ||
ScHashKey = getEnv("ADMINIO_COOKIE_HASH_KEY", "NRUeuq6AdskNPa7ewZuxG9TrDZC4xFat") | ||
ScBlockKey = getEnv("ADMINIO_COOKIE_BLOCK_KEY", "bnfYuphzxPhJMR823YNezH83fuHuddFC") | ||
// --------------- | ||
ScCookieName = getEnv("ADMINIO_COOKIE_NAME", "adminiosessionid") | ||
OauthEnable, _ = strconv.ParseBool(getEnv("ADMINIO_OAUTH_ENABLE", "false")) | ||
AuditLogEnable, _ = strconv.ParseBool(getEnv("ADMINIO_AUDIT_LOG_ENABLE", "false")) | ||
MetricsEnable, _ = strconv.ParseBool(getEnv("ADMINIO_METRICS_ENABLE", "false")) | ||
OauthProvider = getEnv("ADMINIO_OAUTH_PROVIDER", "github") | ||
OauthClientId = getEnv("ADMINIO_OAUTH_CLIENT_ID", "my-github-oauth-app-client-id") | ||
OauthClientSecret = getEnv("ADMINIO_OAUTH_CLIENT_SECRET", "my-github-oauth-app-secret") | ||
OauthCallback = getEnv("ADMINIO_OAUTH_CALLBACK", "http://"+ServerHostPort+"/auth/callback") | ||
OauthCustomDomain = getEnv("ADMINIO_OAUTH_CUSTOM_DOMAIN", "") | ||
) | ||
|
||
func getEnv(key, fallback string) string { | ||
value, exist := os.LookupEnv(key) | ||
|
||
if !exist { | ||
return fallback | ||
} | ||
|
||
return value | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module github.com/rzrbld/adminio-api | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/ajg/form v1.5.1 // indirect | ||
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect | ||
github.com/google/go-querystring v1.0.0 // indirect | ||
github.com/gorilla/securecookie v1.1.1 | ||
github.com/imkira/go-interpol v1.1.0 // indirect | ||
github.com/iris-contrib/middleware/cors v0.0.0-20191219204441-78279b78a367 | ||
github.com/iris-contrib/middleware/prometheus v0.0.0-20191219204441-78279b78a367 | ||
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect | ||
github.com/kataras/iris/v12 v12.1.8 | ||
github.com/markbates/goth v1.62.0 | ||
github.com/mattn/go-isatty v0.0.8 // indirect | ||
github.com/minio/minio v0.0.0-20200315185552-c9212819afbf | ||
github.com/minio/minio-go/v6 v6.0.50-0.20200306231101-b882ba63d570 | ||
github.com/moul/http2curl v1.0.0 // indirect | ||
github.com/onsi/ginkgo v1.12.0 // indirect | ||
github.com/onsi/gomega v1.9.0 // indirect | ||
github.com/prometheus/client_golang v1.2.1 | ||
github.com/rzrbld/goth-provider-wso2 v0.0.0-20200321083654-32bbe73a67d4 | ||
github.com/sergi/go-diff v1.1.0 // indirect | ||
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect | ||
github.com/valyala/fasthttp v1.9.0 // indirect | ||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect | ||
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect | ||
github.com/yudai/gojsondiff v1.0.0 // indirect | ||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect | ||
github.com/yudai/pp v2.0.1+incompatible // indirect | ||
golang.org/x/net v0.0.0-20200320220750-118fecf932d8 // indirect | ||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect | ||
gopkg.in/yaml.v2 v2.2.8 // indirect | ||
) |
Oops, something went wrong.