Compare commits

..

5 Commits

Author SHA1 Message Date
cmeng
7c2fcb67eb fix(stack) add skip TLS toggle for edit stack EE-5391 (#8850)
Some checks failed
Test / test-client (push) Has been cancelled
2023-04-28 13:35:38 +12:00
matias-portainer
2eb4453487 fix(images): avoid returning null on registryId default value EE-5394 (#8842) 2023-04-26 10:24:49 -03:00
cmeng
535e499cc5 fix(webhook) remove NaN fom webhook url EE-5373 (#8815) 2023-04-21 10:56:59 +12:00
Matt Hook
fee315b07e bump version to 2.18.2 (#8808) 2023-04-20 09:05:18 +12:00
Ali
d1166b5294 fix(editor): fix styles [EE-5369] (#8810)
* fix(editor): fix styles [EE-5369]

* rm hash

---------

Co-authored-by: testa113 <testa113>
2023-04-20 08:27:31 +12:00
16 changed files with 61 additions and 8 deletions

View File

@@ -945,6 +945,6 @@
}
],
"version": {
"VERSION": "{\"SchemaVersion\":\"2.18.1\",\"MigratorCount\":0,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}"
"VERSION": "{\"SchemaVersion\":\"2.18.2\",\"MigratorCount\":0,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}"
}
}

View File

@@ -82,7 +82,7 @@ type Handler struct {
}
// @title PortainerCE API
// @version 2.18.1
// @version 2.18.2
// @description.markdown api-description.md
// @termsOfService

View File

@@ -150,6 +150,7 @@ func createStackPayloadFromSwarmGitPayload(name, swarmID, repoUrl, repoReference
Authentication: repoAuthentication,
Username: repoUsername,
Password: repoPassword,
TLSSkipVerify: repoSkipSSLVerify,
},
ComposeFile: composeFile,
AdditionalFiles: additionalFiles,

View File

@@ -25,6 +25,7 @@ type stackGitUpdatePayload struct {
RepositoryAuthentication bool
RepositoryUsername string
RepositoryPassword string
TLSSkipVerify bool
}
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
stack.GitConfig.ReferenceName = payload.RepositoryReferenceName
stack.GitConfig.TLSSkipVerify = payload.TLSSkipVerify
stack.AutoUpdate = payload.AutoUpdate
stack.Env = payload.Env
stack.UpdatedBy = user.Username

View File

@@ -31,6 +31,7 @@ type kubernetesGitStackUpdatePayload struct {
RepositoryUsername string
RepositoryPassword string
AutoUpdate *portainer.AutoUpdateSettings
TLSSkipVerify bool
}
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.TLSSkipVerify = payload.TLSSkipVerify
stack.AutoUpdate = payload.AutoUpdate
if payload.RepositoryAuthentication {

View File

@@ -1514,7 +1514,7 @@ type (
const (
// APIVersion is the version number of the Portainer API
APIVersion = "2.18.1"
APIVersion = "2.18.2"
// Edition is what this edition of Portainer is called
Edition = PortainerCE
// ComposeSyntaxMaxVersion is a maximum supported version of the docker compose syntax

View File

@@ -45,6 +45,7 @@ class KubernetesRedeployAppGitFormController {
this.onChangeRef = this.onChangeRef.bind(this);
this.onChangeAutoUpdate = this.onChangeAutoUpdate.bind(this);
this.onChangeGitAuth = this.onChangeGitAuth.bind(this);
this.onChangeTLSSkipVerify = this.onChangeTLSSkipVerify.bind(this);
}
onChangeRef(value) {
@@ -68,6 +69,12 @@ class KubernetesRedeployAppGitFormController {
});
}
onChangeTLSSkipVerify(value) {
return this.$async(async () => {
this.onChange({ TLSSkipVerify: value });
});
}
async onChangeAutoUpdate(values) {
return this.$async(async () => {
await this.onChange({
@@ -152,6 +159,7 @@ class KubernetesRedeployAppGitFormController {
$onInit() {
this.formValues.RefName = this.stack.GitConfig.ReferenceName;
this.formValues.TLSSkipVerify = this.stack.GitConfig.TLSSkipVerify;
this.formValues.AutoUpdate = parseAutoUpdateResponse(this.stack.AutoUpdate);

View File

@@ -43,6 +43,19 @@
is-auth-edit="$ctrl.state.isAuthEdit"
></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>
<!-- #Git buttons -->
<button
@@ -61,6 +74,7 @@
</span>
<span ng-show="$ctrl.state.redeployInProgress">In progress...</span>
</button>
<button
class="btn btn-sm btn-primary"
ng-click="$ctrl.saveGitSettings()"

View File

@@ -55,6 +55,7 @@ class StackRedeployGitFormController {
this.onChangeEnvVar = this.onChangeEnvVar.bind(this);
this.onChangeOption = this.onChangeOption.bind(this);
this.onChangeGitAuth = this.onChangeGitAuth.bind(this);
this.onChangeTLSSkipVerify = this.onChangeTLSSkipVerify.bind(this);
}
buildAnalyticsProperties() {
@@ -94,6 +95,10 @@ class StackRedeployGitFormController {
this.onChange({ Env: value });
}
onChangeTLSSkipVerify(value) {
this.onChange({ TLSSkipVerify: value });
}
onChangeOption(values) {
this.onChange({
Option: {
@@ -189,6 +194,7 @@ class StackRedeployGitFormController {
async $onInit() {
this.formValues.RefName = this.model.ReferenceName;
this.formValues.TLSSkipVerify = this.model.TLSSkipVerify;
this.formValues.Env = this.stack.Env;
if (this.stack.Option) {

View File

@@ -1,5 +1,6 @@
<form name="$ctrl.redeployGitForm" class="form-horizontal my-8">
<div class="col-sm-12 form-section-title"> Redeploy from git repository </div>
<git-form-info-panel
class-name="'text-muted small'"
url="$ctrl.model.URL"
@@ -17,6 +18,7 @@
webhook-id="{{ $ctrl.state.webhookId }}"
webhooks-docs="https://docs.portainer.io/user/docker/stacks/webhooks"
></git-form-auto-update-fieldset>
<div class="form-group">
<div class="col-sm-12">
<p>
@@ -37,6 +39,7 @@
is-url-valid="true"
stack-id="$ctrl.gitStackId"
></git-form-ref-field>
<git-form-auth-fieldset
ng-if="$ctrl.state.showConfig"
value="$ctrl.formValues"
@@ -45,12 +48,26 @@
is-auth-edit="$ctrl.state.isAuthEdit"
></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
ng-model="$ctrl.formValues.Env"
explanation="These values will be used as substitutions in the stack file"
on-change="($ctrl.onChangeEnvVar)"
show-help-message="true"
></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>
<div class="col-sm-12 form-section-title"> Actions </div>

View File

@@ -42,7 +42,8 @@ function getBaseUrl() {
const port = parseInt(window.location.port, 10);
const displayPort =
(protocol === 'http' && port === 80) ||
(protocol === 'https' && port === 443)
(protocol === 'https' && port === 443) ||
Number.isNaN(port)
? ''
: `:${port}`;
return `${protocol}://${hostname}${displayPort}${baseHref()}`;

View File

@@ -284,6 +284,7 @@ angular.module('portainer.app').factory('StackService', [
RepositoryAuthentication: gitConfig.RepositoryAuthentication,
RepositoryUsername: gitConfig.RepositoryUsername,
RepositoryPassword: gitConfig.RepositoryPassword,
TLSSkipVerify: gitConfig.TLSSkipVerify,
};
}
@@ -468,6 +469,7 @@ angular.module('portainer.app').factory('StackService', [
RepositoryUsername: gitConfig.RepositoryUsername,
RepositoryPassword: gitConfig.RepositoryPassword,
Prune: gitConfig.Option.Prune,
TLSSkipVerify: gitConfig.TLSSkipVerify,
}
).$promise;
};

View File

@@ -11,7 +11,7 @@ function RegistryModalService(RegistryService) {
const defaultValue = _.get(registryModel, 'Registry.Id', 0);
const registryId = await selectRegistry(registries, defaultValue);
if (!registryId) {
if (registryId === undefined) {
return null;
}

View File

@@ -156,7 +156,7 @@
<code-editor
read-only="orphaned"
identifier="stack-editor"
placeholder="# Define or paste the content of your docker compose file here"
placeholder="Define or paste the content of your docker compose file here"
yml="true"
on-change="(editorUpdate)"
value="stackFileContent"

View File

@@ -72,5 +72,5 @@
}
.root :global(.cm-content[contenteditable='true']) {
@apply h-full;
min-height: 100%;
}

View File

@@ -2,7 +2,7 @@
"author": "Portainer.io",
"name": "portainer",
"homepage": "http://portainer.io",
"version": "2.18.1",
"version": "2.18.2",
"repository": {
"type": "git",
"url": "git@github.com:portainer/portainer.git"