From 33c60ebdffb1719f3becc3043fa7d2a203ded318 Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 5 Apr 2024 17:06:57 +0200 Subject: [PATCH 1/2] Add logging --- routers/api/v1/activitypub/repository.go | 3 +++ services/federation/federation_service.go | 1 + 2 files changed, 4 insertions(+) diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index bdf4bd276e..5c2f0b2f67 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -74,6 +74,9 @@ func RepositoryInbox(ctx *context.APIContext) { form := web.GetForm(ctx) httpStatus, title, err := federation.ProcessLikeActivity(ctx, form, repository.ID) if err != nil { + log.Error("Status: %v", httpStatus) + log.Error("Title: %v", title) + log.Error("Error: %v", err) ctx.Error(httpStatus, title, err) } ctx.Status(http.StatusNoContent) diff --git a/services/federation/federation_service.go b/services/federation/federation_service.go index 61345029fd..bac1e7afaf 100644 --- a/services/federation/federation_service.go +++ b/services/federation/federation_service.go @@ -252,6 +252,7 @@ func SendLikeActivities(ctx context.Context, doer user.User, repoID int64) error likeActivityList := make([]forgefed.ForgeLike, 0) for _, followingRepo := range followingRepos { + log.Info("Found following repo: %v", followingRepo) target := followingRepo.URI likeActivity, err := forgefed.NewForgeLike(doer.APAPIURL(), target, time.Now()) if err != nil { From 765298814c3a4b716beec9b6ba433cbf93643368 Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 5 Apr 2024 17:07:04 +0200 Subject: [PATCH 2/2] Add ToDo --- services/repository/star.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/repository/star.go b/services/repository/star.go index e9f4c1cdef..2162544713 100644 --- a/services/repository/star.go +++ b/services/repository/star.go @@ -12,6 +12,7 @@ import ( "code.gitea.io/gitea/services/federation" ) +// ToDo: Consistent Naming, smth like StarLocalAndFollowingRepo func StarRepoAndFederate(ctx context.Context, doer user.User, repoID int64, star bool) error { if err := repo.StarRepo(ctx, doer.ID, repoID, star); err != nil { return err