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

WIP: testserver dokuwiki

parent 404181fa
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
- "{{ basedir }}" - "{{ basedir }}"
- "{{ basedir }}/data" - "{{ basedir }}/data"
- "{{ basedir }}/pdftemplate" - "{{ basedir }}/pdftemplate"
- "{{ basedir }}/data/lib"
- "{{ basedir }}/data/lib/plugins"
- "{{ basedir }}/data/lib/plugins/oauth"
- "{{ basedir }}/data/lib/plugins/oauthgeneric"
- name: Docker Compose Konfig-Datei erstellen - name: Docker Compose Konfig-Datei erstellen
template: template:
...@@ -20,9 +24,36 @@ ...@@ -20,9 +24,36 @@
with_items: with_items:
- docker-compose.yml - docker-compose.yml
- Dockerfile - Dockerfile
- authuffd_vars.php
register: config register: config
- name: oauth plugin clonen
ansible.builtin.git:
repo: https://github.com/cosmocode/dokuwiki-plugin-oauth.git
dest: "{{ basedir }}/data/lib/plugins/oauth"
force: true
- name: config für oauth kopieren
ansible.builtin.template:
src: oauth_vars.php
dest: "{{ basedir }}/data/lib/plugins/oauth/conf/default.php"
- name: oauthgeneric plugin clonen
ansible.builtin.git:
repo: https://github.com/cosmocode/dokuwiki-plugin-oauthgeneric.git
dest: "{{ basedir }}/data/lib/plugins/oauthgeneric"
force: true
- name: config für oauthgeneric kopieren
ansible.builtin.template:
src: oauthgeneric_vars.php
dest: "{{ basedir }}/data/lib/plugins/oauthgeneric/conf/default.php"
- name: oauth provider aktivieren
ansible.builtin.lineinfile:
path: "{{ basedir }}/data/conf/local.php"
regexp: "^$conf['authtype'] = "
line: "$conf['authtype'] = 'oauth';"
- name: "stop {{ servicename}} docker" - name: "stop {{ servicename}} docker"
community.docker.docker_compose_v2: community.docker.docker_compose_v2:
project_src: "{{ basedir }}" project_src: "{{ basedir }}"
......
...@@ -25,16 +25,6 @@ RUN apt-get update && apt-get install -y wget unzip git \ ...@@ -25,16 +25,6 @@ RUN apt-get update && apt-get install -y wget unzip git \
&& tar -xvzf dokuwiki-stable.tgz -C /var/www/html --strip-components=1 \ && tar -xvzf dokuwiki-stable.tgz -C /var/www/html --strip-components=1 \
&& rm dokuwiki-stable.tgz && 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 # Setzen der richtigen Berechtigungen
RUN chown -R www-data:www-data /var/www/html RUN chown -R www-data:www-data /var/www/html
......
<?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'] = '';
<?php
/**
* Default settings for the oauth plugin
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
$conf['info'] = '';
$conf['custom-redirectURI'] = '';
$conf['mailRestriction'] = '';
$conf['singleService'] = '';
$conf['register-on-auth'] = 1;
$conf['overwrite-groups'] = 0;
\ No newline at end of file
<?php
/**
* Default settings for the oauthgeneric plugin
*/
$conf['key'] = 'dokuwiki';
$conf['secret'] = '{{ oauth_secret }}';
$conf['authurl'] = '{{ oauth_global.authorize_url }}';
$conf['tokenurl'] = '{{ oauth_global.token_url }}';
$conf['userurl'] = '{{ oauth_global.userinfo_url }}';
$conf['authmethod'] = '1';
$conf['scopes'] = 'email, openid, profile, groups';
$conf['needs-state'] = 0;
$conf['json-user'] = 'prefered_username';
$conf['json-name'] = 'name';
$conf['json-mail'] = 'email';
$conf['json-grps'] = 'groups';
$conf['label'] = 'uffd';
$conf['color'] = '#ff3d00';
\ No newline at end of file
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