Code Monkey home page Code Monkey logo

oddmuse's Introduction

This is the README file distributed together with the Oddmuse script.

Installing Oddmuse on a Debian System running Apache

The following instructions require a number of tools. You can make sure they're all installed by issuing the following command as root:

apt-get install coreutils apache2 sudo wget w3m perl \
    libwww-perl libxml-rss-perl diffutils

You probably created an account for yourself. You might have to add this user to the sudo group. Here's how I created my own user as root:

adduser alex
usermod -a -G sudo alex

Now you can login as alex and do everything else using sudo.

You need to copy wiki.pl into your cgi-bin directory, and you need to make the script executable. You might also have to change its owner to an appropriate user on your system.

sudo wget -O /usr/lib/cgi-bin/wiki.pl \
  http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
sudo chmod +x /usr/lib/cgi-bin/wiki.pl
sudo chown www-data.www-data /usr/lib/cgi-bin/wiki.pl

If you're on SUSE, the user might not be www-data but wwwrun without appropriate group:

sudo chown wwwrun.root /usr/lib/cgi-bin/wiki.pl

You should be able to test it right now! Visit http://localhost/cgi-bin/wiki.pl. If your site is available from the outside, you will be able to use a normal browser. If don't have a domain name yet, you'll probably have to use a text browser like w3m.

w3m http://localhost/cgi-bin/wiki.pl

If you create pages in this wiki, these will get stored in a temporary directory. You need change the data directory from "/tmp/oddmuse" to like "/var/local/oddmuse". The best way to do this without changing wiki.pl is by editing /etc/apache2/sites-available/default. Add the following line:

SetEnv WikiDataDir /var/local/oddmuse

Enable the default site by calling the following command:

sudo a2ensite default

Reload the Apache configuration by calling the following command:

sudo service apache2 reload

You need to create the new data directory. You webserver runs CGI scripts as www-data. Thus, you need to change the owner and group of the directory to www-data.

sudo mkdir -p /var/local/oddmuse
sudo chown www-data.www-data /var/local/oddmuse

Done! Visit your wiki and start editing. Click on the edit link (the first link below the navigation bar, at the bottom of the page). This will allow you to enter some text for this page. Click the Save button and you are done.

To add new pages, edit the homepage and add links to new pages by putting their names in [[double square brackets]].

Enjoy your wiki experience.

Visit https://www.oddmuse.org/ to learn more about the translation files and modules that are part of this package.

Checking the Apache Setup

If you think this information doesn't work for you, here are some things to check.

Apache's config directory is /etc/apache2/apache2.conf. This is where we get the www-data username from. It says:

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

Checking /etc/apache2/envvars we see the following:

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

So that's what we're using in the chown command in our instructions above.

The default site is configured in /etc/apache2/sites-available/default. In order for it to be enabled, there must be a symlink from a file in /etc/apache2/sites-enabled to the file in sites-available. You can enable it using the following command:

sudo a2ensite default

This file also lists the directories we've used in our instructions above.

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

This means that http://localhost/cgi-bin/wiki.pl will call /usr/lib/cgi-bin/wiki.pl

Don't forget to reload the Apache configuration as shown above, or simply restart it all:

sudo service apache2 graceful

Using just Perl

You can use Mojolicious as your web server. There is a simple ##server.pl## which you can use. Here's how you might start it:

mkdir ~/oddmuse
WikiDataDir=$HOME/oddmuse perl server.pl daemon

This makes the server available on http://localhost:3000/wiki. Make sure you create the directory before starting the server! If you don't, you'll get a strange error: `STDERR: : No such file or directory at ... perl5/Mojolicious/Plugin/CGI.pm`.

If it works, feel free to upgrade to Hypnotoad.

WikiDataDir=$HOME/oddmuse hypnotoad server.pl

Note: Hypnotoad uses a different default port. The above makes the server available on http://localhost:8080/wiki. Hypnotoad will keep forking new processes. To stop it, use the -s flag.

hypnotoad -s server.pl

License

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Both the GNU Free Documentation License, and the GNU General Public License are distributed together with this script. See the files FDL and GPL, respectively.

oddmuse's People

Contributors

ainlaidoja avatar alex-free avatar alexdaniel avatar amorenoprats avatar awwaiid avatar charlesmauch avatar dedalu avatar greenfive avatar ingobelka avatar joonhwan avatar kensanata avatar leycec avatar manateelazycat avatar selkfoster avatar snan avatar tfendin avatar tyatsumi avatar victor-osadci-il avatar weakish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oddmuse's Issues

HTTPS on OddMuse

Hi, I'm sure you already noticed, but... fyi: Your oddmuse.org domain now has an invalid Let's Encrypt SSL certificate. You might... wanna renew that. :P

Link accessibility issue

Hi there! When rendering links to non-existent pages, OddMuse only makes the question mark clickable. That's quite a small target to hit with a mouse, which makes editing uncomfortable. I believe the page name should also be included in the link. Thank you!

incorrect-fsf-address

When building oddmuse on a local Open Build Service (OBS) instance, it correctly displays a warning about outdated FSF address info:

[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/wordstem.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/sitemap-index.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/aawrapperdiv.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/404handler.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/translations.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/linebreaks.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/relation.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/irc.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/throttle.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/faq.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/templates.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/plainsite.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/fckeditor.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/publish.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/age.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/dynlogo.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/download.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/today.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/blockquote.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/calendar.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/login.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/not-found-handler.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/weblog-tracking.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/all.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/linktagmap.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/live-templates.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/tables.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/header-and-footer-templates.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/listtags.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/search-shortcut.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/doubleclick.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/markdown.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/xfn.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/image.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/antispam.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/page-type.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/search-list.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/edit-assist.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/smiley-dir.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/sabifoo.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/thread.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/beautify.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/toc-headers.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/olocalmap.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/strange-spam.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/partial-journal.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/html-uploads.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/hiddenpages.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/pingback-server.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/pdf.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/canonical.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/config.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/compilation.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/csv.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/index.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/commentcount.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/aggregate.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/crumbs.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/checkbox.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/cart.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/wanted.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/cal3.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/no-question-mark.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/agree-disagree.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/headers.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/page-trail.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/weblog-1.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/setext.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/grep.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/html-template.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/lang.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/referrer-rss.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/open-proxy.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/despam.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/slideshow.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/google-search.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/subscriberc.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/plainclusterrc.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/tables-in-lists.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/backlinkage.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/moin.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/small.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/creationdate.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/static-hybrid.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/paragraph-link.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/archive.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/sync.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/signature.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/headlines.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/orphans.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/searchtags.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/simple-rules.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/tagmap.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/flickrgallery.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/links.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/admin.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/show-comments.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/nearlink-create.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/clustermap.pl
[   40s] oddmuse.noarch: W: incorrect-fsf-address /usr/lib/cgi-bin/modules-available/htmllinks.pl
[   40s] The Free Software Foundation address in this file seems to be outdated or
[   40s] misspelled.  Ask upstream to update the address, or if this is a license file,
[   40s] possibly the entire file with a new copy available from the FSF.

tables.pl module: explicit left align doesn't add align="left", alignment markup leaves spurious whitespace in HTML

Description:

According to https://oddmuse.org/wiki/Table_Markup_Extension one can explicitly align the content of table cells with

  • leading white space = align right
  • trailing white space = align left
  • leading+trailing white space = align center

This doesn't work correctly for leading white space, which doesn't add align="left" to <td> or <th>.

How to repeat:

|=left |= middle |= right|
|left | middle | right|
|xxxxxxxxxxxxxxxxxxxxxx|xxxxxxxxxxxxxxxxxxxxxx|xxxxxxxxxxxxxxxxxxxxxx|

which yields

<table class="user"><tr><th>left </th><th align="center">middle </th><th align="right">right</th></tr><tr><td>left </td><td align="center">middle </td><td align="right">right</td></tr><tr><td>xxxxxxxxxxxxxxxxxxxxxx</td><td>xxxxxxxxxxxxxxxxxxxxxx</td><td>xxxxxxxxxxxxxxxxxxxxxx</td></tr></table>

  1. <th>left </th> misses explicit align="left" and has additional trailing white space not chopped
  2. <td>left </td> misses explicit align="left" and has additional trailing white space not chopped
  3. <th align="center">middle </th> has additional trailing white space not chopped
  4. <td align="center">middle </td> has additional trailing white space not chopped

Expected:

<table class="user"><tr><th align="left">left</th><th align="center">middle</th><th align="right">right</th></tr><tr><td align="left">left</td><td align="center">middle</td><td align="right">right</td></tr><tr><td>xxxxxxxxxxxxxxxxxxxxxx</td><td>xxxxxxxxxxxxxxxxxxxxxx</td><td>xxxxxxxxxxxxxxxxxxxxxx</td></tr></table>

Additional notes:

I think the problem is in sub TableAttributes in tables.pl.

wrong timestamp in footer when browsing old revision

When browsing an older revision of a topic (action=browse id=... revision=...) the timestamp display in the footer changes from "Last edited ..." to "Edited ...", which makes me assume it should display that revision's timestamp. However, it seems to always (for any revision=...) display the latest revision's timestamp.

The information must be available, though. The history (action=history id=...) displays the timestamp of each revision correctly.

Unfortunately my Perl-foo is not strong enough to suggest a patch. I can see GetFooterTimestamp() using $Page{ts}, but I have no clue where the {ts} field is filled-in.

I might try again finding the problem, but until then I'll leave the issue here.

Site-wide usernames for namespace pages

I've noticed that pages in a namespace use username local to that namespace. It would be nice to have the option to link to site-wide (top-level) username pages instead.

README incomplete (for openSUSE at least)

README.creole seems to be missing the following:
sudo chown www-data.www-data /usr/lib/cgi-bin/wiki.pl[0]

It should be placed right after:

sudo wget -O /usr/lib/cgi-bin/wiki.pl \
  http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
sudo chmod +x /usr/lib/cgi-bin/wiki.pl

Otherwise, when running on openSUSE Leap 42.1, apache logs the following (different path here) when trying to visit the site:

==> /var/log/apache2/oddmuse-test_80-error.log <==
[Tue Aug 16 16:00:46.543472 2016] [cgi:error] [pid 18917] [client […]] AH01215: (13)Permission denied: exec of '/srv/oddmuse/cgi-bin/wiki.pl' failed: /srv/oddmuse/cgi-bin/wiki.pl
[Tue Aug 16 16:00:46.543968 2016] [cgi:error] [pid 18917] [client […]] End of script output before headers: wiki.pl

I would expect this to be an issue on other distros, too.

[0]: The openSUSE equivalent is sudo chown wwwrun.root /usr/lib/cgi-bin/wiki.pl

Comment signing quirk

This is an odd one. I wasn't able to find an error message in the logs, and worse, the behavior differs between my dev and production server. But for what it's worth...

When trying to submit a comment, if the username I fill in ends in an exclamation mark (a.k.a. bang), OddMuse either seems to crash (?!) and never registers the comment, or -- on another server -- ignores the given username and records the comment as anonymous. There seem to be no lasting side effects in either case.

That pesky punctuation is not important, of course, but it did give me a fright at first.

Customizable namespace name pattern

Background: Currently, the Namespaces Extension requires that namespace names match $InterSitePattern, forcing them to start with an uppercase letter and only consist of alphabet letters.

Request: It would be nice to allow customization of namespace url pattern by introducing a $NamespacePattern.

For my use-case, I would like to allow namespace names starting with and (optionally) consisting of only digits. I asked on #oddmuse and @AlexDaniel suggested the following pattern:

$NamespacePattern = '[A-Z0-9\x{0080}-\x{fffd}]+[A-Za-z0-9\x{0080}-\x{fffd}]+'

Note: a-z is omitted to avoid matching the keep, modules, page, and temp directories.

The following is a git-diff of the changes I made to namespaces.pl to allow for numeric namespace names, basically replacing every ocurrence of InterSitePattern with the new NamespacePattern:

diff --git a/modules/namespaces.pl b/modules/namespaces.pl
index 7ade4caa..3a431ed2 100644
--- a/modules/namespaces.pl
+++ b/modules/namespaces.pl
@@ -42,7 +42,7 @@ AddModuleDescription('namespaces.pl', 'Namespaces Extension');
 
 use File::Glob ':glob';
 
-our ($q, %Action, %Page, @IndexList, $Now, %InterSite, $SiteName, $ScriptName, $UsePathInfo, $DataDir, $HomePage, @MyInitVariables, @MyAdminCode, $FullUrl, $LinkPattern, $InterSitePattern, $FreeLinks, $FreeLinkPattern, $InterLinkPattern, $FreeInterLinkPattern, $UrlProtocols, $WikiLinks, $FS, $RcFile, $RcOldFile, $RcDefault, $PageDir, $KeepDir, $LockDir, $TempDir, $IndexFile, $VisitorFile, $NoEditFile, $WikiDescription, $LastUpdate, $StaticDir, $StaticUrl, $InterWikiMoniker, $RefererDir, $PermanentAnchorsFile);
+our ($q, %Action, %Page, @IndexList, $Now, %InterSite, $SiteName, $ScriptName, $UsePathInfo, $DataDir, $HomePage, @MyInitVariables, @MyAdminCode, $FullUrl, $LinkPattern, $NamespacePattern, $FreeLinks, $FreeLinkPattern, $InterLinkPattern, $FreeInterLinkPattern, $UrlProtocols, $WikiLinks, $FS, $RcFile, $RcOldFile, $RcDefault, $PageDir, $KeepDir, $LockDir, $TempDir, $IndexFile, $VisitorFile, $NoEditFile, $WikiDescription, $LastUpdate, $StaticDir, $StaticUrl, $InterWikiMoniker, $RefererDir, $PermanentAnchorsFile);
 our ($NamespacesMain, $NamespacesSelf, $NamespaceCurrent,
            $NamespaceRoot, $NamespaceSlashing, @NamespaceParameters,
            %Namespaces);
@@ -80,18 +80,19 @@ $NamespaceSlashing = 0;   # affects : decoding NamespaceRcLines
 # variables (eg. localnames.pl)
 unshift(@MyInitVariables, \&NamespacesInitVariables);
 
+my $NamespacePattern = '[A-Z0-9\x{0080}-\x{fffd}]+[A-Za-z0-9\x{0080}-\x{fffd}]+';
 sub GetNamespace {
   my $ns = GetParam('ns', '');
   if (not $ns and $UsePathInfo) {
     my $path_info = decode_utf8($q->path_info());
     # make sure ordinary page names are not matched!
-    if ($path_info =~ m|^/($InterSitePattern)(/.*)?|
+    if ($path_info =~ m|^/($NamespacePattern)(/.*)?|
        and ($2 or $q->keywords or NamespaceRequiredByParameter())) {
       $ns = $1;
     }
   }
   ReportError(Ts('%s is not a legal name for a namespace', $ns))
-    if $ns and $ns !~ m/^($InterSitePattern)$/;
+    if $ns and $ns !~ m/^($NamespacePattern)$/;
   return $ns;
 }
 
@@ -102,7 +103,7 @@ sub NamespacesInitVariables {
     $Namespaces{$NamespacesMain} = $ScriptName . '/';
     foreach my $name (Glob("$DataDir/*")) {
       if (IsDir($name)
-         and $name =~ m|/($InterSitePattern)$|
+         and $name =~ m|/($NamespacePattern)$|
          and $name ne $NamespacesMain
          and $name ne $NamespacesSelf) {
        $Namespaces{$1} = $ScriptName . '/' . $1 . '/';
@@ -311,13 +312,13 @@ sub NewNamespaceScriptUrl {
   if ($action =~ /^($UrlProtocols)\%3a/) { # URL-encoded URL
     # do nothing (why do we need this?)
   } elsif ($action =~ m!(.*?)([^/?&;=]+)%3a(.*)!) {
-    # $2 is supposed to match the $InterSitePattern, but it might be
+    # $2 is supposed to match the $NamespacePattern, but it might be
     # UrlEncoded in Main:RecentChanges. If $2 contains Umlauts, for
-    # example, the encoded $2 will no longer match $InterSitePattern.
+    # example, the encoded $2 will no longer match $NamespacePattern.
     # We have a likely candidate -- now perform an additional test.
     my ($s1, $s2, $s3) = ($1, $2, $3);
     my $s = UrlDecode($s2);
-    if ($s =~ /^$InterSitePattern$/) {
+    if ($s =~ /^$NamespacePattern$/) {
       if ("$s2:$s3" eq GetParam('oldid', '')) {
        if ($s2 eq $NamespacesMain) {
          $ScriptName = $NamespaceRoot;
@@ -353,8 +354,8 @@ sub NewNamespaceGetAuthorLink {
 }
 
 sub NewNamespaceValidId {
-  local $FreeLinkPattern = "($InterSitePattern:)?$FreeLinkPattern";
-  local $LinkPattern = "($InterSitePattern:)?$LinkPattern";
+  local $FreeLinkPattern = "($NamespacePattern:)?$FreeLinkPattern";
+  local $LinkPattern = "($NamespacePattern:)?$LinkPattern";
   return OldNamespaceValidId(@_);
 }
 
@@ -383,8 +384,8 @@ sub NewNamespaceBrowsePage {
   my $text = $revisionPage->{text};
   my $oldId = GetParam('oldid', '');
   if (not $oldId and not $revision and (substr($text, 0, 10) eq '#REDIRECT ')
-      and (($WikiLinks and $text =~ /^\#REDIRECT\s+(($InterSitePattern:)?$InterLinkPattern)/)
-          or ($FreeLinks and $text =~ /^\#REDIRECT\s+\[\[(($InterSitePattern:)?$FreeInterLinkPattern)\]\]/))) {
+      and (($WikiLinks and $text =~ /^\#REDIRECT\s+(($NamespacePattern:)?$InterLinkPattern)/)
+          or ($FreeLinks and $text =~ /^\#REDIRECT\s+\[\[(($NamespacePattern:)?$FreeInterLinkPattern)\]\]/))) {
     my ($ns, $page) = map { UrlEncode($_) } split(/:/, FreeToNormal($1));
     $oldId = ($NamespaceCurrent || $NamespacesMain) . ':' . $id;
     local $ScriptName = $NamespaceRoot || $ScriptName;

It may need more work to sand down any rough edges, but it's been working pretty great for me so far.

Idea for detecting wanted pages

I've read what the OddMuse site has to say about that, and I agree that detecting wanted pages by scanning the database for links is difficult if not impossible. But it's such a useful feature, something ought to be tried. Here's my idea: when someone clicks through to a non-existent page, record it somewhere as wanted. Once created, it can be removed from the list. Won't catch everything, of course, but what it does catch will be useful, and without consuming significant resources either.

other HTTP status code than 404 for empty comment pages

I suggest changing the 404 HTTP status code for empty comment pages to something else, e.g. 200/OK, as having many internal 404 links negatively affects the pagerank for search engines, as it may look like the page is not well cared for (as the page owner is responsible for local broken links, in contrast to external links of which he has no control of). Often a wiki only has comment pages for very few of the pages, so that creates a large overhead of 404s.
Even if the comment page contains no comments, it has content and is not non-existent (= 404): headers, footers, and even a "Create this page" link to add further content to that page. And yes, I do understand the logic behind why it was chosen to return a 404.

See also: https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
"The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable."

In our case however the server in fact has found something matching the Request-URI and the request hasn't been refused.

"index,follow" on empty comment pages -> "noindex,follow"?

After we now get the HTTP status code 200 on otherwise empty comment pages, which is fine, I wonder why we use "INDEX,FOLLOW" in the HTML header, instead of "NOINDEX,FOLLOW" for those empty comment pages.
In my opinion we don't need to have robots indexing empty comment pages that merely act as placeholders for creating them. Shouldn't we change it to "noindex,follow" or am I missing something important here?

action=version does not show wiki engine version

Hello

I'm not sure what your preference is, but I think action=version should show the wiki engine version.

I do see that this was easier with Subversion and its automatic $Id$ expansion in $WikiDescription. One would probably have to manually updatethe "x.x.x" version string for releases and maybe use a "x.x.x+1-dev" in the master branch.

Regards,
Philippe

gopher-server: problems with long writes

Apparently the server closes the connection before sending all the bytes. Basically, on my local machine, running Windows, using Cygwin tools, the following usually returns 0, sometimes it returns 13600, but it never returns the 96975 bytes that I write to $stream on the server. When I try the same command on the same machine hosting the service itself, it works.

echo Image_2_for_2018-01-05_Why_Gopher | nc alexschroeder.ch 7070 | wc -c

Source:

Debug log on the server when it fails (this is from my Windows machine):

[Mon Jan  8 15:33:56 2018] [debug] Selector: Image_2_for_2018-01-05_Why_Gopher
[Mon Jan  8 15:33:57 2018] [info] Serving Image_2_for_2018-01-05_Why_Gopher as file
[Mon Jan  8 15:33:57 2018] [debug] Image_2_for_2018-01-05_Why_Gopher has 129301 bytes of MIME encoded data
[Mon Jan  8 15:33:57 2018] [debug] Image_2_for_2018-01-05_Why_Gopher has 96975 bytes of binary data
[Mon Jan  8 15:33:57 2018] [debug] Done
[Mon Jan  8 15:33:57 2018] [debug] Stream closes

Debug log on the server when it succeeds (this is from the same server providing the service):

[Mon Jan  8 15:34:08 2018] [debug] Selector: Image_2_for_2018-01-05_Why_Gopher
[Mon Jan  8 15:34:08 2018] [info] Serving Image_2_for_2018-01-05_Why_Gopher as file
[Mon Jan  8 15:34:08 2018] [debug] Image_2_for_2018-01-05_Why_Gopher has 129301 bytes of MIME encoded data
[Mon Jan  8 15:34:08 2018] [debug] Image_2_for_2018-01-05_Why_Gopher has 96975 bytes of binary data
[Mon Jan  8 15:34:08 2018] [debug] Done
[Mon Jan  8 15:34:08 2018] [debug] Stream writes 96975 bytes
[Mon Jan  8 15:34:08 2018] [debug] Stream closes

Emojis as usernames don't work

I tried using 🐄 as a username on oddmuse.org but it got replaced with “Anonymous”. Seems to be a fairly old issue because on one of my private wikis there's an identical issue.

Diffing a revision range only shows the last commit message

Greetings, my company uses OddMuse for 13+ years, I use it for 10+ years, and we are very happy with it, thanks!

I never noticed this until today: When diffing a page over multiple changes, like in the following example, only the last "commit message" (or whatever the term in OddMuse lingo is), if non-empty, is shown, which can be quite misleading, because the message doesn't summarize what's in the full diff: emacswiki.org SiteMap range diff (example taken from emacswiki.org because I couldn't quickly find a page with more than 2 revisions on oddmuse.org)

Is this intentional? I couldn't find any info on this (my only source of info being the Browse Action page); I expected to see the messages of all the revisions in the diff range.

This applies to

  • OddMuse 2.3.7 (the version we are still using),
  • 2.3.13-33-g91e054ce (the version of emacswiki.org) and
  • possibly newer versions (I haven't checked).

Link to Paper Wiki example broken

The point is that the page looks a lot like a paper (example).

It's look like this page or URL broken:

Both variants return me "Error 500" page. Maybe, page https://alexschroeder.ch/paper/Divide_and_Conquer was deleted?

P.S: But CSS itself still available

/* don't show the name of the page */

div.header {
	display:none;
}

/* the first h2 header is the title of the document */

div.content > h2:first-child {
	font-size:x-large;
	font-weight:bold;
	text-align:center;
	display:block;
}

/* invert author and address italics */

div.Author {
	text-align:center;
	font-style:italic;
	font-size:smaller;
}

div.Author i {
	font-style:normal;
	font-size:medium;
}

/* printed smaller, and no "AUTHOR" heading, no numbering */

div.Author, div.Abstract, div.Keywords {
	font-size:smaller;
}

div.Author h2 {
	display:none;
}

div.Abstract h2, div.Keywords h2 {
	display:block;
	font-size:medium;
}

/* typical headers are all the same size and bold, h2 is uppercased, h3 is not */

h2, div.footnotes hr + p {
	text-transform:uppercase;
    font-size:large;
	font-weight:bold;
}

h3 {
	font-size:large;
	font-weight:bold;
}

/* main text */

body {
    font:12pt "Times New Roman", serif;
    text-align:justify;
}

div.footnotes {
	text-align:left;
}

/* images */

img {
	border:none;
}

img[smiley] {
    display:none;
}

div.Image a.image {
	display:block;
	padding:2ex;
}

div.Image h2 {
	display:none;
}

/* this should keep image and caption together, but it seems not to work. */

div.Image {
	page-break-inside:avoid;
}

/* link look like ordinary text */

a.number span {
    display:none;
}

@media screen {
    body {
        padding:10ex;
    }
    div.header {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	margin: 0;
	padding: 0;
	vertical-align: top;
	color:#aaa;
	font-size: 10pt;
    }
    div.header h1 {
	margin: 0;
	padding: 0;
	font-size: inherit;
	
    }
    div.header a {
	text-decoration: none;
    }	
    div.footer, div.refer, a, a.number:link, a.number:visited,
    div.content + form, span.gotobar {
	color:#aaa;
    }
    div.content a, div.footnotes a, div.rc a {
	color:#000;
	text-decoration:none;
    }
}

@media print {
	a.edit, div.footer, div.refer, a.number,
	div.content + form, span.gotobar {
		display:none;
	}
	a, a:link, a:visited {
		color:#000;
		text-decoration:none;
	}
}

a[class="url number"]:after,
a[class="inter number"]:after {
    content:"[" attr(href) "]";
}

a[class="local number"]:after {
    content:"[" attr(title) "]";
}

/* footnotes */

a.footnote:before {
    content:"[";
}

a.footnote:after {
    content:"]";
}

div.footnotes a + a[class="url outside"]:after {
    content: ", <" attr(href) ">";
}

div.footnotes a + a[class="url"]:before {
    content: "<";
}

div.footnotes a + a[class="url"]:after {
    content: ">";
}

div.footnotes hr {
    display:none;
}

div.footnotes p {
    padding-left:3em;
    text-indent:-3em;
}

/* must come at the end */

div.content a:hover {
	color:#000;
	background-color:#999;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.