From: Bernhard Tittelbach Date: Fri, 17 Oct 2025 23:19:22 +0000 (+0200) Subject: dokuwiki works X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=85f23fe4e22ef7cc577c2292f344d688268a2be2;p=noc.git dokuwiki works --- diff --git a/ansible/host_vars/vex2/dokuwiki.yml b/ansible/host_vars/vex2/dokuwiki.yml index eeadd1e..cbb7012 100644 --- a/ansible/host_vars/vex2/dokuwiki.yml +++ b/ansible/host_vars/vex2/dokuwiki.yml @@ -15,14 +15,14 @@ dokuwiki_plugins: url: https://github.com/michitux/dokuwiki-plugin-move/archive/refs/tags/2025-06-09.tar.gz sha256: 08c451bb7313bfbfa378f0f49df0cb6ec87c304ff692ed0a377a42272b7a5d23 include: - url: https://github.com/dokufreaks/plugin-include/archive/refs/tags/2018-11-29.tar.gz - sha256: 8aba5104a072089dd1f4a158bffd7db34b951c79da9a89d5270919e9a7a7d505. + url: https://github.com/dokufreaks/plugin-include/archive/master.tar.gz + sha256: d73b9d833b10179c5c807175f32c3aef154fddce49095e21c4ee89a4664b5338 pagelist: - url: https://github.com/dokufreaks/plugin-pagelist/archive/refs/tags/2017-08-24.tar.gz - sha256: 18791d19b52df21958f1aeca0ab73072370c27aa4a03f820aa1a10dcb32d33d3 + url: https://github.com/dokufreaks/plugin-pagelist/archive/master.tar.gz + sha256: 1257a39f6c9a8fd5fca5726b9a4c7604b6decfa1177d887a287e7d41261a3e4f tag: - url: https://github.com/dokufreaks/plugin-tag/archive/refs/tags/2017-08-24.tar.gz - sha256: 4c184b1effe3c12a3c91d9046c0abd0d352891d038f8ae9b5b0fa19b0782c793 + url: https://github.com/dokufreaks/plugin-tag/archive/master.tar.gz + sha256: 2ec1305c7e31954f3206a85bf6cd797871d8695e9eb0d67be553abe1df170dd8 wrap: url: https://github.com/selfthinker/dokuwiki_plugin_wrap/archive/refs/tags/stable.tar.gz sha256: 060d72e664595c746616f1b552213ec615bcb3132e762b2d8a24f672fdd048c0 @@ -36,3 +36,28 @@ dokuwiki_templates: sha256: d0aea1b8c5846012ee4ba6968921d97cb88b8d54eb062c62ce01a6d15a00714d # url: 'https://github.com/dokuwiki/dokuwiki/releases/download/release-2025-05-14a/dokuwiki-2025-05-14a.tgz' # sha256: '91e508832febe10c7317e484e946576692bf9181397f8dace1df006f8161176d' + +dokuwiki_config: + title: "realraum" + startpage: "realraum" + template: "bootstrap3" + tagline: "Hackspace in Graz" + sidebarpage: "sidebar" + license: "cc-by-sa" + savedir: "/srv/dokuwiki/data" + recent: 50 + recent_days: 21 + breadcrumbs: 0 + fullpath: 1 + dformat: '%Y-%m-%d %H:%M' + sneaky_index: 1 + useacl: 1 + passcrypt: 'bcrypt' + superuser: '@admin' + disableactions: 'register' + mailguard: 'hex' + htmlok: 1 + mailfrom: 'noreply@wiki.realraum.at' + sitemap: 5 + dnslookups: 0 + diff --git a/ansible/roles/base/tasks/05tools.yml b/ansible/roles/base/tasks/05tools.yml index 26d92f9..57f072b 100644 --- a/ansible/roles/base/tasks/05tools.yml +++ b/ansible/roles/base/tasks/05tools.yml @@ -4,6 +4,7 @@ name: - htop - zsh + - rsync - name: set root default shell to zsh user: diff --git a/ansible/roles/web/dokuwiki/handlers/main.yml b/ansible/roles/web/dokuwiki/handlers/main.yml index 52aa315..feb04f1 100644 --- a/ansible/roles/web/dokuwiki/handlers/main.yml +++ b/ansible/roles/web/dokuwiki/handlers/main.yml @@ -2,7 +2,7 @@ ## TODO: fix hardcoded php version... - name: reload php-fpm service: - name: php7.3-fpm.service + name: php8.2-fpm.service state: reloaded - name: reload nginx diff --git a/ansible/roles/web/dokuwiki/tasks/main.yml b/ansible/roles/web/dokuwiki/tasks/main.yml index ebbc001..6009e49 100644 --- a/ansible/roles/web/dokuwiki/tasks/main.yml +++ b/ansible/roles/web/dokuwiki/tasks/main.yml @@ -24,11 +24,33 @@ group: dokuwiki mode: 0700 +- name: symlink acl und userdata configs + with_items: + - acl.auth.php + - users.auth.php + file: + state: link + src: "/srv/dokuwiki/acl/{{ item }}" + path: "/etc/dokuwiki/{{ item }}" + +- name: install dokuwiki config + template: + src: dokuwiki.php.j2 + dest: /etc/dokuwiki/dokuwiki.php + notify: reload php-fpm + +- name: install userstyle.css + template: + src: userstyle.css.j2 + dest: /etc/dokuwiki/userstyle.css + notify: reload php-fpm + + ## TODO: fix hardcoded php version... - name: install php-fpm config template: src: php-fpm.conf.j2 - dest: /etc/php/8.2/fpm/pool.d/dokuwiki.conf + dest: /etc/php/8.2/fpm/pool.d/z_read_last_dokuwiki.conf notify: reload php-fpm diff --git a/ansible/roles/web/dokuwiki/templates/dokuwiki.php.j2 b/ansible/roles/web/dokuwiki/templates/dokuwiki.php.j2 new file mode 100644 index 0000000..8134c8d --- /dev/null +++ b/ansible/roles/web/dokuwiki/templates/dokuwiki.php.j2 @@ -0,0 +1,168 @@ + tags + // 'htmldiff' - diff as HTML table + // 'html' - the full page rendered in XHTML +$conf['rss_media'] = '{{ dokuwiki_config.rss_media | default("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'] = {{ dokuwiki_config.rss_show_summary | default("1") }}; //Add revision summary to title? 0|1 +$conf['rss_show_deleted'] = {{ dokuwiki_config.rss_show_deleted | default("1") }}; //Show deleted items 0|1 + +/* Advanced Settings */ +$conf['updatecheck'] = {{ dokuwiki_config.updatecheck | default("0") }}; //automatically check for new releases? +$conf['userewrite'] = {{ dokuwiki_config.userewrite | default("0") }}; //this makes nice URLs: 0: off 1: .htaccess 2: internal +$conf['useslash'] = {{ dokuwiki_config.useslash | default("0") }}; //use slash instead of colon? only when rewrite is on +$conf['sepchar'] = '{{ dokuwiki_config.sepchar | default("_") }}'; //word separator character in page names; may be a + // letter, a digit, '_', '-', or '.'. +$conf['canonical'] = {{ dokuwiki_config.canonical | default("0") }}; //Should all URLs use full canonical http://... style? +$conf['fnencode'] = '{{ dokuwiki_config.fnencode | default("url") }}'; //encode filenames (url|safe|utf-8) +$conf['autoplural'] = {{ dokuwiki_config.autoplural | default("0") }}; //try (non)plural form of nonexisting files? +$conf['compression'] = '{{ dokuwiki_config.compression | default("gz") }}'; //compress old revisions: (0: off) ('gz': gnuzip) ('bz2': bzip) + // bz2 generates smaller files, but needs more cpu-power +$conf['gzip_output'] = {{ dokuwiki_config.gzip_output | default("0") }}; //use gzip content encodeing for the output xhtml (if allowed by browser) +$conf['compress'] = {{ dokuwiki_config.compress | default("1") }}; //Strip whitespaces and comments from Styles and JavaScript? 1|0 +$conf['cssdatauri'] = {{ dokuwiki_config.cssdatauri | default("512") }}; //Maximum byte size of small images to embed into CSS, won't work on IE<8 +$conf['send404'] = {{ dokuwiki_config.send404 | default("0") }}; //Send a HTTP 404 status for non existing pages? +$conf['broken_iua'] = {{ dokuwiki_config.broken_iua | default("0") }}; //Platform with broken ignore_user_abort (IIS+CGI) 0|1 +$conf['xsendfile'] = {{ dokuwiki_config.xsendfile | default("0") }}; //Use X-Sendfile (1 = lighttpd, 2 = standard) +$conf['renderer_xhtml'] = '{{ dokuwiki_config.renderer_xhtml | default("xhtml") }}'; //renderer to use for main page generation +$conf['readdircache'] = {{ dokuwiki_config.readdircache | default("0") }}; //time cache in second for the readdir operation, 0 to deactivate. +$conf['search_nslimit'] = {{ dokuwiki_config.search_nslimit | default("0") }}; //limit the search to the current X namespaces +$conf['search_fragment'] = '{{ dokuwiki_config.search_fragment | default("exact") }}'; //specify the default fragment search behavior +$conf['trustedproxy'] = '{{ dokuwiki_config.trustedproxy | default("^(::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'] = {{ dokuwiki_config.defer_js | default("1") }}; // Defer javascript to be executed after the page's HTML has been parsed. Setting will be removed in the next release. + +/* Network Settings */ +$conf['dnslookups'] = {{ dokuwiki_config.dnslookups | default("1") }}; //disable to disallow IP to hostname lookups +$conf['jquerycdn'] = {{ dokuwiki_config.jquerycdn | default("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'] = ''; diff --git a/ansible/roles/web/dokuwiki/templates/nginx.j2 b/ansible/roles/web/dokuwiki/templates/nginx.j2 index 642cc3c..11ac035 100644 --- a/ansible/roles/web/dokuwiki/templates/nginx.j2 +++ b/ansible/roles/web/dokuwiki/templates/nginx.j2 @@ -50,6 +50,6 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REDIRECT_STATUS 200; - fastcgi_pass unix:/var/run/dokuwiki-php-fpm.sock; + fastcgi_pass unix:/run/dokuwiki-php-fpm.sock; } } diff --git a/ansible/roles/web/dokuwiki/templates/php-fpm.conf.j2 b/ansible/roles/web/dokuwiki/templates/php-fpm.conf.j2 index c1b7efa..e835021 100644 --- a/ansible/roles/web/dokuwiki/templates/php-fpm.conf.j2 +++ b/ansible/roles/web/dokuwiki/templates/php-fpm.conf.j2 @@ -2,7 +2,7 @@ user = dokuwiki group = dokuwiki -listen = /var/run/dokuwiki-php-fpm.sock +listen = /run/dokuwiki-php-fpm.sock listen.owner = www-data listen.group = www-data diff --git a/ansible/roles/web/dokuwiki/templates/transfer_dokuwiki_vex1_data_to_vex2.sh b/ansible/roles/web/dokuwiki/templates/transfer_dokuwiki_vex1_data_to_vex2.sh new file mode 100755 index 0000000..039882d --- /dev/null +++ b/ansible/roles/web/dokuwiki/templates/transfer_dokuwiki_vex1_data_to_vex2.sh @@ -0,0 +1,13 @@ +#!/bin/zsh +rsync -e 'ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa -o KexAlgorithms=curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1' -v -r --size-only --chown dokuwiki:dokuwiki vex.realraum.at:/var/www/dokuwiki/data/ /srv/dokuwiki/data/ +rsync -e 'ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa -o KexAlgorithms=curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1' -v -r --size-only --chown dokuwiki:dokuwiki vex.realraum.at:/var/www/dokuwiki/conf/acl.auth.php vex.realraum.at:/var/www/dokuwiki/conf/users.auth.php /srv/dokuwiki/acl/ + +## Fixes for newer plugins +sed 's//{{fa>\1}}/' -i /srv/dokuwiki/data/pages/navbar.txt +sed '/^{{rss/d' -i /srv/dokuwiki/data/pages/realraum.txt + +## Todo +# - markdown conversion with pandoc + +for f in /srv/dokuwiki/data/pages/**/*.md.txt; do pandoc --from markdown "$f" -t dokuwiki -o "${f:r:r}.txt" && rm "$f"; done + diff --git a/ansible/roles/web/dokuwiki/templates/userstyle.css.j2 b/ansible/roles/web/dokuwiki/templates/userstyle.css.j2 new file mode 100644 index 0000000..b83e71f --- /dev/null +++ b/ansible/roles/web/dokuwiki/templates/userstyle.css.j2 @@ -0,0 +1,125 @@ + /** Vanilla Bootstrap Theme */ +/** +; r3 theme: +; body background: #D0D0AF +; text bg: #ffffff +; text: #000000 +; link text: #761407 +; hr line: #8CACBB +; header bg: #761407 +; logo colour: #ffffff +; menu bg: black +; menu text: white +; footer bg: #761407 +; footer text: #CCC +; realraum text header color: #F8F8F8 +; sidebar item header: bg: #333 +; sidebar item header: text: #DDD + +**/ +body { + background-color:#D0D0AF; +} + + +@media (min-width:1300px) { + .container{ + width:1280px + } +} + +div.r3floatsidebar { + display:none; +} +@media (min-width:992px) { +div.r3floatsidebar { + float:right; + min-width:20em; + border-left:1ex white solid; + display:block; +} +} + + +body.default.page-on-panel, body.optional.page-on-panel { + background-color:#D0D0AF; +} + +nav.navbar,ul.dropdown-menu { + background-color:#761407; + color:white; +} + +li.dropdown-header { + color:white; + font-variant:small-caps; +} +ul.navbar-nav > li > a{ + padding-left:10px; + padding-right:10px; +} +ul.tools > li.dropdown-header { + background-color:#333; +} + + +#dw__title, #dw__taglin{ + color:white; +} + +.navbar-toggle .navbar-brand .dropdown-toggle { + color:white; +} + +a.urlextern, +a.wikilink1, +a.mediafile, +a.action, +ul > li > a { + color: #761407; +} +.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{ + color:white; +} + +.navbar-default .navbar-nav > li > a, +h4 > small { + color:white; +} +.dropdown-menu > li > a { + color:white; +} + +span.label { + background-color:#761407; + color:white; +} +.pageId { + font-size:150%; + +} + +div.wrap_collapse { + overflow:hidden; + max-height:1.7em; + background-image: linear-gradient(#337AB7 10%, white 100%); + transition:all 0.5s linear; +} +div.wrap_collapse:target { + overflow:show; + max-height:none; + background-image:none; + transition:all 0.5s linear; +} + +/** needed to display sensorvalue divs **/ +div.sensorstatus { + width:auto; + padding:5px; + float:left; + text-align:left; + vertical-align:middle; + font-size:90%; +} + +