Skip to content

Commit

Permalink
add cryptpad chart
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Jul 2, 2024
1 parent b14c3cf commit 61dec95
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/cryptpad/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: cryptpad
description: A Helm chart for cryptpad
type: application

version: 0.0.1

# App metadata
appVersion: "2024.3.1"
maintainers:
- name: elasticroentgen
email: [email protected]
87 changes: 87 additions & 0 deletions charts/cryptpad/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
config.js: |-
// SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <[email protected]> and contributors
//
// SPDX-License-Identifier: AGPL-3.0-or-later
// THIS FILE IS MAINLY WITHOUT COMMENTS TO KEEP IT SMALL. CHECK THE EXAMPLE CONFIG FOR EXPLAINATIONS.
module.exports = {
httpUnsafeOrigin: "https://{{ .Values.baseDomain }}",
httpSafeOrigin: "https://{{ .Values.sandboxDomain }}",
httpAddress: '0.0.0.0',
httpPort: 3000,
websocketPort: 3003,
maxWorkers: 8,
//otpSessionExpiration: 7*24, // hours
enforceMFA: true,
/* =====================
* Privacy
* ===================== */
//logIP: false,
/* =====================
* Admin
* ===================== */
adminKeys: [
{{ range .Values.admins }}
"[{{ .username}}/{{ .pubkey }}]",
{{- end}}
],
/* =====================
* STORAGE
* ===================== */
//inactiveTime: 90, // days
//archiveRetentionTime: 15,
//accountRetentionTime: 365,
//disableIntegratedEviction: true,
maxUploadSize: {{ .Values.maxUploadSize }} * 1024 * 1024,
//premiumUploadSize: {{ .Values.maxPremiumUploadSize }} * 1024 * 1024,
/* =====================
* DATABASE VOLUMES
* ===================== */
filePath: './datastore/',
archivePath: './data/archive',
pinPath: './data/pins',
taskPath: './data/tasks',
blockPath: './block',
blobPath: './blob',
blobStagingPath: './data/blobstage',
decreePath: './data/decrees',
logPath: './data/logs',
/* =====================
* Debugging
* ===================== */
logToStdout: true,
logLevel: 'info',
logFeedback: false,
verbose: false,
installMethod: 'docker',
};
application_config.js: |-
define(['/common/application_config_internal.js'], function (AppConfig) {
// Example: If you want to remove the survey link in the menu:
// AppConfig.surveyURL = "";
// To inform users of the support ticket panel which languages your admins speak:
AppConfig.supportLanguages = [ 'en', 'de' ];
AppConfig.loginSalt = '{{ .Values.loginSalt }}'
return AppConfig;
});
82 changes: 82 additions & 0 deletions charts/cryptpad/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-cryptpad
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/component: cryptpad
spec:
selector:
matchLabels:
app.kubernetes.io/component: cryptpad
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/component: cryptpad
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.extraInitContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: {{ .Release.Name }}-cryptpad
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
env:
- name: CPAD_MAIN_DOMAIN
value: {{ .Values.baseDomain | quote }}
- name: CPAD_SANDBOX_DOMAIN
value: {{ .Values.sandboxDomain | quote }}
- name: CPAD_CONF
value: "/cryptpad/config/config.js"
ports:
- name: http
containerPort: 3000
protocol: TCP
- name: websocket
containerPort: 3003
protocol: TCP
volumeMounts:
- name: config
readOnly: true
mountPath: /cryptpad/config
subPath: config.js
- name: config
readOnly: true
mountPath: /cryptpad/customize
subPath: application_config.js
- name: blob
mountPath: /cryptpad/blob
- name: block
mountPath: /cryptpad/block
- name: datastore
mountPath: /cryptpad/data
- name: files
mountPath: /cryptpad/datastore
resources:
{{- toYaml .Values.resources | nindent 10 }}
volumes:
- name: config
configMap:
name: {{ .Release.Name }}-config
- name: blob
persistentVolumeClaim:
claimName: {{ .Release.Name }}-blob
- name: block
persistentVolumeClaim:
claimName: {{ .Release.Name }}-block
- name: datastore
persistentVolumeClaim:
claimName: {{ .Release.Name }}-datastore
- name: files
persistentVolumeClaim:
claimName: {{ .Release.Name }}-files
61 changes: 61 additions & 0 deletions charts/cryptpad/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
{{- if or .Values.commonAnnotations .Values.ingress.annotations }}
annotations:
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.commonAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
{{- with .Values.ingress.tls }}
tls:
{{- range . }}
- hosts:
- {{ .Values.baseDomain }}
- {{ .Values.sandboxDomain }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.baseDomain }}
http:
paths:
- path: /cryptpad_websocket
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-svc
port:
name: websocket
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-svc
port:
name: http
- host: {{ .Values.sandboxDomain }}
http:
paths:
- path: /cryptpad_websocket
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-svc
port:
name: websocket
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-svc
port:
name: http
{{- end }}
14 changes: 14 additions & 0 deletions charts/cryptpad/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-svc
labels:
app.kubernetes.io/name: {{ .Release.Name }}-cryptpad
spec:
selector:
app: {{ .Release.Name }}-cryptpad
ports:
- name: http
port: 3000
- name: websocket
port: 3003
28 changes: 28 additions & 0 deletions charts/cryptpad/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
commonAnnotations: {}

baseDomain: pad.example.com
sandboxDomain: sandbox.example.com
admins: []
maxUploadSize: 1
maxPremiumUploadSize: 100
loginSalt: "abcdefg"


podAnnotations: {}
podLabels: {}
extraInitContainers: {}
resources: {}
image:
repository: ghcr.io/ethdevops/cryptpad-docker
tag: ""

ingress:
enabled: true
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

0 comments on commit 61dec95

Please sign in to comment.