From 56ded965d994c04c846d70e275b18867630ad22b Mon Sep 17 00:00:00 2001 From: Xeronith Date: Wed, 17 Aug 2022 15:39:34 +0430 Subject: [PATCH] feat(activitypub): :sparkles: stand-alone activitypub module --- greataped/{app => }/activitypub/activity.go | 0 greataped/{app => }/activitypub/actor.go | 0 greataped/{app => }/activitypub/create.go | 0 greataped/{app => }/activitypub/followers.go | 0 greataped/activitypub/go.mod | 5 +++++ greataped/activitypub/go.sum | 2 ++ greataped/{app => }/activitypub/note.go | 0 greataped/{app => }/activitypub/object.go | 0 greataped/{app => }/activitypub/outbox.go | 0 greataped/{app => }/activitypub/types.go | 0 greataped/{app => }/activitypub/webfinger.go | 0 greataped/app/go.mod | 3 +-- greataped/app/go.sum | 2 -- greataped/app/routes/follow.go | 2 +- greataped/app/routes/followers.go | 2 +- greataped/app/routes/following.go | 2 +- greataped/app/routes/helpers.go | 2 +- greataped/app/routes/inbox.go | 2 +- greataped/app/routes/outbox.go | 2 +- greataped/cache/go.mod | 2 +- greataped/config/go.mod | 2 +- greataped/contracts/go.mod | 2 +- greataped/db/go.mod | 2 +- greataped/go.work | 3 ++- greataped/go.work.sum | 6 +++++- greataped/log/go.mod | 2 +- greataped/server/go.mod | 2 +- greataped/utility/go.mod | 2 +- 28 files changed, 28 insertions(+), 19 deletions(-) rename greataped/{app => }/activitypub/activity.go (100%) rename greataped/{app => }/activitypub/actor.go (100%) rename greataped/{app => }/activitypub/create.go (100%) rename greataped/{app => }/activitypub/followers.go (100%) create mode 100644 greataped/activitypub/go.mod create mode 100644 greataped/activitypub/go.sum rename greataped/{app => }/activitypub/note.go (100%) rename greataped/{app => }/activitypub/object.go (100%) rename greataped/{app => }/activitypub/outbox.go (100%) rename greataped/{app => }/activitypub/types.go (100%) rename greataped/{app => }/activitypub/webfinger.go (100%) diff --git a/greataped/app/activitypub/activity.go b/greataped/activitypub/activity.go similarity index 100% rename from greataped/app/activitypub/activity.go rename to greataped/activitypub/activity.go diff --git a/greataped/app/activitypub/actor.go b/greataped/activitypub/actor.go similarity index 100% rename from greataped/app/activitypub/actor.go rename to greataped/activitypub/actor.go diff --git a/greataped/app/activitypub/create.go b/greataped/activitypub/create.go similarity index 100% rename from greataped/app/activitypub/create.go rename to greataped/activitypub/create.go diff --git a/greataped/app/activitypub/followers.go b/greataped/activitypub/followers.go similarity index 100% rename from greataped/app/activitypub/followers.go rename to greataped/activitypub/followers.go diff --git a/greataped/activitypub/go.mod b/greataped/activitypub/go.mod new file mode 100644 index 0000000..44d8936 --- /dev/null +++ b/greataped/activitypub/go.mod @@ -0,0 +1,5 @@ +module activitypub + +go 1.19 + +require github.com/google/uuid v1.3.0 diff --git a/greataped/activitypub/go.sum b/greataped/activitypub/go.sum new file mode 100644 index 0000000..3dfe1c9 --- /dev/null +++ b/greataped/activitypub/go.sum @@ -0,0 +1,2 @@ +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= diff --git a/greataped/app/activitypub/note.go b/greataped/activitypub/note.go similarity index 100% rename from greataped/app/activitypub/note.go rename to greataped/activitypub/note.go diff --git a/greataped/app/activitypub/object.go b/greataped/activitypub/object.go similarity index 100% rename from greataped/app/activitypub/object.go rename to greataped/activitypub/object.go diff --git a/greataped/app/activitypub/outbox.go b/greataped/activitypub/outbox.go similarity index 100% rename from greataped/app/activitypub/outbox.go rename to greataped/activitypub/outbox.go diff --git a/greataped/app/activitypub/types.go b/greataped/activitypub/types.go similarity index 100% rename from greataped/app/activitypub/types.go rename to greataped/activitypub/types.go diff --git a/greataped/app/activitypub/webfinger.go b/greataped/activitypub/webfinger.go similarity index 100% rename from greataped/app/activitypub/webfinger.go rename to greataped/activitypub/webfinger.go diff --git a/greataped/app/go.mod b/greataped/app/go.mod index 5d8b279..0a90506 100644 --- a/greataped/app/go.mod +++ b/greataped/app/go.mod @@ -1,9 +1,8 @@ module app -go 1.18 +go 1.19 require ( - github.com/google/uuid v1.3.0 github.com/mazen160/go-random v0.0.0-20210308102632-d2b501c85c03 github.com/mitchellh/mapstructure v1.5.0 gorm.io/gorm v1.23.8 diff --git a/greataped/app/go.sum b/greataped/app/go.sum index f794986..46668b7 100644 --- a/greataped/app/go.sum +++ b/greataped/app/go.sum @@ -1,5 +1,3 @@ -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= diff --git a/greataped/app/routes/follow.go b/greataped/app/routes/follow.go index 65913f3..ce80509 100644 --- a/greataped/app/routes/follow.go +++ b/greataped/app/routes/follow.go @@ -1,7 +1,7 @@ package routes import ( - "app/activitypub" + "activitypub" "config" . "contracts" "io" diff --git a/greataped/app/routes/followers.go b/greataped/app/routes/followers.go index 02c66d8..288d83b 100644 --- a/greataped/app/routes/followers.go +++ b/greataped/app/routes/followers.go @@ -1,7 +1,7 @@ package routes import ( - "app/activitypub" + "activitypub" "app/models/repos" "app/models/types" "config" diff --git a/greataped/app/routes/following.go b/greataped/app/routes/following.go index d472c78..cf45c14 100644 --- a/greataped/app/routes/following.go +++ b/greataped/app/routes/following.go @@ -1,7 +1,7 @@ package routes import ( - "app/activitypub" + "activitypub" "app/models/repos" "app/models/types" "config" diff --git a/greataped/app/routes/helpers.go b/greataped/app/routes/helpers.go index cb0288d..13a0702 100644 --- a/greataped/app/routes/helpers.go +++ b/greataped/app/routes/helpers.go @@ -1,7 +1,7 @@ package routes import ( - "app/activitypub" + "activitypub" "app/models/repos" "config" "encoding/hex" diff --git a/greataped/app/routes/inbox.go b/greataped/app/routes/inbox.go index 203dd8d..986a9e2 100644 --- a/greataped/app/routes/inbox.go +++ b/greataped/app/routes/inbox.go @@ -1,7 +1,7 @@ package routes import ( - "app/activitypub" + "activitypub" "app/models/repos" "app/models/types" "config" diff --git a/greataped/app/routes/outbox.go b/greataped/app/routes/outbox.go index ab28fb4..9746a57 100644 --- a/greataped/app/routes/outbox.go +++ b/greataped/app/routes/outbox.go @@ -1,7 +1,7 @@ package routes import ( - "app/activitypub" + "activitypub" "app/models/repos" "app/models/types" "config" diff --git a/greataped/cache/go.mod b/greataped/cache/go.mod index b9c813e..db1b329 100644 --- a/greataped/cache/go.mod +++ b/greataped/cache/go.mod @@ -1,3 +1,3 @@ module cache -go 1.18 +go 1.19 diff --git a/greataped/config/go.mod b/greataped/config/go.mod index 863d640..c79eae0 100644 --- a/greataped/config/go.mod +++ b/greataped/config/go.mod @@ -1,3 +1,3 @@ module config -go 1.18 +go 1.19 diff --git a/greataped/contracts/go.mod b/greataped/contracts/go.mod index 0418701..55eef9b 100644 --- a/greataped/contracts/go.mod +++ b/greataped/contracts/go.mod @@ -1,3 +1,3 @@ module contracts -go 1.18 +go 1.19 diff --git a/greataped/db/go.mod b/greataped/db/go.mod index 7da9f3f..f2f2aad 100644 --- a/greataped/db/go.mod +++ b/greataped/db/go.mod @@ -1,6 +1,6 @@ module db -go 1.18 +go 1.19 require ( github.com/mattn/go-sqlite3 v1.14.14 diff --git a/greataped/go.work b/greataped/go.work index 3432d0b..4be41bd 100644 --- a/greataped/go.work +++ b/greataped/go.work @@ -1,6 +1,7 @@ -go 1.18 +go 1.19 use ( + ./activitypub ./app ./config ./contracts diff --git a/greataped/go.work.sum b/greataped/go.work.sum index 4682b4a..bc40967 100644 --- a/greataped/go.work.sum +++ b/greataped/go.work.sum @@ -1,3 +1,7 @@ github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY= github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/greataped/log/go.mod b/greataped/log/go.mod index 9e34e75..2b8f4aa 100644 --- a/greataped/log/go.mod +++ b/greataped/log/go.mod @@ -1,3 +1,3 @@ module log -go 1.18 +go 1.19 diff --git a/greataped/server/go.mod b/greataped/server/go.mod index 9ab5712..82476d9 100644 --- a/greataped/server/go.mod +++ b/greataped/server/go.mod @@ -1,6 +1,6 @@ module server -go 1.18 +go 1.19 require ( github.com/gofiber/fiber/v2 v2.35.0 diff --git a/greataped/utility/go.mod b/greataped/utility/go.mod index 60381b4..c4870e8 100644 --- a/greataped/utility/go.mod +++ b/greataped/utility/go.mod @@ -1,6 +1,6 @@ module utility -go 1.18 +go 1.19 require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible