bump copyright, added stats page and updated dependencies

This commit is contained in:
ston1th 2020-01-11 11:32:27 +01:00
commit 0265d820fe
111 changed files with 9556 additions and 3835 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2019 Marius Schellenberger
// Copyright (C) 2020 Marius Schellenberger
package server
@ -30,127 +30,134 @@ var static = []route{
var routes = []route{
{
"/",
core.RootURI,
jwtHandler(
indexHandler),
[]string{"GET"},
},
{
"/sections",
core.SectionsURI,
jwtHandler(
sectionsHandler),
[]string{"GET"},
},
{
"/section/new",
core.SectionURI + "/new",
jwtHandler(
adminAuthHandler(
sectionNewHandler)),
[]string{"GET", "POST"},
},
{
"/section/edit/{section:[a-zA-Z0-9]+$}",
core.SectionURI + "/edit/{section:[a-zA-Z0-9]+$}",
jwtHandler(
adminAuthHandler(
sectionEditHandler)),
[]string{"GET", "POST"},
},
{
"/section/del/{section:[a-zA-Z0-9]+$}",
core.SectionURI + "/del/{section:[a-zA-Z0-9]+$}",
jwtHandler(
adminAuthHandler(
sectionDelHandler)),
[]string{"GET", "POST"},
},
{
"/search",
core.SearchURI,
jwtHandler(
searchHandler),
[]string{"GET", "POST"},
},
{
"/new",
core.NewURI,
jwtHandler(
authHandler(
pageNewHandler)),
[]string{"GET", "POST"},
},
{
"/login",
core.LoginURI,
jwtHandler(
loginHandler),
[]string{"GET", "POST"},
},
{
"/totp",
core.TotpURI,
jwtHandler(
totpAuthHandler(
loginTotpHandler)),
[]string{"GET", "POST"},
},
{
"/blacklist",
core.BlacklistURI,
jwtHandler(
authHandler(
pageBlacklistHandler)),
[]string{"GET", "POST"},
},
{
"/users",
core.UsersURI,
jwtHandler(
adminAuthHandler(
usersHandler)),
[]string{"GET"},
},
{
"/user/new",
core.UserURI + "/new",
jwtHandler(
adminAuthHandler(
userNewHandler)),
[]string{"GET", "POST"},
},
{
"/user/edit/{user:[a-zA-Z0-9]+$}",
core.UserURI + "/edit/{user:[a-zA-Z0-9]+$}",
jwtHandler(
userAuthHandler(
userEditHandler)),
[]string{"GET", "POST"},
},
{
"/user/del/{user:[a-zA-Z0-9]+$}",
core.UserURI + "/del/{user:[a-zA-Z0-9]+$}",
jwtHandler(
userAuthHandler(
userDelHandler)),
[]string{"GET", "POST"},
},
{
"/user/totp/{user:[a-zA-Z0-9]+$}",
core.UserURI + "/totp/{user:[a-zA-Z0-9]+$}",
jwtHandler(
userAuthHandler(
userTotpHandler)),
[]string{"GET", "POST"},
},
{
"/user/unlock/{user:[a-zA-Z0-9]+$}",
core.UserURI + "/unlock/{user:[a-zA-Z0-9]+$}",
jwtHandler(
adminAuthHandler(
userUnlockHandler)),
[]string{"POST"},
},
{
"/logout",
core.StatsURI,
jwtHandler(
adminAuthHandler(
statsHandler)),
[]string{"GET"},
},
{
core.LogoutURI,
jwtHandler(
logoutHandler),
[]string{"GET", "POST"},
},
{
"/view/{key}",
core.ViewURI + "/{key}",
jwtHandler(
pageHandler),
[]string{"GET"},
},
{
"/view/{key}/md",
core.ViewURI + "/{key}/md",
jwtHandler(
pageMDHandler(
pageHandler)),