diff --git a/librebooking/app.yaml b/librebooking/app.yaml new file mode 100644 index 0000000..101d025 --- /dev/null +++ b/librebooking/app.yaml @@ -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" diff --git a/librebooking/versions/3/README.md b/librebooking/versions/3/README.md new file mode 100644 index 0000000..f1672cc --- /dev/null +++ b/librebooking/versions/3/README.md @@ -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) diff --git a/librebooking/versions/3/db-init-job.yaml b/librebooking/versions/3/db-init-job.yaml new file mode 100644 index 0000000..e595db3 --- /dev/null +++ b/librebooking/versions/3/db-init-job.yaml @@ -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} <