Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 80439b1ca9 | |||
| 857a363e84 | |||
| 2f32119f34 |
@@ -0,0 +1,22 @@
|
|||||||
|
package migrator
|
||||||
|
|
||||||
|
import (
|
||||||
|
portainer "github.com/portainer/portainer/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (m *Migrator) updateUsersToDBVersion21() error {
|
||||||
|
legacyUsers, err := m.userService.Users()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, user := range legacyUsers {
|
||||||
|
user.PortainerAuthorizations = portainer.DefaultPortainerAuthorizations()
|
||||||
|
err = m.userService.UpdateUser(user.ID, &user)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -287,5 +287,13 @@ func (m *Migrator) Migrate() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Portainer 1.22.2
|
||||||
|
if m.currentDBVersion < 21 {
|
||||||
|
err := m.updateUsersToDBVersion21()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return m.versionService.StoreDBVersion(portainer.DBVersion)
|
return m.versionService.StoreDBVersion(portainer.DBVersion)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ func (p *proxyTransport) restrictedOperation(request *http.Request, resourceID s
|
|||||||
}
|
}
|
||||||
|
|
||||||
resourceControl := getResourceControlByResourceID(resourceID, resourceControls)
|
resourceControl := getResourceControlByResourceID(resourceID, resourceControls)
|
||||||
if resourceControl == nil || !canUserAccessResource(tokenData.ID, userTeamIDs, resourceControl) {
|
if resourceControl != nil && !canUserAccessResource(tokenData.ID, userTeamIDs, resourceControl) {
|
||||||
return writeAccessDeniedResponse()
|
return writeAccessDeniedResponse()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -903,9 +903,9 @@ type (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// APIVersion is the version number of the Portainer API
|
// APIVersion is the version number of the Portainer API
|
||||||
APIVersion = "1.22.1"
|
APIVersion = "1.22.2"
|
||||||
// DBVersion is the version number of the Portainer database
|
// DBVersion is the version number of the Portainer database
|
||||||
DBVersion = 20
|
DBVersion = 21
|
||||||
// AssetsServerURL represents the URL of the Portainer asset server
|
// AssetsServerURL represents the URL of the Portainer asset server
|
||||||
AssetsServerURL = "https://portainer-io-assets.sfo2.digitaloceanspaces.com"
|
AssetsServerURL = "https://portainer-io-assets.sfo2.digitaloceanspaces.com"
|
||||||
// MessageOfTheDayURL represents the URL where Portainer MOTD message can be retrieved
|
// MessageOfTheDayURL represents the URL where Portainer MOTD message can be retrieved
|
||||||
@@ -913,7 +913,7 @@ const (
|
|||||||
// VersionCheckURL represents the URL used to retrieve the latest version of Portainer
|
// VersionCheckURL represents the URL used to retrieve the latest version of Portainer
|
||||||
VersionCheckURL = "https://api.github.com/repos/portainer/portainer/releases/latest"
|
VersionCheckURL = "https://api.github.com/repos/portainer/portainer/releases/latest"
|
||||||
// ExtensionDefinitionsURL represents the URL where Portainer extension definitions can be retrieved
|
// ExtensionDefinitionsURL represents the URL where Portainer extension definitions can be retrieved
|
||||||
ExtensionDefinitionsURL = AssetsServerURL + "/extensions-1.22.1.json"
|
ExtensionDefinitionsURL = AssetsServerURL + "/extensions-1.22.2.json"
|
||||||
// SupportProductsURL represents the URL where Portainer support products can be retrieved
|
// SupportProductsURL represents the URL where Portainer support products can be retrieved
|
||||||
SupportProductsURL = AssetsServerURL + "/support.json"
|
SupportProductsURL = AssetsServerURL + "/support.json"
|
||||||
// PortainerAgentHeader represents the name of the header available in any agent response
|
// PortainerAgentHeader represents the name of the header available in any agent response
|
||||||
|
|||||||
+2
-2
@@ -54,7 +54,7 @@ info:
|
|||||||
|
|
||||||
**NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8).
|
**NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8).
|
||||||
|
|
||||||
version: "1.22.1"
|
version: "1.22.2"
|
||||||
title: "Portainer API"
|
title: "Portainer API"
|
||||||
contact:
|
contact:
|
||||||
email: "info@portainer.io"
|
email: "info@portainer.io"
|
||||||
@@ -3174,7 +3174,7 @@ definitions:
|
|||||||
description: "Is analytics enabled"
|
description: "Is analytics enabled"
|
||||||
Version:
|
Version:
|
||||||
type: "string"
|
type: "string"
|
||||||
example: "1.22.1"
|
example: "1.22.2"
|
||||||
description: "Portainer API version"
|
description: "Portainer API version"
|
||||||
PublicSettingsInspectResponse:
|
PublicSettingsInspectResponse:
|
||||||
type: "object"
|
type: "object"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"packageName": "portainer",
|
"packageName": "portainer",
|
||||||
"packageVersion": "1.22.1",
|
"packageVersion": "1.22.2",
|
||||||
"projectName": "portainer"
|
"projectName": "portainer"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Name: portainer
|
Name: portainer
|
||||||
Version: 1.22.1
|
Version: 1.22.2
|
||||||
Release: 0
|
Release: 0
|
||||||
License: Zlib
|
License: Zlib
|
||||||
Summary: A lightweight docker management UI
|
Summary: A lightweight docker management UI
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"author": "Portainer.io",
|
"author": "Portainer.io",
|
||||||
"name": "portainer",
|
"name": "portainer",
|
||||||
"homepage": "http://portainer.io",
|
"homepage": "http://portainer.io",
|
||||||
"version": "1.22.1",
|
"version": "1.22.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@github.com:portainer/portainer.git"
|
"url": "git@github.com:portainer/portainer.git"
|
||||||
|
|||||||
Reference in New Issue
Block a user