Skip to content

Commit

Permalink
Merge pull request #9 from rzrbld/feature/fix-release
Browse files Browse the repository at this point in the history
fix group edit error
  • Loading branch information
rzrbld authored Apr 21, 2020
2 parents 76dd46d + df2a1eb commit 0062e27
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 5 deletions.
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Adminio API Contribution Guide

The owners of this repository welcomes your contribution. To make the process as seamless as possible, we recommend you read this contribution guide.

## Development Workflow

Start by forking the this GitHub repository, make changes in a branch and then send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details:

### Setup your adminio-api GitHub Repository
Fork [Adminio API](https://github.com/rzrbld/adminio-api/fork) upstream source repository to your own personal repository.

### Set up git remote as ``upstream``
```sh
$ git clone https://github.com/rzrbld/adminio-api
$ cd adminio-api
$ git remote add upstream https://github.com/rzrbld/adminio-api
$ git fetch upstream
$ git merge upstream/master
...
```

### Create your feature branch
Before making code changes, make sure you create a separate branch for these changes

```
$ git checkout -b my-new-feature
```

### Test changes
After your code changes, make sure
- To run `go build main.go` and see no errors
- To squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request.
- To run some tests.

### Commit changes
After verification, commit your changes. This is a [great post](https://chris.beams.io/posts/git-commit/) on how to write useful commit messages

```
$ git commit -am 'Add some feature'
```

### Push to the branch
Push your locally committed changes to the remote origin (your fork)
```
$ git push origin my-new-feature
```

### Create a Pull Request
Pull requests can be created via GitHub. Refer to [this document](https://help.github.com/articles/creating-a-pull-request/) for detailed steps on how to create a pull request. After a Pull Request gets peer reviewed and approved, it will be merged.

## FAQs
### How does adminio-api manages dependencies?
``adminio-api`` uses `go mod` to manage its dependencies.
- Run `go get foo/bar` in the source folder to add the dependency to `go.mod` file.

To remove a dependency
- Edit your code and remove the import reference.
- Run `go mod tidy` in the source folder to remove dependency from `go.mod` file.

### What are the coding guidelines?
Refer: [Effective Go](https://github.com/golang/go/wiki/CodeReviewComments) article from Golang project. If you observe offending code, please feel free to send a pull request.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
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)

![Docker hub stats](https://img.shields.io/docker/pulls/rzrbld/adminio-api?style=flat-square) ![GitHub License](https://img.shields.io/github/license/rzrbld/adminio-api?style=flat-square)


### Breaking changes in 0.9 version

- env renamed: API_HOST_PORT > ADMINIO_HOST_PORT
Expand Down
3 changes: 2 additions & 1 deletion src/handlers/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (

var GrSetStatus = func(ctx iris.Context) {
var group = ctx.FormValue("group")
var status = ctx.FormValue("status")

if resph.CheckAuthBeforeRequest(ctx) != false {
var status = madmin.GroupStatus(group)
var status = madmin.GroupStatus(status)
err = madmClnt.SetGroupStatus(group, status)
var res = resph.DefaultResHandler(ctx, err)
ctx.JSON(res)
Expand Down
9 changes: 5 additions & 4 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ func main() {

fmt.Println("\033[31m\r\n ________ ________ _____ ______ ___ ________ ___ ________ \r\n|\\ __ \\ |\\ ___ \\ |\\ _ \\ _ \\ |\\ \\ |\\ ___ \\ |\\ \\ |\\ __ \\ \r\n\\ \\ \\|\\ \\\\ \\ \\_|\\ \\\\ \\ \\\\\\__\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\|\\ \\ \r\n \\ \\ __ \\\\ \\ \\ \\\\ \\\\ \\ \\\\|__| \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\\\ \\ \r\n \\ \\ \\ \\ \\\\ \\ \\_\\\\ \\\\ \\ \\ \\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\ \\ \\\\\\ \\ \r\n \\ \\__\\ \\__\\\\ \\_______\\\\ \\__\\ \\ \\__\\\\ \\__\\\\ \\__\\\\ \\__\\\\ \\__\\\\ \\_______\\\r\n \\|__|\\|__| \\|_______| \\|__| \\|__| \\|__| \\|__| \\|__| \\|__| \\|_______|\r\n \r\n \r\n \033[m")
fmt.Println("\033[33mAdmin REST API for http://min.io (minio) s3 server")
fmt.Println("version : 0.9 ")
fmt.Println("Author : rzrbld")
fmt.Println("License : MIT")
fmt.Println("Git-repo : https://github.com/rzrbld/adminio \033[m \r\n")
fmt.Println("Version : 0.96")
fmt.Println("Author : rzrbld")
fmt.Println("License : MIT")
fmt.Println("GitHub : https://github.com/rzrbld/adminio-api")
fmt.Println("Docker Hub : https://hub.docker.com/r/rzrbld/adminio-api \033[m \r\n")

app := iris.New()

Expand Down

0 comments on commit 0062e27

Please sign in to comment.