[Gambas-user] better aproach for wiki offline

Tobias Boege taboege at gmail.com
Tue Jun 26 17:56:54 CEST 2018


On Tue, 26 Jun 2018, PICCORO McKAY Lenz wrote:
> there's a similar problem and request for debian here:
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858382
> 
> not all people have 24/7 internet conection and the offline wiki are crap
> if some pages are not documented!
> 
> should i send a bug request! as a bug of course due specifics pages are not
> show if there's no translations!
> 

The Gambas wiki script is included in the repository. I downloaded the
latest wiki snapshot and ran the script locally. It didn't work for me,
so I patched it (which I wish you would have thought of in the past two
months). Patch is attached. The only problem is that the latest wiki
dump is apparently from 2016. Benoit should set up a cronjob on that
server perhaps.

For completeness, the wiki dump is at [1] and the generation date is [2].
You uncompress the archive to create `$HOME/wiki/gambas/data/...'.
This is approximately what the IDE does, except that is uses a different
path. But instead of using the apparently broken help viewer there,
you run the app/src/gambas-wiki script, which uses a local gb.httpd,
and your usual web browser. I just had to remove some "web server
bug fix" which Benoit probably needs for the production server and which
breaks language fallback (among other things) locally (the gist of it
is that there was always the "wiki" component too much in the path).

Another option is to fix the help browser in the IDE. I never use it
and didn't care to look what, if anything, is broken. Might be the same
error as above. And still, it might interest some people that you can
host your own gambaswiki.org, as long as you have a fresh content dump.
The gambas-wiki is also a neat example of a Gambas web application.

Regards,
Tobi

[1] http://gambaswiki.org/gambas-wiki.tar.bz2
[2] http://gambaswiki.org/timestamp

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
>From 58e40d0e158f3a78683ecc1a2d93b9a4d6c0621e Mon Sep 17 00:00:00 2001
From: Tobias Boege <taboege at gmail.com>
Date: Tue, 26 Jun 2018 17:28:45 +0200
Subject: [PATCH] gambas-wiki: Remove "web server bug" fix for production
 server(?)

There was an alleged 'web server bug' fix which adds a "wiki" component
to all links. That extra component isn't present in the directory
hierarchy of the wiki dump and the fix doesn't seem to be needed when
running the wiki locally under gb.httpd.

Removing it *does*, however, make the fallback to English work again
when the requested page is not available in the chosen language.
---
 app/src/gambas-wiki/.src/Main.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/src/gambas-wiki/.src/Main.module b/app/src/gambas-wiki/.src/Main.module
index 6b3ddc242..c7da54bc2 100644
--- a/app/src/gambas-wiki/.src/Main.module
+++ b/app/src/gambas-wiki/.src/Main.module
@@ -422,7 +422,7 @@ Public Sub Main()
   '   Return
   ' Endif
   
-  CGI["SCRIPT_NAME"] = "/wiki" ' Fix web server bug
+  'CGI["SCRIPT_NAME"] = "/wiki" ' Fix web server bug
   Root = User.Home &/ "wiki/gambas"
   InfoDir = User.Home &/ "wiki/info"
   If Not Exist(InfoDir) Then InfoDir = ""
@@ -1493,4 +1493,4 @@ Private Sub SearchWiki(sText As String)
   Response.Redirect("/wiki/search")
   Return
   
-End
\ No newline at end of file
+End
-- 
2.17.1



More information about the User mailing list