Your message dated Fri, 25 Oct 2024 15:40:16 +0000
with message-id <[email protected]>
and subject line Bug#908857: fixed in didiwiki 3.0.4-1
has caused the Debian Bug report #908857,
regarding Enhancements: https-support, reduced logging, page deletion, 
migration away from NUL byte, help page update
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
908857: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908857
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: didiwiki
Version: 0.5-13
Severity: wishlist
Tags: patch

This is a proposed patch for 0.5-14.

As a side effect, it would also fix bug #864883.

Note that this is *not* related to "Amigo's 0.8 Didiwiki" from the PuppyLinux project, but has been developed independently based on the current Debian version.

The patch is intended to be applied atop of 0.5-13 and contains the following parts:

001_fix_camelcase_in_help.patch
003_document_image_filetypes.patch
004_reduced_logging_opt.patch
005_https_support.patch
006_delete_empty_pages.patch
007_backwards_compatible_automigrate_away_nul.patch

The patches have been developed with Quilt, but have then been reformatted so that they will also be accepted by "git am".

Here is an overview of what the patches do:

==============================

$ sed '/^Subject/,/^diff /!d; /^diff / s/./-/g' *.patch

Subject: Avoid incorrectly formatted word "camelcase"

The help text contains /camelcase/, but for some reason (read: most
likely a bug) the word does not get formatted as italic text.

Therefore changing the word to CamelCase, which will also serve as a
better example.

original-patch-name: fix_camelcase_in_help.patch

--------------------------------------------
Subject: Document which image files types are supported

The current help text mentions just a few examples of possible image
file types, but does not give an exhaustive list.

Fix that.

original-patch-name: document_image_filetypes.patch

--------------------------------------------
Subject: Add --log-less option to restrict logging

I did not like that didiwiki used to flood my syslog with messages what
pages were shown.

Firstly, those messages are mostly irrelevant except for debugging.

Secondly, I consider this to be a privacy issue. didiwiki is supposed to
be a private Wiki, so I cannot see why this private activity should be
logged at all.

When using the shipped /etc/default/didiwiki configuration file, logging
can be restricted via the LISTEN setting: Change

LISTEN=127.0.0.1

into

LISTEN="127.0.0.1 --log-less"

This should do the trick without needing to edit the existing service
script.

original-patch-name: reduced_logging_opt.patch

------------------------------------
Subject: Also support "https://"-URLs as external links

Plus add an exhaustive list of supported URL schemes to the help text.

original-patch-name: https_support.patch

------------------------------------
Subject: Add support for page deletions

This works really simple: If an existing page is edited and turns out to
be empty when saved, it is deleted instead.

original-patch-name: delete_empty_pages.patch

------------------------------------
Subject: Get rid of useless NUL terminator in Wiki pages

Until now, Wiki pages have been saved as Internet text files (i. e.
using CRLF newline sequences), plus a NUL byte at the end.

At first, I assumed this was the case becaus DidiWiki would mmap() the
whole file, therefore requiring the NUL byte as a buffer terminator.

However, this is not the case. The files are read with the usual
functions; not mmapped. IMHO, the NUL terminator is completely useless.

Therefore change the code so that a NUL terminator will do no harm when
it is read, but will be ignored and is not required at all.

Also change code for writing wiki pages so that no NUL terminator is
written.

This allows a seamless and transparent migration from old existing Wiki
pages which still contain NUL terminators to newly written or updated
Wiki pages without the NUL terminator.

This means it is not necessary to convert any existing Wiki Pages. They
will lose their NUL terminator if they should be updated, but will also
work fine with the terminator still present.

original-patch-name: backwards_compatible_automigrate_away_nul.patch

------------------------------------

==============================================================================

The patch can either be applied in a single operation with

$ patch -p1 < didiwiki_0.5-13_p1-2018.258.patch

or by unpacking it into individual patches first and then applying the individual patches:

$ ar xov didiwiki_0.5-13_p1-2018.258.patch
$ cat 0*.patch | patch -p1

Finally, here is the patch itself.

$ cat << 'EOF' > didiwiki_0.5-13_p1-2018.258.patch
!<arch>
//                                              208       `
001_fix_camelcase_in_help.patch/
003_document_image_filetypes.patch/
004_reduced_logging_opt.patch/
005_https_support.patch/
006_delete_empty_pages.patch/
007_backwards_compatible_automigrate_away_nul.patch/
/0              0           0     0     644     1415      `
From b35d756add96aa2c69d7e43beae90cda58730cec Mon Sep 17 00:00:00 2001
From: Guenther Brunthaler <[email protected]>
Date: Thu, 13 Sep 2018 22:40:31 +0200
Subject: Avoid incorrectly formatted word "camelcase"

The help text contains /camelcase/, but for some reason (read: most
likely a bug) the word does not get formatted as italic text.

Therefore changing the word to CamelCase, which will also serve as a
better example.

original-patch-name: fix_camelcase_in_help.patch

diff --git a/src/wikitext.h b/src/wikitext.h
index 50cabe5..1869120 100644
--- a/src/wikitext.h
+++ b/src/wikitext.h
@@ -122,8 +122,8 @@
 "  /*Combination of bold and italics*/\n"                                \
 "----\n"                                                                 \
 "\n"                                                                     \
-"WikiLinks are formed by two or more words in /camelcase/.\n"           \
-" WikiLinks are formed by two or more words in /camelcase/.\n"          \
+"WikiLinks are formed by two or more words in CamelCase.\n"              \
+" WikiLinks are formed by two or more words in CamelCase.\n"             \
 "External links begin with http://, like http://www.freepan.org\n";       \
 " External links begin with http://, like http://www.freepan.org\n";      \
"Forced wiki [links] are a alphanumeric string surrounded by square brackets.\n" \
--
2.11.0


/33             0           0     0     644     1112      `
From 59e1d15cbf52b28bb05d204fe0fce3a4f73b1562 Mon Sep 17 00:00:00 2001
From: Guenther Brunthaler <[email protected]>
Date: Thu, 13 Sep 2018 22:50:04 +0200
Subject: Document which image files types are supported

The current help text mentions just a few examples of possible image
file types, but does not give an exhaustive list.

Fix that.

original-patch-name: document_image_filetypes.patch

diff --git a/src/wikitext.h b/src/wikitext.h
index 1869120..41635b9 100644
--- a/src/wikitext.h
+++ b/src/wikitext.h
@@ -140,6 +140,7 @@
 "\n"                                                                     \
 "http://www.google.com/images/logo.gif\n";                                \
 " http://www.google.com/images/logo.gif\n";                               \
+"Supported image file extensions: .gif .png .jpg .jpeg\n"                \
 "----\n"                                                                 \
"Unordered lists begin with a '* '. The number of asterisks determines the level:\n" \
 "* foo\n"                                                                \
--
2.11.0

/69             0           0     0     644     2492      `
From 7f8eb987429ea32b7aafc39107a22afd9bb0bde4 Mon Sep 17 00:00:00 2001
From: Guenther Brunthaler <[email protected]>
Date: Fri, 14 Sep 2018 18:23:04 +0200
Subject: Add --log-less option to restrict logging

I did not like that didiwiki used to flood my syslog with messages what
pages were shown.

Firstly, those messages are mostly irrelevant except for debugging.

Secondly, I consider this to be a privacy issue. didiwiki is supposed to
be a private Wiki, so I cannot see why this private activity should be
logged at all.

When using the shipped /etc/default/didiwiki configuration file, logging
can be restricted via the LISTEN setting: Change

LISTEN=127.0.0.1

into

LISTEN="127.0.0.1 --log-less"

This should do the trick without needing to edit the existing service
script.

original-patch-name: reduced_logging_opt.patch

diff --git a/src/didi.c b/src/didi.c
index f2ce746..b141db6 100644
--- a/src/didi.c
+++ b/src/didi.c
@@ -1,11 +1,13 @@
 #include "didi.h"

 static int debug;
+int restrict_logging;

 int
 usage()
 {
   fprintf(stderr, "Usage: didiwiki [options]\n");
+ fprintf(stderr, " --log-less : suppress non-critical syslog output\n"); fprintf(stderr, " -d, --debug : debug mode, listens to requests from stdin\n"); fprintf(stderr, " -h, --home <path> : specify didiwiki's home directory\n");
   fprintf(stderr, "   -l, --listen <ipaddr> : specify IP address\n");
@@ -33,6 +35,7 @@ main(int argc, char **argv)
     {
       static struct option long_options[] =
        {
+         {"log-less", no_argument,     0, 12},
          {"debug",  no_argument,       0, 'd'},
       {"listen", required_argument, 0, 'l'},
          {"port",   required_argument, 0, 'p'},
@@ -54,6 +57,10 @@ main(int argc, char **argv)
        {
        case 0:
          break;
+
+       case 12: /* ^L restrict syslog output. */
+         restrict_logging = 1;
+         break;
        
        case 'd':
          debug = 1;
diff --git a/src/http.c b/src/http.c
index 13fd807..c0314fa 100644
--- a/src/http.c
+++ b/src/http.c
@@ -481,6 +481,8 @@ sigterm(int sig)
 */
 #define MAX_PARALLEL 5

+extern int restrict_logging;
+
 /*
 ** Implement an HTTP server daemon.
 */
@@ -539,6 +541,10 @@ http_server(struct in_addr address, int iPort)

   /* log starting information */
   openlog("didiwiki", 0, 0);
+  if (restrict_logging)
+  {
+    setlogmask(LOG_EMERG | LOG_ALERT | LOG_CRIT | LOG_ERR);
+  }
   syslog(LOG_LOCAL0|LOG_INFO, "started with PID %d", getpid());

   listen(listener,10);
--
2.11.0

/100            0           0     0     644     1675      `
From bc904cb25276c34440132f48a53e7289e81a3eec Mon Sep 17 00:00:00 2001
From: Guenther Brunthaler <[email protected]>
Date: Thu, 13 Sep 2018 16:05:24 +0200
Subject: Also support "https://"-URLs as external links

Plus add an exhaustive list of supported URL schemes to the help text.

original-patch-name: https_support.patch

diff --git a/src/wiki.c b/src/wiki.c
index 4c64c95..10cc73c 100644
--- a/src/wiki.c
+++ b/src/wiki.c
@@ -81,6 +81,7 @@ check_for_link(char *line, int *skip_chars)
       p++;
     }
   else if (!strncasecmp(p, "http://";, 7)
+          || !strncasecmp(p, "https://";, 8)
           || !strncasecmp(p, "mailto://";, 9)
           || !strncasecmp(p, "file://", 7))
     {
@@ -132,7 +133,7 @@ check_for_link(char *line, int *skip_chars)
        {
          char *extra_attr = "";

-         if (!strncasecmp(url, "http://";, 7))
+         if (!strncasecmp(url, "http://";, 7) || !strncasecmp(url, "https://";, 
8))
            extra_attr = " title='WWW link' ";

          if (title)
diff --git a/src/wikitext.h b/src/wikitext.h
index 41635b9..0fb04c0 100644
--- a/src/wikitext.h
+++ b/src/wikitext.h
@@ -134,6 +134,7 @@
" Sometimes !WordsShouldNotMakeAWikiLink so put a '! ' beforehand.\n" \
 "Same thing with !http://foobar.com\n";                                   \
 " Same thing with !http://foobar.com\n";                                  \
+"Supported types of external links: http:// https:// mailto:// file://\n" \
 "----\n"                                                                 \
 "\n"                                                                     \
 "Links to images display the image:\n"                                   \
--
2.11.0


/125            0           0     0     644     1824      `
From d83620c6c83819f3056c6d638e650d19e81cd53f Mon Sep 17 00:00:00 2001
From: Guenther Brunthaler <[email protected]>
Date: Thu, 13 Sep 2018 17:06:03 +0200
Subject: Add support for page deletions

This works really simple: If an existing page is edited and turns out to
be empty when saved, it is deleted instead.

original-patch-name: delete_empty_pages.patch

diff --git a/src/wiki.c b/src/wiki.c
index 10cc73c..da02723 100644
--- a/src/wiki.c
+++ b/src/wiki.c
@@ -1027,6 +1027,13 @@ wiki_handle_http_request(HttpRequest *req)
       /* TODO: dont blindly write wikitext data to disk */
       if ( (wikitext = http_request_param_get(req, "wikitext")) != NULL)
        {
+         if (*wikitext == '\0' && access(page, F_OK) == 0)
+           {
+             syslog(LOG_LOCAL0|LOG_INFO, "delete empty page %s", page);
+             unlink(page); /* remove() would also delete empty directories. */
+             wiki_redirect(res, "WikiHome");
+             return;
+           }
          file_write(page, wikitext);

       /* log modified page name and IP address */
diff --git a/src/wikitext.h b/src/wikitext.h
index 0fb04c0..9a07274 100644
--- a/src/wikitext.h
+++ b/src/wikitext.h
@@ -83,7 +83,7 @@
                                                                          \
 "=Quick Guide \n"                                                    \
 "Top toolbar usage\n"                                                    \
-"* [?edit Edit] Allows you to edit pages ( see below for rules )\n"       \
+"* [?edit Edit] Allows you to edit pages (see below for rules). Saving an empty page will delete it.\n" \
 "* [/WikiHome Home] Takes you to the wiki front page\n"                \
"* [/Changes Changes] Lists the pages changed by date\n" \ "* [/Create New] Creates a new wiki page by title\n" \
--
2.11.0

/155            0           0     0     644     1957      `
From 7e71a001db765ba9b31429893137769e8661bcfc Mon Sep 17 00:00:00 2001
From: Guenther Brunthaler <[email protected]>
Date: Fri, 14 Sep 2018 21:30:46 +0200
Subject: Get rid of useless NUL terminator in Wiki pages

Until now, Wiki pages have been saved as Internet text files (i. e.
using CRLF newline sequences), plus a NUL byte at the end.

At first, I assumed this was the case becaus DidiWiki would mmap() the
whole file, therefore requiring the NUL byte as a buffer terminator.

However, this is not the case. The files are read with the usual
functions; not mmapped. IMHO, the NUL terminator is completely useless.

Therefore change the code so that a NUL terminator will do no harm when
it is read, but will be ignored and is not required at all.

Also change code for writing wiki pages so that no NUL terminator is
written.

This allows a seamless and transparent migration from old existing Wiki
pages which still contain NUL terminators to newly written or updated
Wiki pages without the NUL terminator.

This means it is not necessary to convert any existing Wiki Pages. They
will lose their NUL terminator if they should be updated, but will also
work fine with the terminator still present.

original-patch-name: backwards_compatible_automigrate_away_nul.patch

diff --git a/src/wiki.c b/src/wiki.c
index da02723..bc627fb 100644
--- a/src/wiki.c
+++ b/src/wiki.c
@@ -168,8 +168,8 @@ file_read(char *filename)

   str = (char *)malloc(sizeof(char)*(st.st_size + 1));
   len = fread(str, 1, st.st_size, fp);
-  if (len >= 0) str[len] = '\0';
-
+  if (len >= 0) str[len] = '\0'; else { free(str); str= NULL; }
+
   fclose(fp);

   return str;
@@ -181,7 +181,7 @@ file_write(char *filename, char *data)
 {
   FILE*       fp;
   int         bytes_written = 0;
-  int         len           = strlen(data)+1;
+  int         len           = strlen(data);

   if (!(fp = fopen(filename, "wb")))
     return -1;
--
2.11.0



EOF

--- End Message ---
--- Begin Message ---
Source: didiwiki
Source-Version: 3.0.4-1
Done: наб <[email protected]>

We believe that the bug you reported is fixed in the latest version of
didiwiki, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
наб <[email protected]> (supplier of updated didiwiki package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 25 Oct 2024 15:23:09 +0200
Source: didiwiki
Architecture: source
Version: 3.0.4-1
Distribution: unstable
Urgency: medium
Maintainer: Package Salvaging Team <[email protected]>
Changed-By: наб <[email protected]>
Closes: 607783 864883 908857 955989 1039173
Changes:
 didiwiki (3.0.4-1) unstable; urgency=medium
 .
   [ наб ]
   * Salvage Team upload
   * New maintainer: the Package Salvaging Team 
<[email protected]>
     Closes: #955989
   * d/watch: point at https://sf.net/ciwiki
   * New upstream version 3.0.4 (Closes: #607783, #864883)
   * d/README.source: delete, not true
   * d/didiwiki.1: remove, didiwiki.manpages -> upstream docs/ciwiki.man
   * Rebase patches
   * Standards-Version: 4.7.0 (routine-update)
   * debhelper-compat 13 (routine-update)
   * Remove trailing whitespace in debian/changelog (routine-update)
   * debian/styles.css: remove, replace with upstream styles.css
   * d/copyright: DEP-5, update for ciwili 3
   * d/control: missing Build-Depends: debhelper
   * d/rules: don't break on clean
   * Fix build warnings and errors
   * d/docs: update for ciwiki
   * dh_installman: error: Could not determine section for ./docs/ciwiki.man
   * configure-generated-file-in-source
   * d/didiwiki.service: add (Closes: #1039173)
   * d/control: didiwki Provides: ciwiki
   * d/postinst: don't chown -R
   * Apply patches from #908857, adapted to ciwiki 3.x.x
     (except those superseded, and the deletion patch (ciwiki has deletion))
     Closes: #908857
   * Install the notifyuser script as /usr/libexec/didiwiki-notifynewuser.sh
     and configure its path properly
   * d/default: add $OPTIONS
   * Default $OPTIONS to --nologin (like didiwiki 0.5)
   * debian/didiwiki.docs: PAGESTYLES
   * debian/didiwiki.docs: upstream NEWS
   * d/NEWS: add for ciwiki
   * Fix notifynewuser to not put the whole mail in the subject (\r -> \r\n)
   * Fix notifynewuser using ifconfig by replacing it with ip a
   * All patches forwarded
   * d/control: Description: this is CiWiki, compatible with DidiWiki
   * Vcs-Git: https://salsa.debian.org/salvage-team/didiwiki.git
   * Homepage: https://sourceforge.net/projects/ciwiki/
   * Accept $DIDIWIKIHOME in addition to $CIWIKIHOME for compat
   * Rules-Requires-Root: no
 .
   [ Andreas Tille ]
   * Trim trailing whitespace.
   * Avoid explicitly specifying -Wl,--as-needed linker flag.
Checksums-Sha1:
 f2e10356f4fd1a611ef28c3c2f920e0db6b90e4c 1900 didiwiki_3.0.4-1.dsc
 10c9f1042fd89775671c8c46a7e695a3aa684530 261299 didiwiki_3.0.4.orig.tar.gz
 0d3b1927b333f53cbe94664dad24698590d0da05 12824 didiwiki_3.0.4-1.debian.tar.xz
 dd162f9e0470fea73fcdbb3d79c19075aa06f700 6048 didiwiki_3.0.4-1_amd64.buildinfo
Checksums-Sha256:
 9b50d829bb87d6921148719ff29ade2c33e9db8229aa93498a489d85fa6b8271 1900 
didiwiki_3.0.4-1.dsc
 7cc00aa3ef025f4046ac465ca9bf5cba5386a606ef1d9229b90303f55090bf34 261299 
didiwiki_3.0.4.orig.tar.gz
 4473e5b8e075defc5e882232a1d3e19091ce25c0eb095b2896ddef5b5a3da09a 12824 
didiwiki_3.0.4-1.debian.tar.xz
 998ea387ff0c5297f05542e836b22aea03940f3ef28b89f3dda70fb22fa1efea 6048 
didiwiki_3.0.4-1_amd64.buildinfo
Files:
 36ba9972268751e90ec99013d937f295 1900 web optional didiwiki_3.0.4-1.dsc
 3b1c34f2c8d653a14c96985e5d760759 261299 web optional didiwiki_3.0.4.orig.tar.gz
 c3548e5f0a5adb1cda36e83ca8253779 12824 web optional 
didiwiki_3.0.4-1.debian.tar.xz
 59f6c0657a3cef12b25c605c3b5ca06e 6048 web optional 
didiwiki_3.0.4-1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEE8fAHMgoDVUHwpmPKV4oElNHGRtEFAmcbuBoRHHRpbGxlQGRl
Ymlhbi5vcmcACgkQV4oElNHGRtHXQA//Sdp3ofKbyegZBkb8F95ol8AkLsQc/x9P
TWkFmEsGJcQv5EHfp/zRi3qJ9/x+wUvak7V1J0oPT23yxDRje08BpQD8kgGGPZm4
+H/evBpb4tKdYr8WGDsz5OabLrdJI6+JjnMmy0Vq1qwSA2Xer33trzpr+869MF8y
SYmSfbjZNZVVzguxEbQvL8KKNVmaj/QWk0WjJnG+WXNf7SSWz9es5pTkePBTl2n0
u0v76Xj9NljanhFQaZ+Sf1ikyzAQHnLoaBSCsUAV0DOT0B8oxnTKZ5s3A2n08rAE
i19G1j3cdHpbpACgHue7HZ6shZgwORdOF0sioCW+5EH95vNDKw9HgQECcYGb6BOg
/+F3+JX3l8JUCDx+NJDYke4nUC8o1XbqO2hB7uUzE3jfrvfT87ffNKdDHMcnk6kn
8xINyevigxa2IwzNrS0o1Bdu8frDcLnK7CJiDo8v5JIy2ntSLcAMxtMvW7butbkL
Nk75RCjIfj7HwbSJByz7V2DQaOStGroUT7lRyz3NsD/2e19TdaN8OvtWIn2ynMIB
4KaXs7CZoJmxk7TyuAAC0KVh9LFzXK4FzbsCSc5Jl47WmcEOLkFAG3mSLWb2g4J1
f8AAXGh9UfXe3ESAkuU3+8PS1uKx/TK5GxD56s/wBWTziDZ0pKBh8fAQAKJ+Vafc
a+aBmBD+VA8=
=ZReO
-----END PGP SIGNATURE-----

Attachment: pgpdoDrYizafF.pgp
Description: PGP signature


--- End Message ---

Reply via email to