mirror of https://github.com/portainer/portainer
feat(docker-desktop-extension): Make Portainer compatible with Docker Desktop Extension EE-2747 (#6644)
* Initial extension build * Add auto login fix auto auth add some message Add extension version Double attempt to login Add auto login from jwt check Add autologin on logout revert sidebar Catch error 401 to relogin cleanup login Add password generator Hide User block and collapse sidebar by default hide user box and toggle sidebar remove defailt dd Integrate extension to portainer Move extension to build remove files from ignore Move extension folder fix alpine try to copy folder try add Change base image move folder extension ignore folder build Fix relative path Move ext to root fix image name versioned index Update extension on same image Update mod * fix kubeshell baseurl * Fix kube shell * move build and remove https * Tidy mod * Remove space * Fix hash test * Password manager * change to building locally * Restore version variable and add local install command * fix local dev image + hide users & auth * Password manageListen on locahost onlyr * FIxes base path * Hide only username * Move default to constants * Update app/portainer/components/PageHeader/HeaderContent.html Co-authored-by: Chaim Lev-Ari <chiptus@users.noreply.github.com> * fix 2 failing FE tests [EE-2938] * remove password autogeneration from v1 * fix webhooks * fix docker container console and attach * fix default for portainer IP * update meta, dockerfile and makefile for new ver * fix basepath in kube and docker console * revert makefile changes * add icon back * Add remote short cut command * make local methods the default * default to 0.0.0 for version for local development * simplify make commands * small build fixes * resolve conflicts * Update api/filesystem/write.go Co-authored-by: Chaim Lev-Ari <chiptus@users.noreply.github.com> * use a more secure default pass Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Chaim Lev-Ari <chiptus@users.noreply.github.com>pull/6775/head
parent
7efdae5eee
commit
360701e256
@ -1,3 +1,5 @@
|
|||||||
*
|
*
|
||||||
!dist
|
!dist
|
||||||
!build
|
!build
|
||||||
|
!metadata.json
|
||||||
|
!docker-extension/build
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
package crypto
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestService_Hash(t *testing.T) {
|
||||||
|
var s = &Service{}
|
||||||
|
|
||||||
|
type args struct {
|
||||||
|
hash string
|
||||||
|
data string
|
||||||
|
}
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
args args
|
||||||
|
expect bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "Empty",
|
||||||
|
args: args{
|
||||||
|
hash: "",
|
||||||
|
data: "",
|
||||||
|
},
|
||||||
|
expect: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Matching",
|
||||||
|
args: args{
|
||||||
|
hash: "$2a$10$6BFGd94oYx8k0bFNO6f33uPUpcpAJyg8UVX.akLe9EthF/ZBTXqcy",
|
||||||
|
data: "Passw0rd!",
|
||||||
|
},
|
||||||
|
expect: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Not matching",
|
||||||
|
args: args{
|
||||||
|
hash: "$2a$10$ltKrUZ7492xyutHOb0/XweevU4jyw7QO66rP32jTVOMb3EX3JxA/a",
|
||||||
|
data: "Passw0rd!",
|
||||||
|
},
|
||||||
|
expect: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
||||||
|
err := s.CompareHashAndData(tt.args.hash, tt.args.data)
|
||||||
|
if (err != nil) == tt.expect {
|
||||||
|
t.Errorf("Service.CompareHashAndData() = %v", err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,11 @@
|
|||||||
<div class="breadcrumb-links">
|
<div class="breadcrumb-links">
|
||||||
<div class="pull-left" ng-transclude></div>
|
<div class="pull-left" ng-transclude></div>
|
||||||
<div class="pull-right" ng-if="$ctrl.username">
|
<div class="pull-right" ng-if="$ctrl.username && $ctrl.display">
|
||||||
<a ui-sref="portainer.account" style="margin-right: 5px">
|
<a ui-sref="portainer.account" style="margin-right: 5px">
|
||||||
<u><i class="fa fa-wrench" aria-hidden="true"></i> my account </u>
|
<u> <i class="fa fa-wrench" aria-hidden="true"></i> my account </u>
|
||||||
</a>
|
</a>
|
||||||
<a ui-sref="portainer.logout({performApiLogout: true})" class="text-danger" style="margin-right: 25px" data-cy="template-logoutButton">
|
<a ui-sref="portainer.logout({performApiLogout: true})" class="text-danger" style="margin-right: 25px" data-cy="template-logoutButton">
|
||||||
<u><i class="fa fa-sign-out-alt" aria-hidden="true"></i> log out</u>
|
<u> <i class="fa fa-sign-out-alt" aria-hidden="true"></i> log out</u>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<div class="page white-space-normal">
|
<div class="page white-space-normal">
|
||||||
{{ $ctrl.titleText }}
|
{{ $ctrl.titleText }}
|
||||||
<span class="header_title_content" ng-transclude></span>
|
<span class="header_title_content" ng-transclude></span>
|
||||||
<span class="pull-right user-box" ng-if="$ctrl.username"> <i class="fa fa-user-circle" aria-hidden="true"></i> {{ $ctrl.username }} </span>
|
<span class="pull-right user-box" ng-if="$ctrl.username && $ctrl.display">
|
||||||
|
<i class="fa fa-user-circle" aria-hidden="true"></i>
|
||||||
|
{{ $ctrl.username }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
# Makefile for development purpose
|
||||||
|
|
||||||
|
.PHONY: local build
|
||||||
|
local: clean build install
|
||||||
|
remote: clean build-remote install
|
||||||
|
|
||||||
|
ORG=portainer
|
||||||
|
VERSION=0.0.0
|
||||||
|
IMAGE_NAME=$(ORG)/portainer-docker-extension
|
||||||
|
TAGGED_IMAGE_NAME=$(IMAGE_NAME):$(VERSION)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-docker extension remove $(IMAGE_NAME)
|
||||||
|
-docker rmi $(IMAGE_NAME):$(VERSION)
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker buildx build -f build/linux/Dockerfile --load --build-arg TAG=$(VERSION) --build-arg PORTAINER_IMAGE_NAME=$(IMAGE_NAME) --tag=$(TAGGED_IMAGE_NAME) .
|
||||||
|
|
||||||
|
build-remote:
|
||||||
|
docker buildx build -f build/linux/Dockerfile --push --builder=buildx-multi-arch --platform=windows/amd64,linux/amd64,linux/arm64 --build-arg TAG=$(VERSION) --build-arg PORTAINER_IMAGE_NAME=$(IMAGE_NAME) --tag=$(TAGGED_IMAGE_NAME) .
|
||||||
|
|
||||||
|
install:
|
||||||
|
docker extension install $(TAGGED_IMAGE_NAME)
|
||||||
|
|
||||||
|
multiarch:
|
||||||
|
docker buildx create --name=buildx-multi-arch --driver=docker-container --driver-opt=network=host
|
||||||
|
|
||||||
|
portainer:
|
||||||
|
yarn build
|
@ -0,0 +1,18 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
portainer:
|
||||||
|
image: ${DESKTOP_PLUGIN_IMAGE}
|
||||||
|
command: ['--admin-password', '$$$$2y$$$$05$$$$bsb.XmF.r2DU6/9oVUaDxu3.Lxhmg1R8M0NMLK6JJKUiqUcaNjvdu']
|
||||||
|
restart: unless-stopped
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
- portainer_data:/data
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:8000:8000
|
||||||
|
- 127.0.0.1:9000:9000
|
||||||
|
- 127.0.0.1:9443:9443
|
||||||
|
volumes:
|
||||||
|
portainer_data:
|
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "Portainer",
|
||||||
|
"icon": "portainer.svg",
|
||||||
|
"vm": {
|
||||||
|
"composefile": "docker-compose.yml",
|
||||||
|
"exposes": { "socket": "docker.sock" }
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"dashboard-tab": {
|
||||||
|
"title": "Portainer",
|
||||||
|
"root": "/public",
|
||||||
|
"src": "index.html"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in new issue