Manage Garage Websites from Guichet #19
2 changed files with 182 additions and 182 deletions
14
garage.go
14
garage.go
|
@ -1,15 +1,15 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"net/http"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
garage "git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-golang"
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
"github.com/gorilla/mux"
|
||||
garage "git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-golang"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func gadmin() (*garage.APIClient, context.Context) {
|
||||
|
@ -25,7 +25,6 @@ func gadmin() (*garage.APIClient, context.Context) {
|
|||
return client, ctx
|
||||
}
|
||||
|
||||
|
||||
func grgCreateKey(name string) (*garage.KeyInfo, error) {
|
||||
client, ctx := gadmin()
|
||||
|
||||
|
@ -110,7 +109,6 @@ func grgGetBucket(bid string) (*garage.BucketInfo, error) {
|
|||
|
||||
}
|
||||
|
||||
|
||||
func checkLoginAndS3(w http.ResponseWriter, r *http.Request) (*LoginStatus, *garage.KeyInfo, error) {
|
||||
login := checkLogin(w, r)
|
||||
if login == nil {
|
||||
|
@ -159,6 +157,7 @@ type webListView struct {
|
|||
Status *LoginStatus
|
||||
Key *garage.KeyInfo
|
||||
}
|
||||
|
||||
func handleGarageWebsiteList(w http.ResponseWriter, r *http.Request) {
|
||||
login, s3key, err := checkLoginAndS3(w, r)
|
||||
if err != nil {
|
||||
|
@ -219,6 +218,7 @@ type webInspectView struct {
|
|||
MaxSize int64
|
||||
UsedSizePct float64
|
||||
}
|
||||
|
||||
func handleGarageWebsiteInspect(w http.ResponseWriter, r *http.Request) {
|
||||
login, s3key, err := checkLoginAndS3(w, r)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue