Skip to content
Snippets Groups Projects
Commit 7bf23cc6 authored by jabertwo's avatar jabertwo
Browse files

WIP DokuWiki Testsetup

parent 1920b6f9
No related branches found
No related tags found
No related merge requests found
......@@ -105,6 +105,12 @@
domain: "verwaltung-jameica.test-warpzone.de",
basedir: "/srv/{{servicename}}"
}
- {
role: testserver/docker_dokuwiki, tags: [ test_dokuwiki, docker_services ],
servicename: "dokuwiki",
domain: "wiki.test-warpzone.de",
basedir: /srv/dokuwiki,
}
##################################################
# Produktive Server
......
---
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: "{{ basedir }}/secrets/oauth_secret", length: 64}
- name: create folder struct for dokuwiki
file:
path: "{{item}}"
state: "directory"
with_items:
- "{{ basedir }}"
- "{{ basedir }}/data"
- "{{ basedir }}/pdftemplate"
- name: Docker Compose Konfig-Datei erstellen
template:
src: "{{item}}"
dest: "{{ basedir }}/{{item}}"
with_items:
- docker-compose.yml
- Dockerfile
- authuffd_vars.php
register: config
- name: "stop {{ servicename}} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: absent
when: config.changed
- name: "start {{ servicename}} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: present
FROM php:8.3.2-apache-bookworm
# php-gd Modul für dw2pdf Plugin
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
# Upload-Limits hoch setzen
RUN touch /usr/local/etc/php/conf.d/uploads.ini \
&& echo "upload_max_filesize = 10M;" >> /usr/local/etc/php/conf.d/uploads.ini \
&& echo "post_max_size = 10M;" >> /usr/local/etc/php/conf.d/uploads.ini
# Apache mod_rewrite aktivieren
RUN a2enmod rewrite
# Expose Ports
EXPOSE 80
# DokuWiki herunterladen und installieren
RUN apt-get update && apt-get install -y wget unzip git \
&& wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz \
&& tar -xvzf dokuwiki-stable.tgz -C /var/www/html --strip-components=1 \
&& rm dokuwiki-stable.tgz
# Plugin-Verzeichnis erstellen und das Authentifizierungs-Plugin hinzufügen
RUN mkdir -p /var/www/html/lib/plugins/authuffd \
&& git clone https://git.cccv.de/uffd/dokuwiki-plugin-authuffd.git /var/www/html/lib/plugins/authuffd
# Konfigurationsdatei für das Plugin anpassen
COPY authuffd_vars.php /var/www/html/lib/plugins/authuffd/conf/default.php
# DokuWiki Konfiguration anpassen
RUN echo "\$conf['authtype'] = 'authuffd';" >> /var/www/html/conf/local.php
# Setzen der richtigen Berechtigungen
RUN chown -R www-data:www-data /var/www/html
# Startup
CMD ["apache2-foreground"]
<?php
$conf['name'] = 'uffd';
$conf['baseurl'] = '{{ oidc_global.provider_url }}';
$conf['oauth2_client_id'] = '{{ servicename }}';
$conf['oauth2_client_secret'] = '{{ oauth_secret }}';
$conf['oauth2_redirect_uri'] = '{{ domain }}/dokuwiki/doku.php?id=authredirect';
#$conf['api_username'] = '';
#$conf['api_password'] = '';
services:
app:
# values set in configuration: noreply_email_user - noreply_email_pass - smtp_host - smtp_port
build: .
image: "dokuwiki--{{ ansible_date_time.date }}--{{ ansible_date_time.hour }}-{{ ansible_date_time.minute }}-{{ ansible_date_time.second }}"
restart: always
volumes:
- /srv/dokuwiki/data/:/var/www/html
- /srv/dokuwiki/pdftemplate/:/var/www/html/lib/plugins/dw2pdf/tpl/warpzone/
labels:
- com.centurylinklabs.watchtower.enable=false
- traefik.enable=true
- traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`)
- traefik.http.routers.{{ servicename }}.entrypoints=websecure
- traefik.http.services.{{ servicename }}.loadbalancer.server.port=80
networks:
- default
- web
networks:
web:
external: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment