diff --git a/mediawiki/app.yaml b/mediawiki/app.yaml new file mode 100644 index 0000000..636bd04 --- /dev/null +++ b/mediawiki/app.yaml @@ -0,0 +1,5 @@ +name: mediawiki +is: mediawiki +description: MediaWiki is the free and open source wiki software that powers Wikipedia and thousands of other wikis. +icon: https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mediawiki.svg +latest: "1" diff --git a/mediawiki/versions/1/README.md b/mediawiki/versions/1/README.md new file mode 100644 index 0000000..56436cf --- /dev/null +++ b/mediawiki/versions/1/README.md @@ -0,0 +1,49 @@ +# MediaWiki + +MediaWiki is the wiki software that powers Wikipedia. It provides a full-featured collaborative wiki with a rich extension ecosystem. + +## Dependencies + +- **MySQL** - Database for storing wiki content +- **SMTP** - For email notifications and password resets + +## Configuration + +Key settings in `config.yaml`: + +- **domain** - Where MediaWiki will be accessible +- **storage** - Persistent volume size (default: `2Gi`) +- **siteName** - Name of your wiki (default: `My Wiki`) +- **adminUser** - Admin account username (default: `admin`) + +## First-Time Setup + +MediaWiki requires a **web-based installer** after deployment to generate `LocalSettings.php`. + +1. Add and deploy the app: + ```bash + wild app add mediawiki + wild app deploy mediawiki + ``` + +2. Visit `/mw-config/` to run the web installer. + +3. In the installer: + - Database type: **MySQL** + - Database host: value of `db.host` from your config + - Database name: value of `db.name` (default: `mediawiki`) + - Database user/password: from your config and `secrets.yaml` + - Admin username/password: set to the values in your config and `secrets.yaml` + +4. At the end of the installer, download `LocalSettings.php` and copy it into the pod: + ```bash + kubectl cp LocalSettings.php mediawiki/:/var/www/html/LocalSettings.php + ``` + +5. The wiki is now live. + +## Notes + +- The `secretKey` and `upgradeKey` are auto-generated in `secrets.yaml` +- Extensions can be installed by copying them into the pod's `/var/www/html/extensions/` directory +- The wiki will show a "maintenance mode" page until `LocalSettings.php` is in place diff --git a/mediawiki/versions/1/db-init-job.yaml b/mediawiki/versions/1/db-init-job.yaml new file mode 100644 index 0000000..cb75c1c --- /dev/null +++ b/mediawiki/versions/1/db-init-job.yaml @@ -0,0 +1,64 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: mediawiki-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: mediawiki-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: mediawiki-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} <