mirror of https://github.com/portainer/portainer
fix(stacks): confirm enable tls verification [EE-5410] (#8895)
parent
a44e8b04e8
commit
dc259f2fce
|
@ -4,6 +4,7 @@ import { buildConfirmButton } from '@@/modals/utils';
|
||||||
import { ModalType } from '@@/modals';
|
import { ModalType } from '@@/modals';
|
||||||
import { parseAutoUpdateResponse } from '@/react/portainer/gitops/AutoUpdateFieldset/utils';
|
import { parseAutoUpdateResponse } from '@/react/portainer/gitops/AutoUpdateFieldset/utils';
|
||||||
import { baseStackWebhookUrl, createWebhookId } from '@/portainer/helpers/webhookHelper';
|
import { baseStackWebhookUrl, createWebhookId } from '@/portainer/helpers/webhookHelper';
|
||||||
|
import { confirmEnableTLSVerify } from '@/react/portainer/gitops/utils';
|
||||||
|
|
||||||
class KubernetesRedeployAppGitFormController {
|
class KubernetesRedeployAppGitFormController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
|
@ -71,6 +72,13 @@ class KubernetesRedeployAppGitFormController {
|
||||||
|
|
||||||
onChangeTLSSkipVerify(value) {
|
onChangeTLSSkipVerify(value) {
|
||||||
return this.$async(async () => {
|
return this.$async(async () => {
|
||||||
|
if (this.stack.GitConfig.TLSSkipVerify && !value) {
|
||||||
|
const confirmed = await confirmEnableTLSVerify();
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.onChange({ TLSSkipVerify: value });
|
this.onChange({ TLSSkipVerify: value });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { confirmStackUpdate } from '@/react/docker/stacks/common/confirm-stack-u
|
||||||
|
|
||||||
import { parseAutoUpdateResponse } from '@/react/portainer/gitops/AutoUpdateFieldset/utils';
|
import { parseAutoUpdateResponse } from '@/react/portainer/gitops/AutoUpdateFieldset/utils';
|
||||||
import { baseStackWebhookUrl, createWebhookId } from '@/portainer/helpers/webhookHelper';
|
import { baseStackWebhookUrl, createWebhookId } from '@/portainer/helpers/webhookHelper';
|
||||||
|
import { confirmEnableTLSVerify } from '@/react/portainer/gitops/utils';
|
||||||
|
|
||||||
class StackRedeployGitFormController {
|
class StackRedeployGitFormController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
|
@ -95,8 +96,17 @@ class StackRedeployGitFormController {
|
||||||
this.onChange({ Env: value });
|
this.onChange({ Env: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeTLSSkipVerify(value) {
|
async onChangeTLSSkipVerify(value) {
|
||||||
|
return this.$async(async () => {
|
||||||
|
if (this.model.TLSSkipVerify && !value) {
|
||||||
|
const confirmed = await confirmEnableTLSVerify();
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.onChange({ TLSSkipVerify: value });
|
this.onChange({ TLSSkipVerify: value });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeOption(values) {
|
onChangeOption(values) {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { confirm } from '@@/modals/confirm';
|
||||||
|
|
||||||
import { GitFormModel } from './types';
|
import { GitFormModel } from './types';
|
||||||
|
|
||||||
export function getAuthentication(
|
export function getAuthentication(
|
||||||
|
@ -18,3 +20,11 @@ export function getAuthentication(
|
||||||
password: model.RepositoryPassword,
|
password: model.RepositoryPassword,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function confirmEnableTLSVerify() {
|
||||||
|
return confirm({
|
||||||
|
title: 'Enable TLS Verification?',
|
||||||
|
message:
|
||||||
|
'Enabling the verification of TLS certificates without ensuring the correct configuration of your Certificate Authority (CA) for self-signed certificates can result in deployment failures.',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue