Compare commits

...

436 Commits

Author SHA1 Message Date
Aki Goto
16053e26d7 fix namespace locking problem when using with FastCGI servers 2022-09-22 14:06:37 +09:00
Alex Schroeder
f0d0942bfb namespaces: remove underscore from page title 2022-04-15 10:15:00 +02:00
Alex Schroeder
cd9246ebed Add Cooklang extension 2021-11-06 20:32:02 +01:00
Alex Schroeder
f7b23d854f ban-contributors: test Net::IP use 2021-09-29 19:52:12 +02:00
Alex Schroeder
104a1395e7 ban-contributors: use Net::IP to parse CIDR
whois 191.101.31.160 doesn't return a range, only something like
inetnum: 191.101.0.0/16
2021-09-29 18:17:58 +02:00
Alex Schroeder
ceb4c3a9cc Release process: master → main 2021-09-25 16:41:21 +02:00
Alex Schroeder
536757e8e2 ban-contributors: fix get_range
For 8.21.11.127 we have to issues: the key in the result set is
netrange and not inetnum, and the result for netrange is a list of
ranges and not just a single range. The new code no longer presumes to
know the keys. It just goes through all of them, trying to find
something that looks like a range. When it finds an array reference,
it goes through each entry, looking for a range. The first key where
are least one range is found is returned, with all the ranges for that
key, in our case that would be 8.0.0.0 - 8.127.255.255 and 8.21.11.0 -
8.21.11.255.

The ban-contributors code then presents two forms, one for each match.
2021-09-25 16:17:37 +02:00
Alex Schroeder
00af1aa638 New CSS 2021-09-19 23:01:59 +02:00
Alex Schroeder
c2cf3e7b43 namespaces: reload @IndexList before saving
Without this commit, what used to happen is that if ban-contributors
banned a contributor in a namespace, the pageidx of the main space got
overwritten with the pageidx of the namespace: since the values of
@IndexList and %IndexHash remained unchanged.
2021-09-12 18:34:04 +02:00
Alex Schroeder
05c14d37b2 ban-contributors: another regexp improvement 2021-09-09 22:33:41 +02:00
Alex Schroeder
fc3614f291 ban-contributors: improved the IP regex generator
I did not want to use Number::Range::Regex because those regular
expressions are somewhat hard to read, so instead some test cases from
actual spammers were added and the code rewritten to be easier to
understand. It should now also be obvious when it breaks.
2021-09-04 23:39:07 +02:00
Alex Schroeder
e201c77696 namespaces: share BannedContent and BannedHosts
New approach: save the original value of $DataDir in
$NamespacesRootDataDir. When reading the value of $BannedHosts or
$BannedContent via GetPageContent in UserIsBanned or BannedContent,
and in DoBanHosts for ban-contributors.pl, use the root data dir; when
saving $BannedHosts or $BannedContent via DoPost, use the root data
dir.
2021-08-28 00:51:15 +02:00
Alex Schroeder
f280cb5df4 Revert "namespaces: share BannedContent and BannedHosts"
This reverts commit 29863d7109.
2021-08-28 00:09:34 +02:00
Alex Schroeder
29863d7109 namespaces: share BannedContent and BannedHosts
To facilitate spamfighting, the namespace is not set when the current
action refers to one of the page ids in the @NamespaceIgnored list.
The default value for these is $BannedContent and $BannedHosts, in
other words, the pages 'BannedContent' and 'BannedHosts'.
2021-08-26 23:52:58 +02:00
Alex Schroeder
b514ea7846 Fix TRANSLATIONS glob in the Makefile
The current code always resulted in an empty list of files for
TRANSLATIONS; the did not end up in the build directory; and they did
not get installed elsewhere.
2021-08-08 09:10:38 +02:00
Tobias Fendin
eeaf615d3b Added more swedish translations 2021-08-08 08:56:20 +02:00
Tobias Fendin
f003481c5e Translated webmention to swedish 2021-08-08 08:56:14 +02:00
Alex Schroeder
4d10ef389a Add script/unsusbscribe.pl
Mail subscriptions for blog posts that are many years old make no
sense to me. Here's a script to purge those old subscriptions.
2021-08-02 15:50:33 +02:00
Alex Schroeder
726ffdced1 banned-regexps: do not remove URLs from the text
If we want to match borked spam like <a href=http://example> then it's
counterproductive if we remove the URLs because our pattern will have
to be "href=" instead of "href=http". Also it's hard to remember that
URLs are removed.
2021-07-21 15:15:05 +02:00
Alex Schroeder
18c4071da8 t/test: handle spaces in PERLBREW_PATH
When running under the fish shell, PERLREW_PATH contains two
directories separated by a space.
2021-07-13 15:10:53 +02:00
Alex Schroeder
fd7fa0c3ab Add progress indicator to stats 2021-07-13 15:09:21 +02:00
Alex Schroeder
2ba5b72242 stats.pl is a new script to print some stats for a page dir 2021-07-13 14:57:38 +02:00
Alex Schroeder
fa5a2f7a1a rc2mail: print $root
When sending mails for multiple wikis, it's important to show for what
wiki the mails were sent, given that the user asked us to be verbose.
2021-07-13 10:38:35 +02:00
Alex Schroeder
ad042630b6 ban-contributors: fix regexp generator
The code would often prematurely end a regular expression with $.
2021-07-13 10:38:35 +02:00
Alex Schroeder
9cf35b9b52 Updated Swedish translation 2021-07-09 23:40:48 +02:00
Alex Schroeder
4f69103b8c wiki: simplify a regular expression
In OpenHtmlEnvironment we simplyfy the regular expression that is
supposed to detect whether this is a class assignment to a simple
check whether the attribute contains an equal sign.
2021-03-26 15:59:56 +01:00
Alex Schroeder
37c882780a emoji: add \b after :p
This prevents something like time:prime to trigger the emoji
replacement.
2021-03-26 15:58:15 +01:00
Alex Schroeder
6d5f97e1ba journal-rss: fix headers for raw output 2021-02-20 11:17:56 +01:00
Alex Schroeder
4b1063c699 journal-rss: add one more test 2021-02-20 10:18:24 +01:00
Alex Schroeder
b891674a6f journal-rss: support raw mode 2021-02-20 09:51:31 +01:00
Alex Schroeder
1a65df6e36 Update the French translation
Submitted by pierre. Thank you very much!
2021-01-04 23:03:22 +01:00
Alex Schroeder
6043be852c Fix handling of $RssExclude
It contains a list of regular expressions, not of page names.
2020-12-09 12:39:03 +01:00
Alex Schroeder
bb11bdf789 Updated the tests for HTML5
All tests successful.
Files=153, Tests=3483, 128 wallclock secs ( 0.85 usr  0.22 sys + 228.35 cusr 26.61 csys = 256.03 CPU)
Result: PASS

All right!! 😁
2020-10-29 17:02:19 +01:00
Alex Schroeder
540fd588c9 Incompatible HTML changes
Trying to get more HTML5 elements used.

PrintAllPages:

Use the article element instead of a div with class "page". The new
article element still has the "h-entry" class that the old div had.

The h1 element for these pages used to have the class "entry-title"
which is apparently deprecated. The new code now uses the "p-name"
attribute.

The page content is no longer surrounded in a div with the
"entry-content" class and the appropriate lang attribute. We rely on
PrintPageHtml to do the right thing, now.

PrintPageHtml:

Surround the page being printed with a div containing the "e-content"
class and an appropriate lang attribute.

PageHtml:

This also uses PrintPageHtml and therefore doesn't need to surround
the page content with a div containing the "page" class and the lang
attribute.

As PageHtml is used in RSS feed generation, that means that the feed
entries now don't have a div containing the "page" class but a div
containing the "e-content" class.

GetHeaderDiv:

Instead of using a div with the "header" class, use the header
element.

Instead of using a div with the "menu" class, use the nav element.

PrintPageContent:

No changes! We're not changing the div here because the content that
is being printed here does not belong into an article element. It is
not "a self-contained composition in a … page … intended to be
independently distributable or reusable" – it *is* the page
itself (without the h1 header).

PrintFooter:

Use an additional footer element.

DefaultFooter:

Remove the div with the "footer" class.

References:

* http://microformats.org/wiki/h-entry
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer
2020-10-27 21:34:02 +01:00
Alex Schroeder
278fad1f43 Fixed development target in Makefile
The problem is that by default the test-data/config file contains
$ScriptName = 'http://localhost/wiki.pl' but morbo serves the site at
http://127.0.0.1:8080. We therefore append a new $ScriptName
assignment if the correct one doesn't exist. The alternative is
tricky because of the /wiki.pl prefix; fixing that would require a lot
more code, I suspect.
2020-10-25 10:31:36 +01:00
Alex Schroeder
eadeb460f5 Fixed tests
DuckDuckGo search doesn't use the www subdomain anymore.

The raw recent changes returns the bogus hash (four octal digits)
instead of Anonymous before maintenance anonymises the entry.
2020-08-12 21:09:28 +02:00
Alex Schroeder
5da9ce64c0 Lazy loading of images
Use the new loading="lazy" attribute for images.
2020-08-12 20:53:58 +02:00
Alex Schroeder
40498b53f7 duckduckgo-search: no www subdomain
Use duckduckgo.com intead of www.duckduckgo.com.
2020-07-29 09:09:42 +02:00
Alex Schroeder
eaf97602ff Make sure the bogus hash is served for raw changes
When serving recent changes, we know the username and host of the
person making the edit. We use GetAuthorLink to show either the name
linked to the username, or "Anonymous", or a colour coded bogus hash
of their host (that's the four octal digits, hopefully colourized by
your CSS).

When serving raw changes, we used to serve just the username or
"Anonymous". In order to help use cases such as the Gemini wiki
running on gemini://alexschroeder.ch:1965 which consumes raw changes
to present a view that is compatible with Gemini Wiki, we'd like those
bogus hashes as well. This comit does that by splitting ColorCode into
Code and ColorCode such that we can use Code when serving raw changes.
2020-07-23 11:49:42 +02:00
Alex Schroeder
987c262425 wiki: add n limit to index action
Useful when retrieving the latest blog pages from a wiki using raw=1.
2020-07-16 18:11:25 +02:00
Alex Schroeder
c33ee0a9e6 markdown-rule: add one more test 2020-07-13 11:26:25 +02:00
Alex Schroeder
eb7665661f gemini-server: handle Gemini markup
Up to now it was assumed that the raw wiki text would not be written
as Gemtext, but increasingly that is not the case. This commit adds
handling of Gemtext links.
2020-07-12 13:02:02 +02:00
Alex Schroeder
72ae1bf56f gemini-server: fix month in Atom date 2020-07-03 13:41:24 +02:00
Alex Schroeder
8f30ed8109 gemini-server: don't require a space after URL 2020-07-02 17:34:43 +02:00
Alex Schroeder
19e71f1180 gemini-server: clean up feed generation
Reorganize the code a little bit, removing some useless statements.
Make sure it workes with the journal-rss.pl module. Add tests.
2020-07-01 10:34:45 +02:00
Alex Schroeder
9397a38394 gemini-server: add RSS and Atom feeds 2020-06-30 22:48:54 +02:00
Alex Schroeder
17bd2d08cd gemini-server: small updates
gemini_link now handles URLs and is used for all links in
serve_gemini_page.

Paragraph splits now happen at the beginning of list items and when
line breaks are requested. It's not great but what else are you going
to do?

Handle image links.

Handle HTML tags (by ignoring them).

Raw pages served as text/plain instead of text/markdown.
2020-06-22 09:04:39 +02:00
Alex Schroeder
47a5e81000 Run extension even if testing
That is, run the gemini_config file before surge protection!
2020-06-17 23:34:37 +02:00
Alex Schroeder
7bfe740fb2 gemini-server: add language support 2020-06-16 23:08:22 +02:00
Alex Schroeder
6a324b59b9 gemini-server: move run_extensions to the top 2020-06-16 00:08:08 +02:00
Alex Schroeder
23545006a5 gemini-server: add diff support 2020-06-15 20:13:39 +02:00
Alex Schroeder
65012eacbb gemini-server: add history page support
Makefile now also has a gemini target to start up a gemini wiki. It
also calls openssl to generate keys if necessary.

gemini-server.pl now also has log messages in the various functions
serving content, instead of having some of them in the main function.
The footer is printed in a separate function.
2020-06-15 17:19:56 +02:00
Alex Schroeder
91107143f3 gemini-server: switching from gemini+write to titan 2020-06-14 12:34:43 +02:00
Alex Schroeder
cafda90555 gemini-server: various improvements
Render colours (from bbCode).

Serve HTML, including link from footer.

Fix escaping of code blocks.

Remove /m flag from most block substitutions.
2020-06-13 13:51:31 +02:00
Alex Schroeder
32dfec102d gemini-server: add support for a config file 2020-06-13 01:44:26 +02:00
Alex Schroeder
c1cdca5f95 gemini-server: more tests
Also chaged two more permanent redirects to temporary redirects.
2020-06-11 23:45:16 +02:00
Alex Schroeder
61dc928e33 gemini-server: write tests, fix bugs
Fixed sorting. Added \r to some of the links. Allow loading
gemini-server.pl as a library. Don't force the display of ten links in
the main menu unless we actually have as many day pages. Change URL
for minor recent changes.
2020-06-11 13:53:56 +02:00
Alex Schroeder
d43fe3fab9 gemini-server: more improvements
Fixed [URL text] and [[in-reply-to:URL|text]] patterns: don't pass an
URL to gemini_link!

Some log output when writing files. Don't double-decode UTF-8 when
writing text pages.

Render pages ending in '.txt' as raw text. No folding of robots.txt!

Fix two confusing calls to UrlEncode at the end: when serving Gemini
pages and raw text pages, don't URL-encode the page names, use
FreeToNormal to get valid page ids!
2020-06-08 21:34:44 +02:00
Alex Schroeder
3acb572c0d gemini-server: small improvements
Fiddle with the block parsing... Perhaps the single /\n\* / match is
unnecessary? Let's wait for a case where this is wrong. Basically that
would be a paragraph followed immediately by a list item
* like this

I don't think people write it like this when writing for the wiki.

Support the special case <journal search tag:foo> for tag pages.

Fix handling of newlines for blocks that are just links and the like.
2020-06-08 14:09:18 +02:00
Alex Schroeder
0f6787d349 gemini-server: use temporary redirects, always 2020-06-07 22:04:46 +02:00
Alex Schroeder
af287a1279 gemini-server: various improvements
No longer wrap paragraphs. In fact, unwrap paragraphs and list items
because that's what the specification says: Each line is to be wrapped
separately.

Allow single line/paragraph comments. This requires the QuestionAsker
extension and supports the questions and answers.

Support in-reply-to links. Support Markdown links.

Sort pages and their comments correctly even if not day pages.

Fix URL-encoding of $id whenever a URL is printed (for redirection
using 30 and 31, for example), and fix normal form (underscores
instead of spaces for $id).
2020-06-07 21:21:08 +02:00
Alex Schroeder
6bbd43f8a3 gemini-server: various improvements
Do not URL-escape the slash.

Reorganize the main menu and add a 'New page' link.

Change the tag format from $id/tag to tag/$id.

Change the naming so that "text page" is now a "raw page" served via
raw/$id.

Only allow editing of raw pages.

Improve transformation of wiki raw text to Gemini format. Handle tags
with alternate text and images.

Add a footer to Gemini format pages.

When editing existing pages, always make it a minor edit. That matches
how I use the wiki as a blog. It might not be correct for a wiki used
as an encyclopedia.

Handle spaces in $id.
2020-06-07 12:01:27 +02:00
Alex Schroeder
364d7c695b gemini-server: serve Gemini, best effort 2020-06-06 14:22:57 +02:00
Alex Schroeder
871af41881 gemini-server: add searching, matching, sorting 2020-06-05 23:19:03 +02:00
Alex Schroeder
4648bfbd83 wiki: make url-decoding case insensitive 2020-06-05 23:00:31 +02:00
Alex Schroeder
129d02850b gemini-server: answer with a redirect after saving 2020-06-05 13:16:45 +02:00
Alex Schroeder
ee23ef509c gemini-server: fix issues to allow writes
Remaining known problem: HTML output when an error occurs (and status
line at the end saying that everything went fine).
2020-06-05 00:54:58 +02:00
Alex Schroeder
7e865696b0 gemini-server: add write support 2020-06-04 19:59:27 +02:00
Alex Schroeder
244d06ca3b gemini-server: fix recent changes and rss 2020-05-31 19:40:51 +02:00
Alex Schroeder
1a59075b51 gemini-server: new 2020-05-31 00:34:59 +02:00
Alex Schroeder
e0b3c18499 mail: allow unsubscription from all pages
Fix unsubscription from all pages when no list of pages has been
provided: do not return early.
2020-05-27 08:36:34 +02:00
Alex Schroeder
5434136a4d mail: allow unsubscription from all pages
Simplify code. Fix display of email list: URL decoding email addresses
and printing the email addresses in the list. Fix the feedback message
after unsubscribing somebody from all pages.
2020-05-27 08:32:39 +02:00
Alex Schroeder
aeeb182dad mail: allow unsubscription from all pages
A new action (subscribers) also just lists email addresses to make
this easier.
2020-05-27 07:54:07 +02:00
Alex Schroeder
4d6882ffc7 ip-to-regexp.pl: new command line script
Helps to block entire IP blocks.
2020-05-27 07:51:56 +02:00
Alex Schroeder
828482f439 webmention: various updates
scripts/webmention.pl now extracts the author of FROM

modules/webmention.pl now is less complicated about skipping
webmention endpoint advertising and it tries to use the author and
link advertised from the incoming webmention page

And the tests were amended.
2020-05-03 21:09:30 +02:00
Alex Schroeder
2b6f2dfa0c pygmentize: add a test 2020-05-03 14:33:58 +02:00
Alex Schroeder
413b43174c webmention: avoid warning about CGI::param
We're using it in list context, now, and that generates a warning.
Using multi_param avoids this.
2020-05-03 11:49:19 +02:00
Alex Schroeder
9709c87185 webmention: better UI 2020-05-03 10:54:50 +02:00
Alex Schroeder
0cca358de2 webmention: add UI 2020-05-03 10:02:44 +02:00
Alex Schroeder
acff0cb69f Add tests for grep-filtered 2020-03-19 20:45:14 +01:00
Alex Schroeder
8d5956cb7f grep-filtered: old/new module 2020-03-19 14:07:59 +01:00
Alex Schroeder
e9773ea694 Add wordcount module 2020-02-06 14:01:33 +01:00
Alex Schroeder
7094ec098b stuff/server: fix UTF-8 encoding problem
Sadly, I would have thought that the correct solution is the
following, at the end, once we have $server:

$server->cgi_init(
  sub {
    require CGI;
    CGI::initialize_globals();
    CGI->import(qw(-utf8));
  });

This is based on the documentation of HTTP::Server::Simple::CGI, and
skimming its source code, and the documentation of the use pragma, and
the pseudo code in its documentation. The workaround of setting
$CGI::PARAM_UTF8 directly is based on reading the CGI.pm source code.
This is definitely a hack.
2019-12-28 18:11:49 +01:00
Alex Schroeder
04fe4d6991 stuff/server: better instructions at the beginning 2019-12-28 13:59:55 +01:00
Alex Schroeder
570a6b1f07 stuff/server: use ./wiki.pl instead of wiki.pl 2019-12-28 13:45:19 +01:00
Alex Schroeder
4211d6aa03 definition-lists: new 2019-10-14 22:36:32 +02:00
Alex Schroeder
5941fcd7e6 recaptcha: fix tests
check_answer_v2 requires an answer or it throws the error "To check
answer, the user response token must be provided". That causes all the
tests to fail. Thus, if no answer is provided, we return 0 (false).
2019-10-06 18:04:44 +02:00
Alex Schroeder
f3df2eb289 Merge pull request #21 from fancypantalons/master
Switch to reCAPTCH v2 API.
2019-10-06 09:00:03 +02:00
Brett Kosinski
8b975cd5e5 Switch to reCAPTCH v2 API.
The v1 API has been deprecated, so this changeset switches to using the
v2 API as exposed by the Captch::reCAPTCHA module.

The main changes are to switch to the _v2 methods for get_html and
check_answer, plus necessary changes to the check_answer parameters to
make the code compatible with the new form field naming.
2019-10-05 19:37:27 -06:00
Alex Schroeder
850f292260 rc2mail: switch to Net::SMTP and Authen::SASL 2019-10-04 18:33:32 +02:00
Alex Schroeder
ced1252b9d new-utf8: new modules add new translations 2019-10-04 18:32:14 +02:00
Alex Schroeder
c0a6bfebf2 Add language to body element and various divs
The benefit is that this allows us to use the CSS rule that allows the
browser to hyphenate words:

body { hyphens: auto }

This required a number of changes.

wiki.pl

- new option, $CurrentLanguage
- GetHtmlHeader adds lang attribute to body
- PrintAllPages adds lang attribute to div
- PrintPageContent adds lang attribute to div
- PageHtml adds div with lang attribute
- GetLanguages sorts languages by occurences
- GetLanguage is new and returns the first language of GetLanguages

Modules that had to be changed because they refer to the divs that
have now been changed:

- crossbar.pl

Tests that had to be changed:

- atom.t
- crossbar.t
- hr.t
- languages.t
- portrait-support.t
- rss.t
2019-09-27 21:34:32 +02:00
Alex Schroeder
36815767f3 markdown-rule: allow to set text-align style 2019-09-19 10:38:47 +02:00
Alex Schroeder
2cba2d30b7 Makefile: add a morbo target
This makes it easy to quickly deploy the wiki standalone using
Mojolicious. It reloads automatically when any of the relevant files
are changed. This might be easier to work with than a local webserver
installation.
2019-07-16 23:02:10 +02:00
Alex Schroeder
fded17520c namespaces: add test for numerical namespaces 2019-07-16 22:58:43 +02:00
Alex Schroeder
46580a3958 gopher-server: fix linebreaks in links 2019-06-24 12:08:36 +02:00
Alex Schroeder
d584899447 markdown-rule: test removal of MarkdownExtraRule 2019-06-24 11:03:53 +02:00
Alex Schroeder
79c0a9fd02 gopher-server: fix test
The test didn't specify a host explicitly. On my systems, that meant
"localhost" sometimes ended up being "127.0.0.1" or "::1" but for
Alexine it ended up being "::ffff:127.0.0.1". Let's hope that
explicitly setting "127.0.0.1" fixes all of this.
2019-06-24 10:50:14 +02:00
Alex Schroeder
c3f21d60c2 markdown-rule: fix > block quoting 2019-06-24 10:29:02 +02:00
Alex Schroeder
43221ea8a9 markdown-rule: fix """ quotes 2019-06-24 10:19:33 +02:00
Alex Schroeder
25350e93cb markdown-rule: allow newlines in link text
Also added """ for blockquotes.
2019-06-21 23:51:50 +02:00
Alex Schroeder
415a8aa9a8 gopher-server: more links, more tests 2019-06-20 14:27:32 +02:00
Alex Schroeder
a3d740aa67 gopher-server: Gopher URLs can have no type 2019-06-20 12:35:04 +02:00
Alex Schroeder
1956335640 Support gophers URL scheme 2019-06-20 12:31:31 +02:00
Alex Schroeder
b89c8b99e8 Example configs for Mojolicious 2019-06-10 15:02:10 +02:00
Alex Schroeder
4e4d8ee784 Webmention: new feature
This deprecates pingback-server!
2019-05-24 21:43:25 +02:00
Alex Schroeder
7ecd7b784e t: updated copyright years 2019-05-08 08:01:54 +02:00
Alex Schroeder
0d9764b0de gopher-server: fix space normalisation in links 2019-05-04 18:33:36 +02:00
Alex Schroeder
5d7964977c tags: hide the taglist action 2019-04-13 19:33:36 +02:00
Alex Schroeder
d50cda9cea tags: add $TagCloudSize 2019-04-13 19:31:32 +02:00
Alex Schroeder
7257bfb6d5 tags.pl: use HTML::TagCloud to generate cloud 2019-04-13 19:21:55 +02:00
Alex Schroeder
f2470256ae server: fix shebang line with better env path 2019-04-13 19:21:55 +02:00
Alex Schroeder
3c7a56ba5a gopher-server: documentation in the README
And:

- fix typo in the comments of gopher-server.pl
- add log level 4 output to debug how the data directory is sets
2019-04-13 19:21:55 +02:00
Alex Schroeder
07d68b4400 journal-rss: fix tests 2019-03-20 12:12:08 +01:00
Alex Schroeder
51d2d3e0ca tarballs: support "latest" release 2019-03-19 14:50:43 +01:00
Alex Schroeder
0a361873de Fix RSS links in feed
Trying to fix all the issues the validator noticed.
2019-03-19 14:47:39 +01:00
Alex Schroeder
6af02a8a1e Fix quoting of RC and RSS link parameters
When generating RC and RSS link parameters, the values of the
parameters were not URL encoded. This is now fixed.
2019-03-19 14:46:29 +01:00
Alex Schroeder
dc283ea828 tarballs: use Sort::Versions 2019-03-02 14:44:36 +01:00
Alex Schroeder
8e3917b933 rename-pages: add a space in front of the button 2019-03-02 14:27:06 +01:00
Alex Schroeder
5a2209a0c2 rename-pages: fix 'for' attribute for label 2019-03-01 21:00:04 +01:00
Alex Schroeder
73b6949b95 meta: Fix text for 'rename' 2019-03-01 20:59:50 +01:00
Alex Schroeder
771b07e661 rename-pages: new 2019-03-01 20:34:11 +01:00
Alex Schroeder
629693e353 Buf fix in DoMaintain
Frank Betten noted about the old code "$Now - Modified($fname) < 0.5"
that the "left-hand side is in seconds, right-hand side in days".
This was fixed by replacing 0.5 with 12 * 60 * 60.
2019-02-11 21:29:49 +01:00
Alex Schroeder
a45e13f74c pingback-client: add license and intro paragraph 2019-02-01 23:28:03 +01:00
Alex Schroeder
a919f4b8fd Add pingback-client for some experimenting 2019-01-29 13:56:14 +01:00
Alex Schroeder
6d37baabd9 Add pingback-server tests
Also change the HTTP status messages from the pingback-server for
easier debugging. After all, the message text can be whatever we want.
In order to know which of code 400 errors we ran into, use different
messages for each.
2019-01-27 20:07:31 +01:00
Alex Schroeder
41f18d0b3e Make sure we can start multiple servers in tests 2019-01-27 20:06:53 +01:00
Alex Schroeder
8a5cce103e pingback-server: complete rewrite 2019-01-26 23:38:44 +01:00
Alex Schroeder
65cfd93de9 Fix @IndexOptions
Frank Betten reported that after installing the module for Permanent
Anchors the parameter permanentanchors has no effect and there's no
checkbox on the index page. The reason is that Permanent Anchors used
to add to @IndexOptions upon loading (InitModules), but commit
15263102 had moved the setting of @IndexOptions into InitVariables,
thus overwriting any changes made during InitModules. In order to have
an effect, @IndexOptions has to be modified via @MyInitVariables. All
of this is necessary because @IndexOptions uses translated strings and
these are themselves loaded via modules so setting @IndexOptions at
InitModules time can be too early. This was fixed with commit deec99c,
necessitating all these follow-up changes.
2019-01-24 22:22:45 +01:00
Alex Schroeder
a67cac80f5 More support for microformats
On Journal pages, add the classes h-feed for the entire feed, h-entry
for a single page, entry-title for the header, and entry-content for
the page content.
2019-01-20 21:01:35 +01:00
Alex Schroeder
c73f224f2d Allow - in image classes for hCard compatibility 2019-01-19 12:09:39 +01:00
Alex Schroeder
f241d7cd77 Format the summaries of changes in a diff
Make sure to always call QuoteHtml on the summary to avoid XSS
attacks.
2019-01-19 09:33:07 +01:00
Alex Schroeder
a5f5607667 Format the summaries of changes in a diff
Make sure entries consisting of nothing but whitespace are also
skipped.
2019-01-18 21:09:07 +01:00
Alex Schroeder
2d7451402f Format the summaries of changes in a diff
When there is more than one summary, use a list.
2019-01-18 20:15:07 +01:00
Alex Schroeder
7e13816d40 diff.t: removed duplicate tests
The last commit duplicated some tests. This commit simply removes them
again and fixes the number of tests to run.
2019-01-18 19:21:50 +01:00
Alex Schroeder
c2231b9e39 Show all the summaries of changes in a diff 2019-01-18 19:19:42 +01:00
Alex Schroeder
58ecb96975 Add UplinkedIntelligence
Set $HomePage
2018-12-10 13:40:19 +01:00
Alex Schroeder
d24b7d8bd3 mail: allow unsubscription from non-existing pages 2018-12-09 18:01:33 +01:00
Alex Schroeder
91e054cea4 wiki: fix RSS 3.0 and support full parameter 2018-11-30 23:49:30 +01:00
Alex Schroeder
be2abffde2 Revert "gopher-server: add support for RSS Gopher Module"
This reverts commit 93b706dd28.
2018-11-30 22:18:05 +01:00
Alex Schroeder
93b706dd28 gopher-server: add support for RSS Gopher Module 2018-11-30 16:53:52 +01:00
Alex Schroeder
8f43c818df journal-rss: fix bug
The old code assumed that a kept revision for the last major revision
would always exist. But if you just create a page using a minor edit, it
still gets shown, triggering a call to die. This fixes it.
2018-11-26 08:58:21 +01:00
Alex Schroeder
8194d6bb81 permanent-anchors: fixed page deletion
NewPermanentAnchorsDeletePage called DeletePermanentAnchors which
ended with ReleaseLockDir and that is wrong if a lock exists: it’ll
return the value in %Locks which is going to be 1. Thus, with this
module installed, pages would get deleted, but maintenance would still
print: "X not deleted: 1". We fix this by return the empty string from
NewPermanentAnchorsDeletePage.
2018-11-23 18:55:25 +01:00
Alex Schroeder
dc203917b9 german-utf8: updated translation 2018-11-21 10:15:51 +01:00
Alex Schroeder
e7818ef43e translations: updated with new keys 2018-11-21 10:12:24 +01:00
Alex Schroeder
37c4a19f1f Makefile: sort modules
This makes sure that translations have small diffs.
2018-11-21 10:11:48 +01:00
Alex Schroeder
864f294761 translation-stats: fix @INC 2018-11-21 09:57:05 +01:00
Alex Schroeder
1534d6dd8f markdown-convert: all users may use the menu 2018-11-21 09:40:03 +01:00
Alex Schroeder
9ae728bf13 markdown-convert: fix another hungry regexp 2018-11-17 00:03:28 +01:00
Alex Schroeder
768244860f markdown-convert: inline code, fixed 2018-11-17 00:01:18 +01:00
Alex Schroeder
95e566ae97 markdown-conert: inline code 2018-11-16 23:55:21 +01:00
Alex Schroeder
040545269a markdown-conert: fix subheadings
Don't require equal signs at the end; be flexible with spaces at the
beginning.
2018-11-16 23:52:07 +01:00
Alex Schroeder
c6b7d952bd markdown-conert: fix multiple code blocks 2018-11-16 23:48:52 +01:00
Alex Schroeder
06067dd1c1 markdown-convert: strip marker from HTML
On campaignwiki.org we use the code
https://oddmuse.org/wiki/Creole_or_Markdown which also strips the
marker, but we want to support people who don't install that code.
2018-11-16 13:39:36 +01:00
Alex Schroeder
6ee6b384cf markdown-convert: skip uploaded files 2018-11-16 13:17:36 +01:00
Alex Schroeder
7cdf2abe2d markdown-convert: use utf8 2018-11-16 13:11:28 +01:00
Alex Schroeder
942d77f599 markdown-convert: use ordered list for candidates 2018-11-16 13:10:16 +01:00
Alex Schroeder
71baa51a54 markdown-convert: add option to list unconverted pages 2018-11-16 13:05:54 +01:00
Alex Schroeder
8819183be3 markdown-convert: fix space issue 2018-11-16 12:43:17 +01:00
Alex Schroeder
0941a09c19 markdown-convert: fix AddModuleDescription 2018-11-16 12:30:12 +01:00
Alex Schroeder
eae48212be markdown-convert: Add #MARKDOWN marker 2018-11-16 11:45:19 +01:00
Alex Schroeder
4f9641c43f markdown-convert: new module 2018-11-15 22:18:02 +01:00
Alex Schroeder
32fa6057c7 gotobar: support $$id in the GotoBar page 2018-11-08 08:29:54 +01:00
Alex Schroeder
025907f65a gotobar: support $id in the GotoBar page 2018-11-08 08:12:53 +01:00
Alex Schroeder
a259edc0bb bbcode: add [br] 2018-10-21 10:01:48 +02:00
Alex Schroeder
94fd9c0c2a journal-rss: minor changes don't update pubDate
If this is a minor edit, let's keep everything as it is, but show the
date of the last major change, if possible. This is important for
blogs that get added to a Planet. A minor change doesn't mean that the
page needs to go to the front of the Planet.
2018-10-17 23:09:10 +02:00
Alex Schroeder
0affd5a1b7 rc2mail: suppress one more print if -q is given 2018-10-07 18:15:30 +02:00
Alex Schroeder
f27ab9a8a0 gopher-server: support gopher tags
See gopher://circumlunar.space:70/0/~solderpunk/phlog/tagged-gophers.txt
2018-10-07 15:39:51 +02:00
Alex Schroeder
086a992b5a olocalmap.pl: use GetId 2018-09-11 13:11:44 +02:00
Alex Schroeder
54cae9bc1d $SurgeProtection is used by gopher-server.pl 2018-09-10 12:15:02 +02:00
Alex Schroeder
9d9c196441 Add comment, removed unused $SurgeProtection 2018-09-10 11:29:56 +02:00
Alex Schroeder
9238e42cfd banned-regexps: updated copyright year 2018-09-04 09:54:04 +02:00
Alex Schroeder
836f3abecb Fixed bug in banned-regexps
BannedRegexps needs to check for BannedContent before it does
anything. BannedContent checks the URLs, and so BannedRegexps wants to
check everything except for the URLs. The order is important: the old
code used to remove the URLs before handing the text to BannedContent,
so it never found a thing. Changing the order fixed this.
2018-09-04 09:45:47 +02:00
Alex Schroeder
d669f783bb t/ban: test for homepage field 2018-09-04 09:37:49 +02:00
Alex Schroeder
c18279ca4c alex-2018.css: bigger fonts, wrapping pre 2018-08-24 11:29:23 +02:00
Alex Schroeder
bbd280abf9 ban-mixed-script: better fix for encoding issue 2018-08-14 15:01:01 +02:00
Alex Schroeder
c15e6041ef ban-mixed-scripts: silence meta.t warning 2018-08-14 11:57:26 +02:00
Alex Schroeder
e4c84d9b3a ban-mixed-scripts 2018-08-12 19:43:58 +02:00
Alex Schroeder
a49afca3f7 gopher-server: fix regular expressions for links
The regular expression now also matches mardown style external links.
Now using /x and named groups. This makes the entire thing much more
readable.
2018-08-10 20:45:11 +02:00
Alex Schroeder
883f07f926 Fix URL in Makefile 2018-08-06 12:07:18 +02:00
Alex Schroeder
b5d182582f Fix URLs in AddModuleDescription 2018-08-06 11:19:45 +02:00
Alex Schroeder
fe26471abb wiki.css: update for All Modules
Although I must say, the more I see of Div Foo, the less I like it. I
can't wrap a div around the <titles ...> rule and so now I use the
following on the All_Modules page:

<list>
<titles ...>

This introduces an empty div before the div I care about and the CSS
then does .foo_list + .journal etc.
2018-07-25 17:21:01 +02:00
Alex Schroeder
96a3cbbb22 tags: fix double quote bug
The old code removed double quotes before passing the search string on
to SearchString. Thus, "a b" would become a search for "a" and "b".
2018-07-24 12:56:08 +02:00
Alex Schroeder
d303e5e955 journal-rss: switch to full page feed always 2018-07-19 16:18:17 +02:00
Alex Schroeder
dd6198ffca journal-rss.t: simplify tests accordingly
Once the journal RSS just uses the latest edits, we don't have to care
about all the stuff involving major and minor versions.
2018-07-19 16:15:29 +02:00
Alex Schroeder
ae646290ed journal-rss: fix handling of new offset parameter 2018-07-19 16:02:24 +02:00
Alex Schroeder
1a74dc9605 journal-rss: don't ignore minor changes
If a page was created by just minor edits, then it is visible in a
journal. We shouldn't skip it from the journal RSS. Furthermore:
what's the point in showing the text from the last major version? Show
the latest version!
2018-07-19 15:52:17 +02:00
Alex Schroeder
0c19bd13cd tags.t: some more tests for filtering RC 2018-07-19 15:38:14 +02:00
Alex Schroeder
42bb4888a2 rss-journal: support feed pagination 2018-07-19 14:36:27 +02:00
Alex Schroeder
9a5e44aba3 Make feed pagination possible for journal-rss.pl
This works without changes to journal-rss.pl itself. All we do is make
sure that RcSelfAction, RcPreviousAction, and RcLastAction don't get
the action (rc vs. rss) from their arguments but determine it by
looking at the script parameters. Since journal-rss simply uses the
journal action, this will then get picked up correctly.
2018-07-19 13:04:31 +02:00
Alex Schroeder
78b5dd3737 rss.t: add more tests for RSS pagination 2018-07-19 11:43:07 +02:00
Alex Schroeder
b8717c4084 rss.t: add tests for RSS pagination 2018-07-19 11:39:06 +02:00
Alex Schroeder
42f4816ae5 gopher-server: surge protection disabled for tests
Make sure the gopher server reads the config file and skips surge
protection if $SurgeProtection is set to 0. The tests do this. If we
don't do this, tests start failing after a while.
2018-07-19 00:10:24 +02:00
Alex Schroeder
ff8d671787 wiki: first draft at implementing RFC 5005
We can easily provide the latest and the previous feed URL in addition
to the current (self) URL.
2018-07-18 23:53:18 +02:00
Alex Schroeder
e16cda46c1 gopher-server: rewrote surge protection
Instead of calling DoSurgeProtection as part of process_request and
faking username and overwriting ReportError, I've moved the essential
code to allow_deny_hook which seems to be the place dedicated to this
sort of code. Sadly, push(@{$self->{server}->{deny}}, $peeraddr) seems
to have no effect. When the next request comes around, the deny list
is empty again. I guess we would have to persist this somehow. For
now, we're simply using allow_deny_hook and that seems to be just as
well.
2018-07-16 21:34:11 +02:00
Alex Schroeder
431e792e52 gopher-server: add surge protection 2018-07-16 09:37:39 +02:00
Alex Schroeder
c9f3060e42 release: accept non-numeric versions like 2.3.11a 2018-07-13 00:52:35 +02:00
Alex Schroeder
ec4987e817 rc.t: fix copyright year 2018-07-13 00:20:09 +02:00
Alex Schroeder
655d3b47c6 checkbox.t: new tests for checkbox.pl 2018-06-28 10:31:36 +02:00
Alex Schroeder
8b85c6e9dd Save Anonymous username without translation
When saving, write "Anonymous" without translating it. When displaying
"Anonymous", translate it.
2018-06-28 00:51:46 +02:00
Alex Schroeder
ef35e4eda6 rc2mail: update timestamp in any case 2018-06-28 00:49:46 +02:00
Alex Schroeder
7bb1ca239b search-inclusion: new test and fix
I must have misunderstood how 'local' works because it turns out that
you need to move it out of the block for it to work as intended.
2018-06-28 00:49:38 +02:00
Alex Schroeder
a7625b35f4 README: mention problem with non-existing $DataDir 2018-06-28 00:49:23 +02:00
Alex Schroeder
1d239aa9a6 latex.pl: don't read and write; rename instead
Using ReadFileOrDie and WriteStringToFile on a PNG file borks it
because we're decoding and encoding the file as UTF-8. Let's use
Rename instead.
2018-06-28 00:49:10 +02:00
Alex Schroeder
3f1e5caaad bootstrap.js: bootstrap integration example 2018-06-28 00:48:58 +02:00
Alex Schroeder
bdbd6c8ba7 wiki: allow mixing of search and match
Move search up in the list of actions so that it takes precedence over
match if both parameters are provided and add matching to the Filtered
function so that it is taken into account when searching.
2018-06-28 00:48:43 +02:00
Alex Schroeder
1a898ee589 wiki: anonymize rc.log entries even if they are not moved 2018-06-28 00:34:08 +02:00
Alex Schroeder
9609adb575 gopher-server: own implementation of NormaltoFree
We want to avoid turning & into &amp; when printing a menu, so we don't
want to call NormalToFree because it callse QuoteHtml. Replaced all
calls with normal_to_free which only translates underscores to spaces.
2018-06-28 00:31:29 +02:00
Alex Schroeder
34c10202b0 wiki.pl: anonymous entries report as Anonymous
Two changes: First, when moving entries from rc.log to oldrc.log, make
sure we use the string "Anonymous" for the host instead of translating
it. Second, when printing the author link using GetAuthorLink, don't
call ColorCode for anonymous authors if the IP number has been replaced
by the string "Anonymous". In this case, just return "Anonymous".
Otherwise we're getting the color code of the string "Anonymous" which
is confusing.
2018-06-28 00:31:29 +02:00
Alex Schroeder
1457fad242 wiki.pl: update copyright year 2018-06-28 00:31:29 +02:00
Alex Schroeder
ce355499c7 oddtrans: fix missing . in @INC 2018-06-28 00:31:29 +02:00
Alex Schroeder
2bb3d2f967 strip-hosts: also strip ip keys 2018-06-28 00:31:29 +02:00
Alex Schroeder
a301ab5e1c strip-host: fix data corruption 2018-06-28 00:31:29 +02:00
Alex Schroeder
d74d29fa13 Anonymize IPs that we do show using a color code. 2018-06-28 00:31:29 +02:00
Alex Schroeder
96c54d9d66 New: strip-host.pl for DSGVO 2018-06-28 00:31:29 +02:00
Alex Schroeder
9a0700cac1 Getting ready for #DSGVO
Removing IP number ("host") from page files and keep files. The IP
numbers remain in the RC file. GetAuthor and GetAuthorLink now take
username as a first argument and host as an optional second argument.
Sorry for the incompatible change.
2018-06-28 00:31:29 +02:00
Alex Schroeder
864890c168 Added logo previews 2018-06-28 00:31:29 +02:00
Alex Schroeder
a93873d1d4 Logo updates 2018-06-28 00:31:29 +02:00
Alex Schroeder
b0a8fa2141 Logo files
Added old logo by Murray Altheim and new logo by Falky.
2018-06-28 00:31:29 +02:00
Alex Schroeder
88799b3ebc gopher-server: better handle links gopher urls
Accept links without path, i.e. gopher://alexschroeder.ch.
2018-06-28 00:31:29 +02:00
Alex Schroeder
4032aa563c gopher-server: ignore the period issues of RFC 1436
As discussed in issue #38 of VF-1 and on the #gopherproject channel,
newer software does not double leading periods and does send final
periods, so this commit simplifies the code and no longer does that,
either. https://github.com/solderpunk/VF-1/issues/38
2018-06-28 00:31:29 +02:00
Alex Schroeder
2b9fd67dbd gopher-server: support / 2018-06-28 00:31:29 +02:00
Alex Schroeder
62056409de gopher-server: add RSS support 2018-06-28 00:31:29 +02:00
Alex Schroeder
f45f4eb49f gopher-server: add support or external images 2018-06-28 00:31:29 +02:00
Alex Schroeder
acd4d42561 gopher-server: Add support for HTML links 2018-06-28 00:31:29 +02:00
Alex Schroeder
8375c3a842 gopher-server: add support for adding maps
Gopher maps can be added to the main menu.
2018-06-28 00:31:29 +02:00
Alex Schroeder
54138b7998 alex-2018.css: small changes 2018-06-28 00:31:29 +02:00
Alex Schroeder
3816567543 gopher-server: redesign of main menu 2018-06-28 00:31:29 +02:00
Alex Schroeder
c6954437ea gopher-server: URL escape all ids in the log 2018-06-28 00:31:29 +02:00
Alex Schroeder
f3725a4938 gopher-server: header and footer for html items 2018-06-28 00:31:29 +02:00
Alex Schroeder
fc8f6b4a42 gopher_server: Two separate options for SSL
I replaced --wiki_pem_file with two options, --wiki_key_file for your
private key and --wiki_cert_file for your full certificate chain.
2018-06-28 00:31:29 +02:00
Alex Schroeder
b6109e37ad gopher-server: support TLS 2018-06-28 00:31:29 +02:00
Alex Schroeder
b3b98e2b82 gopher-server: handle gopher links 2018-06-28 00:31:29 +02:00
Alex Schroeder
74f6a4b314 gopher-server: url escape selectors 2018-06-28 00:31:29 +02:00
Alex Schroeder
19a9ad3da0 gopher-server: fix handling of image:link 2018-06-28 00:31:29 +02:00
Alex Schroeder
2d99025024 css: added CSS files for alexschroeder.ch/wiki 2018-06-28 00:31:29 +02:00
Alex Schroeder
63370f31d7 markdown-rule: robuster _underline_ and /italic/ 2018-06-28 00:31:29 +02:00
Alex Schroeder
752daa81b5 gopher-server: don't need to decode text 2018-06-28 00:31:29 +02:00
Alex Schroeder
429ead8c69 gopher-server: host and port are arrays
$self->{server}->{host}->[0] instead of $self->{server}->{host}
2018-06-28 00:31:29 +02:00
Alex Schroeder
52f4aad356 gopher-server: don't just use sockaddr 2018-06-28 00:31:29 +02:00
Alex Schroeder
4abd0a26cf gopher-server: switch back to Net::Server again
I'm hoping that this works better than the async framework.
2018-06-28 00:31:29 +02:00
Alex Schroeder
c8173cac04 gopher-server: refactor
Format code, remove unnecessary test for $continue_reading at the end.
2018-06-28 00:31:29 +02:00
Alex Schroeder
be4b141c43 gopher-server: more debug logging 2018-06-28 00:31:29 +02:00
Alex Schroeder
f9d6258744 gopher-server: make sure to use correct info items
Also other improvements, hopefully. There are still problems regarding
feedback. When uploading a file twice in succession, for example, the
second call produces no output until a few seconds have passed.

echo -e "Alex/image/png/write/file\t"`wc -c < test.png` \
| cat - test.png   | nc localhost 7070

echo -e "Alex/image/png/write/file\t"`wc -c < test.png` \
| cat - test.png   | nc localhost 7070

I really have no idea why this is. The log output is correct but
printing to the stream just doesn't work anymore. Has it been closed
in the mean time?
2018-06-28 00:31:29 +02:00
Alex Schroeder
66234d7785 gopher-server: upload binary files with content-length 2018-06-28 00:31:29 +02:00
Alex Schroeder
c67b4a7f12 gopher-server: final period and line breaks
Not sure what we should be stripping, here?
2018-06-28 00:31:29 +02:00
Alex Schroeder
4a94023be2 gopher-server: final period required on uploads
When uploading big files, they get sent in chunks we therefore have to
detect the end of the file being sent. A final period on a line by
itself ("\n.\n") will have to do -- even for binary uploads.
2018-06-28 00:31:29 +02:00
Alex Schroeder
9535f45647 gopher-server: refactor info printing
We're now printing (useless) host and port data on info lines as well,
just because these lines might otherwise not get parsed correctly by
clients. It's a useless waste of bandwidth, though.
2018-06-28 00:31:29 +02:00
Alex Schroeder
8f585bcd29 gopher-server: remove unnecessary Init call 2018-06-28 00:31:29 +02:00
Alex Schroeder
d95d7b0674 wiki.pl: shorten search fields
The search fields at the top were shortened such that they all fit on
one line when all of them are shown (set %Languages and $MatchingPages
to show them all), on a terminal 80 characters wide, using a text
browser like Lynx or w3m.
2018-06-28 00:31:29 +02:00
Alex Schroeder
50fcd7eb0b gopher-server: add a test for large uploads 2018-06-28 00:31:29 +02:00
Alex Schroeder
e5b46fe1a4 gopher-server: refactor test 2018-01-05 11:21:20 +01:00
Alex Schroeder
28872646d0 gopher-server: more fiddling with menu labels 2018-01-05 11:05:43 +01:00
Alex Schroeder
d059e09104 gopher-server: fixed menu labels 2018-01-05 11:03:47 +01:00
Alex Schroeder
545cd78805 gopher-server: refactor comment and history link 2018-01-05 10:57:53 +01:00
Alex Schroeder
1e7a7d2fa7 gopher-server: change the order of links 2018-01-05 10:53:22 +01:00
Alex Schroeder
1b540fc294 gopher-server: after page save, link back to page 2018-01-05 10:45:21 +01:00
Alex Schroeder
493ddc233c markdown-rule: space after list item marker
Common Marks agrees. There, one to four spaces are required after * or
- or 1. to make it a list item.
2018-01-05 08:52:56 +01:00
Alex Schroeder
07b3169c5b Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2018-01-04 14:02:26 +01:00
Alex Schroeder
e73707a16f gopher-server: log level error for tests 2018-01-04 13:57:41 +01:00
Alex Schroeder
5323399bc8 gopher-server: clear metadata on each loop
This resets $q on every call such that no parameters are carried over
to the next request.

Also, refactor printing of menu lines.
2018-01-04 13:55:09 +01:00
Alex Schroeder
13ac083542 gopher-server: serve non-existing pages 2018-01-04 13:55:08 +01:00
Alex Schroeder
3dee191328 gopher-server: changed how new files are created 2018-01-04 13:55:01 +01:00
Alex Schroeder
e13524c1d3 gopher-server: prepare for appending text 2018-01-04 13:51:51 +01:00
Alex Schroeder
dc82b7d64f gopher-server: serve non-existing pages 2018-01-03 22:45:31 +01:00
Alex Schroeder
d68163ee90 gopher-server: changed how new files are created 2018-01-03 18:46:23 +01:00
Alex Schroeder
349ed2722c gopher-server: allow creating new pages 2018-01-03 14:53:30 +01:00
Alex Schroeder
e01b39edf6 gopher-server: link to comment page 2018-01-03 13:25:17 +01:00
Alex Schroeder
783325509a gopher-server: fix tests 2018-01-03 08:54:49 +01:00
Alex Schroeder
2db3736a70 gopher-server: fix port and host handling 2018-01-03 08:53:55 +01:00
Alex Schroeder
22cf00c28f gopher-server: handle encoding issues 2018-01-02 12:42:29 +01:00
Alex Schroeder
3fe2736ad4 gopher-server: remove pid file handling
Usage no suggests using an external tool like daemonize instead.
2018-01-02 11:55:46 +01:00
Alex Schroeder
03b38673f7 gopher-server: fix log setup 2018-01-01 22:36:39 +01:00
Alex Schroeder
3590bb96dd gopher-server: switch to Mojo::IOLoop
This makes it possible to use telnet and nc as a client, and this
makes a separate gopher-client unnecessary.
2018-01-01 22:00:52 +01:00
Alex Schroeder
5051b9602a gopher: client and server, with file uploads 2017-12-31 14:32:39 +01:00
Alex Schroeder
af9da2be34 gopher-server: posting to the wiki 2017-12-30 20:42:24 +01:00
Alex Schroeder
0c17454a0c gopher-server: refactor routing
Use regular expression matching instead of substrings to identify page
names.
2017-12-30 18:56:59 +01:00
Alex Schroeder
d789bc40f0 gopher-server: finished unit tests and more
Fixed the serving of text and html versions of older revisions.
2017-12-30 17:26:41 +01:00
Alex Schroeder
3a97171320 gopher-server: added revisions and tests 2017-12-29 23:20:47 +01:00
Alex Schroeder
110970f310 gopher-server: add toggle for minor edits to rc 2017-12-29 15:28:10 +01:00
Alex Schroeder
9986552ffb gopher-server: simple recent changes 2017-12-29 15:18:55 +01:00
Alex Schroeder
64277e26ed gopher-server: sort search results newest first 2017-12-29 14:55:12 +01:00
Alex Schroeder
b35e867b55 gopher-server: include search 2017-12-29 11:37:56 +01:00
Alex Schroeder
67c6db4b03 gopher-server: more tag support 2017-12-28 21:40:21 +01:00
Alex Schroeder
eec5307bc3 gopher-server; print more entries in main menu 2017-12-28 21:03:50 +01:00
Alex Schroeder
6a3b9a9916 Merge branch 'master' of github.com:kensanata/oddmuse 2017-12-28 19:43:56 +01:00
Alex Schroeder
e6880ae469 Summary: gopher-server more stringent
While testing with the cgo client, I ran into a few problems which are
now fixed. No more mixing of text and menu!
https://github.com/kieselsteini/cgo
2017-12-28 19:39:26 +01:00
Alex Schroeder
40de3ea9a1 gopher-server: image support 2017-12-28 19:09:11 +01:00
Alex Schroeder
93d40b022f Sort tag searches newest first 2017-12-28 13:15:44 +01:00
Alex Schroeder
dec6acf354 gopher-server: Net::Server personality
Switch from Net::Server::PreFork to Net::Server::Fork because I think
all the children will exit due to timeouts anyway.
2017-12-28 13:06:26 +01:00
Alex Schroeder
062cd9b5b9 gopher-server: just link to tag page 2017-12-28 12:54:54 +01:00
Alex Schroeder
31574e3606 gopher-server: handle [[tag:foo]] links 2017-12-28 12:48:34 +01:00
Alex Schroeder
ca01d9d3d6 gopher-server: handle [[foo|bar]] links 2017-12-28 12:16:25 +01:00
Alex Schroeder
9c69322289 gopher-server now with links 2017-12-28 11:07:03 +01:00
Alex Schroeder
c13841e30a gopher-server: add --wiki_pages 2017-12-27 15:26:32 +01:00
Alex Schroeder
9ae1ff22c7 gopher-server: better first page 2017-12-27 15:14:03 +01:00
Alex Schroeder
8db5a45dcd gopher-server: fix copyright year 2017-12-27 12:52:06 +01:00
Alex Schroeder
b3e2485cd0 gopher-server: changes to make it work 2017-12-27 11:11:06 +01:00
Alex Schroeder
6c135be248 gopher-server: new 2017-12-27 09:45:43 +01:00
Alex Schroeder
b5a4af9656 usemod: fix tables and ''''' 2017-12-22 00:18:13 +01:00
Alex Schroeder
b23f1d777b markdown-rule.pl: small change to code 2017-12-21 23:28:56 +01:00
Alex Schroeder
2f49adf605 Merge git.sv.gnu.org:/srv/git/oddmuse 2017-12-17 22:52:39 +01:00
Alex Schroeder
76f9eb7945 markdown-rule: added test 2017-12-17 22:41:40 +01:00
Alex Schroeder
0c2718ca8c markdown-rule: fix /emphasis/
Sometimes I write things like 5./month and that would have
triggered (?<=\P{Word})\/ so I decided to switch that the more
demanding (?<=\s)\/. In order to have italic items start table cells,
however, \G(?<=[|[:space:]])\/ instead.
2017-12-17 22:38:23 +01:00
Alex Schroeder
7109c5be9c markdown-rule: fix /emphasis/
Sometimes I write things like 5./month and that would have
triggered (?<=\P{Word})\/ so I decided to switch that the more
demanding (?<=\s)\/.
2017-12-17 22:34:54 +01:00
Alex Schroeder
e9fad88a10 markdown-rule: fix setext headers
In this situation, the old order caused a problem:

```
---
pandoc: variable
---
```

The result would be <h2>```</h2> and worse to follow.
2017-12-17 22:25:36 +01:00
Alex Schroeder
d94d571881 Perl 5.26 no longer adds . to @INC
test.pl calls stuff/server.pl and needs to pass a qualified
script (./wiki.pl instead of wiki.pl).
2017-11-07 15:06:05 +01:00
Alex Schroeder
d663c2b61d Perl 5.26 no longer adds . to @INC
Trying a different solution. The existing solution only worked for
relative paths in $DataDir. Now we check whether $DataDir starts with /
or ./ and only prepend a ./ if it does not.
2017-11-07 14:49:52 +01:00
Alex Schroeder
a3cbd8db8b Fixed mojolicious-namespaces hack
This is apparently no longer necessary with Perl 5.26.
2017-11-03 18:41:33 +01:00
Alex Schroeder
90e92c27b8 Perl 5.26 no longer adds . to @INC
More changes required, finding more places where do or require is
used.
2017-11-03 18:37:52 +01:00
Alex Schroeder
76b433c1da Perl 5.26 no longer adds . to @INC
More changes required, such as server.pl requiring wiki.pl in the
current directory, which isn't in @INC anymore.
2017-11-03 18:00:50 +01:00
Alex Schroeder
b116a0103e Perl 5.26 no longer adds . to @INC
This is why all the tests requiring t/test.pl had to be changed.
Similarly, the main script loads config and modules using the same
mechanism and paths had to be similarly qualified: prepending './'.
2017-11-03 17:51:30 +01:00
Alex Schroeder
6a7a0dd24d Makefile: Don't set PERL5LIB if it is already set 2017-11-03 13:05:46 +01:00
Alex Schroeder
c2366aa36f Test: give Mojolious server a sec to start up 2017-11-03 11:03:42 +01:00
Alex Schroeder
4da50ef125 Summary: Export PERL5LIB for Alexine
Try again, now using the current directory in the test target of the
Makefile instead of changing run-tests.
2017-11-03 10:48:16 +01:00
Alex Schroeder
2e0f293dcd Export PERL5LIB for Alexine
Try again, now using ODDMUSE_TEST_LOCATION instead of the current
directory.
2017-11-03 10:45:05 +01:00
Alex Schroeder
d0095a36b5 Export PERL5LIB for Alexine 2017-11-03 10:15:01 +01:00
Alex Schroeder
1eae7852c4 Set PERL5LIB for Alexine 2017-11-03 10:12:57 +01:00
Alex Schroeder
da06278df8 Fixed display of comment pages
There was a bug where showing the non-existing comment page for an
existing page: BrowseResolvedPage used to return BrowsePage($id,
GetParam('raw', 0), undef, '404 NOT FOUND') and we wanted to change
this to a 200 response and so we returned BrowsePage($resolved,
GetParam('raw', 0)); -- but that is wrong because in this situation
$id is defined and $resolved is not! This commit fixes the problem.
2017-11-03 10:03:39 +01:00
Alex Schroeder
bd8f914804 Use lib '.' for Alexine 2017-11-03 10:02:42 +01:00
Alex Schroeder
51b24309a7 Allow exclamation mark in page names 2017-11-02 14:06:30 +01:00
Alex Schroeder
60a4572087 creole: fix left alignment of th 2017-11-01 16:51:23 +01:00
Alex Schroeder
248af821a7 Comment pages and $CommentsPattern, again
If $CommentsPattern is a regular expression that matches without
setting $1, we want to avoid the “Use of uninitialized value $1 in
hash element” warning.
2017-10-30 15:56:06 +01:00
Alex Schroeder
c85e8b84b9 Don't return 404 for empty comment pages 2017-10-30 14:16:12 +01:00
Alex Schroeder
e4d159307b Add .gitattributes
GitHub uses Linguist to identify source code and .pl files are
sometimes classified as Prolog files. There are various ways to
override this. Using .gitattributes seems to be the easiest.
https://github.com/github/linguist#overrides

Similar issue:
https://github.com/github/linguist/issues/3230
2017-10-23 07:45:20 +02:00
Alex Schroeder
80a30a9102 ignore TAGS 2017-09-07 22:50:08 +02:00
Alex Schroeder
299b94243d ditaa and mermaid modules added 2017-09-07 22:27:47 +02:00
Alex Schroeder
b7ab45a3a7 wiki.css: only p > a.definition looks like h2 2017-08-29 16:49:54 +02:00
Alex Schroeder
9d3deaff0f permanent-anchors: fix dirty block return 2017-08-29 16:44:08 +02:00
Alex Schroeder
42a1e389a5 namespaces: sort the result of the namespace action 2017-08-29 15:39:08 +02:00
Alex Schroeder
9883a064f3 markdown-rule fixes for _foo_, *foo* and /foo/ 2017-08-28 11:42:02 +02:00
Alex Schroeder
52617b472d bbcode must come after markdown 2017-08-16 09:31:51 +02:00
Alex Schroeder
764c15e6c0 Fixed small bug in release file 2017-08-11 20:47:16 +02:00
Alex Schroeder
88b384c2b4 static-copy: suppress extra output when saving pages 2017-07-24 10:35:18 +02:00
Alex Schroeder
92e231b10c paste-image: new action includes javascript 2017-07-14 13:42:12 +02:00
Alex Schroeder
e9ce006444 Markdown: fixed number of tests 2017-07-07 23:19:31 +02:00
Alex Schroeder
bc5ee74ffd Markdown: one more test 2017-07-07 20:52:35 +02:00
Alex Schroeder
688cf9eea5 markdown-rule: support nested lists by indenting 2017-07-07 17:11:04 +02:00
Alex Schroeder
ad9a19d551 paste-image: step from 0.8 to 0.5
As it turns out, when I tried to paste an 1.5MB image, the old
settings didn't work. We need to shrink more agressively.
2017-06-16 20:01:11 +02:00
Alex Schroeder
7595e6db36 paste-image: fix name of option 2017-06-13 22:43:36 +02:00
Alex Schroeder
74fd5c569c paste-image: delete trailing whitespace 2017-06-13 22:32:30 +02:00
Alex Schroeder
e4376c178b paste-image: handle $QuestionaskerSecretKey 2017-06-13 22:18:11 +02:00
Alex Schroeder
9e46438534 Merge branch 'master' of github.com:kensanata/oddmuse 2017-06-13 22:11:46 +02:00
Alex Schroeder
4dd29bd4a7 paste-image: automatic resizing via Javascript 2017-06-13 22:06:39 +02:00
Alex Schroeder
90af54b7ba Add separate alt text for uploaded images 2017-06-13 12:55:52 +02:00
Alex Schroeder
cadcdde5f8 Fix how image names are determined 2017-06-12 23:22:31 +02:00
Alex Schroeder
4c77bc11de markdown-rule: merge with latest from server 2017-06-11 23:42:51 +02:00
Alex Schroeder
05988eb899 paste-image.pl is new 2017-06-11 23:27:16 +02:00
Alex Schroeder
040bd05333 Markdown rule fix for markup in table cells 2017-05-22 18:20:53 +02:00
Alex Schroeder
5f03238f60 Markdown rule: added tests for // and / 2017-05-22 18:00:59 +02:00
Alex Schroeder
4c6d91a101 Markdown rule: fix rules for __ and _ 2017-05-22 17:59:34 +02:00
Alex Schroeder
71b93887dc webdav: new tests using cadaver, when installed 2017-05-22 12:23:15 +02:00
Alex Schroeder
391049ef77 Qualify OddMuse::Modified in a different package 2017-05-22 12:23:15 +02:00
Alex Schroeder
3d5aec5651 For PUT and POST, CGI will read STDIN
You can get the content via the parameters POSTDATA and PUTDATA. For
other methods, however, this doesn't work and you still need to read
STDIN. One such method is PROPFIND.
2017-05-22 12:23:15 +02:00
Alex Schroeder
d976184e24 README: how to use server.pl 2017-05-22 12:23:15 +02:00
Alex Schroeder
5a45c1191a git.pl: failing to delete a file is not an error 2017-05-22 12:23:15 +02:00
Alex Schroeder
07f315ca12 markdown-rule.pl: improving the regexps 2017-05-22 12:23:15 +02:00
Aleks-Daniel Jakimenko-Aleksejev
be1cf0e876 Tiny indentation changes 2017-04-21 02:03:15 +03:00
greenfive
d4d0ed728f refactored into single outer if-branch (#7)
* refactored into one outer if branch, simplified output of div classes

(squashed to avoid the weird GPL version change)
2017-04-21 01:57:49 +03:00
Alex Schroeder
0f0f20b21c Merge pull request #6 from greenfive/titlelist
added support for <titlelist regexp> to search page titles only
2017-04-20 17:47:05 +02:00
Ralph Graulich
abdb9c973b added support for <titlelist regexp> to search page titles only 2017-04-20 13:19:59 +02:00
Aleks-Daniel Jakimenko-Aleksejev
4e0b287890 Variable %RuleOrder is not needed of course
Oops.
2017-04-15 03:56:48 +03:00
Aleks-Daniel Jakimenko-Aleksejev
00308f9ed6 New module: styled-pages.pl
A user on #oddmuse asked what would be the easiest way to have
different css styles on different pages. Turns out the easiest way is
to write a module.

Not sure if it will break html in some yet unknown edge cases, but for
most things this should work just fine.

greenfive++
2017-04-15 03:54:06 +03:00
Alex Schroeder
2488ccdb8c Makefile now looks for https instead of http 2017-04-11 12:50:09 +02:00
Alex Schroeder
cec2f3cc1b banned-regexps.t: new 2017-03-17 09:32:42 +01:00
Alex Schroeder
5a19773dfa meta.t: ban-contributors.pl may have package 2017-03-01 08:26:47 +01:00
Alex Schroeder
7c3bb0a0af ban-contributors: end with package OddMuse 2017-02-28 12:47:50 +01:00
Alex Schroeder
90d44bf863 Merge branch 'master' of github.com:kensanata/oddmuse 2017-02-13 20:48:34 +01:00
Alex Schroeder
9d0ff86a44 gotobar.pl: remove trailing whitespace 2017-01-09 22:37:08 +01:00
Alex Schroeder
d03bc9f40b Moved the elisp files to a different repo
You can find them here:
https://github.com/kensanata/emacs-setup/tree/master/lib
2017-01-09 22:36:23 +01:00
Alex Schroeder
863bda76dc Various elisp changes 2017-01-09 22:36:23 +01:00
Alex Schroeder
fcbe01bbfd campaignwiki/delete.sh: use --silent for curl 2016-12-30 14:00:08 +01:00
IngoBelka
6178c46aec gotobar.pl: Parameters for automatically set of HOME link and RC link or not 2016-12-02 14:34:44 +01:00
Alex Schroeder
87110eef08 Trying to improve SVG printing from Firefox 2016-11-11 19:34:44 +01:00
Aleks-Daniel Jakimenko-Aleksejev
1bfeac5035 Fix tests in history.t after commit 152188503e
Long story short: it was testing for string “rollback” which is now part
of the warning message. Just making it a bit more specific resolves the
problem.
2016-09-22 00:45:10 +03:00
Aleks-Daniel Jakimenko-Aleksejev
ef257b566f Fix git.t for newer git versions
More recent git versions say “working tree clean” instead of
saying “working directory clean”. Let's just accept both.
2016-09-21 23:54:45 +03:00
Alex Schroeder
0fce2edcf8 meta.t: test for GPL URL
This also catches the URL for Weakish Jiang's GPL v2 and a GPL with no
URL (implying the version with a snail mail address).

This is tes should close issue #4 on GitHub.
2016-09-21 17:06:54 +02:00
Alex Schroeder
152188503e Translations: updated
Two new strings which need to be translated.
2016-09-11 21:46:49 +02:00
Alex Schroeder
d804c16a1c Explain Rollback button on History pages 2016-09-10 23:51:07 +02:00
Alex Schroeder
cb7f2e4634 Explain Rollback button on Recent Changes 2016-09-10 23:15:35 +02:00
Alex Schroeder
b90695c7c8 ban-contributors.t: skip the last few tests
Alexine keeps failing those.
2016-08-31 14:20:50 +02:00
Alex Schroeder
e67c8bfda6 wiki.pl Switch oddmuse.org links to HTTPS 2016-08-31 14:14:47 +02:00
Alex Schroeder
90eb428787 calendar.pl: allow previous and next month
Stefan Kamphausen provided a reason for liking the deprecated cal3
extension: he likes cal3 because it also displays the next and
previous month as opposed to calendar.pl which only displays the
current month.

This commit allows users to get the same behaviour by setting
$CalendarOnEveryPage to values greater than 1: 1 shows the current
month on every page, but 2 shows the previous and the current month on
every page, and 3 shows the previous, the current and the next month
on every page.
2016-08-31 13:44:07 +02:00
Alex Schroeder
e3cacaa89f Merge branch 'master' of github.com:kensanata/oddmuse 2016-08-26 13:50:13 +02:00
Alex Schroeder
6167428ecf ban-contributors.t: commented last test
The last test has been failing for Alexine and we have contacted the
maintainer of the Net::Whois::Parser package. Until we hear back, I'm
going to skip this test.
2016-08-19 14:33:55 +02:00
Alex Schroeder
367f76b6f4 Removed old $Id$ line 2016-08-19 13:09:44 +02:00
Alex Schroeder
733b6dabb1 Fixed another one that had slipped through the cracks
Emacs keyboard macros, oops!
2016-08-16 18:08:34 +02:00
Alex Schroeder
72cd669bf0 Changed nearly remaining code from GPLv2 to GPLv3
There were some files that did not offer "or (at your option) any later
version" in their license and these had to be left alone. This should
solve the incorrect FSF address issue #4 on GitHub.
2016-08-16 18:01:26 +02:00
Alex Schroeder
84f630af4a README.creole: indicate ownership
Typo fixed and a chown command added as suggested by @mx4 in GitHub
issue #5.
2016-08-16 17:44:40 +02:00
Alex Schroeder
05df700140 Fixed erroneous edits from previous commit
The keyboard macro did not deal kindly with two files... This should
address comments by @m4z for the incorrect FSF address issue #4 on
GitHub.
2016-08-16 16:43:21 +02:00
Alex Schroeder
f230a64e7d Changed nearly all modules from GPLv2 to GPLv3
There were some modules that did not offer "or (at your option) any
later version" in their license and these had to be left alone.
This should solve the incorrect FSF address issue #4 on GitHub.
2016-08-16 15:04:47 +02:00
Alex Schroeder
1855c84cec namespaces.pl: more changes to get it working
Encoding of namespace and page name under Mojolicious is not OK and I
don't know why. I added some tests that try to at least prove that the
workaround in the config file is OK.
2016-08-11 17:14:14 +02:00
Alex Schroeder
3c982a6cd4 namespaces.t: added another test 2016-08-11 15:29:41 +02:00
Alex Schroeder
7053561f89 Revert "NamespacesInitVariables not decoding path_info"
This reverts commit 5fce7f4b63.

Same as the previous revert for wiki.pl.
2016-08-11 14:20:45 +02:00
Alex Schroeder
02fcabfdbc Revert "GetId no longer decodes path_info"
This reverts commit 1ee235c949.

Sadly, I discovered that my websites no longer correctly displayed pages
containing characters such as the EN DASH. Reverting this commit seems
to solve the problem.
2016-08-10 14:56:00 +02:00
Alex Schroeder
0c0efdd2c8 banned-regexps.pl: exclude urls 2016-08-08 11:31:06 +02:00
Alex Schroeder
9a93601a03 upload.pl: fix meta.t complaint 2016-08-08 11:30:27 +02:00
Alex Schroeder
b68f2b6cd6 ban-contributors.pl: rely on inetnum 2016-08-05 12:24:36 +02:00
Alex Schroeder
80d95e9225 tarballs.pl: handle missing files 2016-08-03 12:52:29 +02:00
Alex Schroeder
04288eda8c light.css: checkboxes are not 5em wide 2016-08-02 12:04:26 +02:00
Alex Schroeder
3a7f75cf30 translations: updated with new strings 2016-08-02 11:55:39 +02:00
Alex Schroeder
0ca64b2db0 german-utf8.pl: updated 2016-08-02 11:54:15 +02:00
Alex Schroeder
81aaf49463 sort.pl: delete trailing whitespace 2016-08-02 11:49:41 +02:00
Alex Schroeder
5c93616690 sort.pl: be more explicit about the sorting
Clearly print how the result is sorted right now.
2016-08-02 11:48:17 +02:00
Alex Schroeder
c1823bc59c sort.pl: Offer link to sort alphabetically
Don't show the link to the current sort order.
2016-08-02 11:43:08 +02:00
Alex Schroeder
1634859659 Skip pages that no longer exist 2016-08-02 11:38:44 +02:00
Alex Schroeder
684781423d creationdate.pl: fix typo 2016-08-02 11:26:02 +02:00
Alex Schroeder
1f2507fc00 creationdate.pl: now with admin menu to add dates
This is done by parsing rc.log files and adding the information to the
page database.
2016-08-02 11:21:38 +02:00
Alex Schroeder
0644b63b67 sort.pl: new module to sort search results 2016-08-02 10:58:37 +02:00
Alex Schroeder
64f6b267d9 Encode arguments to diff command 2016-07-27 17:35:10 +02:00
Alex Schroeder
528e9d8868 meta.t: remove -T from the syntax check
When testing it on my system, perl -c claims ban-contributors.pl is
good and perl -cT claims ban-contributors.pl bad because it can no
longer find Net/Whois/Parser.pm in @INC even though it's right there
as /home/alex/perl5/lib/perl5/Net/Whois/Parser.pm -- apparently taint
checking changes @INC.
<http://perldoc.perl.org/perlsec.html#Taint-mode-and-%40INC>.
2016-07-27 14:01:51 +02:00
Alex Schroeder
f618822f34 meta.t: suggest the use of perl -cT 2016-07-27 13:56:11 +02:00
Alex Schroeder
e9a5fcdc7c ban-contributors: switch to Net::Whois::Parser
This one is available in a Debian package.
2016-07-27 12:51:47 +02:00
Alex Schroeder
2a33e91167 ban-contributors: fixed failing meta.t tests 2016-07-26 09:37:20 +02:00
Alex Schroeder
77327ec06f ban-contributors: better regexp
Now able to handle the range 77.56.180.0 - 77.57.70.255.
2016-07-26 09:25:58 +02:00
Alex Schroeder
f530b25d74 Document the number range being banned 2016-07-26 09:10:22 +02:00
Alex Schroeder
8db81914b1 ban-contributors.pl now with Net::Whois::IP
We use a whois query to suggest a regular expression that bans the
entire network, not just a single IP.
2016-07-25 15:37:34 +02:00
Alex Schroeder
5fce7f4b63 NamespacesInitVariables not decoding path_info
On a new server with Debian Jessie (8), Apache 2.4, Perl 5.25.1 and CGI
4.28 I'm getting double-decoded namespaces. An Umlaut will thus turn
into an undisplayable character (a questionmark in a black diamond).
Decoding of path_info was necessary on my old server with Debian
Wheezy (7), Apache 2.2, Perl 5.14.2 and CGI 3.52.

If you're still in the unfortunate situation, you can copy the old
implementation of NamespacesInitVariables into your config file.
2016-07-25 09:03:33 +02:00
Alex Schroeder
1ee235c949 GetId no longer decodes path_info
On a new server with Debian Jessie (8), Apache 2.4, Perl 5.25.1 and
CGI 4.28 I'm getting double-decoded page names. An Umlaut will thus
turn into an undisplayable character (a questionmark in a black
diamond). Decoding of path_info was necessary on my old server with
Debian Wheezy (7), Apache 2.2, Perl 5.14.2 and CGI 3.52.

If you're still in the unfortunate situation, you can copy the old
implementation of GetId into your config file:

sub GetId {
  my $id = UnquoteHtml(GetParam('id', GetParam('title', ''))); # id=x or title=x -> x
  if (not $id and $q->keywords) {
    $id = decode_utf8(join('_', $q->keywords)); # script?p+q -> p_q
  }
  if ($UsePathInfo and $q->path_info) {
    my @path = map { decode_utf8($_) } split(/\//, $q->path_info);
    $id ||= pop(@path); # script/p/q -> q
    foreach my $p (@path) {
      SetParam($p, 1);    # script/p/q -> p=1
    }
  }
  return $id;
}
2016-07-21 12:49:01 +02:00
Alex Schroeder
be7d8d4460 translation-links.pl: test with locked wiki, too 2016-07-09 00:07:32 +02:00
Alex Schroeder
f134283bae translation-links.pl: prevent spam from saving
When using banned-regexps.pl, we want to ban certain pages from getting
created. This only works if we test source and target page for spam.
2016-07-09 00:03:18 +02:00
Alex Schroeder
38d5d01ea1 DoPost will also test $id for banned content
If using banned-regexps.pl, testing the page title can be important.
2016-07-06 18:18:28 +02:00
Alex Schroeder
8e3e186fab Fix make release target 2016-07-06 18:14:47 +02:00
Alex Schroeder
4b33b3afeb Get rid of -r 2016-06-27 12:05:37 +02:00
Alex Schroeder
9beca5895a tarballs.pl: decode utf8 2016-06-24 12:29:19 +02:00
Alex Schroeder
1afc03eee1 tarballs.pl: a frontend to serve released files
There is a target in our Makefile to make a new release. This stores a
tarball with the appropriate release information in
https://oddmuse.org/releases. tarballs.pl offers an interface to serve
these files, or their individual member files, with a naive cache of
50 elements.

This is a Mojolicious application and is available here:
https://odddmuse.org/download
2016-06-23 23:41:41 +02:00
Alex Schroeder
331b03f894 Script to serve tarballs 2016-06-23 18:33:42 +02:00
Alex Schroeder
1c9b180b3a Merge git.sv.gnu.org:/srv/git/oddmuse 2016-06-23 00:47:10 +02:00
Alex Schroeder
57a16e85f8 meta.t: improve by skipping comments 2016-06-23 00:44:06 +02:00
Alex Schroeder
c7cd5bcc36 meta.t: improve by skipping comments 2016-06-23 00:38:23 +02:00
Alex Schroeder
f571007516 Fix issues discovered by meta.t 2016-06-23 00:34:56 +02:00
Alex Schroeder
fac3f03f7b meta.t: enforce file access rules 2016-06-23 00:31:52 +02:00
Alex Schroeder
7d85dd6570 toc.pl: use ToString and don't double-decode
ToString now takes more arguments.
2016-06-22 16:24:07 +02:00
Alex Schroeder
a91ef8602f Moving modules from utf8::encode to encode_utf8 2016-06-22 15:37:04 +02:00
Alex Schroeder
1bc670617e test.pl: move to encode_utf8 as well 2016-06-22 14:54:52 +02:00
Alex Schroeder
74288ba3f3 Moving from utf8::encode to encode_utf8 2016-06-22 14:43:28 +02:00
408 changed files with 11721 additions and 3774 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.pl linguist-language=Perl

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@
.DS_Store
wiki.log
.prove
TAGS

View File

@@ -3,8 +3,8 @@
# subdirectory.
VERSION_NO=$(shell git describe --tags)
TRANSLATIONS=$(wildcard modules/translations/[a-z]*-utf8.pl$)
MODULES=$(wildcard modules/*.pl)
TRANSLATIONS=$(wildcard modules/translations/*-utf8.pl)
MODULES=$(sort $(wildcard modules/*.pl))
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
# PREPARE/BUILD: this creates copies of wiki.pl and all the modules
@@ -22,10 +22,10 @@ clean:
prove t/setup.pl
release:
perl stuff/release ~/oddmuse.org
perl stuff/release ~/oddmuse.org/releases 2.3.3
build/wiki.pl: wiki.pl
perl -lne "s/(\\\$$q->a\(\{-href=>'http:\/\/www.oddmuse.org\/'\}, 'Oddmuse'\))/\\\$$q->a({-href=>'http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
perl -lne "s/(\\\$$q->a\(\{-href=>'https:\/\/www.oddmuse.org\/'\}, 'Oddmuse'\))/\\\$$q->a({-href=>'https:\/\/alexschroeder.ch\/cgit\/oddmuse\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
build/%-utf8.pl: modules/translations/%-utf8.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
@@ -36,8 +36,8 @@ build/national-%.pl: modules/translations/national-%.pl
build/month-names-%.pl: modules/translations/month-names-%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
# from: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
# to: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
# from: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
# to: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
build/%.pl: modules/%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
@@ -60,3 +60,21 @@ jobs ?= 4
test:
prove t/setup.pl
prove --jobs=$(jobs) --state=slow,save t
# Spin up a quick test
development:
@if grep --quiet 'ScriptName = "http://127.0.0.1:8080";' test-data/config; then \
echo Not overwriting \$$ScriptName in test-data/config; \
else \
echo '$ScriptName = "http://127.0.0.1:8080";' >> test-data/config; \
fi
morbo --listen http://*:8080 \
--watch wiki.pl --watch test-data/config --watch test-data/modules/ \
stuff/mojolicious-app.pl
%.pem:
openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout key.pem
gemini: cert.pem key.pem
perl stuff/gemini-server.pl --wiki_cert_file=cert.pem --wiki_key_file=key.pem

View File

@@ -23,12 +23,21 @@ 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.
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
@@ -85,7 +94,7 @@ Enjoy your wiki experience.
Visit https://www.oddmuse.org/ to learn more about the translation
files and modules that are part of this package.
== Apache
== Checking the Apache Setup
If you think this information doesn't work for you, here are some things
to check.
@@ -119,7 +128,7 @@ The default site is configured in
sudo a2ensite default
}}}
This file also lists the directories we've used in out instructions
This file also lists the directories we've used in our instructions
above.
{{{
@@ -136,6 +145,35 @@ 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

View File

@@ -1,6 +1,6 @@
#! /usr/bin/perl
# Copyright (C) 20112015 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20112018 Alex Schroeder <alex@gnu.org>
# 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
@@ -23,7 +23,8 @@ use utf8;
# load Oddmuse core
$RunCGI = 0;
do "wiki.pl";
$DataDir = '/home/alex/campaignwiki';
do "/home/alex/farm/wiki.pl";
# globals depending on the name of the script
my ($self, $name, $wiki);
@@ -35,6 +36,9 @@ if ($0 eq '/home/alex/campaignwiki.org/add-link.pl') {
$self = "https://campaignwiki.org/add-adventure";
$name = "OSR Links to Adventures";
$wiki = 'Adventures';
} elsif ($0 eq '/home/alex/campaignwiki.org/add-sf-link.pl') {
$name = "OSRSF House Rules Wiki: Uplinked Intelligence";
$wiki = 'UplinkedIntelligence';
} else {
ReportError('Cannot determine wiki!', '500 INTERNAL SERVER ERROR');
}
@@ -164,7 +168,7 @@ sub is_duplicate {
" already links to the URL you submitted:",
GetUrl($link->[0], $link->[1]));
return 1;
}
}
}
return 0;
}
@@ -288,11 +292,13 @@ sub print_end_of_page {
sub main {
$ConfigFile = "$DataDir/config"; # read the global config file
$ModuleDir = "$DataDir/modules"; # global modules
$DataDir = "$DataDir/$wiki"; # but link to the local pages
Init(); # read config file (no modules!)
Init(); # read config file
$ScriptName = $site; # undo setting in the config file
$FullUrl = $site; #
InitPageVariables(); # call again: $ScriptName was wrong
$HomePage = 'HomePage'; # $HomePage must not be translated
binmode(STDOUT,':utf8');
$q->charset('utf8');
if ($q->path_info eq '/source') {

View File

@@ -7,7 +7,7 @@ fi
username=$1
wiki=$2
for p in $(curl "https://campaignwiki.org/wiki/$wiki?action=index;raw=1"); do
for p in $(curl --silent "https://campaignwiki.org/wiki/$wiki?action=index;raw=1"); do
echo "Deleting: $p"
curl -F frodo=1 -F "title=$p" -F text=DeletedPage -F summary=Deleted -F username="$username" "https://campaignwiki.org/wiki/$wiki"
sleep 5

93
contrib/emacswiki/bootstrap.js vendored Normal file
View File

@@ -0,0 +1,93 @@
// Public Domain
// initial version by Alex Schroeder <alex@gnu.org>
// with many improvements by Evgkeni Sampelnikof
$(function(){
// add fancy classes
$('div.header' ).addClass('container');
$('div.wrapper').addClass('container');
$('div.footer' ).addClass('container');
$('div.footer > .navbar' ).remove();
$('.message > p' ).addClass('alert');
$('img.portrait').addClass('img-polaroid');
$('input:text').addClass('input-medium search-query');
$('textarea').addClass('span12');
$('input:submit').addClass('btn');
$('.download a').addClass('btn btn-success');
$('.footer .gotobar').remove();
$('.footer br').first().remove();
var $gotobar = $('.gotobar')
.after($('<div>').attr('class','navbar')
.append($('<div>').attr('class','navbar-inner')
.append($('<ul>').attr('class', 'nav'))));
var $id = $('h1 a').first().text();
var $list = $('.nav')
.append($('<li>')
.append($('<a>').attr('class', 'brand').attr('href', 'http://www.emacswiki.org/')
.append('Emacs Wiki')));
$('.gotobar a').each(function() {
var $item = $('<li>');
$(this).appendTo($item);
$item.appendTo($list);
if ($(this).text() == $id) {
$item.addClass('active');
}
});
$gotobar.remove();
// search without labels, without button, without language field
$('form.search input[type=submit]').remove();
$('form.search label').remove();
$('form.search input#searchlang').remove();
$('form.search')
.css({'float': 'right',
'margin-top': '10px'});
$('.navbar').append($('form.search'));
// add button style to some links
$('.edit.bar a').addClass('btn');
// add color to Talk button for a non-existing page
$('a.btn.comment.edit').addClass('btn-warning');
// move article link and talk link below title
var $link = $('a.original').add('a.comment');
if ($link) {
$('.header h1').after($('<p>').append($link));
}
// toc
if ($('title').text() == "EmacsWiki: Wikified Emacs Lisp List") {
$('.content').addClass('ell');
}
// tables
$('table').addClass('table');
// minor edit checkbox
$('input[type=checkbox]').addClass('checkbox');
$('input[type=checkbox]').parent().addClass('checkbox');
// clean up admin page
$('li a.clear').parent().remove();
$('li a.index').parent().remove();
$('a[href="http://creativecommons.org/licenses/GPL/2.0/"]')
.parent()
.css({'margin-right': '120px',
'opacity': 0.3,
'padding-top': '1em'});
$('.footer .bar')
.after('<hr />');
var footer_wrapper = $('<div/>')
.addClass('footer_wrapper');
var footer = $('.footer.container');
footer.after(footer_wrapper);
footer_wrapper.append(footer);
var logo_image = $('<img />')
.attr('src', 'http://emacswiki.org/ew_logo.png');
$('.header .navbar .brand').html(logo_image);
});

View File

@@ -3,7 +3,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -12,10 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use CGI;
use CGI::Carp qw(fatalsToBrowser);

File diff suppressed because it is too large Load Diff

View File

@@ -1,165 +0,0 @@
;;; vc-oddmuse.el -- add VC support to oddmuse-curl
;;
;; Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
;;
;; Latest version:
;; http://git.savannah.gnu.org/cgit/oddmuse.git/plain/contrib/vc-oddmuse.el
;; Discussion, feedback:
;; http://www.emacswiki.org/cgi-bin/wiki/OddmuseCurl
;;
;; 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 3 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.
;;
;; You should have received a copy of the GNU General Public License along
;; with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; Add the following to your init file:
;;
;; (add-to-list 'vc-handled-backends 'oddmuse)
(add-to-list 'vc-handled-backends 'oddmuse)
(require 'oddmuse-curl)
(require 'diff)
(defun vc-oddmuse-revision-granularity () 'file)
(defun vc-oddmuse-registered (file)
"Handle files in `oddmuse-directory'."
(string-match (concat "^" (expand-file-name oddmuse-directory))
(file-name-directory file)))
(defun vc-oddmuse-state (file)
"Return the current version control state of FILE.
For a list of possible values, see `vc-state'."
;; Avoid downloading the current version from the wiki and comparing
;; the text: Too much traffic!
'edited)
(defun vc-oddmuse-working-revision (file)
"The current revision based on `oddmuse-revisions'."
(with-oddmuse-file
(oddmuse-get-latest-revision wiki pagename)))
(defun vc-oddmuse-checkout-model (files)
"No locking."
'implicit)
(defun vc-oddmuse-create-repo (file)
(error "You cannot create Oddmuse wikis using Emacs."))
(defun vc-oddmuse-register (files &optional rev comment)
"This always works.")
(defvar vc-oddmuse-log-command
(concat "curl --silent %w"
" --form action=rc"
" --form showedit=1"
" --form all=1"
" --form from=1"
" --form raw=1"
" --form match='%r'")
"Command to use for publishing index pages.
It must print the page to stdout.
See `oddmuse-format-command' for the formatting options.")
(defun vc-oddmuse-print-log (files buffer &optional shortlog start-revision limit)
"Load complete recent changes for the files."
;; Derive `oddmuse-wiki' from the first file
(with-oddmuse-file (car files)
;; The wiki expects a Perl regular expression!
(let ((regexp (concat "^(" (mapconcat 'file-name-nondirectory files "|") ")$")))
(oddmuse-run "Getting recent changes" vc-oddmuse-log-command nil nil buffer)))
(with-current-buffer buffer
(oddmuse-render-rss3))
'limit-unsupported)
(defun vc-oddmuse-log-outgoing ()
(error "This is not supported."))
(defun vc-oddmuse-log-incoming ()
(error "This is not supported."))
(defvar vc-oddmuse-get-revision-command
(concat "curl --silent"
" --form action=browse"
" --form id=%t"
" --form revision=%v"
" --form raw=1"
" '%w'")
"Command to use to get older revisions of a page.
It must print the page to stdout.
%? '?' character
%w URL of the wiki as provided by `oddmuse-wikis'
%t Page title as provided by `oddmuse-page-name'
%v Revision to retrieve as provided by `oddmuse-revision'")
(defun oddmuse-revision-filename (rev)
"Return filename for revision REV.
This uses `oddmuse-directory', `wiki' and `pagename' as bound by
`with-oddmuse-file'."
(concat oddmuse-directory
"/" wiki
"/" pagename
".~" rev "~"))
(defun vc-oddmuse-diff (files &optional rev1 rev2 buffer)
"Report the differences for FILES."
(setq buffer (or buffer (get-buffer-create "*vc-diff*")))
(dolist (file files)
(with-oddmuse-file file
(setq rev1 (or rev1 (oddmuse-get-latest-revision wiki pagename)))
(dolist (rev (list rev1 rev2))
(when (and rev (not (file-readable-p (oddmuse-revision-filename rev))))
(let* ((oddmuse-revision rev)
(command vc-oddmuse-get-revision-command)
(filename (oddmuse-revision-filename rev)))
(with-temp-buffer
(oddmuse-run
(concat "Downloading revision " rev)
command wiki pagename)
(write-file filename)))))
(diff-no-select
(if rev1 (oddmuse-revision-filename rev1) file)
(if rev2 (oddmuse-revision-filename rev2) file)
nil
(vc-switches 'oddmuse 'diff)
buffer))))
(defun vc-oddmuse-revert (file &optional contents-done)
"Revert FILE back to the wiki revision.
If optional arg CONTENTS-DONE is non-nil, then nothing needs to
be done, as the contents of FILE have already been reverted from
a version backup."
(unless contents-done
(with-oddmuse-file file
(let ((command (oddmuse-format-command vc-oddmuse-get-revision-command)))
(with-temp-buffer
(oddmuse-run "Loading" command wiki pagename)
(write-file file))))))
(defun vc-oddmuse-checkin (files rev comment)
"Commit changes in FILES to this backend.
REV is a historical artifact and should be ignored. COMMENT is
used as a check-in comment."
(dolist (file files)
(with-oddmuse-file file
(let* ((summary comment)
(command (oddmuse-format-command oddmuse-post-command))
(buf (get-buffer-create " *oddmuse-response*")))
(with-temp-buffer
(insert-file-contents file)
(oddmuse-run "Posting" command wiki pagename buf t 302))))))
(provide 'vc-oddmuse)

544
css/alex-2017.css Normal file
View File

@@ -0,0 +1,544 @@
/* This file is in the public domain. */
html{ text-align: center; }
body, rss {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-style: normal;
font-size: 14pt;
padding: 1em 3em;
max-width: 72ex;
display: inline-block;
text-align: left;
color: #000;
background-color: #fff;
}
@import url(file:///home/alex/alexschroeder.ch/css/alex-2017.css) print;
@media print {
body {
font-size: 12pt;
}
/* hide all the crap */
div.diff, div.diff+hr, div.refer, div.near, div.definition, div.sister,
div.cal, div.footer, span.specialdays, span.gotobar, a.edit, a.number span,
div.rc form, form.tiny, p.comment, p#plus1, div.g-plusone, div.content a.feed {
display:none;
}
div.content a.book,
div.content a.movie {
text-decoration: none;
}
a cite {
font-style: italic;
}
img[alt="RSS"] { display: none }
a.rss { font-size: 8pt }
}
/* headings: we can use larger sizes if we use a lighter color.
we cannot inherit the font-family because header and footer use a narrow font. */
h1, h2, h3, title {
font-family: inherit;
font-weight: normal;
}
h1, channel title {
font-size: 32pt;
margin: 1em 0 0.5em 0;
padding: 0.4em 0;
}
h2 {
font-size: 18pt;
margin: 2em 0 0 0;
padding: 0;
}
h3 {
font-size: inherit;
font-weight: bold;
padding: 0;
margin: 1em 0 0 0;
clear: both;
}
/* headers in the journal are smaller */
div.journal h1, item title {
font-size: inherit;
padding: 0;
clear: both;
border-bottom: 1px solid #000;
}
div.journal h2 {
font-family: inherit;
font-size: inherit;
}
div.journal h3 {
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font-style: italic;
}
div.journal hr {
visibility: hidden;
}
p.more {
margin-top: 3em;
}
/* Links in headings appear on journal pages. */
h1 a, h2 a, h3 a {
color:inherit;
text-decoration:none;
font-weight: normal;
}
h1 a:visited, h2 a:visited, h3 a:visited {
color: inherit;
}
/* for download buttons and the like */
.button {
display: inline-block;
font-size: 120%;
cursor: pointer;
padding: 0.4em 0.6em;
text-shadow: 0px -1px 0px #ccc;
background-color: #cfa;
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset, 0px 1px 3px black;
}
.button .icon {
color: #363;
text-shadow: 0px -1px 1px white, 0px 1px 3px #666;
}
.button a {
text-decoration: none;
font-weight: normal;
}
/* links */
a.pencil {
padding-left: 1ex;
text-decoration: none;
color: inherit;
visibility: hidden;
transition: visibility 0s 1s, opacity 1s linear;
opacity: 0;
}
*:hover > a.pencil {
visibility: visible;
transition: opacity .5s linear;
opacity: 1;
}
@media print {
a.pencil {
display: none;
}
}
a.number {
text-decoration: none;
}
/* stop floating content from flowing over the footer */
hr {
clear: both;
}
/* the distance between links in the navigation bars */
span.bar a {
margin-right: 1ex;
}
a img {
border: none;
}
/* search box in the top bar */
.header form, .header p {
display: inline;
white-space: nowrap;
}
label[for="searchlang"], #searchlang, .header input[type="submit"] {
/* don't use display: none! http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
visibility: hidden; position: absolute;
}
/* wrap on the iphone */
@media only screen and (max-device-width: 480px) {
}
.header input {
width: 10ex;
}
/* other form fields */
input[type="text"] {
padding: 0;
font-size: 80%;
line-height: 125%;
}
/* code */
textarea, pre, code, tt {
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, "Symbola";
font-size: 80%;
}
pre {
overflow:hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
/* styling for divs that will be invisible when printing
when printing. */
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 14pt;
}
@media print {
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 8pt;
}
}
div.footer form.search {
display: none;
}
div.rc li + li {
margin-top: 1em;
}
div.rc li strong, table.history strong, strong.description {
font-family: inherit;
font-weight: inherit;
}
div.diff {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
color: #000;
}
div.old {
background-color: #ffffaf;
}
div.new {
background-color: #cfffcf;
}
div.refer {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
}
div.message {
background-color:#fee;
color:#000;
}
img.xml {
border:none;
padding:1px;
}
a.small img {
max-width:300px;
}
a.large img {
max-width:600px;
}
div.sister {
margin-right:1ex;
background-color:inherit;
}
div.sister p {
margin-top:0;
}
div.sister hr {
display:none;
}
div.sister img {
border:none;
}
div.near, div.definition {
background-color:#efe;
}
div.sidebar {
float:right;
border:1px dotted #000;
padding:0 1em;
}
div.sidebar ul {
padding-left:1em;
}
/* replacements, features */
ins {
font-style: italic;
text-decoration: none;
}
acronym, abbr {
letter-spacing:0.1em;
font-variant:small-caps;
}
/* Interlink prefix not shown */
a .site, a .separator {
display: none;
}
a cite { font:inherit; }
/* browser borkage */
textarea[name="text"] { width:97%; height:80%; }
textarea[name="summary"] { width:97%; height:3em; }
/* comments */
textarea[name="aftertext"] { width:97%; height:10em; }
div.commentshown {
font-size: 12pt;
padding: 2em 0;
}
div.commenthidden {
display:none;
}
div.commentshown {
display:block;
}
p.comment {
margin-bottom: 0;
}
div.comment {
font-size: 14pt;
}
div.comment h2 {
margin-top: 5em;
}
/* comment pages with username, homepage, and email subscription */
.comment form span { display: block; }
.comment form span label { display: inline-block; width: 10em; }
/* IE sucks */
.comment input#username,
.comment input#homepage,
.comment input#mail { width: 20em; }
/* cal */
div.month { padding:0; margin:0 2ex; }
body > div.month {
float:right;
background-color: inherit;
border:solid thin;
padding:0 1ex;
}
.year > .month {
float:left;
}
.footer {
clear:both;
}
.month .title a.local {
background-color: inherit;
}
.month a.local {
background-color: #ddf;
}
.month a.today {
background-color: #fdd;
}
.month a {
color:inherit;
font-weight:inherit;
text-decoration: none;
background-color: #eee;
}
/* history tables and other tables */
table.history {
border: none;
}
td.history {
border: none;
}
table {
border: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 1em;
margin: 1em 2em;
}
table tr td, table tr th {
border: none;
padding: 0.2em 0.5em;
vertical-align: top;
}
table.arab tr th {
font-weight:normal;
text-align:left;
vertical-align:top;
}
table.arab, table.arab tr th, table.arab tr td {
border:none;
}
th.nobreak {
white-space:nowrap;
}
table.full { width:99%; margin-left:1px; }
table.j td, table.j th, table tr td.j, table tr th.j, .j { text-align:justify; }
table.l td, table.l th, table tr td.l, table tr th.l, .l { text-align:left; }
table.r td, table.r th, table tr td.r, table tr th.r, .r { text-align:right; }
table.c td, table.c th, table tr td.c, table tr th.c, .c { text-align:center; }
table.t td { vertical-align: top; }
td.half { width:50%; }
td.third { width:33%; }
form table td { padding:5px; }
/* lists */
dd { padding-bottom:0.5ex; }
dl.inside dt { float:left; }
/* search */
div.search span.result { font-size:larger; }
div.search span.info { font-size:smaller; font-style:italic; }
div.search p.result { display:none; }
img.logo {
float: right;
margin: 0 0 0 1ex;
padding: 0;
border: 1px solid #000;
opacity: 0.3;
background-color:#ffe;
}
/* images */
div.content a.feed img, div.journal a.feed img,
div.content a img.smiley, div.journal a img.smiley, img.smiley,
div.content a.inline img, div.journal a.inline img,
div.content li a.image img, div.journal li a.image img {
margin: 0; padding: 0; border: none;
}
div.image a img {
margin-bottom: 0;
}
div.image span.caption {
margin: 0 1em;
}
img {
max-width: 100%;
}
.left { float:left; margin-right: 1em; }
.right { float:right; margin-left: 1em; }
.half img { height: 50%; width: 50%; }
.face img { width: 200px; }
div.left .left, div.right .right {
float:none;
}
.center { text-align:center; }
table.aside {
float:right;
width:40%;
margin-left: 1em;
padding: 1ex;
border: 1px dotted #666;
}
table.aside td {
text-align:left;
}
div.sidebar {
float:right; width: 250px;
text-align: right;
border: none;
margin: 1ex;
}
.bigsidebar {
float:right;
width: 500px;
border: none;
margin-left: 1ex;
font-size: 80%;
}
dl.irc dt { width:20ex; float:left; text-align:right; clear:left; }
dl.irc dt span.time { float:left; }
dl.irc dd { margin-left:22ex; }
/* portrait */
div.footer, div.comment, hr { clear: both; }
.portrait { float: left; font-size: small; margin-right: 1em; }
.portrait a { color: #999; }
div.left { float:left; margin:1em; padding: 0.5em; }
div.left p { display:table-cell; }
div.left p + p { display:table-caption; caption-side:bottom; }
p.table a { float:left; width:20ex; }
p.table + p { clear:both; }
/* mastodon */
div.mastodon { padding: 0 2em }
div.mastodon .status {padding-top: 1ex; border-bottom: 1px solid grey;}
div.mastodon .status:first-child {border-top: 1px solid grey;}
/* rss */
channel * { display: block; }
channel title {
margin-top: 30pt;
}
copyright {
font-size: 14pt;
margin-top: 1em;
}
channel:before {
font-size: 14pt;
display: block;
margin: 1em;
padding: 0.5em;
content: "This document is to be read in a feed reader. The item content is escaped HTML, which makes it hard to read for humans. Sorry!";
color: red;
border: 1px solid red;
}
license {
font-size: 11pt;
margin-bottom: 9pt;
}
contributor:before { content: "Last edited by "; }
contributor:after { content: "."; }
generator:before { content: "Feed generated by "; }
generator:after { content: "."; }
channel description {
font-weight: bold;
}
item description {
font-weight: normal;
margin-bottom: 1em;
}
link, managingEditor, webMaster, license, url,
docs, language,
pubDate, lastBuildDate, ttl, guid, category, comments,
docs, image title, image link,
status, version, diff, history, importance {
display: none;
}

615
css/alex-2018.css Normal file
View File

@@ -0,0 +1,615 @@
/* This file is in the public domain. */
html{ text-align: center; }
body, rss {
font-family: "DejaVu Serif", Palatino, serif;
font-style: normal;
font-size: 16pt;
padding: 1em 3em;
max-width: 72ex;
display: inline-block;
text-align: left;
color: #000;
background-color: #fff;
}
@media only screen and (max-device-width: 600px) {
body {
padding: 1ex;
}
textarea {
font-size: inherit;
}
}
/* code */
textarea, pre, code, tt {
font-family: "DejaVu Mono", "Andale Mono", Monaco, "Courier New", Courier, monospace;
}
pre, code, tt {
font-size: 12pt; /* fits 80ex */
}
pre {
overflow:hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
@import url(file:///home/alex/alexschroeder.ch/css/alex-2017.css) print;
@media print {
body {
font-size: 12pt;
}
/* hide all the crap */
div.diff, div.diff+hr, div.refer, div.near, div.definition, div.sister,
div.cal, div.footer, span.specialdays, span.gotobar, a.edit, a.number span,
div.rc form, form.tiny, p.comment, p#plus1, div.g-plusone, div.content a.feed {
display:none;
}
div.content a.book,
div.content a.movie {
text-decoration: none;
}
a cite {
font-style: italic;
}
img[alt="RSS"] { display: none }
a.rss { font-size: 8pt }
}
/* headings: we can use larger sizes if we use a lighter color.
we cannot inherit the font-family because header and footer use a narrow font. */
h1, h2, h3, title {
font-family: inherit;
font-weight: normal;
}
h1, channel title {
font-size: 32pt;
margin: 1em 0 0.5em 0;
padding: 0.4em 0;
}
h2 {
font-size: 18pt;
margin: 2em 0 0 0;
padding: 0;
}
h3 {
font-size: inherit;
font-weight: bold;
padding: 0;
margin: 1em 0 0 0;
clear: both;
}
/* headers in the journal are smaller */
div.journal h1, item title {
font-size: inherit;
padding: 0;
clear: both;
border-bottom: 1px solid #000;
}
div.journal h2 {
font-family: inherit;
font-size: inherit;
}
div.journal h3 {
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font-style: italic;
}
div.journal hr {
visibility: hidden;
}
p.more {
margin-top: 3em;
}
/* Links in headings appear on journal pages. */
h1 a, h2 a, h3 a {
color:inherit;
text-decoration:none;
font-weight: normal;
}
h1 a:visited, h2 a:visited, h3 a:visited {
color: inherit;
}
/* for download buttons and the like */
.button {
display: inline-block;
font-size: 120%;
cursor: pointer;
padding: 0.4em 0.6em;
text-shadow: 0px -1px 0px #ccc;
background-color: #cfa;
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset, 0px 1px 3px black;
}
.button .icon {
color: #363;
text-shadow: 0px -1px 1px white, 0px 1px 3px #666;
}
.button a {
text-decoration: none;
font-weight: normal;
}
/* links */
a.pencil {
padding-left: 1ex;
text-decoration: none;
color: inherit;
visibility: hidden;
transition: visibility 0s 1s, opacity 1s linear;
opacity: 0;
}
*:hover > a.pencil {
visibility: visible;
transition: opacity .5s linear;
opacity: 1;
}
@media print {
a.pencil {
display: none;
}
}
a.number {
text-decoration: none;
}
/* stop floating content from flowing over the footer */
hr {
clear: both;
}
/* the distance between links in the navigation bars */
span.bar a {
margin-right: 1ex;
}
a img {
border: none;
}
/* search box in the top bar */
.header form, .header p {
display: inline;
white-space: nowrap;
}
label[for="searchlang"], #searchlang, .header input[type="submit"] {
/* don't use display: none! http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
visibility: hidden; position: absolute;
}
.header input {
width: 10ex;
}
/* other form fields */
input[type="text"] {
padding: 0;
font-size: 80%;
line-height: 125%;
}
/* styling for divs that will be invisible when printing
when printing. */
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 14pt;
}
@media print {
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 8pt;
}
}
div.footer form.search {
display: none;
}
/* Recent Changes */
div.rc {
overflow: hidden;
}
div.rc li + li {
margin-top: 1em;
}
div.rc li strong, table.history strong, strong.description {
font-family: inherit;
font-weight: inherit;
}
.red {
background: red;
color: red;
}
.orange {
background: orange;
color: orange;
}
.yellow {
background: yellow;
color: yellow;
}
.green {
background: green;
color: green;
}
.blue {
background: blue;
color: blue;
}
.indigo {
background: indigo;
color: indigo;
}
.violet {
background: violet;
color: violet;
}
.white {
background: white;
color: white;
}
.ip-code {
border: 1px solid #666;
}
/* Diff */
div.diff {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
color: #000;
}
div.old {
background-color: #ffffaf;
}
div.new {
background-color: #cfffcf;
}
div.refer {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
}
div.message {
background-color:#fee;
color:#000;
}
img.xml {
border:none;
padding:1px;
}
a.small img {
max-width:300px;
}
a.large img {
max-width:600px;
}
div.sister {
margin-right:1ex;
background-color:inherit;
}
div.sister p {
margin-top:0;
}
div.sister hr {
display:none;
}
div.sister img {
border:none;
}
div.near, div.definition {
background-color:#efe;
}
div.sidebar {
float:right;
border:1px dotted #000;
padding:0 1em;
}
div.sidebar ul {
padding-left:1em;
}
/* replacements, features */
ins {
font-style: italic;
text-decoration: none;
}
acronym, abbr {
letter-spacing:0.1em;
font-variant:small-caps;
}
/* Interlink prefix not shown */
a .site, a .separator {
display: none;
}
a cite { font:inherit; }
/* browser borkage */
textarea[name="text"] { width:97%; height:80%; }
textarea[name="summary"] { width:97%; height:3em; }
/* comments */
textarea[name="aftertext"] { width:97%; height:10em; }
div.commentshown {
font-size: 12pt;
padding: 2em 0;
}
div.commenthidden {
display:none;
}
div.commentshown {
display:block;
}
p.comment {
margin-bottom: 0;
}
div.comment {
font-size: 14pt;
}
div.comment h2 {
margin-top: 5em;
}
/* comment pages with username, homepage, and email subscription */
.comment form span { display: block; }
.comment form span label { display: inline-block; width: 10em; }
/* IE sucks */
.comment input#username,
.comment input#homepage,
.comment input#mail { width: 20em; }
/* cal */
div.month { padding:0; margin:0 2ex; }
body > div.month {
float:right;
background-color: inherit;
border:solid thin;
padding:0 1ex;
}
.year > .month {
float:left;
}
.footer {
clear:both;
}
.month .title a.local {
background-color: inherit;
}
.month a.local {
background-color: #ddf;
}
.month a.today {
background-color: #fdd;
}
.month a {
color:inherit;
font-weight:inherit;
text-decoration: none;
background-color: #eee;
}
/* history tables and other tables */
table.history {
border: none;
}
td.history {
border: none;
}
table {
border: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 1em;
margin: 1em 2em;
}
table tr td, table tr th {
border: none;
padding: 0.2em 0.5em;
vertical-align: top;
}
table.arab tr th {
font-weight:normal;
text-align:left;
vertical-align:top;
}
table.arab, table.arab tr th, table.arab tr td {
border:none;
}
th.nobreak {
white-space:nowrap;
}
table.full { width:99%; margin-left:1px; }
table.j td, table.j th, table tr td.j, table tr th.j, .j { text-align:justify; }
table.l td, table.l th, table tr td.l, table tr th.l, .l { text-align:left; }
table.r td, table.r th, table tr td.r, table tr th.r, .r { text-align:right; }
table.c td, table.c th, table tr td.c, table tr th.c, .c { text-align:center; }
table.t td { vertical-align: top; }
td.half { width:50%; }
td.third { width:33%; }
form table td { padding:5px; }
/* lists */
dd { padding-bottom:0.5ex; }
dl.inside dt { float:left; }
/* search */
div.search span.result { font-size:larger; }
div.search span.info { font-size:smaller; font-style:italic; }
div.search p.result { display:none; }
img.logo {
float: right;
margin: 0 0 0 1ex;
padding: 0;
border: 1px solid #000;
opacity: 0.3;
background-color:#ffe;
}
/* images */
div.content a.feed img, div.journal a.feed img,
div.content a img.smiley, div.journal a img.smiley, img.smiley,
div.content a.inline img, div.journal a.inline img,
div.content li a.image img, div.journal li a.image img {
margin: 0; padding: 0; border: none;
}
div.image a img {
margin-bottom: 0;
}
div.image span.caption {
margin: 0 1em;
}
img {
max-width: 100%;
}
.left { float:left; margin-right: 1em; }
.right { float:right; margin-left: 1em; }
.half img { height: 50%; width: 50%; }
.face img { width: 200px; }
div.left .left, div.right .right {
float:none;
}
.center { text-align:center; }
table.aside {
float:right;
width:40%;
margin-left: 1em;
padding: 1ex;
border: 1px dotted #666;
}
table.aside td {
text-align:left;
}
div.sidebar {
float:right; width: 250px;
text-align: right;
border: none;
margin: 1ex;
}
.bigsidebar {
float:right;
width: 500px;
border: none;
margin-left: 1ex;
font-size: 80%;
}
dl.irc dt { width:20ex; float:left; text-align:right; clear:left; }
dl.irc dt span.time { float:left; }
dl.irc dd { margin-left:22ex; }
/* portrait */
div.footer, div.comment, hr { clear: both; }
.portrait { float: left; font-size: small; margin-right: 1em; }
.portrait a { color: #999; }
div.left { float:left; margin:1em; padding: 0.5em; }
div.left p { display:table-cell; }
div.left p + p { display:table-caption; caption-side:bottom; }
p.table a { float:left; width:20ex; }
p.table + p { clear:both; }
/* mastodon */
div.mastodon { padding: 0 2em }
div.mastodon .status {padding-top: 1ex; border-bottom: 1px solid grey;}
div.mastodon .status:first-child {border-top: 1px solid grey;}
/* terminal "screenshots" */
.terminal {
width: 80%;
margin: 50px auto 100px auto;
padding: 5px;
font-size: 62%; /* fits 80ex */
border: 1px solid #999;
border-radius: 5px;
box-shadow: 0px 25px 50px #999;
}
/* rss */
channel * { display: block; }
channel title {
margin-top: 30pt;
}
copyright {
font-size: 14pt;
margin-top: 1em;
}
channel:before {
font-size: 14pt;
display: block;
margin: 1em;
padding: 0.5em;
content: "This document is to be read in a feed reader. The item content is escaped HTML, which makes it hard to read for humans. Sorry!";
color: red;
border: 1px solid red;
}
license {
font-size: 11pt;
margin-bottom: 9pt;
}
contributor:before { content: "Last edited by "; }
contributor:after { content: "."; }
generator:before { content: "Feed generated by "; }
generator:after { content: "."; }
channel description {
font-weight: bold;
}
item description {
font-weight: normal;
margin-bottom: 1em;
}
link, managingEditor, webMaster, license, url,
docs, language,
pubDate, lastBuildDate, ttl, guid, category, comments,
docs, image title, image link,
status, version, diff, history, importance {
display: none;
}

425
css/latex.css Normal file
View File

@@ -0,0 +1,425 @@
/*!
* LaTeX.css (https://latex.now.sh/)
*
* Source: https://github.com/vincentdoerig/latex-css
* Licensed under MIT (https://github.com/vincentdoerig/latex-css/blob/master/LICENSE)
*/
@font-face {
font-family: 'Latin Modern';
font-style: normal;
font-weight: normal;
font-display: swap;
src: url('/style/fonts/LM-regular.woff2') format('woff2'),
url('/style/fonts/LM-regular.woff') format('woff'),
url('/style/fonts/LM-regular.ttf') format('truetype');
}
@font-face {
font-family: 'Latin Modern';
font-style: italic;
font-weight: normal;
font-display: swap;
src: url('/style/fonts/LM-italic.woff2') format('woff2'),
url('/style/fonts/LM-italic.woff') format('woff'),
url('/style/fonts/LM-italic.ttf') format('truetype');
}
@font-face {
font-family: 'Latin Modern';
font-style: normal;
font-weight: bold;
font-display: swap;
src: url('/style/fonts/LM-bold.woff2') format('woff2'),
url('/style/fonts/LM-bold.woff') format('woff'),
url('/style/fonts/LM-bold.ttf') format('truetype');
}
@font-face {
font-family: 'Latin Modern';
font-style: italic;
font-weight: bold;
font-display: swap;
src: url('/style/fonts/LM-bold-italic.woff2') format('woff2'),
url('/style/fonts/LM-bold-italic.woff') format('woff'),
url('/style/fonts/LM-bold-italic.ttf') format('truetype');
}
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
ul[class],
ol[class],
li,
figure,
figcaption,
dl,
dd {
margin: 0;
}
/* Make default font-size 1rem and add smooth scrolling to anchors */
html {
font-size: 1.4rem;
scroll-behavior: smooth;
}
body {
font-family: 'Latin Modern', Georgia, Cambria, 'DejaVu Serif', 'Times New Roman', Times, serif;
line-height: 1.4;
max-width: 80ch;
min-height: 100vh;
overflow-x: hidden;
margin: 0 auto;
padding: 2rem 1.25rem;
counter-reset: theorem;
counter-reset: definition;
color: hsl(0, 5%, 10%);
background-color: hsl(210, 20%, 98%);
text-rendering: optimizeLegibility;
}
/* Justify and hyphenate all paragraphs */
p {
text-align: justify;
hyphens: auto;
-webkit-hyphens: auto;
-moz-hyphens: auto;
margin-top: 1rem;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
}
/* Make links red */
a {
text-decoration: none;
color: #a00;
}
a:visited {
text-decoration: none;
color: #800;
}
a:focus {
outline-offset: 2px;
outline: 2px solid hsl(220, 90%, 52%);
}
/* Ueberschriften mit Links nur dezent einfärben */
h1 a, h1 a:visited,
h2 a, h2 a:visited,
h3 a, h3 a:visited,
h4 a, h4 a:visited,
h5 a, h5 a:visited,
h6 a, h6 a:visited {
color: #555;
}
/* goto bar */
div.menu form.search {
font-size:75%;
margin-top:2em;
margin-bottom:3em;
}
div.menu span.gotobar a.local,
div.menu span.gotobar a.local:visited {
text-decoration: none;
color: #1e133c87;
margin-right:1.1em;
font-weight: bold;
}
/* Make images easier to work with */
img {
max-width: 100%;
display: block;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
/* Prevent textarea from overflowing */
textarea {
width: 100%;
}
/* Natural flow and rhythm in articles by default */
article > * + * {
margin-top: 1em;
}
/* Styles for inline code or code snippets */
code,
pre,
kbd {
font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
monospace;
font-size: 85%;
}
pre {
padding: 1rem 1.4rem;
max-width: 100%;
overflow: auto;
border-radius: 4px;
background: hsl(210, 28%, 93%);
}
pre code {
font-size: 95%;
position: relative;
}
kbd {
background: hsl(210, 5%, 100%);
border: 1px solid hsl(210, 5%, 70%);
border-radius: 2px;
padding: 2px 4px;
font-size: 75%;
}
/* Make table 100% width, add borders between rows */
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
max-width: 100%;
}
th,
td {
text-align: left;
padding: 0.5rem;
}
td {
border-bottom: 1px solid hsl(0, 0%, 85%);
}
thead th {
border-bottom: 2px solid hsl(0, 0%, 70%);
}
tfoot th {
border-top: 2px solid hsl(0, 0%, 70%);
}
/* Center align the title */
h1:first-child {
text-align: center;
}
/* Nested ordered list for ToC */
nav ol {
counter-reset: item;
padding-left: 2rem;
}
nav li {
display: block;
}
nav li:before {
content: counters(item, '.') ' ';
counter-increment: item;
padding-right: 0.85rem;
}
/* Center definitions (most useful for display equations) */
dl dd {
text-align: center;
}
/* Theorem */
.theorem {
counter-increment: theorem;
display: block;
margin: 12px 0;
font-style: italic;
}
.theorem::before {
content: 'Satz ' counter(theorem) '. ';
font-weight: bold;
font-style: normal;
}
/* Lemma */
.lemma {
counter-increment: theorem;
display: block;
margin: 12px 0;
font-style: italic;
}
.lemma::before {
content: 'Lemma ' counter(theorem) '. ';
font-weight: bold;
font-style: normal;
}
/* Proof */
.proof {
display: block;
margin: 12px 0;
font-style: normal;
position: relative;
}
.proof::before {
content: 'Beweis.' attr(title);
font-style: italic;
}
.proof:after {
content: '◾️';
position: absolute;
right: -12px;
bottom: -2px;
}
/* Definition */
.definition {
counter-increment: definition;
display: block;
margin: 12px 0;
font-style: normal;
}
.definition::before {
content: 'Definition ' counter(definition) '. ';
font-weight: bold;
font-style: normal;
}
/* Center align author name, use small caps and add vertical spacing */
.author {
margin: 0.85rem 0;
font-variant-caps: small-caps;
text-align: center;
}
/* Make footnote text smaller and left align it (looks bad with long URLs) */
.footnotes p {
text-align: left;
line-height: 1.5;
font-size: 85%;
margin-bottom: 0.4rem;
}
.footnotes {
border-top: 1px solid hsl(0, 0%, 39%);
}
/* Center title and paragraph */
.abstract,
.abstract p {
text-align: center;
}
.abstract {
margin: 2.25rem 0;
}
/* Format the LaTeX symbol correctly (a higher up, e lower) */
.latex span:nth-child(1) {
text-transform: uppercase;
font-size: 0.75em;
vertical-align: 0.28em;
margin-left: -0.48em;
margin-right: -0.15em;
line-height: 1ex;
}
.latex span:nth-child(2) {
text-transform: uppercase;
vertical-align: -0.5ex;
margin-left: -0.1667em;
margin-right: -0.125em;
line-height: 1ex;
}
/* Heading typography */
h1 {
font-size: 2.5rem;
line-height: 3.25rem;
margin-bottom: 1.625rem;
}
h2 {
font-size: 1.7rem;
line-height: 2rem;
margin-top: 3rem;
}
h3 {
font-size: 1.4rem;
margin-top: 2.5rem;
}
h4 {
font-size: 1.2rem;
margin-top: 2rem;
}
h5 {
font-size: 1rem;
margin-top: 1.8rem;
}
h6 {
font-size: 1rem;
font-style: italic;
font-weight: normal;
margin-top: 2.5rem;
}
h3,
h4,
h5,
h6 {
line-height: 1.625rem;
}
h1 + h2 {
margin-top: 1.625rem;
}
h2 + h3,
h3 + h4,
h4 + h5 {
margin-top: 0.8rem;
}
h5 + h6 {
margin-top: -0.8rem;
}
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 0.8rem;
}
div.diff div.old {
background-color: #FFFFAF;
}
div.diff div.new {
background-color: #CFFFCF;
}
div.content blockquote {
font-style: italic;
}

View File

@@ -27,6 +27,10 @@ textarea, pre, code, tt {
font-family: Times, serif;
font-size:10pt;
}
/* Printing from Firefox */
svg {
transform: translate(-1.5cm, -1cm);
}
}
/* iPhone */
@@ -49,7 +53,8 @@ textarea, pre, code, tt {
/* hide the buttons but don't use display:none because of
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form
.header input[type="submit"] { position: absolute; visibility: hidden; } */
.header input { width: 5em; font-size: 80%; }
.header input { width: 6em; font-size: 80%; }
.header input[type="checkbox"] { width: 1em; }
.footer { clear:both; font-size: 90%; }
.content input { font-size: 80%; line-height: 125%; }

View File

@@ -51,13 +51,13 @@ a.image:hover img {
}
/* a.definition soll aussehen wie h2 */
h2, p a.definition {
h2, p > a.definition {
display: block;
clear: both;
}
/* Such Link im h1 soll nicht auffallen. */
h1, h2, h3, h4, h1 a, h1 a:visited, p a.definition {
h1, h2, h3, h4, h1 a, h1 a:visited, p > a.definition {
color: #666;
font-size: 30pt;
font-weight: normal;
@@ -172,6 +172,50 @@ span.bar a {
padding: 1ex 0;
}
.red {
background: red;
color: red;
}
.orange {
background: orange;
color: orange;
}
.yellow {
background: yellow;
color: yellow;
}
.green {
background: green;
color: green;
}
.blue {
background: blue;
color: blue;
}
.indigo {
background: indigo;
color: indigo;
}
.violet {
background: violet;
color: violet;
}
.white {
background: white;
color: white;
}
.ip-code {
border: 1px solid #666;
}
hr {
border: none;
color: black;
@@ -219,3 +263,19 @@ code {
background: #eee;
white-space: pre-wrap;
}
/* for https://oddmuse.org/wiki/All_Modules */
.foo_list + .journal h1 {
font: inherit;
border: none;
display: list-item;
margin-top: 0;
margin-left: 1em;
}
.foo_list + .journal a {
font: inherit;
border: none;
text-decoration: none;
color: #a00;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

15
logo/falky/README.md Normal file
View File

@@ -0,0 +1,15 @@
Falky schreibt:
Zum Thema Rechte am Logo möchte ich erstmal sagen, dass es mir primär
darum ging den Auftritt von oddmuse.org aufzuhübschen. Also du/ihr
sollt durch das Logo unterstützt werden, nicht eingeschränkt.
Welche Lizenz das ab besten leisten, da hab ich keinen Schimmer.
Schön wäre, wenn irgendwo ein verweis auf "Falky [falky.de]"
auftaucht, der soll aber nicht bei jeder Verwendung auftauchen,
sondern irgendwo 'auffindbar' an 'zentraler' Stelle - halt irgendwo
auf der Homepage, dass ich darauf verweisen kann und dass niemand was
anderes behaupten kann. Das wäre es schon. Und ja, falls jemand das
logo für ein anderes Projekt verwenden möchte, kann man ja höflich
nochmal fragen oder so.

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-61 -1 177 62">
<rect fill="#FFF" x="-60" y="0" width="175" height="60"/>
<text style="font:400 6px Neris Black" fill="#000" x="2" y="18">powered by</text>
<text style="font:400 16px Neris Thin" fill="#000" x="2" y="34">Oddmuse<tspan style="font-family:Neris Black">.org</tspan></text>
<g id="new" transform="translate(-30,30) scale(.18,.18)" >
<circle fill="#FFF" stroke="#000" stroke-width="3" cx="0" cy="0" r="160.5"/>
<g id="new" transform="rotate(207.2)" >
<path fill="#000" d="m42 -77 q24 0 38 20 c14 -1 42 -18 52 -29 c-1 50 -26 68 -44 70 c0 90 -44 141 -88 141 c-44 0 -88 -51 -88 -141 c-18 -2 -43 -20 -44 -70 c10 11 38 28 52 29 q14 -20 38 -20z"/>
<path fill="#000" transform="translate(0,60) rotate(-14)" d="m -22 46q1 50 22 50q21 0 22 -50z"/>
<path stroke="#FFF" stroke-width="4" fill="#000" d="m0 17 c 30 0 36 -2 46 -2 c 18 0 32 16 32 51 c 0 34 -12 50 -32 50 c-16 0 -26 -5 -46 -5 c-20 0 -30 5 -46 5 c-20 0 -33 -18 -32 -50 c0 -36 16 -52 32 -51 c10 0 16 2 46 2z"/>
<circle fill="#FFF" cx="44" cy="49" r="12"/> <circle fill="#FFF" cx="-44" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#000" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g></g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
logo/falky/oddmuse.icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-100 -100 200 200" >
<rect fill="#D88" x="-100" y="-100" width="200" height="200"/>
<g id="new" transform="rotate(180) translate(0,-19)" >
<path fill="#A00" d="m42 -77 q18 0 33 14 q 12 -6 23 -16 q-2 25 -10 43 c0 110 -44 155 -88 155 c-44 0 -88 -44 -88 -155 q-8 -18 -10 -43 q11 10 23 16 q15 -14 33 -14z"/>
<path stroke="#FFF" stroke-width="6" fill="#A00" d="m0 16 c30 0 38 -2 48 -2 c17 0 33 16 33 52 c0 34 -12 52 -31 52 c-15 0 -30 -7 -50 -7 c-20 0 -35 7 -50 7 c-19 0 -31 -18 -31 -52 c0 -36 16 -52 33 -52 c10 0 18 2 48 2z"/>
<circle fill="#FFF" cx="45" cy="49" r="12"/> <circle fill="#FFF" cx="-45" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#666" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
logo/falky/oddmuse.logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-162 -162 324 324">
<circle fill="#FEE" stroke="#000" stroke-width="3" cx="0" cy="0" r="160.5"/>
<g id="new" transform="rotate(210)" >
<path fill="#A00" d="m42 -77 q24 0 38 20 c14 -1 42 -18 52 -29 c-1 50 -26 68 -44 70 c0 90 -44 141 -88 141 c-44 0 -88 -51 -88 -141 c-18 -2 -43 -20 -44 -70 c10 11 38 28 52 29 q14 -20 38 -20z"/>
<path fill="#A00" transform="translate(0,60) rotate(-14)" d="m -22 46q1 50 22 50q21 0 22 -50z"/>
<path stroke="#FFF" stroke-width="4" fill="#D88" d="m0 17 c 30 0 36 -2 46 -2 c 18 0 32 16 32 51 c 0 34 -12 50 -32 50 c-16 0 -26 -5 -46 -5 c-20 0 -30 5 -46 5 c-20 0 -33 -18 -32 -50 c0 -36 16 -52 32 -51 c10 0 16 2 46 2z"/>
<circle fill="#FFF" cx="44" cy="49" r="12"/> <circle fill="#FFF" cx="-44" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#666" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-162 -162 324 324">
<circle fill="#FFF" stroke="#000" stroke-width="3" cx="0" cy="0" r="160.5"/>
<text style="font:400 27px Neris Black" fill="#000" text-anchor="middle" x="-5" y="137">Oddmuse</text>
<g id="new" transform="rotate(210)" >
<path fill="#000" d="m42 -77 q24 0 38 20 c14 -1 42 -18 52 -29 c-1 50 -26 68 -44 70 c0 90 -44 141 -88 141 c-44 0 -88 -51 -88 -141 c-18 -2 -43 -20 -44 -70 c10 11 38 28 52 29 q14 -20 38 -20z"/>
<path fill="#000" transform="translate(0,60) rotate(-14)" d="m -22 46q1 50 22 50q21 0 22 -50z"/>
<path stroke="#FFF" stroke-width="4" fill="#000" d="m0 17 c 30 0 36 -2 46 -2 c 18 0 32 16 32 51 c 0 34 -12 50 -32 50 c-16 0 -26 -5 -46 -5 c-20 0 -30 5 -46 5 c-20 0 -33 -18 -32 -50 c0 -36 16 -52 32 -51 c10 0 16 2 46 2z"/>
<circle fill="#FFF" cx="44" cy="49" r="12"/> <circle fill="#FFF" cx="-44" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#000" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
logo/falky/testmonial.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

4
logo/murray/README.md Normal file
View File

@@ -0,0 +1,4 @@
The logo is licensed under the [GNU Free Documentation
License](http://www.emacswiki.org/FDL) as well as the [CC BY
2.0](http://creativecommons.org/licenses/by/2.0/) license. The author
is [Murray Altheim](http://www.altheim.com/murray/).

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="0.41"
sodipodi:docname="oddmuse-logo.svg"
sodipodi:docbase="/Users/alex/Pictures/Oddmuse"
height="1000pt"
width="1000pt"
sodipodi:version="0.32"
id="svg1">
<metadata
id="metadata32">
<rdf:RDF
id="RDF34">
<cc:Work
id="Work36"
rdf:about="">
<dc:format
id="format38">image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage"
id="type40" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3" />
<sodipodi:namedview
inkscape:current-layer="svg1"
inkscape:window-y="22"
inkscape:window-x="0"
inkscape:window-height="535"
inkscape:window-width="640"
inkscape:cy="625.00000"
inkscape:cx="625.00000"
inkscape:zoom="0.28960000"
id="base" />
<g
transform="translate(-155.7935,22.13440)"
id="g176">
<path
transform="matrix(1.021740,0.000000,0.000000,1.021740,-299.4160,85.75640)"
sodipodi:ry="148.93437"
sodipodi:rx="142.30524"
sodipodi:cy="475.27606"
sodipodi:cx="1066.8474"
d="M 1209.1526 475.27606 A 142.30524 148.93437 0 1 1 924.54218,475.27606 A 142.30524 148.93437 0 1 1 1209.1526 475.27606 z"
id="path166"
style="fill:#ffde00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:22.021299;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
<path
transform="matrix(0.591973,0.000000,0.000000,0.523224,159.0800,309.0390)"
sodipodi:ry="148.93437"
sodipodi:rx="142.30524"
sodipodi:cy="475.27606"
sodipodi:cx="1066.8474"
d="M 1209.1526 475.27606 A 142.30524 148.93437 0 1 1 924.54218,475.27606 A 142.30524 148.93437 0 1 1 1209.1526 475.27606 z"
id="path168"
style="fill:#ffde00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:38.609402;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
<rect
transform="translate(-1.416020,0.000000)"
y="561.16870"
x="694.39026"
height="88.691116"
width="195.30150"
id="rect170"
style="font-size:12.000000;fill:#ffde00;fill-opacity:1.0000000;fill-rule:evenodd;stroke-width:1.0000000pt" />
<g
id="g173">
<path
transform="translate(185.0000,-158.7500)"
sodipodi:ry="31.250000"
sodipodi:rx="25.000000"
sodipodi:cy="783.75000"
sodipodi:cx="565.00000"
d="M 590.00000 783.75000 A 25.000000 31.250000 0 1 1 540.00000,783.75000 A 25.000000 31.250000 0 1 1 590.00000 783.75000 z"
id="path171"
style="fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
<path
transform="translate(266.2500,-158.7500)"
sodipodi:ry="31.250000"
sodipodi:rx="25.000000"
sodipodi:cy="783.75000"
sodipodi:cx="565.00000"
d="M 590.00000 783.75000 A 25.000000 31.250000 0 1 1 540.00000,783.75000 A 25.000000 31.250000 0 1 1 590.00000 783.75000 z"
id="path172"
style="fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -3,7 +3,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -12,10 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
package OddMuse;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
@@ -68,13 +65,13 @@ sub AdminPowerRename {
Unlink($IndexFile);
# page file
CreateDir($PageDir); # It might not exist yet
rename($fname, $newfname)
Rename($fname, $newfname)
or ReportError(Tss('Cannot rename %1 to %2', $fname, $newfname) . ": $!", '500 INTERNAL SERVER ERROR');
# keep directory
my $kdir = GetKeepDir($id);
my $newkdir = GetKeepDir($new);
CreateDir($KeepDir); # It might not exist yet (only the parent directory!)
rename($kdir, $newkdir)
Rename($kdir, $newkdir)
or ReportError(Tss('Cannot rename %1 to %2', $kdir, $newkdir) . ": $!", '500 INTERNAL SERVER ERROR')
if IsDir($kdir);
# refer file
@@ -82,7 +79,7 @@ sub AdminPowerRename {
my $rdir = GetRefererFile($id);
my $newrdir = GetRefererFile($new);
CreateDir($RefererDir); # It might not exist yet
rename($rdir, $newrdir)
Rename($rdir, $newrdir)
or ReportError(Tss('Cannot rename %1 to %2', $rdir, $newrdir) . ": $!", '500 INTERNAL SERVER ERROR')
if IsDir($rdir);
}

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -29,8 +29,7 @@ $NewQuestion = 'Write your question here:';
sub IncrementInFile {
my $filename = shift;
utf8::encode($filename);
sysopen my $fh, $filename, O_RDWR|O_CREAT or die "can't open $filename: $!";
sysopen my $fh, encode_utf8($filename), O_RDWR|O_CREAT or die "can't open $filename: $!";
flock $fh, LOCK_EX or die "can't flock $filename: $!";
my $num = <$fh> || 1;
seek $fh, 0, 0 or die "can't rewind $filename: $!";

View File

@@ -206,18 +206,17 @@ except where noted.
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
This file 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 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 3 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
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.
You should have received a copy of the GNU General Public License
along with this file; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
along with this program. If not, see <http://www.gnu.org/licenses/>.
=cut

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Grab MLDBM at http://search.cpan.org/dist/MLDBM/lib/MLDBM.pm
# ie: http://search.cpan.org/CPAN/authors/id/C/CH/CHAMAS/MLDBM-2.01.tar.gz
@@ -44,10 +41,8 @@ sub BacklinksMenu {
$Action{buildback} = \&BuildBacklinkDatabase;
sub BuildBacklinkDatabase {
print GetHttpHeader('text/plain');
my $file = $backfile;
utf8::encode($file); # bytes
unlink($file); # Remove old database
tie my %backhash, 'MLDBM', $file or die "Cannot open file $backfile $!\n";
Unlink($backfile); # Remove old database
tie my %backhash, 'MLDBM', encode_utf8($backfile) or die "Cannot open file $backfile $!\n";
log1("Starting Database Store Process ... please wait\n\n");
foreach my $name (AllPagesList()) {
@@ -103,9 +98,7 @@ sub GetBackLink {
our ($BacklinkBanned);
$BacklinkBanned = "HomePage|ScratchPad" if !$BacklinkBanned;
my $file = $backfile;
utf8::encode($file);
tie my %backhash, 'MLDBM', $file, O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
tie my %backhash, 'MLDBM', encode_utf8($backfile), O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
# Search database for matches
while ( my ($source, $hashes) = each %backhash ) {

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2013 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2013-2021 Alex Schroeder <alex@gnu.org>
# 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
@@ -21,11 +21,12 @@ compared to the list of regular expressions on the C<BannedHosts> page
(see C<$BannedHosts>). If the contributor is already banned, this is
mentioned. If the contributor is not banned, you'll see a button
allowing you to ban him or her immediately. If you click the button,
the IP or hostname will be added to the C<BannedHosts> page for you.
the IP will be added to the C<BannedHosts> page for you.
=cut
use strict;
use v5.10;
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
@@ -56,17 +57,18 @@ sub IsItBanned {
sub DoBanHosts {
my $id = shift;
my $content = GetParam('content', '');
my $host = GetParam('host', '');
my $range = GetParam('range', '');
my $regexp = GetParam('regexp', '');
if ($content) {
SetParam('text', GetPageContent($BannedContent)
. $content . " # " . CalcDay($Now) . " "
. NormalToFree($id) . "\n");
SetParam('summary', NormalToFree($id));
DoPost($BannedContent);
} elsif ($host) {
$host =~ s/\./\\./g;
} elsif ($regexp) {
SetParam('text', GetPageContent($BannedHosts)
. "^" . $host . " # " . CalcDay($Now) . " "
. $regexp . " # " . CalcDay($Now)
. " $range "
. NormalToFree($id) . "\n");
SetParam('summary', NormalToFree($id));
DoPost($BannedHosts);
@@ -94,12 +96,20 @@ sub DoBanHosts {
if (IsItBanned($_, \@regexps)) {
print $q->p(Ts("%s is banned", $name));
} else {
print GetFormStart(undef, 'get', 'ban'),
GetHiddenValue('action', 'ban'),
GetHiddenValue('id', $id),
GetHiddenValue('host', $_),
GetHiddenValue('recent_edit', 'on'),
$q->p($name, $q->submit(T('Ban!'))), $q->end_form();
my @pairs = BanContributors::get_range($_);
while (@pairs) {
my $start = shift(@pairs);
my $end = shift(@pairs);
$range = "[$start - $end]";
$name .= " " . $range;
print GetFormStart(undef, 'get', 'ban'),
GetHiddenValue('action', 'ban'),
GetHiddenValue('id', $id),
GetHiddenValue('range', $range),
GetHiddenValue('regexp', BanContributors::get_regexp_ip($start, $end)),
GetHiddenValue('recent_edit', 'on'),
$q->p($name, $q->submit(T('Ban!'))), $q->end_form();
}
}
}
}
@@ -158,3 +168,139 @@ sub NewBanContributorsWriteRcLog {
};
return OldBanContributorsWriteRcLog(@_);
}
package BanContributors;
use Net::Whois::Parser qw/parse_whois/;
use Net::IP;
sub get_range {
my $ip = shift;
my $response = parse_whois(domain => $ip);
my $re = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}';
# Just try all the keys and see whether there is a range match.
for (keys %$response) {
my @result;
$_ = $response->{$_};
for (ref eq 'ARRAY' ? @$_ : $_) {
$ip = Net::IP->new($_);
push(@result, $ip->ip, $ip->last_ip) if $ip;
}
return @result if @result;
}
# Fallback
return $ip, $ip;
}
sub get_groups {
my ($from, $to) = @_;
my @groups;
if ($from == $to) {
return [$from, $to];
}
# ones up to the nearest ten
if ($from < $to and ($from % 10 or $from < 10)) {
# from 5-7: as is
# from 5-17: 5 + 9 - 5 = 9 thus 5-9, set $from to 10
my $to2 = int($to/10) > int($from/10) ? $from + 9 - $from % 10 : $to;
push(@groups, [$from, $to2]);
$from = $to2 + 1;
}
# tens up to the nearest hundred
if ($from < $to and $from % 100) {
# 10-17: as is
# 10-82: 10 to 79, set $from to 80 (8*10-1)
# 10-182: 10 to 99, set $from to 100 (10+99=10=99)
# 110-182: 110 to 179, set $from to 180 (170)
# 110-222: 110 to 199, set $from to 200 (110+99-10 = 199)
my $to2 = int($to/100) > int($from/100) ? $from + 99 - $from % 100
: int($to/10) > int($from/10) ? int($to / 10) * 10 - 1
: $to;
push(@groups, [$from, $to2]);
$from = $to2 + 1;
}
# up to the next hundred
if (int($to/100) > int($from/100)) {
# from 100 to 223: set $from to 200 (2*100-1)
my $to2 = int($to/100) * 100 - 1;
push(@groups, [$from, $to2]);
$from = $to2 + 1;
}
# up to the next ten
if (int($to/10) > int($from/10)) {
# 10 to 17: skip
# 100 to 143: set $from to 140 (14*10-1)
my $to2 = int($to / 10) * 10 - 1;
push(@groups, [$from, $to2]);
$from = $to2 + 1;
}
# up to the next one
if ($from <= $to) {
push(@groups, [$from, $to]);
}
# warn join("; ", map { "@$_" } @groups);
return \@groups;
}
sub get_regexp_range {
my @chars;
for my $group (@{get_groups(@_)}) {
my ($from, $to) = @$group;
my $char;
for (my $i = length($from); $i >= 1; $i--) {
if (substr($from, - $i, 1) eq substr($to, - $i, 1)) {
$char .= substr($from, - $i, 1);
} else {
$char .= '[' . substr($from, - $i, 1) . '-' . substr($to, - $i, 1). ']';
}
}
push(@chars, $char);
}
return join('|', @chars);
}
sub get_regexp_ip {
my ($from, $to) = @_;
my @start = split(/\./, $from);
my @end = split(/\./, $to);
my $regexp = "^";
for my $i (0 .. 3) {
if ($start[$i] eq $end[$i]) {
# if the byte is the same, use it as is
$regexp .= $start[$i];
$regexp .= '\.' if $i < 3;
} elsif ($start[$i] == 0 and $end[$i] == 255) {
# the starting byte is 0 and the end byte is 255, then anything goes:
# we're done, e.g. 185.244.214.0 - 185.244.214.255 results in 185\.244\.214\.
last;
} elsif ($i == 3 and $start[$i] != $end[$i]) {
# example 45.87.2.128 - 45.87.2.255: the last bytes differ
$regexp .= '(' . get_regexp_range($start[$i], $end[$i]) . ')';
last;
} elsif ($start[$i + 1] == 0 and $end[$i + 1] == 255) {
# if we're here, we already know that the start byte and the end byte are
# not the same; if the next bytes are from 0 to 255, we know that
# everything else doesn't matter, e.g. 42.118.48.0 - 42.118.63.255
$regexp .= '(' . get_regexp_range($start[$i], $end[$i]) . ')';
$regexp .= '\.' if $i < 3;
last;
} elsif ($end[$i] - $start[$i] == 1 and $start[$i + 1] > 0 and $end[$i + 1] < 255) {
# if we're here, we already know that the start byte and the end byte are
# not the same; if the starting byte of the next (!) byte is bigger than
# zero, then we need groups: in the case 77.56.180.0 - 77.57.70.255 for
# example,
$regexp .= '(' . $start[$i] . '\.(' . get_regexp_range($start[$i + 1], 255) . ')|'
. $end[$i] . '\.(' . get_regexp_range(0, $end[$i + 1]) . ')';
$regexp .= '\.' if $i < 3;
last;
} else {
warn "Unhandled regexp: $from - $to ($i)";
$regexp .= 'XXX';
$regexp .= '\.' if $i < 3;
last;
}
}
return $regexp;
}
# this is required in case we concatenate other modules to this one
package OddMuse;

View File

@@ -0,0 +1,72 @@
# Copyright (C) 2018 Alex Schroeder <alex@gnu.org>
# 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 3 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.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
=encoding utf8
=head1 Mixed Scripts
This module disallows ordinary users from posting words that consist of multiple
scripts. Stuff like this: "It's diffіcult to find knowledgeable people on this
topic, but youu sound like you know wgat you're takіng аboսt!" Did you notice
the confusable characters? The sentence contains the following:
ARMENIAN SMALL LETTER SEH
CYRILLIC SMALL LETTER A
CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
SMALL ROMAN NUMERAL FIFTY
=cut
use strict;
use v5.10;
use Unicode::UCD qw(charprop);
AddModuleDescription('ban-mixed-scripts.pl', 'Ban Mixed Scripts Extension');
*OldBanMixedScriptsBannedContent = \&BannedContent;
*BannedContent = \&NewBanMixedScriptsBannedContent;
sub NewBanMixedScriptsBannedContent {
my $rule = OldBanMixedScriptsBannedContent(@_);
$rule ||= BanMixedScript(@_);
return $rule;
}
sub BanMixedScript {
my $str = shift;
my @words = $str =~ m/\w+/g;
my %seen;
my %prop;
for my $word (@words) {
next if $seen{$word};
$seen{$word} = 1;
my $script;
for my $char (split(//, $word)) {
my $s = $prop{$char};
if (not $s) {
$s = charprop(ord($char), "Script_Extensions");
if ($s eq 'Hiragana') {
$s = 'Han'; # this mixing is ok
}
$prop{$char} = $s;
}
next if $s eq "Common";
if (not $script) {
$script = $s;
} elsif ($script ne $s) {
return "Mixed scripts in $word ($script and $s, if not more)";
}
}
}
}

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2012 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2012-2018 Alex Schroeder <alex@gnu.org>
#
# 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
@@ -45,7 +45,8 @@ This extension works with logbannedcontent.pl.
=cut
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile);
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile,
$FullUrlPattern);
our ($BannedRegexps);
$BannedRegexps = 'BannedRegexps';
@@ -61,12 +62,13 @@ push(@MyInitVariables, sub {
sub RegexpNewBannedContent {
my $str = shift;
# check whether Banned Content complains
my $rule = RegexpOldBannedContent($str, @_);
if (not $rule) {
foreach (split(/\n/, GetPageContent($BannedRegexps))) {
next unless m/^\s*([^#]+?)\s*(#\s*(\d\d\d\d-\d\d-\d\d\s*)?(.*))?$/;
my ($regexp, $comment, $re) = ($1, $4, undef);
eval { $re = qr/$regexp/i; };
eval { $re = qr/($regexp)/i; };
if (defined($re) && $str =~ $re) {
my $group1 = $1;
my $explanation = ($group1

View File

@@ -19,7 +19,7 @@ AddModuleDescription('bbcode.pl', 'bbCode Extension');
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
push(@MyRules, \&bbCodeRule);
$RuleOrder{\&bbCodeRule} = 100; # must come after PortraitSupportRule
$RuleOrder{\&bbCodeRule} = 300; # must come after PortraitSupportRule, MarkdownRule
our ($bbBlock);
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);
@@ -32,7 +32,9 @@ sub bbCodeRule {
my $bbcode = $1;
my $tag = lc($2);
my $option = $3; # sanitize?
if ($tag eq 'b') {
if ($tag eq 'br') {
return $q->br(); }
elsif ($tag eq 'b') {
return AddHtmlEnvironment('b'); }
elsif ($tag eq 'i') {
return AddHtmlEnvironment('i'); }

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -3,7 +3,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -12,10 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
@@ -26,6 +23,7 @@ our ($q, %Page, %Action, $Now, $OpenPageName, $CollectingJournal, $FreeLinkPatte
our ($CalendarOnEveryPage, $CalAsTable, $CalStartMonday);
$CalendarOnEveryPage = 0; # 1=on every page is a month-div situated in the header, use css to control
# 2=this month and the previous month; 3=this, previous and next month
$CalAsTable = 0; # 0=every month-div is "free", 1=every month-div is caught in a table, use css to control
$CalStartMonday = 0; # 0=week starts with Su, 1=week starts with Mo
@@ -37,8 +35,22 @@ sub NewCalendarGetHeader {
return $header unless $CalendarOnEveryPage;
my $action = GetParam('action', 'browse');
return $header if grep(/^$action$/, ('calendar', 'edit'));
my $cal = Cal();
$header =~ s/<div class="header">/$cal<div class="header">/;
my $cal;
my ($sec, $min, $hour, $mday, $mon, $year) = localtime($Now);
$year += 1900;
# $mon is 0 based and thus good for previous month
if ($mon < 1) { $year -= 1; $mon += 12; };
$cal .= Cal($year, $mon) if $CalendarOnEveryPage > 1;
# the current month
$mon += 1;
if ($mon > 12) { $year += 1; $mon -= 12; };
$cal .= Cal($year, $mon) if $CalendarOnEveryPage;
# the next month
$mon += 1;
if ($mon > 12) { $year += 1; $mon -= 12; };
$cal .= Cal($year, $mon) if $CalendarOnEveryPage > 2;
# insert calendars before header div
$header =~ s!<div class="header">!<div class="cal">$cal</div><div class="header">!;
return $header;
}
@@ -88,7 +100,7 @@ sub Cal {
$year_text, 'local collection year'));
}
}}e;
return "<div class=\"cal month\"><pre>$cal</pre></div>";
return "<div class=\"month\"><pre>$cal</pre></div>";
}
$Action{collect} = \&DoCollect;
@@ -129,7 +141,7 @@ sub CalendarRule {
my $oldpos = pos;
Clean(CloseHtmlEnvironments());
Dirty($1);
print Cal($2, $3);
print $q->div({-class => 'cal'}, Cal($2, $3));
pos = $oldpos;
return AddHtmlEnvironment('p');
} elsif (/\G(month:([+-]\d\d?))/cg
@@ -144,7 +156,7 @@ sub CalendarRule {
$mon += 1 + $delta;
while ($mon < 1) { $year -= 1; $mon += 12; };
while ($mon > 12) { $year += 1; $mon -= 12; };
print Cal($year, $mon, undef, $id);
print $q->div({-class => 'cal'}, Cal($year, $mon, undef, $id));
pos = $oldpos;
return AddHtmlEnvironment('p');
}

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,8 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
use utf8;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,

66
modules/cook-lang.pl Normal file
View File

@@ -0,0 +1,66 @@
# Copyright (C) 2021 Alex Schroeder <alex@gnu.org>
#
# 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 3 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.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('cook-lang.pl', 'Cooklang Extension');
our ($q, $bol, @MyRules);
push(@MyRules, \&CookLangRule);
sub CookLangRule {
if (/\G#([^\n#\@\{\}]+)\{(?:([^\n%\}]+)(?:%([^\n\}]+))?)?\}/cg) {
# #canning funnel{}
my $html = "";
$html .= $q->strong({-title=>"number"}, $2) if $2;
$html .= " " if $2 and $3;
$html .= $q->strong({-title=>"unit"}, $3) if $3;
$html .= " " if $1 and ($2 or $3);
$html .= $q->strong({-title=>"cookware"}, $1);
return $html;
} elsif (/\G#(\w+)/cg) {
# #pot
return $q->strong({-title=>"cookware"}, $1);
} elsif (/\G\@([^\n#\@\{\}]+)\{(?:([^\n%\}]+)(?:%([^\n\}]+))?)?\}/cg) {
# @ground black pepper{}
my $html = "";
$html .= $q->strong({-title=>"number"}, $2) if $2;
$html .= " " if $2 and $3;
$html .= $q->strong({-title=>"unit"}, $3) if $3;
$html .= " " if $1 and ($2 or $3);
$html .= $q->strong({-title=>"ingredient"}, $1);
return $html;
} elsif (/\G\@(\w+)/cg) {
# @salt
return $q->strong({-title=>"ingredient"}, $1);
} elsif (/\G\~\{([^\n%\}]+)(?:%([^\n\}]+))?\}/cg) {
# ~{25%minutes}
my $html = $q->strong({-title=>"number"}, $1);
$html .= " " if $1 and $2;
$html .= $q->strong({-title=>"unit"}, $2) if $2;
return $html;
} elsif (/\G\/\/\s*(.*)/cg) {
# // Don't burn the roux!
return $q->em({-title=>"comment"}, $1);
} elsif ($bol and /\G&gt;&gt;\s*(.*)/cg) {
# // Don't burn the roux!
return CloseHtmlEnvironments()
. $q->blockquote({-title=>"meta"}, $1)
. AddHtmlEnvironment('p');
}
# no match
return;
}

View File

@@ -1,34 +1,35 @@
# Copyright (C) 2005 Fletcher T. Penney <fletcher@freeshell.org>
# Copyright (C) 2016 Alex Schroeder <alex@gnu.org>
#
# 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 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 3 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.
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
#
# This module stores additional information about a page when it is
# first created:
# created = the date the page is FIRST saved
# originalAuthor = the username that first created a page
#
# Of course, you can customize this to store more information
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
=head1 Creation Date Extension
This module stores additional information about a page when it is first created:
=over
=item C<created> is the date the page is first saved
=item C<originalAuthor> is the username that first created a page
=back
=cut
use strict;
use v5.10;
AddModuleDescription('creationdate.pl', 'CreationDate Module');
our (%Page, $Now);
our (%Page, $Now, @MyAdminCode, %Action, $q, $FS, $RcOldFile, $RcFile);
*CreationDateOldOpenPage = \&OpenPage;
*OpenPage = \&CreationDateOpenPage;
@@ -39,3 +40,45 @@ sub CreationDateOpenPage{
$Page{originalAuthor} = GetParam('username','') unless $Page{originalAuthor}
or $Page{revision};
}
# Allow administrators to add the 'created' item to page files, based on rc log
# files.
push(@MyAdminCode, \&CreationDateMenu);
sub CreationDateMenu {
my ($id, $menuref, $restref) = @_;
push(@$menuref,
ScriptLink('action=add-creation-date',
T('Add creation date to page files'),
'creationdate')) if UserIsAdmin();
}
$Action{'add-creation-date'} = \&AddCreationDate;
sub AddCreationDate {
print GetHeader('', T('Add creation date to page files'));
print $q->start_div({-class=>'creationdate'});
print '<ul>';
RequestLockOrError();
for my $file ($RcOldFile, $RcFile) {
open(my $F, '<:encoding(UTF-8)', encode_utf8($file)) or next;
while (my $line = <$F>) {
chomp($line);
my ($ts, $id, $minor, $summary, $host, $username, $revision)
= split(/$FS/, $line);
next unless $revision == 1;
print $q->li(NormalToFree($id));
OpenPage($id);
next unless $Page{revision}; # skip if page no longer exists
next if $Page{created} and $Page{originalAuthor};
$Page{created} = $ts unless $Page{created};
$Page{originalAuthor} = $username unless $Page{originalAuthor};
SavePage();
}
}
ReleaseLock();
print '</ul>';
print $q->end_div();
PrintFooter();
}

View File

@@ -246,7 +246,8 @@ sub CreoleRule {
$q->img({-src=> UnquoteHtml($1),
-alt=> UnquoteHtml($3),
-title=> UnquoteHtml($3),
-class=> 'url outside'})));
-class=> 'url outside',
-loading=>'lazy'})));
}
# image link: [[link|{{pic}}]] and [[link|{{pic|text}}]]
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern
@@ -257,7 +258,8 @@ sub CreoleRule {
$q->img({-src=> GetDownloadLink(FreeToNormal($3), 2),
-alt=> UnquoteHtml($text),
-title=> UnquoteHtml($text),
-class=> 'upload'}), 'image')), $text);
-class=> 'upload',
-loading=>'lazy'}), 'image')), $text);
}
# image link: [[link|{{url}}]] and [[link|{{url|text}}]]
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern
@@ -268,7 +270,8 @@ sub CreoleRule {
$q->img({-src=> UnquoteHtml($3),
-alt=> UnquoteHtml($text),
-title=> UnquoteHtml($text),
-class=> 'url outside'}), 'image')), $text);
-class=> 'url outside',
-loading=>'lazy'}), 'image')), $text);
}
# image link: [[url|{{pic}}]] and [[url|{{pic|text}}]]
elsif (m/\G(\[\[$FullUrlPattern$CreoleLinkPipePattern
@@ -279,7 +282,8 @@ sub CreoleRule {
$q->img({-src=> GetDownloadLink(FreeToNormal($3), 2),
-alt=> UnquoteHtml($text),
-title=> UnquoteHtml($text),
-class=> 'upload'}))), $text);
-class=> 'upload',
-loading=>'lazy'}))), $text);
}
# image link: [[url|{{url}}]] and [[url|{{url|text}}]]
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkPipePattern
@@ -289,7 +293,8 @@ sub CreoleRule {
$q->img({-src=> UnquoteHtml($2),
-alt=> UnquoteHtml($4),
-title=> UnquoteHtml($4),
-class=> 'url outside'})));
-class=> 'url outside',
-loading=>'lazy'})));
}
# link: [[url]] and [[url|text]]
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkTextPattern\]\]/cgs) {
@@ -405,8 +410,7 @@ sub CreoleRule {
if ($is_left_justified and
$is_right_justified) { $attributes .= 'align="center"' }
elsif ($is_right_justified) { $attributes .= 'align="right"' }
# this is the default:
# elsif ($is_left_justified) { $attributes .= 'align="left"' }
elsif ($is_left_justified) { $attributes .= 'align="left"' }
return
(InElement('td') || InElement('th') ? CloseHtmlEnvironmentUntil('tr') : '')

View File

@@ -217,7 +217,7 @@ sub PrintPageContentCrossbar {
# If the crossbar div is placed immediately after the content div, place it
# immediately before the content div.
if (not ($html =~ s~(<div class="content browse">)$crossbar_pattern~$2$1~)) {
if (not ($html =~ s~(<div class="content browse" lang="[a-z]*">)$crossbar_pattern~$2$1~)) {
# Otherwise, if the crossbar div is placed immediately before the end of the
# content div, place it immediately after the end of the content div.
$html =~

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -0,0 +1,37 @@
#! /usr/bin/perl
# Copyright (C) 2019 Alex Schroeder <alex@gnu.org>
# 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 3 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.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('definition-lists.pl', 'Definition Lists Extension');
our ($q, $bol, @MyRules, @HtmlStack, $Fragment);
push(@MyRules, \&DefinitionListsRule);
# term
# : definition
sub DefinitionListsRule {
if ($bol and /\G(?:\s*\n)*(\S.*)\n[ \t]*:[ \t]*/cg) {
return OpenHtmlEnvironment('dl', 1) . "<dt>$1</dt>" . AddHtmlEnvironment('dd');
} elsif (InElement('dd') and /\G(?:\s*\n)+(\S.*)\n[ \t]*:[ \t]*/cg) {
return OpenHtmlEnvironment('dl', 1) . "<dt>$1</dt>" . AddHtmlEnvironment('dd');
} elsif (InElement('dd') and /\G(\s*\n)+[ \t]*:[ \t]*/cg) {
return OpenHtmlEnvironment('dl', 1) . AddHtmlEnvironment('dd');
}
return;
}

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -77,8 +77,7 @@ sub DoUnifiedDiff { # copied from DoDiff
RequestLockDir('diff') or return '';
WriteStringToFile($oldName, $_[0]);
WriteStringToFile($newName, $_[1]);
my $diff_out = `diff -U 99999 -- \Q$oldName\E \Q$newName\E | tail -n +7`; # should be +4, but we always add extra line # TODO that workaround is ugly, fix it!
utf8::decode($diff_out); # needs decoding
my $diff_out = decode_utf8(`diff -U 99999 -- \Q$oldName\E \Q$newName\E | tail -n +7`); # should be +4, but we always add extra line # TODO that workaround is ugly, fix it!
$diff_out =~ s/\n\K\\ No newline.*\n//g; # Get rid of common complaint.
ReleaseLockDir('diff');
# No need to unlink temp files--next diff will just overwrite.

49
modules/ditaa.pl Normal file
View File

@@ -0,0 +1,49 @@
#! /usr/bin/perl
# Copyright (C) 20152017 Alex Schroeder <alex@gnu.org>
# 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 3 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.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('ditaa.pl', 'Ditaa for Diagrams');
our ($q, $bol, @MyRules, @KnownLocks, $TempDir);
push (@MyRules, \&DitaaRule);
push(@KnownLocks, 'diagram');
sub DitaaRule {
if ($bol && m/\G&lt;diagram(\s+style=".*")?&gt;\n((.*\n)+)&lt;\/diagram&gt;/cg) {
return "MIME::Base64 not installed" unless eval { require MIME::Base64; };
my $style = $1;
my $map = UnquoteHtml($2);
RequestLockDir('diagram', undef, undef, 1);
WriteStringToFile("$TempDir/diagram.txt", $map);
$ENV{LANG}='en_US.UTF-8'; # Java needs Locale to match as well!
my $output = `ditaa "$TempDir/diagram.txt" "$TempDir/diagram.png"`;
my $image = '';
# not UTF-8 layer!
if (open(IN, '<', "$TempDir/diagram.png")) {
local $/ = undef; # Read complete files
$image = <IN>;
close IN;
}
ReleaseLockDir('diagram');
my $data = MIME::Base64::encode_base64($image);
my $url = "data:image/png;base64,$data";
return CloseHtmlEnvironments()
. "<div$style>" . $q->img({-src=>$url, -alt=>$map, -loading=>'lazy'}) . "</div>";
}
return undef;
}

View File

@@ -3,7 +3,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -12,10 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This module offers the user the additional possibility to
# edit a page by double-clicking on it. The user must have

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -76,10 +76,7 @@ push(@MyMaintenance, \&DraftCleanup);
sub DraftFiles {
return map {
my $x = $_;
$x = substr($x, length($DraftDir) + 1);
utf8::decode($x);
$x;
substr($_, length($DraftDir) + 1);
} Glob("$DraftDir/*"), Glob("$DraftDir/.*");
}

View File

@@ -49,5 +49,5 @@ sub DuckDuckGoSearchInit {
sub DoDuckDuckGoSearch {
my $search = UrlEncode(GetParam('search', undef));
print $q->redirect({-uri=>"https://www.duckduckgo.com/?q=$search+site%3A$DuckDuckGoSearchDomain"});
print $q->redirect({-uri=>"https://duckduckgo.com/?q=$search+site%3A$DuckDuckGoSearchDomain"});
}

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Makes the wiki logo depend on the current date.
#

View File

@@ -1,6 +1,6 @@
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -9,10 +9,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -48,7 +48,7 @@ sub EmojiRule {
} elsif (/\G&gt;:-?\(/cg) {
# 😠 1F620 ANGRY FACE
return '&#x1F620;';
} elsif (/\G:-?[Ppb]/cg) {
} elsif (/\G:-?[Ppb]\b/cg) {
# 😝 1F61D FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES
return '&#x1F61D;';
} elsif (/\G&lt;3/cg) {

View File

@@ -3,7 +3,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -12,10 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This module creates a list of all questions on the page, e.g.
# for a faq. It does so by recognizing all lines that begin with

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA,
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -27,8 +27,7 @@ sub FixEncoding {
ValidIdOrDie($id);
RequestLockOrError();
OpenPage($id);
my $text = $Page{text};
utf8::decode($text);
my $text = decode_utf8($Page{text});
Save($id, $text, T('Fix character encoding'), 1) if $text ne $Page{text};
ReleaseLock();
ReBrowsePage($id);

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -163,9 +163,7 @@ sub GdSecurityImageGenerate {
my ($imgData) = $img->out(force => 'png');
my $ticketId = Digest::MD5::md5_hex(rand());
CreateDir($GdSecurityImageDir);
my $file = GdSecurityImageGetImageFile($ticketId);
utf8::encode($file);
open my $fh, ">:raw", $file
open my $fh, ">:raw", encode_utf8(GdSecurityImageGetImageFile($ticketId))
or ReportError(Ts('Image storing failed. (%s)', $!), '500 INTERNAL SERVER ERROR');
print $fh $imgData;
#print $fh $png; ### experimental ###
@@ -188,9 +186,7 @@ sub GdSecurityImageIsValidId {
}
sub GdSecurityImageReadImageFile {
my $file = shift;
utf8::encode($file); # filenames are bytes!
if (open(my $IN, '<:raw', $file)) {
if (open(my $IN, '<:raw', encode_utf8(shift))) {
local $/ = undef; # Read complete files
my $data=<$IN>;
close $IN;

View File

@@ -39,9 +39,9 @@ sub GitCommit {
}
sub GitInitRepository {
return if -d "$DataDir/page/.git";
return if IsDir("$DataDir/page/.git");
capture {
system($GitBinary, qw(init -q --), "$DataDir/page");
system($GitBinary, qw(init -q --), encode_utf8("$DataDir/page"));
};
GitCommit('Initial import', 'Oddmuse');
}

View File

@@ -191,15 +191,12 @@ sub GitCleanup {
print $q->p('Git cleanup starting');
AllPagesList();
# delete all the files including all the files starting with a dot
my $dir = $GitRepo;
utf8::encode($dir);
opendir(DIR, $dir) or ReportError("cannot open directory $GitRepo: $!");
opendir(DIR, encode_utf8($GitRepo)) or ReportError("cannot open directory $GitRepo: $!");
foreach my $file (readdir(DIR)) {
my $name = $file;
utf8::decode($name); # filenames are bytes
my $name = decode_utf8($file);
next if $file eq '.git' or $file eq '.' or $file eq '..' or $IndexHash{$name};
print $q->p("Deleting left over file $name");
Unlink("$GitRepo/$file") or ReportError("cannot delete $GitRepo/$name: $!");
Unlink("$GitRepo/$file") or print $q->p("Cannot delete $GitRepo/$name: $!");
}
closedir DIR;
# write all the files again, just to be sure

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -1,4 +1,5 @@
# Copyright (C) 2006-2014 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2016 Ingo Belka
#
# 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
@@ -25,12 +26,17 @@ our ($GotobarName);
$GotobarName = 'GotoBar';
our ($GotobarSetHome, $GotobarSetRC);
# 0 does set home-link and/or rc-link automatically, 1 doesn't
# do this later so that the user can customize $GotobarName
push(@MyInitVariables, \&GotobarInit);
sub GotobarInit {
$GotobarName = FreeToNormal($GotobarName); # spaces to underscores
$AdminPages{$GotobarName} = 1;
my $id = GetId();
my $encoded = UrlEncode($id);
if ($IndexHash{$GotobarName}) {
OpenPage($GotobarName);
return if PageMarkedForDeletion();
@@ -38,8 +44,11 @@ sub GotobarInit {
# links for unsuspecting users.
@UserGotoBarPages = ();
$UserGotoBar = '';
my $text = $Page{text};
$text =~ s/\$\$id\b/$encoded/g;
$text =~ s/\$id\b/$id/g;
my $count = 0;
while ($Page{text} =~ m/($LinkPattern|\[\[$FreeLinkPattern\]\]|\[\[$FreeLinkPattern\|([^\]]+)\]\]|\[$InterLinkPattern\s+([^\]]+?)\]|\[$FullUrlPattern[|[:space:]]([^\]]+?)\])/g) {
while ($text =~ m/($LinkPattern|\[\[$FreeLinkPattern\]\]|\[\[$FreeLinkPattern\|([^\]]+)\]\]|\[$InterLinkPattern\s+([^\]]+?)\]|\[$FullUrlPattern[|[:space:]]([^\]]+?)\])/g) {
my $page = $2||$3||$4||$6||$8;
my $text = $5||$7||$9;
$UserGotoBar .= ' ' if $UserGotoBar;
@@ -53,9 +62,9 @@ sub GotobarInit {
# is the list of recent changes.
$count++;
if ($count == 1) {
$HomePage = FreeToNormal($page);
unless ($GotobarSetHome) {$HomePage = FreeToNormal($page)};
} elsif ($count == 2) {
$RCName = FreeToNormal($page);
unless ($GotobarSetRC) {$RCName = FreeToNormal($page);}
}
}
}

48
modules/grep-filtered.pl Normal file
View File

@@ -0,0 +1,48 @@
# Copyright (C) 2020 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2020 Daniel MacKay <daniel@bonmot.ca>
#
# 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 3 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('grep-filtered.pl', 'Grep Filtered');
our ($PageDir);
our ($UseGrep);
$UseGrep = 1;
*OldGrepFiltered = \&Filtered;
*Filtered = \&NewGrepFiltered;
sub NewGrepFiltered {
my ($string, @pages) = @_;
my @pages = OldGrepFiltered(@_);
my $regexp = SearchRegexp($string);
return @pages unless GetParam('grep', $UseGrep) and $regexp;
my @result = grep(/$regexp/i, @pages); # search parameter for page titles
my %found = map {$_ => 1} @result;
$regexp =~ s/\\n(\)*)$/\$$1/g; # sometimes \n can be replaced with $
$regexp =~ s/([?+{|()])/\\$1/g; # basic regular expressions from man grep
# if we know of any remaining grep incompatibilities we should
# return @pages here!
$regexp = quotemeta($regexp);
open(F, '-|:encoding(UTF-8)', "find $PageDir -type f -print0 | xargs -0 -n10 -P4 grep --ignore-case -l '$regexp'") ;
while (<F>) {
my ($pageName) = m/.*\/(.*)\.pg$/ ;
push(@result, $pageName) if not $found{$pageName};
} close(F);
return sort @result;
}

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
@@ -43,7 +40,7 @@ sub HtmlTemplate {
my $type = shift;
# return header.de.html, or header.html, or error.html, or report an error...
foreach my $f ((map { "$type.$_" } HtmlTemplateLanguage()), $type, "error") {
return "$HtmlTemplateDir/$f.html" if -r "$HtmlTemplateDir/$f.html";
return "$HtmlTemplateDir/$f.html" if IsFile("$HtmlTemplateDir/$f.html");
}
ReportError(Tss('Could not find %1.html template in %2', $type, $HtmlTemplateDir),
'500 INTERNAL SERVER ERROR');

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -3,7 +3,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -12,10 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -5,7 +5,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -14,10 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This module offers the possibility to restrict viewing of "hidden"
# pages to only editors or admins. The restriction may be based

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
@@ -87,7 +84,7 @@ sub GetActionHtmlTemplate {
my $action = GetParam('action', 'browse');
# return browse.de.html, or browse.html, or error.html, or report an error...
foreach my $f ((map { "$action.$_" } HtmlTemplateLanguage()), $action, "error") {
return "$HtmlTemplateDir/$f.html" if -r "$HtmlTemplateDir/$f.html";
return "$HtmlTemplateDir/$f.html" if IsFile("$HtmlTemplateDir/$f.html");
}
ReportError(Tss('Could not find %1.html template in %2', $action, $HtmlTemplateDir),
'500 INTERNAL SERVER ERROR');

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
@@ -32,7 +29,7 @@ push(@MyRules, \&ImageSupportRule);
sub ImageSupportRule {
my $result = undef;
if (m!\G\[\[image((/[a-z]+)*)( external)?:\s*([^]|]+?)\s*(\|[^]|]+?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*\]\](\{([^}]+)\})?!cg) {
if (m!\G\[\[image((/[-a-z]+)*)( external)?:\s*([^]|]+?)\s*(\|[^]|]+?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*\]\](\{([^}]+)\})?!cg) {
my $oldpos = pos;
my $class = 'image' . $1;
my $external = $3;
@@ -69,7 +66,7 @@ sub ImageSupportRule {
$src = $ImageUrlPath . '/' . ImageUrlEncode($name);
}
if ($found) {
$result = $q->img({-src=>$src, -alt=>$alt, -title=>$alt, -class=>'upload'});
$result = $q->img({-src=>$src, -alt=>$alt, -title=>$alt, -class=>'upload', -loading=>'lazy'});
$result = $q->a({-href=>$link, -class=>$linkclass}, $result);
if ($comments) {
for (split '\n', $comments) {

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

View File

@@ -2,7 +2,7 @@
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -11,10 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;

Some files were not shown because too many files have changed in this diff Show More