diff --git a/.github/workflows/clustertool.golangci-lint.yaml b/.github/workflows/clustertool.golangci-lint.yaml new file mode 100644 index 0000000000000..d7d304c6ab45c --- /dev/null +++ b/.github/workflows/clustertool.golangci-lint.yaml @@ -0,0 +1,34 @@ +name: golangci-lint +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} +on: + # push: + # branches: + # - main + # tags: + # - "*" + # paths: + # - 'clustertool/**' + # - ".github/workflows/clsutertool.test.yaml" + #pull_request: + # branches: + # - main + # paths: + # - 'clustertool/**' + # - ".github/workflows/clsutertool.test.yaml" +permissions: + contents: read +jobs: + golangci: + name: lint + runs-on: actions-runner-large + steps: + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + with: + go-version: stable + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + - name: golangci-lint + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 + with: + version: latest + args: --timeout 3m0s diff --git a/.github/workflows/clustertool.release.yaml b/.github/workflows/clustertool.release.yaml new file mode 100644 index 0000000000000..d032cb34628c7 --- /dev/null +++ b/.github/workflows/clustertool.release.yaml @@ -0,0 +1,27 @@ +name: goreleaser +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} +on: + push: + tags: + - "*" + paths: + - 'clustertool/**' +jobs: + goreleaser: + runs-on: actions-runner-large + steps: + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + with: + go-version: stable + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + with: + fetch-depth: 0 + - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6 + with: + args: release --clean + distribution: goreleaser # or 'goreleaser-pro' + version: "~> v2" # or 'latest', 'nightly', semver + env: + GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}" + diff --git a/.github/workflows/clustertool.test.yaml b/.github/workflows/clustertool.test.yaml new file mode 100644 index 0000000000000..386f9199ed8a6 --- /dev/null +++ b/.github/workflows/clustertool.test.yaml @@ -0,0 +1,43 @@ +name: clustertool-test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} +on: + push: + branches: + - main + tags: + - "*" + paths: + - 'main.go' + - 'go.mod' + - 'go.sum' + - 'pkg/**' + - 'cmd/**' + - 'clustertool/**' + - ".github/workflows/clsutertool.test.yaml" + pull_request: + branches: + - main + paths: + - 'main.go' + - 'go.mod' + - 'go.sum' + - 'pkg/**' + - 'cmd/**' + - 'clustertool/**' + - ".github/workflows/clsutertool.test.yaml" +permissions: + contents: read +jobs: + build: + runs-on: actions-runner-large + steps: + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + with: + go-version: stable + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + - run: | + cd ./clustertool + go build -o /usr/local/bin/clustertool + go test -v ./... -race -covermode=atomic + clustertool-dev diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34f02f21eae72..f77fe671625a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: - id: check-added-large-files # prevents giant files from being committed. exclude: \.(png|jpg|jpeg|svg|yaml|yml|tpl)$ - id: check-yaml # checks yaml files for parseable syntax. - exclude: (^archive|templates\/.*|crds\/.*|questions.yaml|chart_schema.yaml|test-chart\/.*\.yaml) + exclude: (^archive|templates\/.*|crds\/.*|questions.yaml|chart_schema.yaml|test-chart\/.*\.yaml|^clustertool) - id: detect-private-key # detects the presence of private keys. exclude: ^archive/ @@ -53,5 +53,5 @@ repos: rev: v3.1.0 hooks: - id: prettier - exclude: (^archive|templates\/.*|crds\/.*|README.md|CHANGELOG.md|questions.yaml|devcontainer.json) + exclude: (^archive|templates\/.*|crds\/.*|README.md|CHANGELOG.md|questions.yaml|devcontainer.json|^clustertool) files: \.(js|ts|jsx|tsx|css|less|html|json|markdown|md|yaml|yml)$ diff --git a/DEVTRIGGER b/DEVTRIGGER new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/charts/incubator/pingvin-share/Chart.yaml b/charts/incubator/pingvin-share/Chart.yaml index 045211f6f7431..9e3f035491081 100644 --- a/charts/incubator/pingvin-share/Chart.yaml +++ b/charts/incubator/pingvin-share/Chart.yaml @@ -6,7 +6,7 @@ annotations: truecharts.org/min_helm_version: "3.11" truecharts.org/train: incubator apiVersion: v2 -appVersion: 1.2.0 +appVersion: 1.2.1 dependencies: - name: common version: 25.0.0 @@ -32,4 +32,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/pingvin-share - https://hub.docker.com/r/stonith404/pingvin-share type: application -version: 2.3.0 +version: 2.3.1 diff --git a/charts/incubator/pingvin-share/values.yaml b/charts/incubator/pingvin-share/values.yaml index ed9b7709040a1..f03b73940b5f1 100644 --- a/charts/incubator/pingvin-share/values.yaml +++ b/charts/incubator/pingvin-share/values.yaml @@ -1,7 +1,7 @@ image: repository: stonith404/pingvin-share pullPolicy: IfNotPresent - tag: v1.2.0@sha256:a016d8fb674e59cb6ef17036113cb3f1b64c4614d79e42f68490fc18768ff3aa + tag: v1.2.1@sha256:2639387bc47b8d7a5c0c733e1ad39ba507632d53996ad8714dfbac2622f74b9e securityContext: container: diff --git a/charts/stable/esphome/Chart.yaml b/charts/stable/esphome/Chart.yaml index 07f847091ce98..69f0c9cb6369f 100644 --- a/charts/stable/esphome/Chart.yaml +++ b/charts/stable/esphome/Chart.yaml @@ -6,7 +6,7 @@ annotations: truecharts.org/min_helm_version: "3.11" truecharts.org/train: stable apiVersion: v2 -appVersion: 2024.9.2 +appVersion: 2024.10.0 dependencies: - name: common version: 25.0.0 @@ -32,4 +32,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/esphome - https://hub.docker.com/r/esphome/esphome type: application -version: 21.6.0 +version: 21.7.0 diff --git a/charts/stable/esphome/values.yaml b/charts/stable/esphome/values.yaml index 95e892f329458..f67d62462860f 100644 --- a/charts/stable/esphome/values.yaml +++ b/charts/stable/esphome/values.yaml @@ -1,7 +1,7 @@ image: repository: esphome/esphome pullPolicy: IfNotPresent - tag: 2024.9.2@sha256:ec10ec2b28c1afe792cebdccbeadd8e6dd4a3b0be58b5451128fa6bdc60fccf0 + tag: 2024.10.0@sha256:78f7d125ecff29061cfdc14dc77d60e69532aec6b28680eba19afa72b7ac5640 securityContext: container: runAsNonRoot: false diff --git a/charts/stable/nginx-proxy-manager/Chart.yaml b/charts/stable/nginx-proxy-manager/Chart.yaml index 7e271ba9b0278..99cfb3fa4b995 100644 --- a/charts/stable/nginx-proxy-manager/Chart.yaml +++ b/charts/stable/nginx-proxy-manager/Chart.yaml @@ -6,7 +6,7 @@ annotations: truecharts.org/min_helm_version: "3.11" truecharts.org/train: stable apiVersion: v2 -appVersion: 2.11.3 +appVersion: 2.12.0 dependencies: - name: common version: 25.0.0 @@ -42,4 +42,4 @@ sources: - https://hub.docker.com/r/jc21/nginx-proxy-manager - https://nginxproxymanager.com/ type: application -version: 11.6.2 +version: 11.7.0 diff --git a/charts/stable/nginx-proxy-manager/values.yaml b/charts/stable/nginx-proxy-manager/values.yaml index d7b03a5ab3326..b7c1f5996aceb 100644 --- a/charts/stable/nginx-proxy-manager/values.yaml +++ b/charts/stable/nginx-proxy-manager/values.yaml @@ -1,7 +1,7 @@ image: repository: jc21/nginx-proxy-manager pullPolicy: IfNotPresent - tag: 2.11.3@sha256:e81d01ad119208334ba7adb4986b36ebeb7c727a78732f411e5df84f7c6c50ec + tag: 2.12.0@sha256:15fb87417a36246e30a6c894b437c3aab031b692f59b77245cb61008397b7890 service: main: ports: diff --git a/charts/stable/watcharr/Chart.yaml b/charts/stable/watcharr/Chart.yaml index fbdf4fcc7afa4..abd15231f20a5 100644 --- a/charts/stable/watcharr/Chart.yaml +++ b/charts/stable/watcharr/Chart.yaml @@ -6,7 +6,7 @@ annotations: truecharts.org/min_helm_version: "3.11" truecharts.org/train: stable apiVersion: v2 -appVersion: 1.44.1 +appVersion: 1.44.2 dependencies: - name: common version: 25.0.0 @@ -33,4 +33,4 @@ sources: - https://github.com/sbondCo/Watcharr - https://github.com/truecharts/charts/tree/master/charts/stable/watcharr type: application -version: 6.7.1 +version: 6.7.2 diff --git a/charts/stable/watcharr/values.yaml b/charts/stable/watcharr/values.yaml index c103b990a9765..297ef23b97f48 100644 --- a/charts/stable/watcharr/values.yaml +++ b/charts/stable/watcharr/values.yaml @@ -1,6 +1,6 @@ image: repository: ghcr.io/sbondco/watcharr - tag: v1.44.1@sha256:90c2c58cd0d2d74ada7eaaf0350fb7c928b0d89f0031dc1c93a0bae653fcbe8c + tag: v1.44.2@sha256:85df9a7f4e7cb73d89edf546c9458a096d40d2641c22e36d6ad41aa15da47625 pullPolicy: IfNotPresent securityContext: diff --git a/charts/system/lvm-disk-watcher/LICENSE b/charts/system/lvm-disk-watcher/LICENSE new file mode 100644 index 0000000000000..33a8cbb23f017 --- /dev/null +++ b/charts/system/lvm-disk-watcher/LICENSE @@ -0,0 +1,106 @@ +Business Source License 1.1 + +Parameters + +Licensor: The TrueCharts Project, it's owner and it's contributors +Licensed Work: The TrueCharts "Blocky" Helm Chart +Additional Use Grant: You may use the licensed work in production, as long + as it is directly sourced from a TrueCharts provided + official repository, catalog or source. You may also make private + modification to the directly sourced licenced work, + when used in production. + + The following cases are, due to their nature, also + defined as 'production use' and explicitly prohibited: + - Bundling, including or displaying the licensed work + with(in) another work intended for production use, + with the apparent intend of facilitating and/or + promoting production use by third parties in + violation of this license. + +Change Date: 2050-01-01 + +Change License: 3-clause BSD license + +For information about alternative licensing arrangements for the Software, +please contact: legal@truecharts.org + +Notice + +The Business Source License (this document, or the “License”) is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +“Business Source License” is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Business Source License 1.1 + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark “Business Source License”, +as long as you comply with the Covenants of Licensor below. + +Covenants of Licensor + +In consideration of the right to use this License’s text and the “Business +Source License” name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where “compatible” means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text “None”. + +3. To specify a Change Date. + +4. Not to modify this License in any other way. diff --git a/charttool.LICENSE b/charttool.LICENSE index 8501143454020..33a8cbb23f017 100644 --- a/charttool.LICENSE +++ b/charttool.LICENSE @@ -1,5 +1,106 @@ -ChartTool: -All rights reserved Kjeld Schouten +Business Source License 1.1 -This tool can freely be used for development of Helm charts including the TrueCharts common chart. -This tool cannot be used for commercial purposses without prior explicit permission +Parameters + +Licensor: The TrueCharts Project, it's owner and it's contributors +Licensed Work: The TrueCharts "Blocky" Helm Chart +Additional Use Grant: You may use the licensed work in production, as long + as it is directly sourced from a TrueCharts provided + official repository, catalog or source. You may also make private + modification to the directly sourced licenced work, + when used in production. + + The following cases are, due to their nature, also + defined as 'production use' and explicitly prohibited: + - Bundling, including or displaying the licensed work + with(in) another work intended for production use, + with the apparent intend of facilitating and/or + promoting production use by third parties in + violation of this license. + +Change Date: 2050-01-01 + +Change License: 3-clause BSD license + +For information about alternative licensing arrangements for the Software, +please contact: legal@truecharts.org + +Notice + +The Business Source License (this document, or the “License”) is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +“Business Source License” is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Business Source License 1.1 + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark “Business Source License”, +as long as you comply with the Covenants of Licensor below. + +Covenants of Licensor + +In consideration of the right to use this License’s text and the “Business +Source License” name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where “compatible” means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text “None”. + +3. To specify a Change Date. + +4. Not to modify this License in any other way. diff --git a/clustertool.LICENSE b/clustertool.LICENSE new file mode 100644 index 0000000000000..33a8cbb23f017 --- /dev/null +++ b/clustertool.LICENSE @@ -0,0 +1,106 @@ +Business Source License 1.1 + +Parameters + +Licensor: The TrueCharts Project, it's owner and it's contributors +Licensed Work: The TrueCharts "Blocky" Helm Chart +Additional Use Grant: You may use the licensed work in production, as long + as it is directly sourced from a TrueCharts provided + official repository, catalog or source. You may also make private + modification to the directly sourced licenced work, + when used in production. + + The following cases are, due to their nature, also + defined as 'production use' and explicitly prohibited: + - Bundling, including or displaying the licensed work + with(in) another work intended for production use, + with the apparent intend of facilitating and/or + promoting production use by third parties in + violation of this license. + +Change Date: 2050-01-01 + +Change License: 3-clause BSD license + +For information about alternative licensing arrangements for the Software, +please contact: legal@truecharts.org + +Notice + +The Business Source License (this document, or the “License”) is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +“Business Source License” is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Business Source License 1.1 + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark “Business Source License”, +as long as you comply with the Covenants of Licensor below. + +Covenants of Licensor + +In consideration of the right to use this License’s text and the “Business +Source License” name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where “compatible” means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text “None”. + +3. To specify a Change Date. + +4. Not to modify this License in any other way. diff --git a/clustertool/.gitignore b/clustertool/.gitignore new file mode 100644 index 0000000000000..557670c158d3c --- /dev/null +++ b/clustertool/.gitignore @@ -0,0 +1,20 @@ +.direnv +dist/ +.cr-gpg +tgz_cache +index_cache +clustertool +talconfig.json +/talconfig.yaml +/talenv.yaml +talsecret.yaml +.sops.yaml +/clusterconfig/ +age.agekey +/clusters +/repositories +ssh-public-key.txt +*DS_Store +.DS_Store +/lvm-operator +*.DS_Store \ No newline at end of file diff --git a/clustertool/.vscode/extensions.json b/clustertool/.vscode/extensions.json new file mode 100644 index 0000000000000..bfa3665723424 --- /dev/null +++ b/clustertool/.vscode/extensions.json @@ -0,0 +1,23 @@ +{ + "recommendations": [ + "golang.go", + "redhat.vscode-yaml", + "formulahendry.code-runner", + "streetsidesoftware.code-spell-checker", + "Codium.codium", + "mrmlnc.vscode-duplicate", + "IgorSbitnev.error-gutters", + "usernamehw.errorlens", + "mhutchie.git-graph", + "eamodio.gitlens", + "vivaldy22.go-auto-struct-tag", + "msyrus.go-doc", + "766b.go-outliner", + "premparihar.gotestexplorer", + "yzhang.markdown-all-in-one", + "searKing.preview-vscode", + "zxh404.vscode-proto3", + "DavidAnson.vscode-markdownlint", + "GitHub.copilot" + ] +} \ No newline at end of file diff --git a/clustertool/.vscode/settings.json b/clustertool/.vscode/settings.json new file mode 100644 index 0000000000000..0e0dcd235c497 --- /dev/null +++ b/clustertool/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/clustertool/.vscode/tasks.json b/clustertool/.vscode/tasks.json new file mode 100644 index 0000000000000..eaf4171780a08 --- /dev/null +++ b/clustertool/.vscode/tasks.json @@ -0,0 +1,22 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Install All Recommended Extensions", + "type": "shell", + "windows": { + "command": "foreach ($ext in (Get-Content -Raw .vscode/extensions.json | ConvertFrom-Json).recommendations) { Write-Host Installing $ext; code --install-extension $ext; }" + }, + "linux": { + "command": "cat .vscode/extensions.json | jq .recommendations[] | xargs -n 1 code . --install-extension" + }, + "runOptions": { + "runOn": "folderOpen" + }, + "presentation": { + "reveal": "silent" + }, + "problemMatcher" : [] + }, + ] +} \ No newline at end of file diff --git a/clustertool/DEVTRIGGER b/clustertool/DEVTRIGGER new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/clustertool/LICENSE b/clustertool/LICENSE new file mode 100644 index 0000000000000..33a8cbb23f017 --- /dev/null +++ b/clustertool/LICENSE @@ -0,0 +1,106 @@ +Business Source License 1.1 + +Parameters + +Licensor: The TrueCharts Project, it's owner and it's contributors +Licensed Work: The TrueCharts "Blocky" Helm Chart +Additional Use Grant: You may use the licensed work in production, as long + as it is directly sourced from a TrueCharts provided + official repository, catalog or source. You may also make private + modification to the directly sourced licenced work, + when used in production. + + The following cases are, due to their nature, also + defined as 'production use' and explicitly prohibited: + - Bundling, including or displaying the licensed work + with(in) another work intended for production use, + with the apparent intend of facilitating and/or + promoting production use by third parties in + violation of this license. + +Change Date: 2050-01-01 + +Change License: 3-clause BSD license + +For information about alternative licensing arrangements for the Software, +please contact: legal@truecharts.org + +Notice + +The Business Source License (this document, or the “License”) is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +“Business Source License” is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Business Source License 1.1 + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark “Business Source License”, +as long as you comply with the Covenants of Licensor below. + +Covenants of Licensor + +In consideration of the right to use this License’s text and the “Business +Source License” name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where “compatible” means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text “None”. + +3. To specify a Change Date. + +4. Not to modify this License in any other way. diff --git a/clustertool/README.md b/clustertool/README.md new file mode 100644 index 0000000000000..2790f812c763f --- /dev/null +++ b/clustertool/README.md @@ -0,0 +1,33 @@ +
+ +

clustertool

+ + [![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/truecharts/clustertool?include_prereleases)](https://github.com/truecharts/private/clustertool/releases) + [![GitHub issues](https://img.shields.io/github/issues/truecharts/clustertool)](https://github.com/truecharts/private/clustertool/issues) + +

+ A helper tool to help building TrueCharts helm charts +
+ · + Report Bug + · + Request Feature +

+
+ +## About The Project + +## CLA: Before contributing + +Our CLA applies to this repository as well. + +Please ensure it's signed before submitting a PR: +https://cla-assistant.io/truecharts/charts + +*We use the truecharts/charts link, as CLA assistant does not allow for creating a custom link to a private repository. +However, they all sign the same CLA that applies project-wide* + +## License + +This tool is released as "All Rights reserved" and hence it's code should NOT be shared. This includes binaries that are modified to remove TrueCharts specific code, unless approved by Kjeld Schouten "The Owner". +Those that are invited to have access to repository, are free to edit and use this code for testing purposes, as long as its sourcecode is not shared or saved in-the-cloud. diff --git a/clustertool/changelog.tmpl b/clustertool/changelog.tmpl new file mode 100644 index 0000000000000..031154498272c --- /dev/null +++ b/clustertool/changelog.tmpl @@ -0,0 +1,18 @@ +--- +title: Changelog +pagefind: false +--- + +All history information can be found at [Github History](https://github.com/truecharts/charts/commits/master/charts/{{ .Train }}/{{ .Name }}) + +:::tip + +If you need more than 2 scrolls to find your current version, please consider updating the chart as soon as possible. + +::: +{{ range $key := .SortedVersions }} +## {{ $key }} • [Train: {{ (index $.Versions $key).Train }}] +{{ range $commit := (index $.Versions $key).SortedCommits }} +- {{ printf "%s • [`%s`](https://github.com/truecharts/charts/commit/%s) • [@%s] (%s)" $commit.Message (slice $commit.CommitHash 0 7) $commit.CommitHash $commit.Author.Name $commit.Author.Date -}} +{{ end }} +{{ end -}} diff --git a/clustertool/cmd/adv.go b/clustertool/cmd/adv.go new file mode 100644 index 0000000000000..dddb2c6667090 --- /dev/null +++ b/clustertool/cmd/adv.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "strings" + + "github.com/spf13/cobra" +) + +var advLongHelp = strings.TrimSpace(` +These are all advanced commands that should generally not be needed + +`) + +var adv = &cobra.Command{ + Use: "adv", + Short: "Advanced cluster maintanence commands", + Long: advLongHelp, + SilenceUsage: true, + SilenceErrors: true, +} + +func init() { + RootCmd.AddCommand(adv) +} diff --git a/clustertool/cmd/adv_bootstrap.go b/clustertool/cmd/adv_bootstrap.go new file mode 100644 index 0000000000000..e9aa033342b26 --- /dev/null +++ b/clustertool/cmd/adv_bootstrap.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/gencmd" +) + +var bootstrap = &cobra.Command{ + Use: "bootstrap", + Short: "bootstrap first Talos Node", + Run: bootstrapfunc, +} + +func bootstrapfunc(cmd *cobra.Command, args []string) { + gencmd.RunBootstrap(args) +} + +func init() { + adv.AddCommand(bootstrap) +} diff --git a/clustertool/cmd/adv_fluxbootstrap.go b/clustertool/cmd/adv_fluxbootstrap.go new file mode 100644 index 0000000000000..8af2a45d3c810 --- /dev/null +++ b/clustertool/cmd/adv_fluxbootstrap.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "context" + + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/fluxhandler" +) + +var fluxbootstrap = &cobra.Command{ + Use: "fluxbootstrap", + Short: "Manually bootstrap fluxcd on existing cluster", + Run: func(cmd *cobra.Command, args []string) { + ctx := context.Background() + fluxhandler.FluxBootstrap(ctx) + }, +} + +func init() { + adv.AddCommand(fluxbootstrap) +} diff --git a/clustertool/cmd/adv_health.go b/clustertool/cmd/adv_health.go new file mode 100644 index 0000000000000..1c494b22bf8ce --- /dev/null +++ b/clustertool/cmd/adv_health.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/gencmd" + "github.com/truecharts/private/clustertool/pkg/helper" + "github.com/truecharts/private/clustertool/pkg/sops" +) + +var health = &cobra.Command{ + Use: "health", + Short: "Check Talos Cluster Health", + Run: func(cmd *cobra.Command, args []string) { + if err := sops.DecryptFiles(); err != nil { + log.Info().Msgf("Error decrypting files: %v\n", err) + } + log.Info().Msg("Running Cluster HealthCheck") + healthcmd := gencmd.GenHealth(helper.TalEnv["VIP_IP"]) + gencmd.ExecCmd(healthcmd) + }, +} + +func init() { + adv.AddCommand(health) +} diff --git a/clustertool/cmd/adv_precommit.go b/clustertool/cmd/adv_precommit.go new file mode 100644 index 0000000000000..c6c877b03eef6 --- /dev/null +++ b/clustertool/cmd/adv_precommit.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "os" + + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/sops" +) + +var precommit = &cobra.Command{ + Use: "precommit", + Short: "Runs the PreCommit encryption check", + Run: func(cmd *cobra.Command, args []string) { + if err := sops.CheckFilesAndReportEncryption(true, true); err != nil { + log.Info().Msgf("Error checking files: %v\n", err) + os.Exit(1) + } + }, +} + +func init() { + adv.AddCommand(precommit) +} diff --git a/clustertool/cmd/adv_reset.go b/clustertool/cmd/adv_reset.go new file mode 100644 index 0000000000000..af6a20fc11e7f --- /dev/null +++ b/clustertool/cmd/adv_reset.go @@ -0,0 +1,41 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/gencmd" + "github.com/truecharts/private/clustertool/pkg/sops" +) + +var reset = &cobra.Command{ + Use: "reset", + Short: "Reset Talos Nodes and Kubernetes", + Run: func(cmd *cobra.Command, args []string) { + var extraArgs []string + node := "" + + if len(args) > 1 { + extraArgs = args[1:] + } + if len(args) >= 1 { + node = args[0] + if args[0] == "all" { + node = "" + } + } + + if err := sops.DecryptFiles(); err != nil { + log.Info().Msgf("Error decrypting files: %v\n", err) + } + + log.Info().Msg("Running Cluster node Reset") + + taloscmds := gencmd.GenReset(node, extraArgs) + gencmd.ExecCmds(taloscmds, true) + + }, +} + +func init() { + adv.AddCommand(reset) +} diff --git a/clustertool/cmd/adv_scaleexport.go b/clustertool/cmd/adv_scaleexport.go new file mode 100644 index 0000000000000..c510d0dbf14c4 --- /dev/null +++ b/clustertool/cmd/adv_scaleexport.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/scale" +) + +var scaleexport = &cobra.Command{ + Use: "scaleexport", + Short: "Export SCALE Apps to file", + Run: func(cmd *cobra.Command, args []string) { + scale.ExportApps() + }, +} + +func init() { + adv.AddCommand(scaleexport) +} diff --git a/clustertool/cmd/adv_scalemigrate.go b/clustertool/cmd/adv_scalemigrate.go new file mode 100644 index 0000000000000..201b604e0881c --- /dev/null +++ b/clustertool/cmd/adv_scalemigrate.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/scale" +) + +var scalemigrate = &cobra.Command{ + Use: "scalemigrate", + Short: "Migrate exported SCALE Apps to the Talos Cluster", + Run: func(cmd *cobra.Command, args []string) { + err := scale.ProcessJSONFiles("./truenas_exports") + if err != nil { + log.Info().Msgf("Error: %v", err) + } + }, +} + +func init() { + adv.AddCommand(scalemigrate) +} diff --git a/clustertool/cmd/adv_testcmd.go b/clustertool/cmd/adv_testcmd.go new file mode 100644 index 0000000000000..4c4686a328852 --- /dev/null +++ b/clustertool/cmd/adv_testcmd.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/gencmd" + "github.com/truecharts/private/clustertool/pkg/initfiles" +) + +var testcmd = &cobra.Command{ + Use: "test", + Short: "test run", + Run: func(cmd *cobra.Command, args []string) { + initfiles.LoadTalEnv() + // err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports") + // if err != nil { + // log.Info().Msg("Error:", err) + // } + something := gencmd.GenBootstrap("", []string{}) + log.Info().Msgf("test %v", something) + }, +} + +func init() { + adv.AddCommand(testcmd) +} diff --git a/clustertool/cmd/apply.go b/clustertool/cmd/apply.go new file mode 100644 index 0000000000000..ee5facd531710 --- /dev/null +++ b/clustertool/cmd/apply.go @@ -0,0 +1,78 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/gencmd" + "github.com/truecharts/private/clustertool/pkg/helper" + "github.com/truecharts/private/clustertool/pkg/nodestatus" + "github.com/truecharts/private/clustertool/pkg/sops" +) + +var apply = &cobra.Command{ + Use: "apply", + Short: "apply TalosConfig", + Run: func(cmd *cobra.Command, args []string) { + var extraArgs []string + node := "" + + if len(args) > 1 { + extraArgs = args[1:] + } + if len(args) >= 1 { + node = args[0] + if args[0] == "all" { + node = "" + } + } + + if err := sops.DecryptFiles(); err != nil { + log.Info().Msgf("Error decrypting files: %v\n", err) + } + + bootstrapcmds := gencmd.GenBootstrap("", extraArgs) + bootstrapNode := helper.ExtractNode(bootstrapcmds) + + log.Info().Msgf("Checking if first node is ready to recieve anything... %s", bootstrapNode) + status, err := nodestatus.WaitForHealth(bootstrapNode, []string{"running", "maintenance"}) + if err != nil { + + } else if status == "maintenance" { + bootstrapNeeded, err := nodestatus.CheckNeedBootstrap(bootstrapNode) + if err != nil { + + } else if bootstrapNeeded { + log.Info().Msg("First Node requires to be bootstrapped before it can be used.") + if helper.GetYesOrNo("Do you want to bootstrap now? (yes/no) [y/n]: ") { + gencmd.RunBootstrap(extraArgs) + if helper.GetYesOrNo("Do you want to apply config to all remaining clusternodes as well? (yes/no) [y/n]: ") { + RunApply("", extraArgs) + } + } else { + log.Info().Msg("Exiting bootstrap, as apply is not possible...") + } + + } else { + log.Info().Msg("Detected maintenance mode, but first node does not require to be bootrapped.") + log.Info().Msg("Assuming apply is requested... continuing with Apply...") + RunApply(node, extraArgs) + } + + } else if status == "running" { + log.Info().Msg("Apply: running first controlnode detected, continuing...") + RunApply(node, extraArgs) + } + }, +} + +func RunApply(node string, extraArgs []string) { + taloscmds := gencmd.GenApply(node, extraArgs) + gencmd.ExecCmds(taloscmds, true) + + kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"]) + gencmd.ExecCmd(kubeconfigcmds) +} + +func init() { + RootCmd.AddCommand(apply) +} diff --git a/clustertool/cmd/charts.go b/clustertool/cmd/charts.go new file mode 100644 index 0000000000000..db653d2c2e644 --- /dev/null +++ b/clustertool/cmd/charts.go @@ -0,0 +1,31 @@ +package cmd + +import ( + "strings" + + "github.com/spf13/cobra" +) + +var chartsLongHelp = strings.TrimSpace(` +charttool is a tool to help you build TrueCharts Charts + +Workflow: + Create talconfig.yaml file defining your nodes information like so: + + Available commands + > charttool bump 1.2.3 patch + > charttool tagclean soemtag@somedigest + +`) + +var charts = &cobra.Command{ + Use: "charts", + Short: "A tool to help with creating Talos cluster", + Long: chartsLongHelp, + SilenceUsage: true, + SilenceErrors: true, +} + +func init() { + RootCmd.AddCommand(charts) +} diff --git a/clustertool/cmd/charts_bump.go b/clustertool/cmd/charts_bump.go new file mode 100644 index 0000000000000..fcbe987eb61ae --- /dev/null +++ b/clustertool/cmd/charts_bump.go @@ -0,0 +1,23 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/charts/version" +) + +var bumper = &cobra.Command{ + Use: "bump", + Short: "generate a bumped image version", + Example: "charttool bump ", + Args: cobra.ExactArgs(2), + Run: func(cmd *cobra.Command, args []string) { + if err := version.Bump(args[0], args[1]); err != nil { + log.Fatal().Err(err).Msg("failed to bump version") + } + }, +} + +func init() { + charts.AddCommand(bumper) +} diff --git a/clustertool/cmd/charts_deps.go b/clustertool/cmd/charts_deps.go new file mode 100644 index 0000000000000..81faa9472fc99 --- /dev/null +++ b/clustertool/cmd/charts_deps.go @@ -0,0 +1,29 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/charts/deps" + "github.com/truecharts/private/clustertool/pkg/helper" +) + +var depsCmd = &cobra.Command{ + Use: "deps", + Short: "Download, Update and Verify Helm dependencies", + Example: "charttool deps ", + Run: func(cmd *cobra.Command, args []string) { + if err := deps.LoadGPGKey(); err != nil { + log.Fatal().Err(err).Msg("failed to load gpg key") + } + + // Specify the mode (SyncMode or AsyncMode) + mode := helper.SyncMode // Change to helper.SyncMode for synchronous processing + if err := helper.WalkCharts(args, deps.DownloadDeps, "", mode); err != nil { + log.Fatal().Err(err).Msg("failed to update Chart.yaml") + } + }, +} + +func init() { + charts.AddCommand(depsCmd) +} diff --git a/clustertool/cmd/charts_genchangelog.go b/clustertool/cmd/charts_genchangelog.go new file mode 100644 index 0000000000000..2de816597c15e --- /dev/null +++ b/clustertool/cmd/charts_genchangelog.go @@ -0,0 +1,39 @@ +package cmd + +import ( + "github.com/rs/zerolog/log" + + "github.com/spf13/cobra" + "github.com/truecharts/private/clustertool/pkg/charts/changelog" +) + +var genChangelogCmd = &cobra.Command{ + Use: "genchangelog", + Short: "Generate changelog for charts", + Example: "charttool genchangelog