mirror of https://github.com/portainer/portainer
parent
2eb4453487
commit
7c2fcb67eb
|
@ -150,6 +150,7 @@ func createStackPayloadFromSwarmGitPayload(name, swarmID, repoUrl, repoReference
|
||||||
Authentication: repoAuthentication,
|
Authentication: repoAuthentication,
|
||||||
Username: repoUsername,
|
Username: repoUsername,
|
||||||
Password: repoPassword,
|
Password: repoPassword,
|
||||||
|
TLSSkipVerify: repoSkipSSLVerify,
|
||||||
},
|
},
|
||||||
ComposeFile: composeFile,
|
ComposeFile: composeFile,
|
||||||
AdditionalFiles: additionalFiles,
|
AdditionalFiles: additionalFiles,
|
||||||
|
|
|
@ -25,6 +25,7 @@ type stackGitUpdatePayload struct {
|
||||||
RepositoryAuthentication bool
|
RepositoryAuthentication bool
|
||||||
RepositoryUsername string
|
RepositoryUsername string
|
||||||
RepositoryPassword string
|
RepositoryPassword string
|
||||||
|
TLSSkipVerify bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (payload *stackGitUpdatePayload) Validate(r *http.Request) error {
|
func (payload *stackGitUpdatePayload) Validate(r *http.Request) error {
|
||||||
|
@ -138,6 +139,7 @@ func (handler *Handler) stackUpdateGit(w http.ResponseWriter, r *http.Request) *
|
||||||
|
|
||||||
//update retrieved stack data based on the payload
|
//update retrieved stack data based on the payload
|
||||||
stack.GitConfig.ReferenceName = payload.RepositoryReferenceName
|
stack.GitConfig.ReferenceName = payload.RepositoryReferenceName
|
||||||
|
stack.GitConfig.TLSSkipVerify = payload.TLSSkipVerify
|
||||||
stack.AutoUpdate = payload.AutoUpdate
|
stack.AutoUpdate = payload.AutoUpdate
|
||||||
stack.Env = payload.Env
|
stack.Env = payload.Env
|
||||||
stack.UpdatedBy = user.Username
|
stack.UpdatedBy = user.Username
|
||||||
|
|
|
@ -31,6 +31,7 @@ type kubernetesGitStackUpdatePayload struct {
|
||||||
RepositoryUsername string
|
RepositoryUsername string
|
||||||
RepositoryPassword string
|
RepositoryPassword string
|
||||||
AutoUpdate *portainer.AutoUpdateSettings
|
AutoUpdate *portainer.AutoUpdateSettings
|
||||||
|
TLSSkipVerify bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (payload *kubernetesFileStackUpdatePayload) Validate(r *http.Request) error {
|
func (payload *kubernetesFileStackUpdatePayload) Validate(r *http.Request) error {
|
||||||
|
@ -62,6 +63,7 @@ func (handler *Handler) updateKubernetesStack(r *http.Request, stack *portainer.
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.GitConfig.ReferenceName = payload.RepositoryReferenceName
|
stack.GitConfig.ReferenceName = payload.RepositoryReferenceName
|
||||||
|
stack.GitConfig.TLSSkipVerify = payload.TLSSkipVerify
|
||||||
stack.AutoUpdate = payload.AutoUpdate
|
stack.AutoUpdate = payload.AutoUpdate
|
||||||
|
|
||||||
if payload.RepositoryAuthentication {
|
if payload.RepositoryAuthentication {
|
||||||
|
|
|
@ -45,6 +45,7 @@ class KubernetesRedeployAppGitFormController {
|
||||||
this.onChangeRef = this.onChangeRef.bind(this);
|
this.onChangeRef = this.onChangeRef.bind(this);
|
||||||
this.onChangeAutoUpdate = this.onChangeAutoUpdate.bind(this);
|
this.onChangeAutoUpdate = this.onChangeAutoUpdate.bind(this);
|
||||||
this.onChangeGitAuth = this.onChangeGitAuth.bind(this);
|
this.onChangeGitAuth = this.onChangeGitAuth.bind(this);
|
||||||
|
this.onChangeTLSSkipVerify = this.onChangeTLSSkipVerify.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeRef(value) {
|
onChangeRef(value) {
|
||||||
|
@ -68,6 +69,12 @@ class KubernetesRedeployAppGitFormController {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onChangeTLSSkipVerify(value) {
|
||||||
|
return this.$async(async () => {
|
||||||
|
this.onChange({ TLSSkipVerify: value });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async onChangeAutoUpdate(values) {
|
async onChangeAutoUpdate(values) {
|
||||||
return this.$async(async () => {
|
return this.$async(async () => {
|
||||||
await this.onChange({
|
await this.onChange({
|
||||||
|
@ -152,6 +159,7 @@ class KubernetesRedeployAppGitFormController {
|
||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
this.formValues.RefName = this.stack.GitConfig.ReferenceName;
|
this.formValues.RefName = this.stack.GitConfig.ReferenceName;
|
||||||
|
this.formValues.TLSSkipVerify = this.stack.GitConfig.TLSSkipVerify;
|
||||||
|
|
||||||
this.formValues.AutoUpdate = parseAutoUpdateResponse(this.stack.AutoUpdate);
|
this.formValues.AutoUpdate = parseAutoUpdateResponse(this.stack.AutoUpdate);
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,19 @@
|
||||||
is-auth-edit="$ctrl.state.isAuthEdit"
|
is-auth-edit="$ctrl.state.isAuthEdit"
|
||||||
></git-form-auth-fieldset>
|
></git-form-auth-fieldset>
|
||||||
|
|
||||||
|
<div class="form-group" ng-if="$ctrl.state.showConfig">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<por-switch-field
|
||||||
|
name="TLSSkipVerify"
|
||||||
|
checked="$ctrl.formValues.TLSSkipVerify"
|
||||||
|
tooltip="'Enabling this will allow skipping TLS validation for any self-signed certificate.'"
|
||||||
|
label-class="'col-sm-3 col-lg-2'"
|
||||||
|
label="'Skip TLS Verification'"
|
||||||
|
on-change="($ctrl.onChangeTLSSkipVerify)"
|
||||||
|
></por-switch-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-12 form-section-title"> Actions </div>
|
<div class="col-sm-12 form-section-title"> Actions </div>
|
||||||
<!-- #Git buttons -->
|
<!-- #Git buttons -->
|
||||||
<button
|
<button
|
||||||
|
@ -61,6 +74,7 @@
|
||||||
</span>
|
</span>
|
||||||
<span ng-show="$ctrl.state.redeployInProgress">In progress...</span>
|
<span ng-show="$ctrl.state.redeployInProgress">In progress...</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="btn btn-sm btn-primary"
|
class="btn btn-sm btn-primary"
|
||||||
ng-click="$ctrl.saveGitSettings()"
|
ng-click="$ctrl.saveGitSettings()"
|
||||||
|
|
|
@ -55,6 +55,7 @@ class StackRedeployGitFormController {
|
||||||
this.onChangeEnvVar = this.onChangeEnvVar.bind(this);
|
this.onChangeEnvVar = this.onChangeEnvVar.bind(this);
|
||||||
this.onChangeOption = this.onChangeOption.bind(this);
|
this.onChangeOption = this.onChangeOption.bind(this);
|
||||||
this.onChangeGitAuth = this.onChangeGitAuth.bind(this);
|
this.onChangeGitAuth = this.onChangeGitAuth.bind(this);
|
||||||
|
this.onChangeTLSSkipVerify = this.onChangeTLSSkipVerify.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
buildAnalyticsProperties() {
|
buildAnalyticsProperties() {
|
||||||
|
@ -94,6 +95,10 @@ class StackRedeployGitFormController {
|
||||||
this.onChange({ Env: value });
|
this.onChange({ Env: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onChangeTLSSkipVerify(value) {
|
||||||
|
this.onChange({ TLSSkipVerify: value });
|
||||||
|
}
|
||||||
|
|
||||||
onChangeOption(values) {
|
onChangeOption(values) {
|
||||||
this.onChange({
|
this.onChange({
|
||||||
Option: {
|
Option: {
|
||||||
|
@ -189,6 +194,7 @@ class StackRedeployGitFormController {
|
||||||
|
|
||||||
async $onInit() {
|
async $onInit() {
|
||||||
this.formValues.RefName = this.model.ReferenceName;
|
this.formValues.RefName = this.model.ReferenceName;
|
||||||
|
this.formValues.TLSSkipVerify = this.model.TLSSkipVerify;
|
||||||
this.formValues.Env = this.stack.Env;
|
this.formValues.Env = this.stack.Env;
|
||||||
|
|
||||||
if (this.stack.Option) {
|
if (this.stack.Option) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<form name="$ctrl.redeployGitForm" class="form-horizontal my-8">
|
<form name="$ctrl.redeployGitForm" class="form-horizontal my-8">
|
||||||
<div class="col-sm-12 form-section-title"> Redeploy from git repository </div>
|
<div class="col-sm-12 form-section-title"> Redeploy from git repository </div>
|
||||||
|
|
||||||
<git-form-info-panel
|
<git-form-info-panel
|
||||||
class-name="'text-muted small'"
|
class-name="'text-muted small'"
|
||||||
url="$ctrl.model.URL"
|
url="$ctrl.model.URL"
|
||||||
|
@ -17,6 +18,7 @@
|
||||||
webhook-id="{{ $ctrl.state.webhookId }}"
|
webhook-id="{{ $ctrl.state.webhookId }}"
|
||||||
webhooks-docs="https://docs.portainer.io/user/docker/stacks/webhooks"
|
webhooks-docs="https://docs.portainer.io/user/docker/stacks/webhooks"
|
||||||
></git-form-auto-update-fieldset>
|
></git-form-auto-update-fieldset>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<p>
|
<p>
|
||||||
|
@ -37,6 +39,7 @@
|
||||||
is-url-valid="true"
|
is-url-valid="true"
|
||||||
stack-id="$ctrl.gitStackId"
|
stack-id="$ctrl.gitStackId"
|
||||||
></git-form-ref-field>
|
></git-form-ref-field>
|
||||||
|
|
||||||
<git-form-auth-fieldset
|
<git-form-auth-fieldset
|
||||||
ng-if="$ctrl.state.showConfig"
|
ng-if="$ctrl.state.showConfig"
|
||||||
value="$ctrl.formValues"
|
value="$ctrl.formValues"
|
||||||
|
@ -45,12 +48,26 @@
|
||||||
is-auth-edit="$ctrl.state.isAuthEdit"
|
is-auth-edit="$ctrl.state.isAuthEdit"
|
||||||
></git-form-auth-fieldset>
|
></git-form-auth-fieldset>
|
||||||
|
|
||||||
|
<div class="form-group" ng-if="$ctrl.state.showConfig">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<por-switch-field
|
||||||
|
name="TLSSkipVerify"
|
||||||
|
checked="$ctrl.formValues.TLSSkipVerify"
|
||||||
|
tooltip="'Enabling this will allow skipping TLS validation for any self-signed certificate.'"
|
||||||
|
label-class="'col-sm-3 col-lg-2'"
|
||||||
|
label="'Skip TLS Verification'"
|
||||||
|
on-change="($ctrl.onChangeTLSSkipVerify)"
|
||||||
|
></por-switch-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<environment-variables-panel
|
<environment-variables-panel
|
||||||
ng-model="$ctrl.formValues.Env"
|
ng-model="$ctrl.formValues.Env"
|
||||||
explanation="These values will be used as substitutions in the stack file"
|
explanation="These values will be used as substitutions in the stack file"
|
||||||
on-change="($ctrl.onChangeEnvVar)"
|
on-change="($ctrl.onChangeEnvVar)"
|
||||||
show-help-message="true"
|
show-help-message="true"
|
||||||
></environment-variables-panel>
|
></environment-variables-panel>
|
||||||
|
|
||||||
<option-panel ng-if="$ctrl.stack.Type === 1 && $ctrl.endpoint.apiVersion >= 1.27" ng-model="$ctrl.formValues.Option" on-change="($ctrl.onChangeOption)"></option-panel>
|
<option-panel ng-if="$ctrl.stack.Type === 1 && $ctrl.endpoint.apiVersion >= 1.27" ng-model="$ctrl.formValues.Option" on-change="($ctrl.onChangeOption)"></option-panel>
|
||||||
|
|
||||||
<div class="col-sm-12 form-section-title"> Actions </div>
|
<div class="col-sm-12 form-section-title"> Actions </div>
|
||||||
|
|
|
@ -284,6 +284,7 @@ angular.module('portainer.app').factory('StackService', [
|
||||||
RepositoryAuthentication: gitConfig.RepositoryAuthentication,
|
RepositoryAuthentication: gitConfig.RepositoryAuthentication,
|
||||||
RepositoryUsername: gitConfig.RepositoryUsername,
|
RepositoryUsername: gitConfig.RepositoryUsername,
|
||||||
RepositoryPassword: gitConfig.RepositoryPassword,
|
RepositoryPassword: gitConfig.RepositoryPassword,
|
||||||
|
TLSSkipVerify: gitConfig.TLSSkipVerify,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,6 +469,7 @@ angular.module('portainer.app').factory('StackService', [
|
||||||
RepositoryUsername: gitConfig.RepositoryUsername,
|
RepositoryUsername: gitConfig.RepositoryUsername,
|
||||||
RepositoryPassword: gitConfig.RepositoryPassword,
|
RepositoryPassword: gitConfig.RepositoryPassword,
|
||||||
Prune: gitConfig.Option.Prune,
|
Prune: gitConfig.Option.Prune,
|
||||||
|
TLSSkipVerify: gitConfig.TLSSkipVerify,
|
||||||
}
|
}
|
||||||
).$promise;
|
).$promise;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue