aboutsummaryrefslogtreecommitdiff
path: root/cmd/server/main.go
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-06-19 23:57:04 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2022-06-19 23:57:04 -0400
commitbf7d9c79cae53f64fcd04527248987bd4e7ca3c4 (patch)
tree0c763f6545cee4a287f5e6fa0a45489a85454325 /cmd/server/main.go
parent235b8f871fdfa35f9595268d194d28a3de655ec0 (diff)
downloadgo-website-0.0.17a.tar.gz
go-website-0.0.17a.tar.xz
0.0.17a / Alpha. Introduce users and page editing.v0.0.17a
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.
Diffstat (limited to 'cmd/server/main.go')
-rw-r--r--cmd/server/main.go7
1 files changed, 7 insertions, 0 deletions
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
}