Skip to content

Commit

Permalink
Merge pull request #1413 from p-l-/update-dokuwiki
Browse files Browse the repository at this point in the history
Web/dokuwiki: support release 20220731
  • Loading branch information
p-l- committed Aug 1, 2022
2 parents 1028a8f + 4af7f0e commit b9c8b82
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 22 deletions.
2 changes: 1 addition & 1 deletion doc/install/fast-install-and-first-run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Setup
# ln -s /usr/local/share/ivre/dokuwiki/media/logo.png
# ln -s /usr/local/share/ivre/dokuwiki/media/doc
# cd /usr/share/dokuwiki
# patch -p0 < /usr/local/share/ivre/patches/dokuwiki/backlinks.patch
# patch -p0 < /usr/local/share/ivre/patches/dokuwiki/backlinks-20200729.patch
# cd /etc/apache2/mods-enabled
# for m in rewrite.load wsgi.conf wsgi.load ; do
> [ -L $m ] || ln -s ../mods-available/$m ; done
Expand Down
2 changes: 1 addition & 1 deletion docker/web-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN echo 'WEB_GET_NOTEPAD_PAGES = "localdokuwiki"' >> /etc/ivre.conf
RUN apt-get update && \
apt-get -qy --no-install-recommends install patch && \
cd usr/share/dokuwiki && \
patch -p0 < /usr/local/share/ivre/patches/dokuwiki/backlinks.patch && \
patch -p0 < /usr/local/share/ivre/patches/dokuwiki/backlinks-20200729.patch && \
apt-get -qy --purge autoremove patch && \
apt-get clean && rm -rf /var/lib/apt/lists/*

Expand Down
4 changes: 2 additions & 2 deletions docker/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ RUN echo '\ndaemon off;' >> /etc/nginx/nginx.conf
RUN mkdir /var/run/uwsgi

# Download & install Dokuwiki
ADD http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz ./dokuwiki-stable.tgz
ADD https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz ./dokuwiki-stable.tgz
RUN tar --transform='s#^dokuwiki-\([^/]*\)#var/www/dokuwiki#' -zxf ./dokuwiki-stable.tgz && rm ./dokuwiki-stable.tgz

# IVRE-specific
RUN apt-get -q update && \
apt-get -qy --no-install-recommends install patch && \
patch var/www/dokuwiki/inc/html.php usr/local/share/ivre/patches/dokuwiki/backlinks.patch && \
patch var/www/dokuwiki/inc/Ui/Backlinks.php usr/local/share/ivre/patches/dokuwiki/backlinks.patch && \
apt-get -qy --purge autoremove patch && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/local/share/ivre/dokuwiki/doc var/www/dokuwiki/data/pages/doc && \
Expand Down
19 changes: 19 additions & 0 deletions patches/dokuwiki/backlinks-20200729.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- inc/html.php.orig 2013-04-13 13:54:32.942894348 +0200
+++ inc/html.php 2013-04-13 14:10:28.926918827 +0200
@@ -844,7 +844,15 @@ function html_backlinks(){
print '</div></li>';
}
print '</ul>';
- } else {
+ }
+ if (filter_var($ID, FILTER_VALIDATE_IP)) {
+ print '<ul class="idx">';
+ print '<li><div class="li">';
+ print '<a target="_top" href="/#'.$ID.'">IVRE record(s)</a>';
+ print '</div></li>';
+ print '</ul>';
+ }
+ else if(empty($data)) {
print '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
}
}
34 changes: 17 additions & 17 deletions patches/dokuwiki/backlinks.patch
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
--- inc/html.php.orig 2013-04-13 13:54:32.942894348 +0200
+++ inc/html.php 2013-04-13 14:10:28.926918827 +0200
@@ -844,7 +844,15 @@ function html_backlinks(){
print '</div></li>';
--- inc/Ui/Backlinks.php.orig 2022-08-01 12:59:41.027353178 +0200
+++ inc/Ui/Backlinks.php 2022-08-01 13:13:32.514029298 +0200
@@ -35,7 +35,15 @@ class Backlinks extends Ui
print '</div></li>';
}
print '</ul>';
- } else {
+ }
+ if (filter_var($ID, FILTER_VALIDATE_IP)) {
+ print '<ul class="idx">';
+ print '<li><div class="li">';
+ print '<a target="_top" href="/#'.$ID.'">IVRE record(s)</a>';
+ print '</div></li>';
+ print '</ul>';
+ }
+ else if(empty($data)) {
print '<div class="level1"><p>'. $lang['nothingfound'] .'</p></div>';
}
print '</ul>';
- } else {
+ }
+ if(preg_match('/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/', $ID)) {
+ print '<ul class="idx">';
+ print '<li><div class="li">';
+ print '<a target="_top" href="/#'.$ID.'">IVRE record(s)</a>';
+ print '</div></li>';
+ print '</ul>';
+ }
+ else if(empty($data)) {
print '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
}
}
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,13 @@ def _write_pkg_file(self, file):
# Dokuwiki
("share/ivre/dokuwiki/media", ["web/dokuwiki/media/logo.png"]),
# Patches
("share/ivre/patches/dokuwiki", ["patches/dokuwiki/backlinks.patch"]),
(
"share/ivre/patches/dokuwiki",
[
"patches/dokuwiki/backlinks.patch",
"patches/dokuwiki/backlinks-20200729.patch",
],
),
(
"share/ivre/patches/nmap",
["patches/nmap/rtsp-url-brute.patch"],
Expand Down

0 comments on commit b9c8b82

Please sign in to comment.