Addr flag for debug server, logging
This commit is contained in:
parent
03178f59e6
commit
d767921e0e
11 changed files with 54 additions and 13 deletions
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
webutils "git.mstar.dev/mstar/goutils/http"
|
||||
"git.mstar.dev/mstar/goutils/other"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/rs/zerolog/hlog"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"git.mstar.dev/mstar/linstrom/config"
|
||||
|
@ -30,6 +30,7 @@ func WellKnownWebfinger(w http.ResponseWriter, r *http.Request) {
|
|||
Links []OutboundLink `json:"links"`
|
||||
Aliases []string `json:"aliases,omitempty"`
|
||||
}
|
||||
log := hlog.FromRequest(r)
|
||||
requestedResource := r.FormValue("resource")
|
||||
matches := webfingerResourceRegex.FindStringSubmatch(requestedResource)
|
||||
if len(matches) == 0 {
|
||||
|
@ -104,6 +105,7 @@ func WellKnownWebfinger(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func Nodeinfo(w http.ResponseWriter, r *http.Request) {
|
||||
u := dbgen.User
|
||||
log := hlog.FromRequest(r)
|
||||
userCount, err := u.Where(u.DeletedAt.IsNull(), u.Verified.Is(true)).Count()
|
||||
if err != nil {
|
||||
webutils.ProblemDetails(w, 500, "/errors/db-failure", "internal database failure", nil, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue