From a8ad7132b64b0d2210605f6b3f55fec4562731e4 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Tue, 20 Jul 2021 10:34:34 -0700 Subject: [PATCH 1/8] Only enable kubeconfig on ready cluster (#3490) --- models/provisioning.cattle.io.cluster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/provisioning.cattle.io.cluster.js b/models/provisioning.cattle.io.cluster.js index 11284033ab..f199f23419 100644 --- a/models/provisioning.cattle.io.cluster.js +++ b/models/provisioning.cattle.io.cluster.js @@ -61,7 +61,7 @@ export default { label: 'Download KubeConfig', icon: 'icon icon-download', bulkable: true, - enabled: this.$rootGetters['isRancher'], + enabled: this.$rootGetters['isRancher'] && this.mgmt?.isReady, }); insertAt(out, idx++, { From 731f3021e481e321803ce771993b7527b9d72775 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Thu, 22 Jul 2021 14:37:01 -0700 Subject: [PATCH 2/8] Default Azure cloud creds to public environment --- cloud-credential/azure.vue | 81 +++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 45 deletions(-) diff --git a/cloud-credential/azure.vue b/cloud-credential/azure.vue index de9263312d..191bb73493 100644 --- a/cloud-credential/azure.vue +++ b/cloud-credential/azure.vue @@ -9,6 +9,10 @@ export default { mixins: [CreateEditView], data() { + if ( !this.value.decodedData.environment ) { + this.value.setData('environment', 'AzurePublicCloud'); + } + return { azureEnvironments }; }, @@ -22,9 +26,6 @@ export default { 'value.decodedData.subscriptionId'(neu) { this.$emit('validationChanged', !!neu); }, - 'value.decodedData.tenantId'(neu) { - this.$emit('validationChanged', !!neu); - }, 'value.decodedData.environment'(neu) { this.$emit('validationChanged', !!neu); }, @@ -36,7 +37,6 @@ export default { clientId, clientSecret, subscriptionId, - tenantId, } = this.value.decodedData; try { @@ -47,7 +47,6 @@ export default { clientId, clientSecret, subscriptionId, - tenantId, }, }); @@ -62,46 +61,6 @@ export default { From 1c9133c5ce1c279dcdd1031280eb078c68f51eaa Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Fri, 23 Jul 2021 13:04:23 -0700 Subject: [PATCH 3/8] EC2 pools must select a network (#3306) --- machine-config/amazonec2.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/machine-config/amazonec2.vue b/machine-config/amazonec2.vue index 7eb83789b8..f2c8c320a8 100644 --- a/machine-config/amazonec2.vue +++ b/machine-config/amazonec2.vue @@ -345,6 +345,16 @@ export default { this.$set(this.value, 'tags', ary.join(',')); }, + + test() { + const errors = []; + + if (!this.selectedNetwork) { + errors.push(this.t('validation.required', { key: 'VPC/Subnet' }, true)); + } + + return { errors }; + }, }, }; From b3e71bdf183ce2e55c61594c342da59965436ebf Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Mon, 26 Jul 2021 15:19:00 -0700 Subject: [PATCH 4/8] Default to RKE1 provisioning --- store/prefs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/prefs.js b/store/prefs.js index 65ddd9c258..ca1bf01c71 100644 --- a/store/prefs.js +++ b/store/prefs.js @@ -95,7 +95,7 @@ export const HIDE_HOME_PAGE_CARDS = create('home-page-cards', {}, { parseJSON } export const _RKE1 = 'rke1'; export const _RKE2 = 'rke2'; -export const PROVISIONER = create('provisioner', _RKE2, { options: [_RKE1, _RKE2] }); +export const PROVISIONER = create('provisioner', _RKE1, { options: [_RKE1, _RKE2] }); // Promo for Cluster Tools feature on Cluster Dashboard page export const CLUSTER_TOOLS_TIP = create('hide-cluster-tools-tip', false, { parseJSON }); From 72d131895301121ce065a755fe3dfc9234f6e586 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Wed, 28 Jul 2021 11:06:31 -0700 Subject: [PATCH 5/8] Disable clone on node and node accessories (#3541) --- models/cluster.x-k8s.io.machine.js | 4 ++++ models/cluster/node.js | 4 ++++ models/management.cattle.io.node.js | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/models/cluster.x-k8s.io.machine.js b/models/cluster.x-k8s.io.machine.js index c26b99a91d..fb87cc341c 100644 --- a/models/cluster.x-k8s.io.machine.js +++ b/models/cluster.x-k8s.io.machine.js @@ -30,6 +30,10 @@ export default { return out; }, + canClone() { + return false; + }, + openSsh() { return () => { this.$dispatch('wm/open', { diff --git a/models/cluster/node.js b/models/cluster/node.js index 120ada3244..160a569b71 100644 --- a/models/cluster/node.js +++ b/models/cluster/node.js @@ -383,6 +383,10 @@ export default { return true; }, + canClone() { + return false; + }, + // You need to preload CAPI.MACHINEs to use this provisionedMachine() { const namespace = this.metadata?.annotations?.[CAPI_ANNOTATIONS.CLUSTER_NAMESPACE]; diff --git a/models/management.cattle.io.node.js b/models/management.cattle.io.node.js index 48d998885e..ae82db7535 100644 --- a/models/management.cattle.io.node.js +++ b/models/management.cattle.io.node.js @@ -85,6 +85,9 @@ export default { id: this.namespace } }; - } + }, + canClone() { + return false; + }, }; From 9aada674856fd90f7365b76c80b509ad92d6aa09 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Thu, 29 Jul 2021 10:49:57 -0700 Subject: [PATCH 6/8] Preserve whitespace on opaque secret values --- components/form/KeyValue.vue | 10 +++++++++- edit/secret/generic.vue | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/form/KeyValue.vue b/components/form/KeyValue.vue index 90a22d1217..6c09d6cf84 100644 --- a/components/form/KeyValue.vue +++ b/components/form/KeyValue.vue @@ -123,6 +123,10 @@ export default { type: Boolean, default: true, }, + valueTrim: { + type: Boolean, + default: true, + }, valueBase64: { type: Boolean, default: false, @@ -373,7 +377,11 @@ export default { if (value && typeOf(value) === 'object') { out[key] = JSON.parse(JSON.stringify(value)); } else { - value = (value || '').trim(); + value = value || ''; + + if ( this.valueTrim ) { + value = value.trim(); + } if ( value && this.valueBase64 ) { value = base64Encode(value); diff --git a/edit/secret/generic.vue b/edit/secret/generic.vue index 90fe0a4418..3d0faff851 100644 --- a/edit/secret/generic.vue +++ b/edit/secret/generic.vue @@ -53,6 +53,7 @@ export default { :mode="mode" :initial-empty-row="true" :value-base64="true" + :value-trim="false" :value-concealed="isView && hideSensitiveData" :file-modifier="fileModifier" read-icon="" From 5ec2a77dcd8f13439651fbfed6754480119574dc Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Thu, 29 Jul 2021 10:50:38 -0700 Subject: [PATCH 7/8] Bootstrap password cleanup, simplify setup --- assets/translations/en-us.yaml | 36 +++---- components/CopyCode.vue | 16 +++- components/form/Checkbox.vue | 45 +++++---- config/settings.js | 6 +- mixins/brand.js | 2 +- pages/auth/login.vue | 38 ++++++-- pages/auth/setup.vue | 168 ++++++++++++++++----------------- store/i18n.js | 7 +- 8 files changed, 183 insertions(+), 135 deletions(-) diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index c0dbe21fcf..f0a403a5be 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -307,7 +307,7 @@ authConfig: 5: 'Upload the downloaded JSON file in the OAuth credentials box.' 3: title: 'Create Service Account credentials' - introduction: 'Follow this guide to:' + introduction: 'Follow this guide to:' body: 1: Create a service account. 2: Generate a key for the service account. @@ -818,7 +818,7 @@ cis: alertNeeded: |- Alerting must be enabled within the CIS chart values.yaml. This requires that the {vendor} Monitoring and Alerting app is installed - and the Receivers and Routes are configured to send out alerts. + and the Receivers and Routes are configured to send out alerts. alertOnComplete: Alert on scan completion alertOnFailure: Alert on scan failure benchmarkVersion: Benchmark Version @@ -2276,7 +2276,7 @@ monitoring: keyFilePath: label: Key File Path placeholder: e.g. ./key-file.pfx - secretsBanner: The file paths below must be referenced in
alertmanager.alertmanagerSpec.secrets
when deploying the Monitoring chart. For more information see our documentation. + secretsBanner: The file paths below must be referenced in
alertmanager.alertmanagerSpec.secrets
when deploying the Monitoring chart. For more information see our documentation. route: fields: @@ -2292,7 +2292,7 @@ monitoring: stepTitle: Uninstall V1 stepSubtext: Uninstall Previous Monitoring warning1: V1 Monitoring is currently deployed. This needs to be uninstalled before V2 monitoring can be installed. - warning2: Learn more about the migration steps to V2 Monitoring. + warning2: Learn more about the migration steps to V2 Monitoring. promptDescription:
You are attempting to uninstall V1 Monitoring. Please ensure you have read the migration steps.
success1: V1 monitoring successfully uninstalled. success2: Press Next to continue @@ -3402,24 +3402,26 @@ servicesPage: label: Service Type setup: + currentPassword: Bootstrap Password confirmPassword: Confirm New Password - defaultPasswordError: It looks like this is your first time visiting the Rancher UI; you will need to log in to the local admin account to continue to the setup process.

If the admin password wasn't preset with an environment variable during installation, one has been randomly generated for you and may be found in your install logs. Alternatively follow the instructions here to reset the admin password. + defaultPassword: + intro: It looks like this is your first time visiting {vendor}; if you pre-set your own bootstrap password, enter it here. Otherwise a random one has been generated for you.

+ dockerPrefix: 'For a "docker run" installation:' + dockerCmd: 'docker logs container-id 2>&1 | grep "Bootstrap Password:"' + dockerPs: 'Find your container ID with docker ps, then run:' + dockerSuffix: "" + helmPrefix: 'For a Helm installation, run:' + helmCmd: "kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{.data.bootstrapPassword|base64decode}}{{\"\\n\"}}'" + helmSuffix: "" eula: I agree to the terms and conditions for using Rancher. newPassword: New Password newUserSetPassword: The first order of business is to set a strong password. We suggest using this random one generated just for you, but enter your own if you like. serverUrl: label: Server URL skip: Skip - tip: What URL should be used for this Rancher installation? All the nodes in your clusters will need to be able to reach this. You can skip setting this for now, and update it later in General Settings>Advanced Settings. + tip: What URL should be used for this {vendor} installation? All the nodes in your clusters will need to be able to reach this. setPassword: The first order of business is to set a strong password for the default {username} user. We suggest using this random one generated just for you, but enter your own if you like. - telemetry: - label: Allow collection of anonymous statistics to help us improve Rancher - tip: 'Rancher Labs would like to collect a bit of anonymized information - about the configuration of your installation to help make Rancher better. - Your data will not be shared with anyone else, and no information about - what specific resources or endpoints you are deploying is included. - Once enabled you can view exactly what data will be sent at /v1-telemetry. - More Info' + telemetry: Allow collection of anonymous statistics to help us improve {vendor}. useManual: Set a specific password to use useRandom: Use a randomly generated password welcome: Welcome to {vendor}! @@ -4988,13 +4990,13 @@ embedding: v1ClusterTools: monitoring: label: Monitoring (Legacy) - description: 'Legacy V1 monitoring. V1 Monitoring is deprecated since Rancher 2.5.0. Learn more about the migration steps to V2 Monitoring.' + description: 'Legacy V1 monitoring. V1 Monitoring is deprecated since Rancher 2.5.0. Learn more about the migration steps to V2 Monitoring.' logging: label: Logging (Legacy) - description: 'Legacy V1 logging. V1 Logging is deprecated since Rancher 2.5.0. Learn more about migrating to V2 Logging.' + description: 'Legacy V1 logging. V1 Logging is deprecated since Rancher 2.5.0. Learn more about migrating to V2 Logging.' istio: label: Istio (Legacy) - description: 'Legacy V1 Istio. Istio v1.5 has been deprecated since Rancher 2.5.0. Learn more about migrating to the latest version.' + description: 'Legacy V1 Istio. Istio v1.5 has been deprecated since Rancher 2.5.0. Learn more about migrating to the latest version.' legacy: alerts: Alerts diff --git a/components/CopyCode.vue b/components/CopyCode.vue index e28ecdcc0b..11f340b295 100644 --- a/components/CopyCode.vue +++ b/components/CopyCode.vue @@ -1,4 +1,16 @@