From 26683b3d49beea9b1f0e8f78df4720285d4c0825 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 15 Apr 2022 14:33:01 +0200 Subject: [feature] Web profile pages for accounts (#449) * add default avatars * allow webModule to error * return errWithCode from account get * add AccountGetLocalByUsername * check nil requesting account * add timestampShort function for just month/year * move loading logic to New + add default avatars * add profile page view * update swagger docs * add excludeReblogs to GetAccountStatuses * ignore casing when selecting local account by username * appropriate redirects * css fiddling * add 'about' heading * adjust thread page to work with routing * return AP representation if requested + authorized * simplify auth check * go fmt * golangci-lint ignore math/rand --- cmd/gotosocial/action/server/server.go | 11 +++++++++-- cmd/gotosocial/action/testrig/testrig.go | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'cmd') diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go index edd6fc1a7..8c6cd7afe 100644 --- a/cmd/gotosocial/action/server/server.go +++ b/cmd/gotosocial/action/server/server.go @@ -148,6 +148,12 @@ var Start action.GTSAction = func(ctx context.Context) error { return fmt.Errorf("error creating oidc idp: %s", err) } + // build web module + webModule, err := web.New(processor) + if err != nil { + return fmt.Errorf("error creating web module: %s", err) + } + // build client api modules authModule := auth.New(dbService, oauthServer, idp) accountModule := account.New(processor) @@ -156,7 +162,6 @@ var Start action.GTSAction = func(ctx context.Context) error { followRequestsModule := followrequest.New(processor) webfingerModule := webfinger.New(processor) nodeInfoModule := nodeinfo.New(processor) - webBaseModule := web.New(processor) usersModule := user.New(processor) timelineModule := timeline.New(processor) notificationModule := notification.New(processor) @@ -179,8 +184,10 @@ var Start action.GTSAction = func(ctx context.Context) error { securityModule, authModule, + // now the web module + webModule, + // now everything else - webBaseModule, accountModule, instanceModule, appsModule, diff --git a/cmd/gotosocial/action/testrig/testrig.go b/cmd/gotosocial/action/testrig/testrig.go index d79ba3ea4..1e38b5554 100644 --- a/cmd/gotosocial/action/testrig/testrig.go +++ b/cmd/gotosocial/action/testrig/testrig.go @@ -95,6 +95,12 @@ var Start action.GTSAction = func(ctx context.Context) error { return fmt.Errorf("error creating oidc idp: %s", err) } + // build web module + webModule, err := web.New(processor) + if err != nil { + return fmt.Errorf("error creating web module: %s", err) + } + // build client api modules authModule := auth.New(dbService, oauthServer, idp) accountModule := account.New(processor) @@ -103,7 +109,6 @@ var Start action.GTSAction = func(ctx context.Context) error { followRequestsModule := followrequest.New(processor) webfingerModule := webfinger.New(processor) nodeInfoModule := nodeinfo.New(processor) - webBaseModule := web.New(processor) usersModule := user.New(processor) timelineModule := timeline.New(processor) notificationModule := notification.New(processor) @@ -126,8 +131,10 @@ var Start action.GTSAction = func(ctx context.Context) error { securityModule, authModule, + // now the web module + webModule, + // now everything else - webBaseModule, accountModule, instanceModule, appsModule, -- cgit v1.3