From bf7d9c79cae53f64fcd04527248987bd4e7ca3c4 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 19 Jun 2022 23:57:04 -0400 Subject: 0.0.17a / Alpha. Introduce users and page editing. Breaking changes: inc/base.html is now tpl/base.md by default. This can be overridden on the command line. 404.md is now tpl/404.md. This can be overridden with templatedirectory in the configuration file. Additional files: `auth.json` file that stores credentials and settings for authorization cookie. Further notes: This will likely receive some major updates and changes over the next few commits. The scaffolidng is now in place for user accounts, login handling, and page editing. It's all extremely basic at the moment, on the idea list: Listing of all markdown files File uploader and general content management Flags to turn on/off git integration for edits. Download / Upload of all markdown files as a backup/restore. It's of course, all subject to change. --- cmd/server/main.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd/server/main.go') diff --git a/cmd/server/main.go b/cmd/server/main.go index 912cba0..ee8cf6f 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -28,6 +28,8 @@ func main() { //nolint:funlen directory := fl.String("d", ".", "Directory to serve.") version := fl.Bool("v", false, "Print the version then exit") confFn := fl.String("c", "conf.yml", "Location for the config file") + authConfFn := fl.String("ac", "auth.json", + "Location for authorization configuration file") verbose := fl.Bool("V", false, "Be more verbose ( dump config, etc ) ") fl.StringVar(&page.TimeFormat, "T", page.TimeFormat, "Set the page time format, be careful with this") @@ -61,6 +63,11 @@ func main() { //nolint:funlen app = &App{} } + err = app.ReadAuth(*authConfFn) + if err != nil { + log.Println(err) + } + if app.ReIndexPath == "" || *indexPath != defaultIndexPath { app.ReIndexPath = *indexPath } -- cgit v1.2.3