From c30fb61d6f91185741ac81f9576fc3b6424e911d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tilen=20Barbiri=C4=8D?= Date: Sun, 15 Feb 2026 13:39:00 +0100 Subject: [PATCH] feat: add initial chart files --- .gitignore | 4 +++ .releaserc.yaml | 12 +++++++ .woodpecker/publish-chart.yml | 59 ++++++++++++++++++++++++++++++++ .woodpecker/release.yaml | 22 ++++++++++++ .woodpecker/renovate.yaml | 21 ++++++++++++ README.md | 42 +++++++++++++++++++++++ helm/Chart.yaml | 10 ++++++ helm/templates/common.yaml | 1 + helm/values.yaml | 64 +++++++++++++++++++++++++++++++++++ mise.toml | 18 ++++++++++ renovate.json | 23 +++++++++++++ 11 files changed, 276 insertions(+) create mode 100644 .gitignore create mode 100644 .releaserc.yaml create mode 100644 .woodpecker/publish-chart.yml create mode 100644 .woodpecker/release.yaml create mode 100644 .woodpecker/renovate.yaml create mode 100644 README.md create mode 100644 helm/Chart.yaml create mode 100644 helm/templates/common.yaml create mode 100644 helm/values.yaml create mode 100644 mise.toml create mode 100644 renovate.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a89f400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +helm/charts/ +helm/Chart.lock +/.cr-release-packages/ +.idea/ \ No newline at end of file diff --git a/.releaserc.yaml b/.releaserc.yaml new file mode 100644 index 0000000..71375b9 --- /dev/null +++ b/.releaserc.yaml @@ -0,0 +1,12 @@ +plugins: + - "@semantic-release/commit-analyzer" + - "@semantic-release/release-notes-generator" + - "@semantic-release/changelog" + - ["@semantic-release/exec", { + "prepareCmd": "sed -i 's/^version:.*/version: \"${nextRelease.version}\"/' helm/Chart.yaml && sed -i 's/^appVersion:.*/appVersion: \"${nextRelease.version}\"/' helm/Chart.yaml" + }] + - ["@semantic-release/git", { + "assets": ["CHANGELOG.md", "helm/Chart.yaml"], + "message": "chore(release): ${nextRelease.version} [skip ci]" + }] + - "@forge-for-gitea/semantic-release-gitea" \ No newline at end of file diff --git a/.woodpecker/publish-chart.yml b/.woodpecker/publish-chart.yml new file mode 100644 index 0000000..c20dee4 --- /dev/null +++ b/.woodpecker/publish-chart.yml @@ -0,0 +1,59 @@ +when: + - event: push + branch: [main] + path: + include: + - 'helm/**' + - '.woodpecker/**' + - event: tag + ref: "refs/tags/v*" + +steps: + - name: release + image: node:24-alpine + environment: + GITEA_TOKEN: + from_secret: gitea_token + GITEA_USERNAME: + from_secret: gitea_username + GITEA_URL: ${CI_FORGE_URL} + commands: + - apk add --no-cache git + - git config --global credential.helper store + - echo "https://$${GITEA_USERNAME}:$${GITEA_TOKEN}@git.barbiric.io" > ~/.git-credentials + - npm install -g semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/changelog @semantic-release/git @semantic-release/exec @forge-for-gitea/semantic-release-gitea + - npx semantic-release + when: + event: push + branch: main + + - name: package-charts + image: quay.io/helmpack/chart-testing:v3.11.0 + commands: + - mkdir -p .cr-release-packages + - | + helm package helm -d .cr-release-packages + when: + event: tag + + - name: publish-charts + image: quay.io/helmpack/chart-testing:v3.11.0 + environment: + GITEA_USERNAME: + from_secret: gitea_username + GITEA_TOKEN: + from_secret: gitea_token + commands: + - | + for pkg in .cr-release-packages/*.tgz; do + if [ -f "$pkg" ]; then + echo "Publishing $pkg to Gitea..." + curl -s -f \ + -u "$${GITEA_USERNAME}:$${GITEA_TOKEN}" \ + -X POST \ + --upload-file "$pkg" \ + "${CI_FORGE_URL}/api/packages/${CI_REPO_OWNER}/helm/api/charts" + fi + done + when: + event: tag \ No newline at end of file diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml new file mode 100644 index 0000000..de606b5 --- /dev/null +++ b/.woodpecker/release.yaml @@ -0,0 +1,22 @@ +when: + - event: push + branch: main + +steps: + - name: release + image: node:20-alpine + environment: + GITEA_TOKEN: + from_secret: gitea_token + GITEA_USERNAME: + from_secret: gitea_username + GITEA_URL: ${CI_FORGE_URL} + commands: + - apk add --no-cache git + - git config --global credential.helper store + - echo "https://$${GITEA_USERNAME}:$${GITEA_TOKEN}@git.barbiric.io" > ~/.git-credentials + - npm install -g semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/changelog @semantic-release/git @forge-for-gitea/semantic-release-gitea + - npx semantic-release + when: + event: push + branch: main \ No newline at end of file diff --git a/.woodpecker/renovate.yaml b/.woodpecker/renovate.yaml new file mode 100644 index 0000000..3b493bf --- /dev/null +++ b/.woodpecker/renovate.yaml @@ -0,0 +1,21 @@ +when: + - event: cron + cron: "renovate" + - event: manual + +steps: + - name: renovate + image: renovate/renovate:43.15 + environment: + RENOVATE_PLATFORM: gitea + RENOVATE_ENDPOINT: ${CI_FORGE_URL} + RENOVATE_REPOSITORIES: ${CI_REPO} + RENOVATE_TOKEN: + from_secret: RENOVATE_CI_KEY + RENOVATE_ONBOARDING: false + RENOVATE_GITHUB_COM_TOKEN: + from_secret: RENOVATE_GH_KEY + LOG_LEVEL: info + + commands: + - renovate ${CI_REPO} diff --git a/README.md b/README.md new file mode 100644 index 0000000..1ff8098 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# A helm chart for opencloud-oidc-webfinger-proxy + +## Status +This is a very basic chart that deploys [opencloud-oidc-webfinger-proxy](https://git.barbiric.io/opencloud-oidc-webfinger-proxy). + +## Development +Use mise to install devdeps. + +## Parameters + +### Common Configuration + +| Name | Description | Value | +| --------------------------------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------- | +| `common.controllers.main.containers.app.image.repository` | Image repository | `git.barbiric.io/barbirict/opencloud-oidc-webfinger-proxy` | +| `common.controllers.main.containers.app.image.tag` | Image tag (defaults to Chart.AppVersion) | `{{ .Chart.AppVersion }}` | +| `common.controllers.main.containers.app.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `common.controllers.main.containers.app.env[0].name` | Environment variable name | `PORT` | +| `common.controllers.main.containers.app.env[0].value` | Application listen port | `9210` | +| `common.controllers.main.containers.app.envFrom[0].configMapRef.name` | ConfigMap name for env vars | `opencloud-oidc-webfinger-proxy-config` | +| `common.controllers.main.containers.app.probes.liveness.enabled` | Enable liveness probe | `true` | +| `common.controllers.main.containers.app.probes.readiness.enabled` | Enable readiness probe | `true` | +| `common.controllers.main.containers.app.resources.requests.cpu` | CPU request | `100m` | +| `common.controllers.main.containers.app.resources.requests.memory` | Memory request | `64Mi` | +| `common.controllers.main.containers.app.resources.limits.cpu` | CPU limit | `250m` | +| `common.controllers.main.containers.app.resources.limits.memory` | Memory limit | `128Mi` | + +### Service Configuration + +| Name | Description | Value | +| ------------------------------------ | ---------------------------- | ------ | +| `common.service.app.controller` | Controller to associate with | `main` | +| `common.service.app.ports.http.port` | HTTP service port | `9210` | + +### ConfigMap Configuration + +| Name | Description | Value | +| ------------------------------------------------ | ------------------------------------------- | ---------------------------------------- | +| `common.configMaps.config.data.UPSTREAM_URL` | Upstream URL to proxy requests to | `https://cloud.domain.com` | +| `common.configMaps.config.data.HREF_PATTERN` | Pattern to match in href attributes | `https://auth.domain.com/application/o/` | +| `common.configMaps.config.data.HREF_REPLACEMENT` | Replacement value for matched href patterns | `https://auth.domain.com/application/o/` | +| `common.configMaps.config.data.DEFAULT_SUFFIX` | Default suffix appended to requests | `opencloud` | diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 0000000..1aa9da8 --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: opencloud-oidc-webfinger-proxy +description: OpenCloud OIDC WebFinger Proxy +version: 1.0.0 +appVersion: "1.1.0" +type: application +dependencies: + - name: common + version: 4.5.0 + repository: https://bjw-s-labs.github.io/helm-charts/ \ No newline at end of file diff --git a/helm/templates/common.yaml b/helm/templates/common.yaml new file mode 100644 index 0000000..effc535 --- /dev/null +++ b/helm/templates/common.yaml @@ -0,0 +1 @@ +{{ include "bjw-s.common.loader.all" . }} \ No newline at end of file diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..92d935f --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,64 @@ +## @section Common Configuration + +common: + controllers: + main: + containers: + app: + image: + ## @param common.controllers.main.containers.app.image.repository Image repository + repository: git.barbiric.io/barbirict/opencloud-oidc-webfinger-proxy + ## @param common.controllers.main.containers.app.image.tag Image tag (defaults to Chart.AppVersion) + tag: "{{ .Chart.AppVersion }}" + ## @param common.controllers.main.containers.app.image.pullPolicy Image pull policy + pullPolicy: IfNotPresent + ## @param common.controllers.main.containers.app.env[0].name Environment variable name + ## @param common.controllers.main.containers.app.env[0].value Application listen port + env: + - name: PORT + value: 9210 + envFrom: + - configMapRef: + ## @param common.controllers.main.containers.app.envFrom[0].configMapRef.name ConfigMap name for env vars + name: opencloud-oidc-webfinger-proxy-config + probes: + liveness: + ## @param common.controllers.main.containers.app.probes.liveness.enabled Enable liveness probe + enabled: true + readiness: + ## @param common.controllers.main.containers.app.probes.readiness.enabled Enable readiness probe + enabled: true + resources: + requests: + ## @param common.controllers.main.containers.app.resources.requests.cpu CPU request + cpu: "100m" + ## @param common.controllers.main.containers.app.resources.requests.memory Memory request + memory: "64Mi" + limits: + ## @param common.controllers.main.containers.app.resources.limits.cpu CPU limit + cpu: "250m" + ## @param common.controllers.main.containers.app.resources.limits.memory Memory limit + memory: "128Mi" + + ## @section Service Configuration + service: + app: + ## @param common.service.app.controller Controller to associate with + controller: main + ports: + http: + ## @param common.service.app.ports.http.port HTTP service port + port: 9210 + + ## @section ConfigMap Configuration + configMaps: + config: + data: + ## @param common.configMaps.config.data.UPSTREAM_URL Upstream URL to proxy requests to + UPSTREAM_URL: https://cloud.domain.com + ## @param common.configMaps.config.data.HREF_PATTERN Pattern to match in href attributes + HREF_PATTERN: https://auth.domain.com/application/o/ + ## @param common.configMaps.config.data.HREF_REPLACEMENT Replacement value for matched href patterns + HREF_REPLACEMENT: https://auth.domain.com/application/o/ + ## @param common.configMaps.config.data.DEFAULT_SUFFIX Default suffix appended to requests + DEFAULT_SUFFIX: opencloud \ No newline at end of file diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..46c43c2 --- /dev/null +++ b/mise.toml @@ -0,0 +1,18 @@ +[tools] +go = "1.25.1" + +[tasks.devdeps] +description = "Install dev tools" +run = "go install github.com/cozystack/readme-generator-for-helm@latest" + +[tasks.readme] +description = "Generate helm chart README" +run = "readme-generator-for-helm --values helm/values.yaml --readme README.md" + +[tasks.helm-lint] +description = "Lint helm chart" +run = "helm lint helm/" + +[tasks.helm-template] +description = "Preview helm chart output" +run = "helm template opencloud-oidc-webfinger-proxy helm/" \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..0a12161 --- /dev/null +++ b/renovate.json @@ -0,0 +1,23 @@ +{ + "extends": [ + "config:recommended" + ], + "dependencyDashboard": true, + "assignees": [ + "barbirict" + ], + "gitAuthor": "Renovate Bot ", + "major": { + "dependencyDashboardApproval": true + }, + "regexManagers": [ + { + "fileMatch": ["Chart\\.yaml$"], + "matchStrings": [ + "appVersion:\\s*\"?(?[^\"\\s]+)\"?" + ], + "depNameTemplate": "git.barbiric.io/barbirict/opencloud-oidc-webfinger-proxy", + "datasourceTemplate": "docker" + } + ] +}