Victor Vieux 12 роки тому
батько
коміт
d7b01c049d
3 змінених файлів з 11 додано та 6 видалено
  1. 4 4
      api.go
  2. 1 1
      docs/sources/installation/ubuntulinux.rst
  3. 6 1
      registry/registry.go

+ 4 - 4
api.go

@@ -59,7 +59,7 @@ func getBoolParam(value string) (bool, error) {
 }
 }
 
 
 func getAuth(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
 func getAuth(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
-	b, err := json.Marshal(srv.registry.GetAuthConfig())
+	b, err := json.Marshal(srv.registry.GetAuthConfig(false))
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
@@ -72,9 +72,9 @@ func postAuth(srv *Server, version float64, w http.ResponseWriter, r *http.Reque
 	if err := json.NewDecoder(r.Body).Decode(config); err != nil {
 	if err := json.NewDecoder(r.Body).Decode(config); err != nil {
 		return err
 		return err
 	}
 	}
-
-	if config.Username == srv.registry.GetAuthConfig().Username {
-		config.Password = srv.registry.GetAuthConfig().Password
+	authConfig := srv.registry.GetAuthConfig(true)
+	if config.Username == authConfig.Username {
+		config.Password = authConfig.Password
 	}
 	}
 
 
 	newAuthConfig := auth.NewAuthConfig(config.Username, config.Password, config.Email, srv.runtime.root)
 	newAuthConfig := auth.NewAuthConfig(config.Username, config.Password, config.Email, srv.runtime.root)

+ 1 - 1
docs/sources/installation/ubuntulinux.rst

@@ -38,7 +38,7 @@ Due to a bug in LXC docker works best on the 3.8 kernel. Precise comes with a 3.
 .. code-block:: bash
 .. code-block:: bash
 
 
    # install the backported kernel
    # install the backported kernel
-   sudo apt-get update && sudo apt-get install linux-image-3.8.0-19-generic
+   sudo apt-get update && sudo apt-get install linux-image-generic-lts-raring
 
 
    # reboot
    # reboot
    sudo reboot
    sudo reboot

+ 6 - 1
registry/registry.go

@@ -428,9 +428,14 @@ func (r *Registry) ResetClient(authConfig *auth.AuthConfig) {
 	r.client.Jar = cookiejar.NewCookieJar()
 	r.client.Jar = cookiejar.NewCookieJar()
 }
 }
 
 
-func (r *Registry) GetAuthConfig() *auth.AuthConfig {
+func (r *Registry) GetAuthConfig(withPasswd bool) *auth.AuthConfig {
+	password := ""
+	if withPasswd {
+		password = r.authConfig.Password
+	}
 	return &auth.AuthConfig{
 	return &auth.AuthConfig{
 		Username: r.authConfig.Username,
 		Username: r.authConfig.Username,
+		Password: password,
 		Email:    r.authConfig.Email,
 		Email:    r.authConfig.Email,
 	}
 	}
 }
 }