Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/chart-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish chart

on:
workflow_dispatch:
inputs:
version:
description: 'Chart version to publish (e.g. 0.14.0-sha-fdfc584)'
required: false
default: '0.14.0-dev'
type: string

permissions:
contents: read
packages: write

jobs:
publish-chart:
name: Package & push Helm chart to GHCR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: azure/setup-helm@v4

- name: Log in to GHCR (Helm OCI)
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io \
--username "${{ github.actor }}" \
--password-stdin

- name: Package chart
run: |
VERSION="${{ inputs.version }}"
helm package charts/openconcho \
--version "$VERSION" \
--app-version "$VERSION"

- name: Push chart
run: |
VERSION="${{ inputs.version }}"
helm push "openconcho-$VERSION.tgz" \
oci://ghcr.io/${{ github.repository_owner }}/charts
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ RUN pnpm --filter @openconcho/web build
FROM nginxinc/nginx-unprivileged:alpine

COPY --chown=101:101 --from=builder /app/packages/web/dist /usr/share/nginx/html
# Rendered to /etc/nginx/conf.d/default.conf by the image's envsubst entrypoint.
COPY --chown=101:101 docker/nginx.conf.template /etc/nginx/templates/default.conf.template
# Served verbatim by 40-openconcho-config.sh from /etc/openconcho/nginx.conf
# to /etc/nginx/conf.d/default.conf at container start. Stored outside
# /etc/nginx/templates/ on purpose so the base image's 20-envsubst-on-templates.sh
# does not try to render it back into the read-only root filesystem — the
# template has no $VAR placeholders, so envsubst adds nothing.
COPY --chown=101:101 docker/nginx.conf.template /etc/openconcho/nginx.conf
# Writes /usr/share/nginx/html/config.js from OPENCONCHO_DEFAULT_HONCHO_URL.
# --chmod=0755 so nginx's docker-entrypoint.d actually executes it.
COPY --chown=101:101 --chmod=0755 docker/40-openconcho-config.sh /docker-entrypoint.d/40-openconcho-config.sh
Expand Down
2 changes: 1 addition & 1 deletion charts/openconcho/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,4 @@ helm test openconcho --logs
| `seccompProfile` | `RuntimeDefault` |
| `allowPrivilegeEscalation` | `false` |
| `automountServiceAccountToken` | `false` |
| Writable paths | `/var/cache/nginx`, `/var/run`, `/tmp` (tmpfs) |
| Writable paths | `/etc/nginx/conf.d`, `/var/cache/nginx`, `/var/run`, `/tmp` (tmpfs) |
4 changes: 2 additions & 2 deletions charts/openconcho/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ spec:
{{- if .Values.tmpfsMounts }}
volumeMounts:
{{- range .Values.tmpfsMounts }}
- name: {{ .mountPath | trimPrefix "/" | replace "/" "-" | trunc 63 | trimSuffix "-" }}
- name: {{ .mountPath | trimPrefix "/" | replace "/" "-" | replace "." "-" | trunc 63 | trimSuffix "-" }}
mountPath: {{ .mountPath }}
{{- end }}
{{- end }}
{{- if .Values.tmpfsMounts }}
volumes:
{{- range .Values.tmpfsMounts }}
- name: {{ .mountPath | trimPrefix "/" | replace "/" "-" | trunc 63 | trimSuffix "-" }}
- name: {{ .mountPath | trimPrefix "/" | replace "/" "-" | replace "." "-" | trunc 63 | trimSuffix "-" }}
emptyDir:
medium: Memory
{{- end }}
Expand Down
9 changes: 9 additions & 0 deletions docker/40-openconcho-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
# so the container works cleanly under a read-only root filesystem.
set -eu

# Stage the openconcho server config into the writable tmpfs the chart mounts
# at /etc/nginx/conf.d. The image ships the config at /etc/openconcho/nginx.conf
# so the base image's envsubst step has nothing to render against the read-only
# filesystem. The base image's 10-listen-on-ipv6-by-default.sh may have created
# default.conf already on a writable mount, so we force-overwrite with cp -f.
cp -f /etc/openconcho/nginx.conf /etc/nginx/conf.d/default.conf
chmod 0644 /etc/nginx/conf.d/default.conf
chown 101:101 /etc/nginx/conf.d/default.conf

cat > /tmp/openconcho-config.js <<EOF
window.__OPENCONCHO_DEFAULT_HONCHO_URL__ = "${OPENCONCHO_DEFAULT_HONCHO_URL:-}";
EOF
Expand Down