Adds etherpad app.

This commit is contained in:
2026-06-19 21:32:58 +00:00
parent aee2e93803
commit a25366daf7
10 changed files with 293 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
# Etherpad
Etherpad is a real-time collaborative document editor. Multiple users can write and edit documents simultaneously.
## Dependencies
- **PostgreSQL** - Database for storing pads and history
## Configuration
Key settings in `config.yaml`:
- **domain** - Where Etherpad will be accessible
- **storage** - Persistent volume size (default: `2Gi`)
- **title** - Instance name shown in the browser (default: `Etherpad`)
## Usage
No account is required to create or edit pads. Just visit the app URL and:
- Click **New Pad** to create a document
- Share the pad URL with collaborators — anyone with the link can edit in real time
## Admin Panel
An admin panel is available at `/admin`:
- **Username**: `admin`
- **Password**: value of `adminPassword` in your `secrets.yaml`
Use the admin panel to manage plugins, view connected users, and configure the instance.
## Notes
- Pads are identified by URL — anyone with the link can view and edit by default
- Password-protected pads can be created via the admin panel settings
- The admin panel also provides access to the plugin manager for extending functionality

View File

@@ -0,0 +1,63 @@
apiVersion: batch/v1
kind: Job
metadata:
name: etherpad-db-init
labels:
component: db-init
spec:
template:
metadata:
labels:
component: db-init
spec:
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 999
seccompProfile:
type: RuntimeDefault
containers:
- name: db-init
image: postgres:17
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
command: ["/bin/bash", "-c"]
args:
- |
PGPASSWORD=${POSTGRES_ADMIN_PASSWORD} psql -h ${DB_HOSTNAME} -U postgres <<EOF
DO \$\$
BEGIN
IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = '${DB_USERNAME}') THEN
CREATE USER ${DB_USERNAME} WITH ENCRYPTED PASSWORD '${DB_PASSWORD}';
ELSE
ALTER USER ${DB_USERNAME} WITH ENCRYPTED PASSWORD '${DB_PASSWORD}';
END IF;
END
\$\$;
SELECT 'CREATE DATABASE ${DB_DATABASE_NAME}' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '${DB_DATABASE_NAME}')\gexec
ALTER DATABASE ${DB_DATABASE_NAME} OWNER TO ${DB_USERNAME};
GRANT ALL PRIVILEGES ON DATABASE ${DB_DATABASE_NAME} TO ${DB_USERNAME};
EOF
env:
- name: POSTGRES_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secrets
key: password
- name: DB_HOSTNAME
value: "{{ .db.host }}"
- name: DB_DATABASE_NAME
value: "{{ .db.name }}"
- name: DB_USERNAME
value: "{{ .db.user }}"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: etherpad-secrets
key: dbPassword

View File

@@ -0,0 +1,97 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: etherpad
namespace: etherpad
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: web
template:
metadata:
labels:
component: web
spec:
securityContext:
runAsNonRoot: true
runAsUser: 5001
runAsGroup: 0
fsGroup: 5001
seccompProfile:
type: RuntimeDefault
containers:
- name: etherpad
image: etherpad/etherpad:2.2.7
ports:
- name: http
containerPort: 9001
protocol: TCP
env:
- name: DB_TYPE
value: postgres
- name: DB_HOST
value: {{ .db.host }}
- name: DB_PORT
value: "{{ .db.port }}"
- name: DB_NAME
value: {{ .db.name }}
- name: DB_USER
value: {{ .db.user }}
- name: DB_PASS
valueFrom:
secretKeyRef:
name: etherpad-secrets
key: dbPassword
- name: TITLE
value: {{ .title }}
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: etherpad-secrets
key: adminPassword
- name: TRUST_PROXY
value: "true"
- name: EDIT_ONLY
value: "false"
resources:
limits:
cpu: 500m
ephemeral-storage: 1Gi
memory: 512Mi
requests:
cpu: 50m
ephemeral-storage: 50Mi
memory: 128Mi
volumeMounts:
- name: etherpad-data
mountPath: /opt/etherpad-lite/var
livenessProbe:
httpGet:
path: /
port: 9001
initialDelaySeconds: 60
timeoutSeconds: 5
periodSeconds: 15
failureThreshold: 6
readinessProbe:
httpGet:
path: /
port: 9001
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
volumes:
- name: etherpad-data
persistentVolumeClaim:
claimName: etherpad-data
restartPolicy: Always

View File

@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: etherpad
namespace: etherpad
annotations:
external-dns.alpha.kubernetes.io/target: {{ .externalDnsDomain }}
external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"
external-dns.alpha.kubernetes.io/ttl: "60"
spec:
ingressClassName: traefik
rules:
- host: {{ .domain }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: etherpad
port:
number: 80
tls:
- hosts:
- {{ .domain }}
secretName: {{ .tlsSecretName }}

View File

@@ -0,0 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: etherpad
labels:
- includeSelectors: true
pairs:
app: etherpad
managedBy: kustomize
partOf: wild-cloud
resources:
- namespace.yaml
- db-init-job.yaml
- deployment.yaml
- service.yaml
- ingress.yaml
- pvc.yaml

View File

@@ -0,0 +1,22 @@
version: 2.2.7-1
requires:
- name: postgres
defaultConfig:
namespace: etherpad
externalDnsDomain: '{{ .cloud.domain }}'
domain: etherpad.{{ .cloud.domain }}
tlsSecretName: wildcard-wild-cloud-tls
storage: 2Gi
title: Etherpad
db:
host: '{{ .apps.postgres.host }}'
port: '{{ .apps.postgres.port }}'
name: etherpad
user: etherpad
defaultSecrets:
- key: adminPassword
- key: dbPassword
- key: dbUrl
default: 'postgresql://{{ .app.db.user }}:{{ .secrets.dbPassword }}@{{ .app.db.host }}:{{ .app.db.port }}/{{ .app.db.name }}?sslmode=disable'
requiredSecrets:
- postgres.password

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .namespace }}

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: etherpad-data
namespace: etherpad
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .storage }}

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: etherpad
namespace: etherpad
spec:
selector:
component: web
ports:
- name: http
port: 80
targetPort: 9001
protocol: TCP