minimedit.git
3 years agothumb: validate path before extracting missing parts
Mischa POSLAWSKY [Sun, 27 Dec 2020 01:36:04 +0000 (02:36 +0100)]
thumb: validate path before extracting missing parts

Silence PHP warning about undefined offset on invalid requests.

3 years agoedit/page: ignore missing edit target
Mischa POSLAWSKY [Sun, 27 Dec 2020 01:35:14 +0000 (02:35 +0100)]
edit/page: ignore missing edit target

Silence javascript warning on uneditable pages.

3 years agoedit/page: describe hotkey letter in save plugin
Mischa POSLAWSKY [Sun, 27 Dec 2020 01:39:12 +0000 (02:39 +0100)]
edit/page: describe hotkey letter in save plugin

Minor code cleanup of a magic value.

3 years agoedit/page: allow image uploads through easyimage
Mischa POSLAWSKY [Sun, 17 May 2020 00:40:31 +0000 (02:40 +0200)]
edit/page: allow image uploads through easyimage

Fix local files shown as blobs in testing.

3 years agoedit/page: disable pdf plugin for ckeditor
Mischa POSLAWSKY [Tue, 22 Dec 2020 23:20:13 +0000 (00:20 +0100)]
edit/page: disable pdf plugin for ckeditor

Imposed in Full release since version 4.15.1, causing license warning
despite being unused and unwanted.

3 years agoedit/page: ckeditor image upload to user dir, returned as thumb
Mischa POSLAWSKY [Tue, 22 Dec 2020 23:35:42 +0000 (00:35 +0100)]
edit/page: ckeditor image upload to user dir, returned as thumb

3 years agoedit/page: disable image size attributes in editor
Mischa POSLAWSKY [Tue, 22 Dec 2020 12:33:24 +0000 (13:33 +0100)]
edit/page: disable image size attributes in editor

Disallow width and height, with Advanced Content Filtering enabled following
<https://ckeditor.com/docs/ckeditor4/latest/guide/dev_disallowed_content.html
#how-to-allow-everything-except>.

3 years agoedit/page: fix ckeditor [json] upload response
Mischa POSLAWSKY [Tue, 22 Dec 2020 12:11:54 +0000 (13:11 +0100)]
edit/page: fix ckeditor [json] upload response

One incompatibility in commit v4.4-28-gdd363674c2 (2020-12-05)
[update remote ckeditor to version 4.15.1] after all, according to
https://ckeditor.com/docs/ckeditor4/latest/guide/dev_file_browser_api.html:

> Since CKEditor 4.9 all file uploads, including those initiated by the File
> Browser plugin, expect a JSON response

3 years agoedit/page: include admin stylesheet in editor ui
Mischa POSLAWSKY [Tue, 22 Dec 2020 18:34:53 +0000 (19:34 +0100)]
edit/page: include admin stylesheet in editor ui

Fix dialog style separated in the previous commit.

3 years agoedit/head: optional admin stylesheet for editor overrides v5.0
Mischa POSLAWSKY [Sun, 20 Dec 2020 15:55:24 +0000 (16:55 +0100)]
edit/head: optional admin stylesheet for editor overrides

Fix logout hiding if logged out.

3 years agoedit/head: ckeditor script url in data attribute
Mischa POSLAWSKY [Sun, 20 Dec 2020 01:16:19 +0000 (02:16 +0100)]
edit/head: ckeditor script url in data attribute

3 years agoedit/head: check original file request for writability
Mischa POSLAWSKY [Sun, 20 Dec 2020 00:58:13 +0000 (01:58 +0100)]
edit/head: check original file request for writability

3 years agopage: rename page method to file
Mischa POSLAWSKY [Sun, 20 Dec 2020 00:56:50 +0000 (01:56 +0100)]
page: rename page method to file

More descriptive of requested file name, avoiding duplicate $Page->page.

3 years agoedit/page: add edit button in javascript
Mischa POSLAWSKY [Sat, 19 Dec 2020 14:40:52 +0000 (15:40 +0100)]
edit/page: add edit button in javascript

3 years agoedit/head: move admin preparation to separate include
Mischa POSLAWSKY [Sat, 19 Dec 2020 14:29:03 +0000 (15:29 +0100)]
edit/head: move admin preparation to separate include

3 years agoissue/report: activity widget to list latest messages
Mischa POSLAWSKY [Fri, 3 Jan 2020 08:46:05 +0000 (09:46 +0100)]
issue/report: activity widget to list latest messages

3 years agoedit/page: enforce relative links to local domain
Mischa POSLAWSKY [Wed, 16 Dec 2020 13:05:11 +0000 (14:05 +0100)]
edit/page: enforce relative links to local domain

Replace <a href> and <img src> urls on save to fix common user mistake
breaking site deployment on a different [dev] domain.

3 years agoedit/page: replace format selection by style options
Mischa POSLAWSKY [Wed, 16 Dec 2020 12:54:24 +0000 (13:54 +0100)]
edit/page: replace format selection by style options

Save one button (fitting in 2 rows on 420px width) by getting rid of the
arbitrary distinction between formatting and styles, the latter having
equally semantic elements and capable of toggling headers.

3 years agoedit/page: rename and append editor style options
Mischa POSLAWSKY [Wed, 16 Dec 2020 12:52:45 +0000 (13:52 +0100)]
edit/page: rename and append editor style options

Support previously manual elements on Lijtweg: p.nav, s, span.right.
Prepare options to be displayed in 2 columns (frontend style).

3 years agopage: retain conditional login elements in editor
Mischa POSLAWSKY [Wed, 16 Dec 2020 12:49:14 +0000 (13:49 +0100)]
page: retain conditional login elements in editor

Fix losing logout parts on save.

3 years agopage: quote link name fallback
Mischa POSLAWSKY [Sat, 12 Dec 2020 16:23:42 +0000 (17:23 +0100)]
page: quote link name fallback

Match title from page html.

3 years agositemap: nested index of handler subpages results
Mischa POSLAWSKY [Sat, 12 Dec 2020 15:02:35 +0000 (16:02 +0100)]
sitemap: nested index of handler subpages results

3 years agopage: search results as article objects
Mischa POSLAWSKY [Sat, 12 Dec 2020 14:41:39 +0000 (15:41 +0100)]
page: search results as article objects

Wanted to determine page link, but also afterwards in sitemap
and likely most other uses.

3 years agopage: index method to call metadata handler
Mischa POSLAWSKY [Sat, 12 Dec 2020 14:29:24 +0000 (15:29 +0100)]
page: index method to call metadata handler

Clean up duplicate code on login and sitemap.

3 years agonieuws: article index on sitemap request
Mischa POSLAWSKY [Sat, 12 Dec 2020 14:16:29 +0000 (15:16 +0100)]
nieuws: article index on sitemap request

Restore subpages ignored since previous commit.

3 years agopage: skip directory handlers in search
Mischa POSLAWSKY [Wed, 9 Dec 2020 09:38:06 +0000 (10:38 +0100)]
page: skip directory handlers in search

Code can alter file behaviour, so should be omitted from sitemap results
(to be replaced by custom index in following commit).

Removes wanted nieuws articles, but also random foto descriptions and
some accidental html files.

3 years agopage: retain thumb subhandlers over invalid resize
Mischa POSLAWSKY [Wed, 9 Dec 2020 08:01:49 +0000 (09:01 +0100)]
page: retain thumb subhandlers over invalid resize

Ignore non-static files such as /thumb/qr on Lijtweg.

3 years agositemap: apply link metadata from handler call
Mischa POSLAWSKY [Wed, 9 Dec 2020 07:56:42 +0000 (08:56 +0100)]
sitemap: apply link metadata from handler call

Execute generic index code introduced in commit v4.5-23-gb9757db578
(2020-12-19) [login: userless handler call to obtain metadata].

3 years agomail: support invalid and repeated requests
Mischa POSLAWSKY [Wed, 9 Dec 2020 09:38:56 +0000 (10:38 +0100)]
mail: support invalid and repeated requests

Fix random sitemap pages.

3 years agologin: userless handler call to obtain metadata
Mischa POSLAWSKY [Wed, 9 Dec 2020 07:55:48 +0000 (08:55 +0100)]
login: userless handler call to obtain metadata

Generic solution (previously hardcoded to only /melding) to run code of any
forwarding request, returning at least custom title, teaser, and image,
without having to construct full html.

3 years agonieuws: fix relative image paths in toc
Mischa POSLAWSKY [Sun, 6 Dec 2020 08:18:16 +0000 (09:18 +0100)]
nieuws: fix relative image paths in toc

Current path does not apply with trailing /.

3 years agowidget: unnamed options as placeholders instead of path
Mischa POSLAWSKY [Sun, 6 Dec 2020 08:08:38 +0000 (09:08 +0100)]
widget: unnamed options as placeholders instead of path

3 years agomail: navigation links to earlier files
Mischa POSLAWSKY [Sun, 6 Dec 2020 07:40:32 +0000 (08:40 +0100)]
mail: navigation links to earlier files

3 years agologin/commits: nav widget for common pagination links
Mischa POSLAWSKY [Sun, 6 Dec 2020 07:28:11 +0000 (08:28 +0100)]
login/commits: nav widget for common pagination links

3 years agomail: lay out sender and date as subheader
Mischa POSLAWSKY [Sun, 6 Dec 2020 06:33:51 +0000 (07:33 +0100)]
mail: lay out sender and date as subheader

Similar to the GMail interface.

3 years agomail: imap function to parse sender addresses
Mischa POSLAWSKY [Sun, 6 Dec 2020 06:31:32 +0000 (07:31 +0100)]
mail: imap function to parse sender addresses

Require built-in imap module instead of the mailparse extension.
Either can be installed on Debian (or enabled on Vimexx servers)
so prefer the more complete solution.

3 years agomail: ignore unreadable files
Mischa POSLAWSKY [Sun, 6 Dec 2020 06:11:06 +0000 (07:11 +0100)]
mail: ignore unreadable files

Incorrect installation should be obvious without fatal errors.

3 years agopage: showsize() to format file sizes
Mischa POSLAWSKY [Sat, 9 Sep 2017 00:08:33 +0000 (02:08 +0200)]
page: showsize() to format file sizes

Copied from Lijtweg [doclist precursor] introduced in commit
v2.0-12-g040c5406df (2017-09-18) [com/bewoners: group file types by date];
unaltered since but no longer used.  Could prove useful later, so move here
to merge identically named files and share with other projects.

3 years agopage: move showdate() into formatting include
Mischa POSLAWSKY [Sat, 5 Dec 2020 08:15:51 +0000 (09:15 +0100)]
page: move showdate() into formatting include

Do not enforce presentation style in articles.  Separate from class,
allowing site override if wanted.

3 years agopage: delay loading user code until after page
Mischa POSLAWSKY [Sat, 5 Dec 2020 07:57:52 +0000 (08:57 +0100)]
page: delay loading user code until after page

Improved presentation on failure.

3 years agopage: move custom error handling to include
Mischa POSLAWSKY [Sat, 5 Dec 2020 07:56:52 +0000 (08:56 +0100)]
page: move custom error handling to include

3 years agologin: preview teaser metadata of goto target
Mischa POSLAWSKY [Sat, 5 Dec 2020 03:15:09 +0000 (04:15 +0100)]
login: preview teaser metadata of goto target

Assume the introduction paragraph does not contain restricted contents
(also included in public sitemap) and wanted as contents for social media
links instead of unrelated login description.

3 years agoedit/page: common retrieval of contents element
Mischa POSLAWSKY [Mon, 7 Dec 2020 14:25:29 +0000 (15:25 +0100)]
edit/page: common retrieval of contents element

3 years agoedit/page: copy static contents before dynamic alterations
Mischa POSLAWSKY [Fri, 10 Jan 2020 21:16:11 +0000 (22:16 +0100)]
edit/page: copy static contents before dynamic alterations

Revert javascript alterations before starting edits, preventing them being
saved on lijtweg.nl/doc/splitsing and various Excelsior pages.

3 years agohead: load edit script before body
Mischa POSLAWSKY [Mon, 7 Dec 2020 14:23:49 +0000 (15:23 +0100)]
head: load edit script before body

Introduce $Page->head for html head output.

Allows editor setup before running other javascript.

3 years agopage: prepend 404 contents to admin template
Mischa POSLAWSKY [Fri, 4 Dec 2020 22:50:39 +0000 (23:50 +0100)]
page: prepend 404 contents to admin template

Preview actual output on edit.

3 years agopage: ignore output buffer in article render
Mischa POSLAWSKY [Fri, 4 Dec 2020 00:30:17 +0000 (01:30 +0100)]
page: ignore output buffer in article render

Operate on object property [raw] only.

Stops preliminary output (such as in nieuws code) being injected inside the
html body, probably something to restore later for improved behaviour of
errors and broken code.

3 years agowidget/page: apply nested placeholders
Mischa POSLAWSKY [Thu, 3 Dec 2020 21:57:06 +0000 (22:57 +0100)]
widget/page: apply nested placeholders

Similar to article rendering added in commit v3.5-16-g9e9882d6f2
(2018-08-07) [nieuws: replace placeholders in article contents].

3 years agopage: store placeholder values in $Page object
Mischa POSLAWSKY [Thu, 3 Dec 2020 21:22:28 +0000 (22:22 +0100)]
page: store placeholder values in $Page object

3 years agopage: move getoutput() to render method
Mischa POSLAWSKY [Thu, 3 Dec 2020 20:22:27 +0000 (21:22 +0100)]
page: move getoutput() to render method

3 years agopage: move placeholder_include() to widget method
Mischa POSLAWSKY [Thu, 3 Dec 2020 21:28:09 +0000 (22:28 +0100)]
page: move placeholder_include() to widget method

3 years agopage: replace global variables by $Page object
Mischa POSLAWSKY [Thu, 3 Dec 2020 19:59:58 +0000 (20:59 +0100)]
page: replace global variables by $Page object

Former $Article is sufficient to provide all derived values:

$Page       = $Page->handler
$Args       = $Page->path
$PageAccess = $Page->restricted
$Article    = $Page

Swap with more appropriate (and short) $Page name and replace any usage.
Major incompatible cleanup before other upcoming behavioural changes.

3 years agofoto: fix colon separator after empty root title v4.5
Mischa POSLAWSKY [Wed, 9 Dec 2020 09:38:31 +0000 (10:38 +0100)]
foto: fix colon separator after empty root title

3 years agofoto: replace deprecated <strike> element by <s>
Mischa POSLAWSKY [Thu, 3 Dec 2020 19:26:59 +0000 (20:26 +0100)]
foto: replace deprecated <strike> element by <s>

Identical results conforming to the HTML5 standard.

Obsolete HTML 3 spelling is not recognised by ckeditor
so cannot be used in static html.

3 years agoedit/page: update remote ckeditor to version 4.15.1
Mischa POSLAWSKY [Thu, 3 Dec 2020 19:00:01 +0000 (20:00 +0100)]
edit/page: update remote ckeditor to version 4.15.1

Over 3 years since original implementation.
No notable config incompatibilities.

3 years agomail: primitive maildir message reader
Mischa POSLAWSKY [Sat, 28 Nov 2020 23:48:38 +0000 (00:48 +0100)]
mail: primitive maildir message reader

Minimal admin interface to access site emails;
formatted similarly to issue page.

3 years agoedit/page: empty target argument for index
Mischa POSLAWSKY [Thu, 3 Dec 2020 18:59:27 +0000 (19:59 +0100)]
edit/page: empty target argument for index

Fix saving of /index broken by parameter fix in commit v4.0-30-ga66a71bc45
(2019-11-09) [keep page named after existing directory].

Dropping argument requirement fail-safe seems only a slight regression
in case of future bugs.

3 years agonieuws/feed: prefer article dates from metadata
Mischa POSLAWSKY [Thu, 3 Dec 2020 02:49:20 +0000 (03:49 +0100)]
nieuws/feed: prefer article dates from metadata

Frequently available since the previous commit.

3 years agopage: record creation time in template meta tag
Mischa POSLAWSKY [Wed, 2 Dec 2020 22:46:30 +0000 (23:46 +0100)]
page: record creation time in template meta tag

Another https://ogp.me/#no_vertical object for availability start.
May be distinct from chosen (eg historic) dates shown for news articles.

Values may be reconstructed for existing files from Git history:

perl -i -pE '
close ARGV if eof;  # reset line number
$. == 1 or next;  # ignore consecutive lines
my $first = qx{git log --follow --pretty=%ai -- "$ARGV" | tail -n1}
or next;  # find earliest commit time
chomp $first;
print qq{<meta property="article:published_time" content="$first" />};
say "" unless /^<meta/;
' **/*.html

3 years agopage: record author metadata on creation
Mischa POSLAWSKY [Sun, 7 Jun 2020 05:26:53 +0000 (07:26 +0200)]
page: record author metadata on creation

Alter initial template html to include a link to the current admin,
retained by ckeditor and available in meta for optional crediting of
different sources.

Named according to https://ogp.me/#no_vertical specification, except target
does not contain the required Open Graph profile tags yet.

3 years agopage: extract metadata after reading template
Mischa POSLAWSKY [Wed, 2 Dec 2020 22:39:34 +0000 (23:39 +0100)]
page: extract metadata after reading template

Retain headers in edit if any; prepare for common modification.

3 years agopage: editable meta tags without xml closure
Mischa POSLAWSKY [Wed, 2 Dec 2020 22:38:17 +0000 (23:38 +0100)]
page: editable meta tags without xml closure

Match ckeditor output, just in case save doesn't reformat.

3 years agoedit/page: load ckeditor dependency from script include
Mischa POSLAWSKY [Mon, 7 Jan 2019 15:29:58 +0000 (16:29 +0100)]
edit/page: load ckeditor dependency from script include

Adapted from poslawsky.nl change, but retaining variable source.

3 years agoedit/page: input replacement of breaking space after abbreviations
Mischa POSLAWSKY [Tue, 1 Dec 2020 02:54:24 +0000 (03:54 +0100)]
edit/page: input replacement of breaking space after abbreviations

Clean up rule to prevent line breaks after common name titles.

3 years agoedit/page: clean up trailing whitespace after save
Mischa POSLAWSKY [Mon, 31 Dec 2018 14:40:59 +0000 (15:40 +0100)]
edit/page: clean up trailing whitespace after save

Strip invisible trash commonly left by less precise users.
First implemented on and copied from poslawsky.nl/bio/.

3 years agofoto: lock characters from icon font
Mischa POSLAWSKY [Wed, 1 Jan 2020 09:38:44 +0000 (10:38 +0100)]
foto: lock characters from icon font

Match style override to page icons introduced in the previous commit.

3 years agohead: icons to abbreviate user and edit
Mischa POSLAWSKY [Mon, 30 Dec 2019 11:25:06 +0000 (12:25 +0100)]
head: icons to abbreviate user and edit

Elect literal representation instead of CSS hacks to replace texts,
with Unicode emoji characters BUST IN SILHOUETTE and WRITING HAND
hopefully good enough for screen readers.

Assume preferred site style is obtained by an installed font.

3 years agopage: ignore asides in article body (cq title, teaser)
Mischa POSLAWSKY [Sun, 29 Nov 2020 03:07:33 +0000 (04:07 +0100)]
page: ignore asides in article body (cq title, teaser)

Prepare significant page contents in body attribute, regardless of raw.
Assume it will be used for summary text, without stripped parts in preface.

Fixes preceding aside becoming page metadata on lijtweg.nl/doc/regels.

3 years agohead: title as og:name property, clean up description
Mischa POSLAWSKY [Sun, 17 May 2020 04:23:23 +0000 (06:23 +0200)]
head: title as og:name property, clean up description

Satisfy automated SEO warnings about missing title (wanting an explicit tag)
and recommended summary length (fitting some long paragraphs by omitting
inconsequential spaces).

3 years agonieuws: fix block replacement of variable contents
Mischa POSLAWSKY [Wed, 1 Jan 2020 07:53:32 +0000 (08:53 +0100)]
nieuws: fix block replacement of variable contents

Restored as empty [[]] placeholders since previous commit.

3 years agoedit/page: indicate edit replacements in data-dyn attributes
Mischa POSLAWSKY [Thu, 21 Nov 2019 00:20:31 +0000 (01:20 +0100)]
edit/page: indicate edit replacements in data-dyn attributes

Clean up hack of html comments by a proper dom integration.
Does require placeholders to be wrapped in a single outer element.

3 years agothumb: apply exif orientation
Mischa POSLAWSKY [Mon, 16 Nov 2020 23:23:20 +0000 (00:23 +0100)]
thumb: apply exif orientation

Match expected results (and modern browser rendering of originals)
for common rotation on phone submissions.

May not match photoswipe rendering, which depends on browser support.
Best to apply rotation without tags for now (exifautotran).

3 years agositemap: strip images from teaser
Mischa POSLAWSKY [Sun, 17 May 2020 03:50:17 +0000 (05:50 +0200)]
sitemap: strip images from teaser

Fix duplicate display of early images.

3 years agositemap: fix html syntax of list items
Mischa POSLAWSKY [Sun, 17 May 2020 13:48:29 +0000 (15:48 +0200)]
sitemap: fix html syntax of list items

Restore closing tag accidentally removed in commit v4.0-7-g5e246b86aa
(2019-10-17) [linkref part to format a single page].

3 years agocontact: silence warning checking missing client headers
Mischa POSLAWSKY [Fri, 20 Nov 2020 01:16:47 +0000 (02:16 +0100)]
contact: silence warning checking missing client headers

Same behaviour but avoiding definedness error in logs.

3 years agologin: status 403 for initial unauthorised redirects
Mischa POSLAWSKY [Fri, 1 May 2020 18:10:52 +0000 (20:10 +0200)]
login: status 403 for initial unauthorised redirects

Appropriate error code for original requests.

3 years agopage: ignore failed user setup during errors
Mischa POSLAWSKY [Mon, 30 Nov 2020 21:43:11 +0000 (22:43 +0100)]
page: ignore failed user setup during errors

Report auth.inc.php exceptions without breaking on attempted usage of
$User->login in output, or missing ArchiveArticle class.

3 years agoauth: create user object regardless of login
Mischa POSLAWSKY [Fri, 6 Dec 2019 22:05:18 +0000 (23:05 +0100)]
auth: create user object regardless of login

Simplify code not having to check for object existence.

3 years agonieuws/feed: optional site icon
Mischa POSLAWSKY [Sun, 19 Jan 2020 13:14:53 +0000 (14:14 +0100)]
nieuws/feed: optional site icon

Used by some readers in feed overviews.

3 years agoissue/feed: include reply count as thread metadata
Mischa POSLAWSKY [Tue, 4 Feb 2020 20:23:45 +0000 (21:23 +0100)]
issue/feed: include reply count as thread metadata

Possibly useful values for derived layouts.
Might be shown in overviews of some RSS readers.

3 years agofoto: fix admin indication of unrestricted access
Mischa POSLAWSKY [Wed, 18 Nov 2020 15:06:52 +0000 (16:06 +0100)]
foto: fix admin indication of unrestricted access

Misdetected since variable is defined false since commit v4.3-3-ged38c6a767
(2020-02-04) [page: article method to find handler code].

3 years agonieuws/feed: header to allow js access from any domain
Mischa POSLAWSKY [Tue, 18 Aug 2020 20:06:11 +0000 (22:06 +0200)]
nieuws/feed: header to allow js access from any domain

Data is meant to be readable.

3 years agonieuws: navigation links in common aside container v4.4
Mischa POSLAWSKY [Sun, 17 May 2020 03:42:58 +0000 (05:42 +0200)]
nieuws: navigation links in common aside container

3 years agoissue: metadata list in aside container
Mischa POSLAWSKY [Sun, 17 May 2020 03:06:19 +0000 (05:06 +0200)]
issue: metadata list in aside container

Better semantics, benefits from common aside styling.

3 years agoarticle: ignore placeholders before teaser paragraph
Mischa POSLAWSKY [Sun, 17 May 2020 03:39:59 +0000 (05:39 +0200)]
article: ignore placeholders before teaser paragraph

3 years agoarticle: find teaser paragraph from variable offset
Mischa POSLAWSKY [Sun, 17 May 2020 03:17:38 +0000 (05:17 +0200)]
article: find teaser paragraph from variable offset

Simplify matching by starting at optional first </h2>.
No longer ignores (short) preceding titles such as on Lijtweg home;
more reliable otherwise.

3 years agopage: restrict security policy of base-src
Mischa POSLAWSKY [Sun, 17 May 2020 00:40:31 +0000 (02:40 +0200)]
page: restrict security policy of base-src

3 years agohead: indicate explicit og:type of website
Mischa POSLAWSKY [Sat, 16 May 2020 23:50:32 +0000 (01:50 +0200)]
head: indicate explicit og:type of website

Include just to allow page overrides, such as "article" for nieuws pages
(might affect Facebook, but seems a minor and mostly useless distinction).
At least silences Dareboost warnings about required Open Graph properties.

3 years agohead: include canonical location in og:url
Mischa POSLAWSKY [Sun, 17 May 2020 00:03:52 +0000 (02:03 +0200)]
head: include canonical location in og:url

Does not (yet) account for all aliases, but at least provides a good
reference to the requested page.

3 years agopage: extend teaser range of fallback paragraph
Mischa POSLAWSKY [Sat, 16 May 2020 23:33:36 +0000 (01:33 +0200)]
page: extend teaser range of fallback paragraph

Arbitrarily increase allowed separation to 512 bytes, as Lijtweg index page
introduction recently moved beyond 256 because of longer image paths.

3 years agopage: declare minimal security policy header
Mischa POSLAWSKY [Sat, 16 May 2020 23:05:27 +0000 (01:05 +0200)]
page: declare minimal security policy header

Define current data usage to provide some protection from XSS attacks.
Allow for remaining scripts and images (editor script, gallery, some onclick
actions in user forms, inline svg) to be improved at a later time.

3 years agopage: disallow frame ancestors to prevent clickjacking
Mischa POSLAWSKY [Sat, 16 May 2020 22:17:23 +0000 (00:17 +0200)]
page: disallow frame ancestors to prevent clickjacking

Security policy recommended by Dareboost, to stop potential malicious page
embedding.  Support should be decent (enough), so do not bother with an
equivalent X-Frame-Options directive for compatibility.

3 years agothumb: strip metadata and chroma
Mischa POSLAWSKY [Sat, 18 Jan 2020 14:57:10 +0000 (15:57 +0100)]
thumb: strip metadata and chroma

Decreased colour quality recommended by Google PageSpeed:
<https://developers.google.com/speed/docs/insights/OptimizeImages>

3 years agothumb: decrease preferred quality to 85%
Mischa POSLAWSKY [Sat, 18 Jan 2020 14:57:10 +0000 (15:57 +0100)]
thumb: decrease preferred quality to 85%

Better trade-off, also recommended by PageSpeed.

3 years agothumb: prefer progressive jpeg encoding
Mischa POSLAWSKY [Sat, 18 Jan 2020 14:14:10 +0000 (15:14 +0100)]
thumb: prefer progressive jpeg encoding

Intermediate rendering for faster results, and overall smaller file sizes
similar (if not identical) to jpegtran -optimize or PageSpeed.

4 years agopage: reenclose template contents in static container
Mischa POSLAWSKY [Wed, 18 Mar 2020 16:28:59 +0000 (17:28 +0100)]
page: reenclose template contents in static container

Fix editing of new pages since v4.2-24-ged38c6a767 (2020-02-04)
[page: article method to find handler code].

4 years agoissue: match image replies for metadata
Mischa POSLAWSKY [Tue, 4 Feb 2020 21:36:11 +0000 (22:36 +0100)]
issue: match image replies for metadata

Database paragraphs not cleaned by editor lack preceding newline.

4 years agologin: target page in description and image metadata
Mischa POSLAWSKY [Tue, 4 Feb 2020 21:20:18 +0000 (22:20 +0100)]
login: target page in description and image metadata

4 years agologin: run handler of pending melding page
Mischa POSLAWSKY [Tue, 4 Feb 2020 20:22:56 +0000 (21:22 +0100)]
login: run handler of pending melding page

Run script to get dynamic page metadata.  Most wanted for issues (otherwise
inaccessible since move to database), considered mostly safe to execute.
Not a generic solution for other code which could exit.

4 years agologin: redirection message if pending page
Mischa POSLAWSKY [Tue, 4 Feb 2020 20:19:29 +0000 (21:19 +0100)]
login: redirection message if pending page

Assume ?goto page required authorisation.