Commit 51dc861a authored by lixiang's avatar lixiang

modify domain name

parent b02c6277
This diff is collapsed.
......@@ -10,6 +10,7 @@
如果修改了main中的go文件,就需重新编译(需要go环境)
编译:
bash
cd conf/extensions
GOOS=linux GOARCH=386 go build ../../main/authentication.go
......
version: "2.3"
version: "3.6"
services:
registry:
image: registry:2
......@@ -12,7 +12,7 @@ services:
- REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data
- REGISTRY_STORAGE_DELETE_ENABLED=true
- REGISTRY_AUTH=token
- REGISTRY_AUTH_TOKEN_REALM=https://ce-z1.cloudam.cn:5001/auth
- REGISTRY_AUTH_TOKEN_REALM=https://ce-z1.bkunyun.com:5001/auth
- REGISTRY_AUTH_TOKEN_SERVICE="CE-Z1"
- REGISTRY_AUTH_TOKEN_ISSUER="AuthService"
- REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE=/ssl/ssl.pem
......
module docker-registry
go 1.13
require github.com/cesanta/docker_auth/auth_server v0.0.0-20230505183229-057a0bc622f1
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
package main
import (
"strings"
"os"
"docker-registry/utils"
"fmt"
utils "../utils"
"os"
"strings"
)
func main() {
text := utils.ReadStdIn()
credentials := strings.Split(text, " ")
......@@ -23,7 +21,7 @@ func main() {
re, _ := utils.HttpLogin(uName, password)
isUserAuthenticated := re
if (strings.EqualFold(uName, "root") && strings.EqualFold(password, "bkunyun2021")) {
if strings.EqualFold(uName, "root") && strings.EqualFold(password, "bkunyun2021") {
isUserAuthenticated = true
}
......
package main
import (
"docker-registry/utils"
"encoding/json"
"os"
"github.com/cesanta/docker_auth/auth_server/authz"
"fmt"
utils "../utils"
)
"os"
"github.com/cesanta/docker_auth/auth_server/api"
)
func main() {
text := utils.ReadStdIn()
// Create the authReqInfo object from the input
var authReqInfo authz.AuthRequestInfo
var authReqInfo *api.AuthRequestInfo
err := json.Unmarshal([]byte(text), &authReqInfo)
if err != nil {
os.Exit(utils.ErrorExitCode)
......
package main
import (
"../utils"
"github.com/cesanta/docker_auth/auth_server/authz"
"docker-registry/utils"
"github.com/cesanta/docker_auth/auth_server/api"
)
func main() {
// utils.HttpLogin("lglhope", "123456789")
var authRequestInfo authz.AuthRequestInfo
var authRequestInfo *api.AuthRequestInfo
authRequestInfo.Account = "wln"
authRequestInfo.Name = "wln/apple"
authRequestInfo.Service = "wln"
......
......@@ -2,15 +2,16 @@ package utils
import (
"bufio"
"os"
"strings"
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"fmt"
"github.com/cesanta/docker_auth/auth_server/authz"
"encoding/json"
"bytes"
"os"
"strconv"
"strings"
"github.com/cesanta/docker_auth/auth_server/api"
)
const SuccessExitCode = 0
......@@ -64,9 +65,9 @@ func HttpLogin(username string, password string) (bool, error) {
return true, nil
}
func HttpAuth(authReqInfo authz.AuthRequestInfo) bool {
func HttpAuth(authReqInfo *api.AuthRequestInfo) bool {
client := &http.Client{}
authUrl := "https://www.cloudam.cn/c3ce/dockerimage/authorization"
authUrl := "https://www.bkunyun.com/c3ce/dockerimage/authorization"
bytesData, _ := json.Marshal(authReqInfo)
fmt.Println(string(bytesData))
req, _ := http.NewRequest("POST", authUrl, bytes.NewReader(bytesData))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment