This enables automated user creation by running:
writefreely --create-admin username:password
It will fail if an admin (first user) already exists, which makes this
suitable for use on both for single- and multi-user instances.
Closes T544
A quick test with ApacheBench revealed that SQLite really can't handle
multiple concurrent requests with the default settings, due to a locked
database. This fixes that by following the suggestions here:
https://github.com/mattn/go-sqlite3#faq
Testing with ab -n 100 -c 5 http://localhost:8080/blog/post shows that
this fixes the issue. But we could improve performance by reducing
writes, like what's mentioned in T545.
Part of T529
Minimal changes, definitely WIP, to resolve:
- how to support dualstack when not using localhost?
- net/http package uses string, mentions IP address instead of bind,
need info.
This supports running the server on port 443, serving secure pages, with
automatic redirects from the insecure site. It also modifies the
configuration process to better guide users through configuring for
running behind a reverse proxy or as a standalone server.
This closes T537
This allows admin to edit these pages from the web, using Markdown. It
also dynamically loads information on those pages now, and makes loading
`pages` templates a little easier to find in the code / more explicit.
It requires this new schema change:
CREATE TABLE IF NOT EXISTS `appcontent` (
`id` varchar(36) NOT NULL,
`content` mediumtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
This closes T533