Adds librebooking app.

This commit is contained in:
2026-06-19 21:33:08 +00:00
parent 347c4e0c90
commit 3e3b048f5b
10 changed files with 286 additions and 0 deletions

5
librebooking/app.yaml Normal file
View File

@@ -0,0 +1,5 @@
name: librebooking
is: librebooking
description: LibreBooking is a self-hosted open-source resource scheduling application for managing reservations of rooms, equipment, and other resources.
icon: https://raw.githubusercontent.com/LibreBooking/app/develop/favicon.png
latest: "3"

View File

@@ -0,0 +1,38 @@
# LibreBooking
LibreBooking is an open-source resource scheduling system for booking rooms, equipment, and other shared resources.
## Dependencies
- **MySQL** - Database for storing reservations and resources
## Configuration
Key settings in `config.yaml`:
- **domain** - Where LibreBooking will be accessible
- **storage** - Persistent volume size (default: `2Gi`)
- **timezone** - Timezone for scheduling (default: `UTC`)
- **db.name** - Database name (default: `librebooking`)
## First-Time Setup
1. Add and deploy the app:
```bash
wild app add librebooking
wild app deploy librebooking
```
2. Visit the app URL and complete the web installer:
- Use the `installPassword` from your `secrets.yaml` when prompted for the installation password
- Enter database connection details from your config
3. After installation, log in with the admin account you created during setup.
4. Define your resources (rooms, equipment, etc.) and set up booking schedules.
## Notes
- The installer is at `/install/` and can only be run once
- Resources are organized into groups and can have custom booking rules, approval workflows, and availability schedules
- Users can be given different permission levels (view-only, book, admin)

View File

@@ -0,0 +1,64 @@
apiVersion: batch/v1
kind: Job
metadata:
name: librebooking-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: mysql-init
image: mysql:9.1.0
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: librebooking-secrets
key: mysql.rootPassword
- name: DB_HOSTNAME
value: {{ .db.host }}
- name: DB_PORT
value: "{{ .db.port }}"
- name: DB_DATABASE_NAME
value: {{ .db.name }}
- name: DB_USERNAME
value: {{ .db.user }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: librebooking-secrets
key: dbPassword
command:
- /bin/bash
- -c
- |
set -e
until mysql -h ${DB_HOSTNAME} -P ${DB_PORT} -u root -p${MYSQL_ROOT_PASSWORD} -e "SELECT 1" 2>/dev/null; do
echo "Waiting for MySQL..."
sleep 2
done
mysql -h ${DB_HOSTNAME} -P ${DB_PORT} -u root -p${MYSQL_ROOT_PASSWORD} <<EOF
CREATE DATABASE IF NOT EXISTS ${DB_DATABASE_NAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS '${DB_USERNAME}'@'%' IDENTIFIED BY '${DB_PASSWORD}';
ALTER USER '${DB_USERNAME}'@'%' IDENTIFIED BY '${DB_PASSWORD}';
GRANT ALL PRIVILEGES ON ${DB_DATABASE_NAME}.* TO '${DB_USERNAME}'@'%';
FLUSH PRIVILEGES;
EOF
echo "Done"

View File

@@ -0,0 +1,89 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: librebooking
namespace: {{ .namespace }}
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: web
template:
metadata:
labels:
component: web
spec:
securityContext:
runAsNonRoot: true
runAsUser: 33
runAsGroup: 33
fsGroup: 33
seccompProfile:
type: RuntimeDefault
containers:
- name: librebooking
image: librebooking/librebooking:5.1.0
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: LB_DATABASE_HOSTSPEC
value: "{{ .db.host }}"
- name: LB_DATABASE_NAME
value: {{ .db.name }}
- name: LB_DATABASE_USER
value: {{ .db.user }}
- name: LB_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: librebooking-secrets
key: dbPassword
- name: LB_INSTALL_PASSWORD
valueFrom:
secretKeyRef:
name: librebooking-secrets
key: installPassword
- name: LB_DEFAULT_TIMEZONE
value: {{ .timezone }}
resources:
limits:
cpu: 500m
ephemeral-storage: 1Gi
memory: 512Mi
requests:
cpu: 50m
ephemeral-storage: 50Mi
memory: 128Mi
volumeMounts:
- name: librebooking-uploads
mountPath: /var/www/html/Web/uploads/images
livenessProbe:
httpGet:
path: /Web/
port: 8080
initialDelaySeconds: 60
timeoutSeconds: 10
periodSeconds: 30
failureThreshold: 6
readinessProbe:
httpGet:
path: /Web/
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 10
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
volumes:
- name: librebooking-uploads
persistentVolumeClaim:
claimName: librebooking-uploads
restartPolicy: Always

View File

@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: librebooking
namespace: {{ .namespace }}
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: librebooking
port:
number: 80
tls:
- hosts:
- {{ .domain }}
secretName: {{ .tlsSecretName }}

View File

@@ -0,0 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: {{ .namespace }}
labels:
- includeSelectors: true
pairs:
app: librebooking
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,20 @@
version: 3.3.7-1
requires:
- name: mysql
defaultConfig:
namespace: librebooking
externalDnsDomain: "{{ .cloud.domain }}"
domain: booking.{{ .cloud.domain }}
tlsSecretName: wildcard-wild-cloud-tls
storage: 2Gi
timezone: UTC
db:
host: "{{ .apps.mysql.host }}"
port: "3306"
name: librebooking
user: librebooking
defaultSecrets:
- key: dbPassword
- key: installPassword
requiredSecrets:
- mysql.rootPassword

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: librebooking-uploads
namespace: {{ .namespace }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .storage }}

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: librebooking
namespace: {{ .namespace }}
spec:
selector:
component: web
ports:
- name: http
port: 80
targetPort: 8080
protocol: TCP