diff --git a/.charted.hcl b/.charted.hcl new file mode 100644 index 0000000..962db52 --- /dev/null +++ b/.charted.hcl @@ -0,0 +1,44 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +charted { + # view https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements + # to see what `~` is meant since `charted-helm-plugin` uses Cargo's SemVer implementation. + version = "~ 0.1-beta" + helm = "~ 3.12" +} + +registry "default" { + version = 1 + url = "https://charts.noelware.org/api" +} + +repository "charted-server" { + registry = registry.default + source = "${cwd}/charts/charted" + path = "charted/server" +} + +repository "charted-emails" { + registry = registry.default + source = "${cwd}/charts/emails" + path = "charted/emails" +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..c17ed1d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +{ + "name": "charted-server", + "remoteUser": "noel", + "image": "ghcr.io/auguwu/coder-images/base", + "containerUser": "noel", + "customizations": { + "vscode": { + "extensions": ["redhat.vscode-yaml", "hashicorp.hcl"], + "settings": { + "dotfiles.installCommand": "bootstrap.sh", + "dotfiles.repository": "https://github.com/auguwu/.dotfiles" + } + } + }, + "features": { + "ghcr.io/devcontainers/features/sshd:1": { + "version": "latest" + } + } +} diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..9c62d52 --- /dev/null +++ b/.envrc @@ -0,0 +1,35 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" +fi + +# make .direnv if it doesn't exist +mkdir -p "$(direnv_layout_dir)" + +watch_file shell.nix +watch_file flake.nix +watch_file flake.lock + +# try to use flakes, if it fails use normal nix (ie. shell.nix) +use flake || use nix +eval "$shellHook" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..dab0f1b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @auguwu @IceeMC @spotlightishere diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..83592fc --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at **team@noelware.org**. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..b2f0c99 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1 @@ +coming soon near a gay dog diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 0000000..9d4645c --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,98 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +name: CI +on: + workflow_dispatch: {} + push: + branches: + - 'issues/gh-**' + - 'feat/**' + - main + paths-ignore: + - '.github/**' + - '.coder/**' + - '.devcontainer/**' + - '.vscode/**' + - 'docs/**' + - 'scripts/**' + - '.*ignore' + - '**.md' + - renovate.json + - LICENSE + pull_request: + types: [opened, synchronize] + branches: + - main + paths-ignore: + - '.coder/**' + - '.devcontainer/**' + - '.vscode/**' + - 'docs/**' + - '.*ignore' + - '**.md' + - renovate.json + - LICENSE +jobs: + ci: + name: helm test [${{matrix.chart}}; Kubernetes ${{matrix.kubernetes}}] + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + chart: [charted, emails] + kubernetes: [v1.26.13, v1.28.6, v1.29.1] + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup Helm + uses: Azure/setup-helm@v3 + + - name: Setup Minikube cluster + uses: medyagh/setup-minikube@v0.0.14 + with: + kubernetes-version: ${{matrix.kubernetes}} + container-runtime: containerd + minikube-version: 1.32.0 + start-args: '--delete-on-failure --profile=helm-test' + memory: 4000m + addons: ingress + cache: true + cpus: 4 + wait: true + cni: bridge + + - name: Lint + working-directory: ./charts/${{matrix.chart}} + run: helm lint + + # - name: Install chart + # working-directory: ./charts/${{matrix.chart}} + # run: helm install ${{matrix.chart}} --namespace ci --create-namespace --wait --atomic + + # - name: Test + # working-directory: ./charts/${{matrix.chart}} + # run: helm test + + - name: Delete cluster (since we're done) + if: ${{ always() }} + run: minikube delete --profile=helm-test diff --git a/.github/workflows/UpdateValues.yaml b/.github/workflows/UpdateValues.yaml new file mode 100644 index 0000000..eb4753c --- /dev/null +++ b/.github/workflows/UpdateValues.yaml @@ -0,0 +1,52 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +name: Update Values +on: + workflow_dispatch: {} + push: + paths: + - './charts/**/values.yaml' +jobs: + update-values: + name: Update README.md for `values.yaml` parameters + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + + - name: Write values.yaml into README + run: ./scripts/emit-values + + - name: Prettier! + run: bunx prettier --config=${GITHUB_WORKSPACE}/.prettierrc.json --write charts/**/README.md + + - name: Commit! + uses: EndBug/add-and-commit@v9 + with: + author_name: Noel[bot] + default_author: user_info + author_email: noelbot@users.noreply.github.com + message: '[skip ci] :sparkles: Update Protobufs in repository' + push: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..18d6a3e --- /dev/null +++ b/.gitignore @@ -0,0 +1,508 @@ +### Helm ### +# Chart dependencies +**/charts/*.tgz + +### JetBrains+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +*.code-workspace + +# Local History for Visual Studio Code + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +### VisualStudio Patch ### +# Additional files built by Visual Studio + +.direnv/ +.cache/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..1f4372b --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "semi": true, + "tabWidth": 4, + "singleQuote": true, + "endOfLine": "lf", + "printWidth": 120, + "trailingComma": "none", + "bracketSpacing": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..733ef09 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "editor.tabSize": 4, + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[yaml]": { + "editor.defaultFormatter": "redhat.vscode-yaml" + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d52cee8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023-2024 Noelware, LLC. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..681b497 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# 🐻‍❄️🪻 Helm Charts for `charted` + +> _Helm Charts available for Noelware's charted project_ + +This is the way to deploy [charted-server](https://github.com/charted-dev/charted) and [charted-emails](https://github.com/charted-dev/emails) on Kubernetes with Helm. + +> [!IMPORTANT] +> All Helm charts require the Kubernetes API to be v1.26 or higher and Helm v3.12 or higher to be used. + +| Helm Chart | Version | +| :--------------------------------------------------------- | :----------------------------- | +| [`charted-server`](https://github.com/charted-dev/charted) | [v0.1.0-beta][charted-release] | +| [`charted-emails`](https://github.com/charted-dev/emails) | [v0.2.0][emails-release] | + +## License + +Helm charts are released under the **MIT License** while `charted-server` and `charted-emails` are both released by the **Apache 2.0** License with love and care by Noelware, LLC.! :purple_heart: + +Please read the `LICENSE` files in for the software and the [repository](/LICENSE) for more information on what you can do with the source code. + +[charted-release]: https://github.com/charted-dev/charted/releases/0.1.0-beta +[emails-release]: https://github.com/charted-dev/emails/releases/0.2.0 diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..1066024 Binary files /dev/null and b/bun.lockb differ diff --git a/charts/charted/Chart.lock b/charts/charted/Chart.lock new file mode 100644 index 0000000..a238080 --- /dev/null +++ b/charts/charted/Chart.lock @@ -0,0 +1,12 @@ +dependencies: +- name: common + repository: oci://registry-1.docker.io/bitnamicharts + version: 2.14.1 +- name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 13.4.4 +- name: redis + repository: oci://registry-1.docker.io/bitnamicharts + version: 18.12.0 +digest: sha256:e5f9486553eb55bbd0a8ad5132ad55eec2f26c1b7d46d8bca6d5786ec4a8e082 +generated: "2024-02-02T10:17:42.918872232-08:00" diff --git a/charts/charted/Chart.yaml b/charts/charted/Chart.yaml new file mode 100644 index 0000000..2a5790f --- /dev/null +++ b/charts/charted/Chart.yaml @@ -0,0 +1,72 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +kubeVersion: ">=1.26" +description: "📦 Free, open source, and reliable Helm Chart registry made in Rust" +apiVersion: v2 + +# renovate: datasource=github-tags version=charted-dev/charted +appVersion: 0.1.0-beta +version: 0.1.0 +type: application +home: https://charts.noelware.org +name: charted-server +icon: https://cdn.noelware.org/branding/charted.svg +sources: + - https://github.com/charted-dev/charted + - https://github.com/charted-dev/helm-charts +keywords: + - helm-chart + - chart-registry + - registry +maintainers: + - name: Noelware, LLC. + email: team@noelware.org + url: https://noelware.org + - name: Noel Towa + email: cutie@floofy.dev + url: https://floofy.dev + - name: Spotlight + email: spotlight@joscomputing.space + url: https://joscomputing.space + - name: John Burke + email: winter@winterfox.tech + url: https://winterfox.tech +annotations: + charts.noelware.org/licenses: Apache-2.0 + charts.noelware.org/categories: Registry + charts.noelware.org/owners: |- + - user: noel + maintainer: Noel Towa + - organization: noelware + maintainer: Noelware, LLC. +dependencies: + - name: common + version: 2.14.1 + repository: oci://registry-1.docker.io/bitnamicharts + - name: postgresql + version: 13.4.4 + repository: oci://registry-1.docker.io/bitnamicharts + condition: external.postgresql.enabled + - name: redis + version: 18.12.0 + repository: oci://registry-1.docker.io/bitnamicharts + condition: external.redis.enabled diff --git a/charts/charted/README.md b/charts/charted/README.md new file mode 100644 index 0000000..8eb330b --- /dev/null +++ b/charts/charted/README.md @@ -0,0 +1,57 @@ +# 🐻‍❄️🪻 Helm Chart for `charted-server` + +This is the Helm Chart to install [charted-server](https://github.com/charted-dev/charted) on Kubernetes with Helm. + +## Requirements + +- Kubernetes v1.26 or higher +- Helm 3.12 or higher + +## Installation + +```shell +$ helm repo add charted https://charts.noelware.org/~/charted +$ helm install emails charted/server --namespace charted --create-namespace +``` + +## Parameters + +### Global Parameters + +Contains any global parameters that will affected all objects in the `youtrack` Helm chart. + +| Name | Description | Value | +| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | +| `global.replicas` | Amount of replicas to spawn | `1` | +| `global.resources` | Resource list to apply to all containers. | `{}` | +| `global.fullNameOverride` | String to fully override the Helm installation name for all objects | `""` | +| `global.nameOverride` | String to override the Helm installation name for all objects, will be in conjunction with a prefix of `-` | `""` | +| `global.clusterDomain` | Domain host that maps to the cluster | `cluster.local` | +| `global.nodeSelector` | Selector labels to apply to contraint the pods to specific nodes. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector). | `{}` | +| `global.tolerations` | List of all taints/tolerations to apply in conjunction with `global.affinity`. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration) | `[]` | +| `global.affinity` | Map of all the affinity to apply to the spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/). | `{}` | +| `global.annotations` | Map of annotations to append to on all objects that this Helm chart creates. | `{}` | +| `global.extraEnvVars` | List of extra environment variables to append to all init/sidecar containers and normal containers. | `[]` | +| `global.initContainers` | List of init containers to create. | `[]` | +| `global.podSecurityContext` | Security context for all spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). | `{}` | +| `global.containerSecurityContext` | Security context for all init, sidecar, and normal containers. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). | `{}` | + +### Docker Image Parameters + +Parameters to modify the Docker image that is ran. + +| Name | Description | Value | +| ------------------ | --------------------------------------------------------------------------------------------------------------- | ------------------- | +| `image.pullPolicy` | [Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) when pulling the image. | `""` | +| `image.registry` | Registry URL to point to. For Docker Hub, use an empty string. | `cr.noelware.cloud` | +| `image.image` | Image name. | `charted/server` | +| `image.tag` | The tag of the image. Keep this as a empty string if you wish to use the default app's version. | `""` | +| `image.digest` | Digest in the form of `:`, this will replace the `image.tag` property if this is not empty. | `""` | + +### Service Account Parameters + +| Name | Description | Value | +| ---------------------------- | ------------------------------------------------------------------------------------------ | ------ | +| `serviceAccount.create` | Whether or not if the service account should be created for this Helm installation. | `true` | +| `serviceAccount.annotations` | Any additional annotations to append to this ServiceAccount | `{}` | +| `serviceAccount.name` | The name of the service account, this will be the Helm installation name if this is empty. | `""` | diff --git a/charts/charted/templates/NOTES.txt b/charts/charted/templates/NOTES.txt new file mode 100644 index 0000000..e69de29 diff --git a/charts/charted/templates/helpers.tpl b/charts/charted/templates/helpers.tpl new file mode 100644 index 0000000..e69de29 diff --git a/charts/charted/values.yaml b/charts/charted/values.yaml new file mode 100644 index 0000000..823387b --- /dev/null +++ b/charts/charted/values.yaml @@ -0,0 +1,87 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +## @section Global Parameters +## @descriptionStart +## Contains any global parameters that will affected all objects in the `youtrack` Helm chart. +## @descriptionEnd +## +## @param global.replicas Amount of replicas to spawn +## @param global.resources Resource list to apply to all containers. +## @param global.fullNameOverride String to fully override the Helm installation name for all objects +## @param global.nameOverride String to override the Helm installation name for all objects, will be in conjunction with a prefix of `-` +## @param global.clusterDomain Domain host that maps to the cluster +## @param global.nodeSelector Selector labels to apply to contraint the pods to specific nodes. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector). +## @param global.tolerations List of all taints/tolerations to apply in conjunction with `global.affinity`. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration) +## @param global.affinity Map of all the affinity to apply to the spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/). +## @param global.annotations Map of annotations to append to on all objects that this Helm chart creates. +## @param global.extraEnvVars List of extra environment variables to append to all init/sidecar containers and normal containers. +## @param global.initContainers List of init containers to create. +## @param global.podSecurityContext Security context for all spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). +## @param global.containerSecurityContext Security context for all init, sidecar, and normal containers. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). +global: + replicas: 1 + fullNameOverride: "" + nameOverride: "" + clusterDomain: cluster.local + nodeSelector: {} + tolerations: [] + affinity: {} + annotations: {} + extraEnvVars: [] + initContainers: [] + podSecurityContext: {} + containerSecurityContext: {} + resources: + {} + ## Example: + ## limits: + ## memory: 2Gi + ## cpu: 1500m + ## requests: + ## memory: 512Mi + ## cpu: 150m + +## @section Docker Image Parameters +## @descriptionStart +## Parameters to modify the Docker image that is ran. +## @descriptionEnd +## +## @param image.pullPolicy [string] [Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) when pulling the image. +## @param image.registry Registry URL to point to. For Docker Hub, use an empty string. +## @param image.image Image name. +## @param image.tag The tag of the image. Keep this as a empty string if you wish to use the default app's version. +## @param image.digest Digest in the form of `:`, this will replace the `image.tag` property if this is not empty. +image: + pullPolicy: IfNotPresent + registry: cr.noelware.cloud + image: charted/server + tag: "" # keep empty for the app version + digest: "" + +## @section Service Account Parameters +## @param serviceAccount.create Whether or not if the service account should be created for this Helm installation. +## @param serviceAccount.annotations Any additional annotations to append to this ServiceAccount +## @param serviceAccount.name The name of the service account, this will be the Helm installation name if this is empty. +serviceAccount: + create: true + annotations: {} + name: "" diff --git a/charts/emails/Chart.lock b/charts/emails/Chart.lock new file mode 100644 index 0000000..2336a47 --- /dev/null +++ b/charts/emails/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: oci://registry-1.docker.io/bitnamicharts + version: 2.14.1 +digest: sha256:c18e87191d35e805a40a45ba75edb912efc98d6e54bc2ff466294f93d0218382 +generated: "2024-02-02T10:20:49.337134114-08:00" diff --git a/charts/emails/Chart.yaml b/charts/emails/Chart.yaml new file mode 100644 index 0000000..5f4df1f --- /dev/null +++ b/charts/emails/Chart.yaml @@ -0,0 +1,57 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +kubeVersion: ">=1.26" +description: "📦 Free, open source, and reliable Helm Chart registry made in Rust" +apiVersion: v2 + +# renovate: datasource=github-tags version=charted-dev/emails +appVersion: 0.2.0 +version: 0.1.0 +type: application +home: https://charts.noelware.org +name: charted-emails +icon: https://cdn.noelware.org/branding/charted.svg +sources: + - https://github.com/charted-dev/emails + - https://github.com/charted-dev/helm-charts +keywords: + - email-service + - grpc +maintainers: + - name: Noelware, LLC. + email: team@noelware.org + url: https://noelware.org + - name: Noel Towa + email: cutie@floofy.dev + url: https://floofy.dev +annotations: + charts.noelware.org/licenses: Apache-2.0 + charts.noelware.org/categories: RpcService + charts.noelware.org/owners: |- + - user: noel + maintainer: Noel Towa + - organization: noelware + maintainer: Noelware, LLC. +dependencies: + - name: common + version: 2.14.1 + repository: oci://registry-1.docker.io/bitnamicharts diff --git a/charts/emails/README.md b/charts/emails/README.md new file mode 100644 index 0000000..7708a40 --- /dev/null +++ b/charts/emails/README.md @@ -0,0 +1,57 @@ +# 🐻‍❄️🪻 Helm Chart for `charted-emails` + +This is the Helm Chart to install [charted-emails](https://github.com/charted-dev/emails) on Kubernetes with Helm. + +## Requirements + +- Kubernetes v1.26 or higher +- Helm 3.12 or higher + +## Installation + +```shell +$ helm repo add charted https://charts.noelware.org/~/charted +$ helm install emails charted/emails --namespace charted --create-namespace +``` + +## Parameters + +### Global Parameters + +Contains any global parameters that will affected all objects in the `youtrack` Helm chart. + +| Name | Description | Value | +| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | +| `global.replicas` | Amount of replicas to spawn | `1` | +| `global.resources` | Resource list to apply to all containers. | `{}` | +| `global.fullNameOverride` | String to fully override the Helm installation name for all objects | `""` | +| `global.nameOverride` | String to override the Helm installation name for all objects, will be in conjunction with a prefix of `-` | `""` | +| `global.clusterDomain` | Domain host that maps to the cluster | `cluster.local` | +| `global.nodeSelector` | Selector labels to apply to contraint the pods to specific nodes. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector). | `{}` | +| `global.tolerations` | List of all taints/tolerations to apply in conjunction with `global.affinity`. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration) | `[]` | +| `global.affinity` | Map of all the affinity to apply to the spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/). | `{}` | +| `global.annotations` | Map of annotations to append to on all objects that this Helm chart creates. | `{}` | +| `global.extraEnvVars` | List of extra environment variables to append to all init/sidecar containers and normal containers. | `[]` | +| `global.initContainers` | List of init containers to create. | `[]` | +| `global.podSecurityContext` | Security context for all spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). | `{}` | +| `global.containerSecurityContext` | Security context for all init, sidecar, and normal containers. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). | `{}` | + +### Docker Image Parameters + +Parameters to modify the Docker image that is ran. + +| Name | Description | Value | +| ------------------ | --------------------------------------------------------------------------------------------------------------- | ------------------- | +| `image.pullPolicy` | [Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) when pulling the image. | `""` | +| `image.registry` | Registry URL to point to. For Docker Hub, use an empty string. | `cr.noelware.cloud` | +| `image.image` | Image name. | `charted/emails` | +| `image.tag` | The tag of the image. Keep this as a empty string if you wish to use the default app's version. | `""` | +| `image.digest` | Digest in the form of `:`, this will replace the `image.tag` property if this is not empty. | `""` | + +### Service Account Parameters + +| Name | Description | Value | +| ---------------------------- | ------------------------------------------------------------------------------------------ | ------ | +| `serviceAccount.create` | Whether or not if the service account should be created for this Helm installation. | `true` | +| `serviceAccount.annotations` | Any additional annotations to append to this ServiceAccount | `{}` | +| `serviceAccount.name` | The name of the service account, this will be the Helm installation name if this is empty. | `""` | diff --git a/charts/emails/templates/NOTES.txt b/charts/emails/templates/NOTES.txt new file mode 100644 index 0000000..e69de29 diff --git a/charts/emails/templates/helpers.tpl b/charts/emails/templates/helpers.tpl new file mode 100644 index 0000000..e69de29 diff --git a/charts/emails/values.yaml b/charts/emails/values.yaml new file mode 100644 index 0000000..79f85fa --- /dev/null +++ b/charts/emails/values.yaml @@ -0,0 +1,87 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +## @section Global Parameters +## @descriptionStart +## Contains any global parameters that will affected all objects in the `youtrack` Helm chart. +## @descriptionEnd +## +## @param global.replicas Amount of replicas to spawn +## @param global.resources Resource list to apply to all containers. +## @param global.fullNameOverride String to fully override the Helm installation name for all objects +## @param global.nameOverride String to override the Helm installation name for all objects, will be in conjunction with a prefix of `-` +## @param global.clusterDomain Domain host that maps to the cluster +## @param global.nodeSelector Selector labels to apply to contraint the pods to specific nodes. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector). +## @param global.tolerations List of all taints/tolerations to apply in conjunction with `global.affinity`. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration) +## @param global.affinity Map of all the affinity to apply to the spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/). +## @param global.annotations Map of annotations to append to on all objects that this Helm chart creates. +## @param global.extraEnvVars List of extra environment variables to append to all init/sidecar containers and normal containers. +## @param global.initContainers List of init containers to create. +## @param global.podSecurityContext Security context for all spawned Pods. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). +## @param global.containerSecurityContext Security context for all init, sidecar, and normal containers. Read more in the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). +global: + replicas: 1 + fullNameOverride: "" + nameOverride: "" + clusterDomain: cluster.local + nodeSelector: {} + tolerations: [] + affinity: {} + annotations: {} + extraEnvVars: [] + initContainers: [] + podSecurityContext: {} + containerSecurityContext: {} + resources: + {} + ## Example: + ## limits: + ## memory: 2Gi + ## cpu: 1500m + ## requests: + ## memory: 512Mi + ## cpu: 150m + +## @section Docker Image Parameters +## @descriptionStart +## Parameters to modify the Docker image that is ran. +## @descriptionEnd +## +## @param image.pullPolicy [string] [Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) when pulling the image. +## @param image.registry Registry URL to point to. For Docker Hub, use an empty string. +## @param image.image Image name. +## @param image.tag The tag of the image. Keep this as a empty string if you wish to use the default app's version. +## @param image.digest Digest in the form of `:`, this will replace the `image.tag` property if this is not empty. +image: + pullPolicy: IfNotPresent + registry: cr.noelware.cloud + image: charted/emails + tag: "" # keep empty for the app version + digest: "" + +## @section Service Account Parameters +## @param serviceAccount.create Whether or not if the service account should be created for this Helm installation. +## @param serviceAccount.annotations Any additional annotations to append to this ServiceAccount +## @param serviceAccount.name The name of the service account, this will be the Helm installation name if this is empty. +serviceAccount: + create: true + annotations: {} + name: "" diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..0a2c8bc --- /dev/null +++ b/default.nix @@ -0,0 +1,28 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +let + lockfile = builtins.fromJSON (builtins.readFile ./flake.lock); + compat = builtins.fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lockfile.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = "${lockfile.nodes.flake-compat.locked.narHash}"; + }; +in + (import compat {src = ./.;}).defaultNix.default diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4d43e29 --- /dev/null +++ b/flake.lock @@ -0,0 +1,78 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706683685, + "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a262066 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +{ + description = "🐻‍❄️🪻 Helm Charts available for Noelware's charted project"; + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable; + flake-utils.url = github:numtide/flake-utils; + flake-compat = { + url = github:edolstra/flake-compat; + flake = false; + }; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; + helm = pkgs.kubernetes-helm; + in { + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + helm + bun + ]; + }; + }); +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5d0f733 --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{ "dependencies": { "@bitnami/readme-generator-for-helm": "/workspaces/Noelware/Products/charted/helm-charts/.cache/bitnami-helm-gen" } } \ No newline at end of file diff --git a/scripts/emit-values b/scripts/emit-values new file mode 100755 index 0000000..a39509a --- /dev/null +++ b/scripts/emit-values @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +while [ -L "$BASH_SRC" ]; do + target=$(readlink "$BASH_SRC") + if [[ $target == /* ]]; then + BASH_SRC=$target + else + dir=$(dirname "$BASH_SRC") + BASH_SRC=$dir/$target + fi +done + +DIR=$(cd -P "$(dirname "$BASH_SRC")" >/dev/null 2>&1 && pwd) + +if ! command -v bun >/dev/null; then + echo "[ERROR] ===> Missing \`bun\` in host machine, install it please!" + exit 1 +fi + +! [ -d "$DIR/.cache" ] && mkdir -p "$DIR/.cache" + +if ! [ -d "$DIR/.cache/bitnami-helm-gen" ]; then + echo "===> Missing $DIR/.cache/bitnami-helm-gen directory, installing..." + + git clone https://github.com/bitnami-labs/readme-generator-for-helm "$DIR/.cache/bitnami-helm-gen" + bun install "$DIR/.cache/bitnami-helm-gen" +fi + +# TODO(@auguwu): auto generate this list (if we need to) +charts=( + "$DIR/charts/charted" + "$DIR/charts/emails" +) + +for chart in "${charts[@]}"; do + rel="./$(realpath --relative-to="$DIR" "$chart")" + echo "Updating README.md with Helm values... [$rel]" + + if ! [ -f "$chart/values.yaml" ]; then + echo ".... Skipping due to no \`values.yaml\` in $rel" + continue + fi + + if ! [ -f "$chart/README.md" ]; then + echo ".... Skipping due to no \`README.md\` in $rel" + continue + fi + + echo ".... Generating..." + (cd "$DIR/.cache/bitnami-helm-gen" && bun --bun bin/index.js --values "$chart/values.yaml" --readme "$chart/README.md") + + if [ "$?" != "0" ]; then + echo ".... Failed to generate, view logs above" + exit 1 + fi +done diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..ec18fbb --- /dev/null +++ b/shell.nix @@ -0,0 +1,28 @@ +# 🐻‍❄️🪻 helm-charts: Helm Charts available for Noelware's charted project +# Copyright (c) 2023-2024 Noelware, LLC. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +let + lockfile = builtins.fromJSON (builtins.readFile ./flake.lock); + compat = builtins.fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lockfile.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = "${lockfile.nodes.flake-compat.locked.narHash}"; + }; +in + (import compat {src = ./.;}).shellNix.default