Commit Graph

135 Commits

Author SHA1 Message Date
Alex Schroeder
ceb4c3a9cc Release process: master → main 2021-09-25 16:41:21 +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
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
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
46580a3958 gopher-server: fix linebreaks in links 2019-06-24 12:08:36 +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
0d9764b0de gopher-server: fix space normalisation in links 2019-05-04 18:33:36 +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
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
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
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
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
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
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