From 762bb0c590b501e3d167648a7d4b7476f40091c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Sun, 17 Dec 2023 15:07:55 +0100 Subject: [PATCH] [add] role:dokuwiki --- ansible/roles/dokuwiki/defaults/main.json | 4 + ansible/roles/dokuwiki/info.md | 4 + ansible/roles/dokuwiki/tasks/main.json | 52 ++++++ ansible/roles/dokuwiki/templates/conf.php.j2 | 179 +++++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 ansible/roles/dokuwiki/defaults/main.json create mode 100644 ansible/roles/dokuwiki/info.md create mode 100644 ansible/roles/dokuwiki/tasks/main.json create mode 100644 ansible/roles/dokuwiki/templates/conf.php.j2 diff --git a/ansible/roles/dokuwiki/defaults/main.json b/ansible/roles/dokuwiki/defaults/main.json new file mode 100644 index 0000000..d16f8f2 --- /dev/null +++ b/ansible/roles/dokuwiki/defaults/main.json @@ -0,0 +1,4 @@ +{ + "var_dokuwiki_directory": "/opt/dokuwiki", + "var_dokuwiki_title": "DokuWiki" +} diff --git a/ansible/roles/dokuwiki/info.md b/ansible/roles/dokuwiki/info.md new file mode 100644 index 0000000..d670d5c --- /dev/null +++ b/ansible/roles/dokuwiki/info.md @@ -0,0 +1,4 @@ +## Beschreibung + +Für das leicht-gewichtige Wiki-System [DokuWiki](https://www.dokuwiki.org/dokuwiki) + diff --git a/ansible/roles/dokuwiki/tasks/main.json b/ansible/roles/dokuwiki/tasks/main.json new file mode 100644 index 0000000..e451cd5 --- /dev/null +++ b/ansible/roles/dokuwiki/tasks/main.json @@ -0,0 +1,52 @@ +[ + { + "name": "directory", + "become": true, + "ansible.builtin.file": { + "state": "directory", + "path": "{{var_dokuwiki_directory}}", + "owner": "www-data" + } + }, + { + "name": "acquisition", + "ansible.builtin.url_get": { + "url": "https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz", + "dest": "/tmp/dokuwiki.tgz" + } + }, + { + "name": "extraction", + "ansible.builtin.unarchive": { + "remote_src": true, + "src": "/tmp/dokuwiki.tgz", + "dest": "/tmp" + } + }, + { + "name": "version retrieval", + "ansible.builtin.shell": { + "cmd": "ls -1 /tmp/ | grep dokuwiki-" + }, + "register": "temp_version_output" + }, + { + "name": "emplacement", + "become": true, + "ansible.builtin.copy": { + "remote_src": true, + "state": "directory", + "src": "/tmp/{{temp_version_output}}", + "dest": "{{var_dokuwiki_directory}}", + "owner": "www-data" + } + }, + { + "name": "configuration", + "become": true, + "ansible.builtin.template": { + "src": "conf.php.j2", + "dest": "{{var_dokuwiki_directory}}/conf/dokuwiki.php" + } + } +] diff --git a/ansible/roles/dokuwiki/templates/conf.php.j2 b/ansible/roles/dokuwiki/templates/conf.php.j2 new file mode 100644 index 0000000..e911e8f --- /dev/null +++ b/ansible/roles/dokuwiki/templates/conf.php.j2 @@ -0,0 +1,179 @@ + tags + // 'htmldiff' - diff as HTML table + // 'html' - the full page rendered in XHTML +$conf['rss_media'] = 'both'; //what should be listed? + // 'both' - page and media changes + // 'pages' - page changes only + // 'media' - media changes only +$conf['rss_update'] = 5*60; //Update the RSS feed every n seconds (defaults to 5 minutes) +$conf['rss_show_summary'] = 1; //Add revision summary to title? 0|1 +$conf['rss_show_deleted'] = 1; //Show deleted items 0|1 + +/* Advanced Settings */ +$conf['updatecheck'] = 1; //automatically check for new releases? +$conf['userewrite'] = 0; //this makes nice URLs: 0: off 1: .htaccess 2: internal +$conf['useslash'] = 0; //use slash instead of colon? only when rewrite is on +$conf['sepchar'] = '_'; //word separator character in page names; may be a + // letter, a digit, '_', '-', or '.'. +$conf['canonical'] = 0; //Should all URLs use full canonical http://... style? +$conf['fnencode'] = 'url'; //encode filenames (url|safe|utf-8) +$conf['autoplural'] = 0; //try (non)plural form of nonexistent files? +$conf['compression'] = 'gz'; //compress old revisions: (0: off) ('gz': gnuzip) ('bz2': bzip) + // bz2 generates smaller files, but needs more cpu-power +$conf['gzip_output'] = 0; //use gzip content encoding for the output xhtml (if allowed by browser) +$conf['compress'] = 1; //Strip whitespaces and comments from Styles and JavaScript? 1|0 +$conf['cssdatauri'] = 512; //Maximum byte size of small images to embed into CSS, won't work on IE<8 +$conf['send404'] = 0; //Send an HTTP 404 status for nonexistent pages? +$conf['broken_iua'] = 0; //Platform with broken ignore_user_abort (IIS+CGI) 0|1 +$conf['xsendfile'] = 0; //Use X-Sendfile (1 = lighttpd, 2 = standard) +$conf['renderer_xhtml'] = 'xhtml'; //renderer to use for main page generation +$conf['readdircache'] = 0; //time cache in second for the readdir operation, 0 to deactivate. +$conf['search_nslimit'] = 0; //limit the search to the current X namespaces +$conf['search_fragment'] = 'exact'; //specify the default fragment search behavior +$conf['trustedproxy'] = '^(::1|[fF][eE]80:|127\.|10\.|192\.168\.|172\.((1[6-9])|(2[0-9])|(3[0-1]))\.)'; + //Regexp of trusted proxy address when reading IP using HTTP header + // if blank, do not trust any proxy (including local IP) + +/* Feature Flags */ +$conf['defer_js'] = 1; // Defer javascript to be executed after the page's HTML has been parsed. Setting will be removed in the next release. +$conf['hidewarnings'] = 0; // Hide warnings + +/* Network Settings */ +$conf['dnslookups'] = 1; //disable to disallow IP to hostname lookups +$conf['jquerycdn'] = 0; //use a CDN for delivering jQuery? +// Proxy setup - if your Server needs a proxy to access the web set these +$conf['proxy']['host'] = ''; +$conf['proxy']['port'] = ''; +$conf['proxy']['user'] = ''; +$conf['proxy']['pass'] = ''; +$conf['proxy']['ssl'] = 0; +$conf['proxy']['except'] = '';