Commit Graph

5823 Commits

Author SHA1 Message Date
Alex Schroeder
bf559ed705 Translation: not deleted: without trailing space 2015-10-14 12:32:25 +02:00
Alex Schroeder
789a753ac1 Translation: Cookie: no longer required
With or without trailing space, this text is no longer required.
2015-10-14 12:28:22 +02:00
Alex Schroeder
5f4fa83f46 Translation: %s: without trailing space
We can still translate %s: to %s : for the French.
2015-10-14 12:24:31 +02:00
Alex Schroeder
6637e92cb8 month-names, national-days: delete cruft
An error in the Makefile treated all *.pl files in the translations
directory as translation files -- including these other files which are
not regular translation files.
2015-10-14 12:23:18 +02:00
Alex Schroeder
7d248880ec alex-2015.css: switched fonts
Removed the @font-face rules that downloaded Noticia Text and Symbola
from the net. This was slowing down access from old mobile phones.
Instead, I'm now using a font-family of "Palatino Linotype", "Book
Antiqua", Palatino, serif.
2015-10-14 10:29:45 +02:00
Alex Schroeder
663feb662e Allow custom setting for --jobs in make test 2015-10-13 03:21:11 +03:00
Alex Schroeder
75a061dc8b Alexine: more comfortable default paths 2015-10-13 02:26:00 +03:00
Alex Schroeder
19790c39bb big-brother.t: more rebust under heavy load
The previous fix was no good. Now attempting a different fix.
2015-10-12 15:45:09 +02:00
Alex Schroeder
b9572f7ccf Parallelize tests
Using random numbers to generate new test-directories for every test
file. Use t/setup.pl to reset.
2015-10-12 15:13:22 +02:00
Alex Schroeder
68da7e4e75 Use warnings
search.t: Using braces without escaping them in regular expressions
trigges a warning. wiki.pl will now quotemeta the replacement string
when highlighting changes.

upgrade-files.t: Only remove the old UseMod directory if it actually
exists in order to fix some warnings.

wiki.pl: only reading the log file when open actually succeeded in order
to fix some warnings.
2015-10-12 15:12:20 +02:00
Alex Schroeder
c38ff25cda recaptcha.t: use Captcha::reCAPTCHA always
This module is no longer optional. The test will not skip.
2015-10-12 15:09:15 +02:00
Alex Schroeder
a8f9ff9d48 Some tests now more rebust under heavy load
When running tests with four jobs on a laptop with just two cores, load
is heavy and some tests may fail. Trying to make them more robust...

- big-brother.t
- captcha.t
2015-10-12 15:08:08 +02:00
Alex Schroeder
c5fc0c126c meta.t: perl -c only takes one file 2015-10-12 14:48:51 +02:00
Alex Schroeder
29b2b4de21 server.pl: instructions for the plugin to use
I've submitted some patches for Mojolicious::Plugin::CGI and the
comments now point to a fork.
2015-10-11 20:02:37 +02:00
Alex Schroeder
76853d5780 aawrapperdiv.pl deleted 2015-10-11 12:19:29 +03:00
Alex Schroeder
1f0f6485d7 Adding wiki.log to .gitignore 2015-10-09 00:48:07 +02:00
Alex Schroeder
1a228cc95d server.pl is a Mojolicious server for Oddmuse 2015-10-09 00:47:31 +02:00
Alex Schroeder
d17cdb43b0 WikiConfigFile and WikiModuleDir ENV variables
Currently the config file and modules are supposed to be in $DataDir,
which does make any sense from security point of view. Files with code
should not be in directories that are writable by www-data.

Previously you had to use a wrapper script to work around that. Now we
provide special variables.

Please note that oddmuse will sometimes cache data by using Storable.
Such cache is saved to the disk and then read back when required. This,
however, is an insecure operation given that there is a risk that the
file will be manipulated from www-data in a malicious way.
2015-10-06 04:53:21 +03:00
Alex Schroeder
0904f168d1 New make target: new-utf8.pl
Changes to oddtrans make sure that lines starting with # are comments
and will be stripped when the translation file is read. When writing new
translation files, comments are added to indicate which files are being
processed right now. This will help translators figure out where the
texts originated from. Note that every key appears only once, so
translations will be missing in the section for later files if they
appeared in earlier sections.

Recreated new-utf8.pl in order to illustrate the new format.
2015-09-30 17:35:02 +02:00
Alex Schroeder
b969714909 ban.t: fix number of tests 2015-09-30 16:27:40 +03:00
Alex Schroeder
9f8f33f962 ban.t: removing more strange-spam tests 2015-09-30 16:00:30 +03:00
Alex Schroeder
616d3c3f0b strange-spam.pl module was deleted, deleting tests as well 2015-09-28 11:24:58 +03:00
Alex Schroeder
66a408a112 strange-spam.pl: Module deleted
The wiki says that this module is obsolete. If it is, then there is no need to
keep it in our repo.
2015-09-28 11:21:18 +03:00
Alex Schroeder
8b394e9044 private-wiki.pl: missing our 2015-09-23 21:30:54 +03:00
Alex Schroeder
9e1cccb84f Stop leaving locks behind
Previously if some user cancelled his request (simply by pressing Stop button
in his browser), then the script will receive a TERM signal or the like.

This means that some locks could be left behind, which required someone
to unlock the wiki manually (by using Unlock Wiki action).

Now we remove these locks automatically!

However, some tasks might want to handle such situations gracefully. That's why
%LockCleaners hash was added. Use lock name as the key and put a coderef as a
value. If SIGTERM (or a bunch of other signals) is received, then it will run
this code, which, supposedly, cleans all of the stuff after it. Private Wiki
Extension was changed according to that, so you can see it in action.

Also, tests added!
2015-09-23 21:07:02 +03:00
Alex Schroeder
1af01be779 big-brother.pl: Make sure restricted URL is used 2015-09-21 17:56:02 +02:00
Alex Schroeder
673776827e Rollback fixes for $KeepDays = 0
RollbackPossible needs to handle the situation where $KeepDays == 0.
DoRollback used to examine all the pages where rollback was
possible (using $KeepDays) but in order to avoid the special case where
$KeepDays == 0, we can also examine all the pages changed after the
target timestamp $to.
2015-09-21 09:58:38 +02:00
Alex Schroeder
79680daeb0 maintain.t: Fix for $KeepDays = 0 2015-09-21 09:42:30 +02:00
Alex Schroeder
5d3976bef7 preview.pl: remove trailing whitespace 2015-09-21 09:41:00 +02:00
Alex Schroeder
f64cc1d8e3 preview.pl: fix typo
'$id' is not interpolated...
2015-09-21 09:39:40 +02:00
Alex Schroeder
69289afe74 conflict.t: typo 2015-09-21 09:34:00 +02:00
Alex Schroeder
c5121ddaba history.t: Fix for $KeepDays = 0 2015-09-21 09:27:48 +02:00
Alex Schroeder
528a84e0d7 preview.pl: Add admin menu 2015-09-21 09:24:53 +02:00
Alex Schroeder
bf2c8824e1 preview.pl: New module to report changes in HTML 2015-09-21 09:12:32 +02:00
Alex Schroeder
cf21d0c584 Print cache even if just have a single clean block
Once again, bitten by Perl. We used to print a cache "if ($Page{blocks}
and $Page{flags} and GetParam('cache', $UseCache) > 0)" -- but if we
have exactly one clean block, then flags will be "0" which is false. So
now we're testing for defined $Page{flags}.
2015-09-21 09:09:14 +02:00
Alex Schroeder
82459db5b5 rollback.t: Fix tests given $KeepDays default
As $KeepDays now defaults to 0, more changes are required to make these
tests work again.
2015-09-20 14:03:18 +02:00
Alex Schroeder
f8ad447424 rollback.t: fix many tests
This is done by appending "$KeepDays = 14" to the config file whenever
it gets written. This restores the old behaviour and thus "fixes" the
tests.
2015-09-20 11:44:37 +02:00
Alex Schroeder
631f312312 Fix crossbar.t after 858ff72
It seems like the test needs any empty page (not exactly HomePage,
which now returns "Welcome!").
2015-09-19 23:02:29 +03:00
Alex Schroeder
314bc74d61 Explanation for $KeepDays = 0 (0 means forever) 2015-09-19 22:40:12 +03:00
Alex Schroeder
2e07830888 Let's have a working page history (no more ForgiveAndForget by default)
There was a huge discussion with a lot of tension:
https://oddmuse.org/wiki/Revolutionary_Changes#ForgiveAndForget
And also the comments:
https://oddmuse.org/wiki/Comments_on_Revolutionary_Changes#ForgiveAndForget

But in the end, it is safer to have a history which is not broken.
Don't get it wrong, ForgiveAndForget is still a good thing, it's just not what
we should do *by default*.

If your wiki does benefit from ForgiveAndForget, then add this to your config:
$KeepDays = 14;

Although this change solves a couple of important problems, it does not address
new ones that arise because of no ForgiveAndForget. Namely it does not
resolve the problem of deleting stuff when you *really* have to do it. For
example, [[DMCA Extension]] (or similarly named extension with the same
purpose) should be developed. These problems existed for a long time, because
people were using “$KeepDays = 0” a lot. It is just that we started to accept
wikis with no ForgiveAndForget more thoroughly.

In other words, this commit is just part of the bigger change.

Why don't we set it to 5 years? Because then it will be a time bomb that will
be triggered unexpectedly. We should have a more predictable default value.
2015-09-19 22:18:15 +03:00
Alex Schroeder
e1f6c28887 Make sure the "Welcome!" message is shown 2015-09-19 18:30:51 +02:00
Alex Schroeder
47cb0f7423 load-lang.pl: missing translations, meta test 2015-09-19 08:28:05 +03:00
Alex Schroeder
53c84cc030 load-lang.pl: Use $ModuleDir/translations by default
Modules are not loaded recursively, so we are free to use any directory inside
$ModuleDir. It is also where translations are located in the git repo.

Also, %library was renamed to %TranslationsLibrary (which is now "our"). This
is required for tests and for custom configuration.
2015-09-19 07:57:33 +03:00
Alex Schroeder
1fbbfd422e Workaround for utf8::decode bug (sometimes utf8 chars were not decoded)
Remember the problem with toc.pl when the whole page was *sometimes* not
utf8-decoded? There were some thoughts that it might be associated with
memory files, and it is correct. Although I was not able to narrow it down
last time, now I did (simply because this problem appeared elsewhere).

If you look at $output variable after utf8::decode with Devel::Peek, you
will see two variants of flags. This one looks good:
   FLAGS = (PADMY,POK,pPOK,UTF8)
And this one is wrong:
   FLAGS = (PADMY,POK,pPOK)
This problem is weird because it works inconsistently. Most of the time
you will get correct output, but sometimes it will be broken.

Someone has to golf it down to something short in order to submit perl
bug report. This, however, does not look like a simple task.

Current workaround is as stupid as it looks like, but it works.
Somehow assigning it to another variable solves the problem (which, by the
way, is similar to solving other perl string-related problems).
2015-09-16 04:13:02 +03:00
Alex Schroeder
7d1c8817ac server.pl: just whitespace 2015-09-15 04:13:24 +03:00
Alex Schroeder
fe7dc7cdc5 atom.t: Use our own server for this test
We no longer require an existing webserver running a wiki at
http://localhost/cgi-bin/wiki.pl. Instead, we're running our own
stuff/server.pl on a random port and use it for testing -- and we kill
it when we're done.
2015-09-14 13:01:22 +02:00
Alex Schroeder
5809d64a94 server.pl simplified and with license 2015-09-14 12:40:09 +02:00
Alex Schroeder
34eae54080 server.pl: a stand-alone Oddmuse wiki server 2015-09-13 22:40:05 +02:00
Alex Schroeder
04ed358c91 atom.pl: use PUTDATA 2015-09-12 19:06:59 +02:00
Alex Schroeder
d46905ebe2 Make Atom tests mandatory
You must have a wiki running at http://localhost/cgi-bin/wiki.pl and it
must have the Atom Extension installed.
2015-09-12 19:06:09 +02:00