Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GO-4140 publish 2 #1938

Merged
merged 57 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
96d1512
GO-4179 publish service, wire protobufs
zarkone Oct 10, 2024
a5be0a3
GO-4179 workaround object show
zarkone Oct 11, 2024
b5105a6
GO-4179 remove publishById
zarkone Oct 14, 2024
c3f64bd
GO-4179 dummy error handle
zarkone Oct 14, 2024
f44c219
GO-4179 remove blockservice
zarkone Oct 14, 2024
2146d2c
GO-4256 build ufs structure, wip
zarkone Oct 17, 2024
0ae14e5
GO-4256 forgot to add root node to DAG, fixed
zarkone Oct 18, 2024
6d72554
GO-4256 fix lint issues
zarkone Oct 18, 2024
9b5a145
GO-4256 add published ufs structure
zarkone Oct 18, 2024
cbf1654
Merge pull request #1703 from anyproto/go-4256-read-exported-ipld-tre…
zarkone Oct 18, 2024
60db021
GO-4140 Merge branch 'feature/chat' into go-4140-epic-web-publishing-go
zarkone Oct 18, 2024
e9cfc97
GO-4140 Merge branch 'main' into go-4140-epic-web-publishing-go
zarkone Oct 23, 2024
d9e7aed
GO-4140 Merge branch 'main' into go-4140-epic-web-publishing-go
zarkone Oct 24, 2024
a9c79f7
GO-4140 Merge branch 'main' into go-4140-epic-web-publishing-go
zarkone Oct 24, 2024
17db039
GO-4355 write page and assets from Export
zarkone Oct 24, 2024
870aee2
Merge pull request #1733 from anyproto/go-4355-put-export-protobufs-a…
zarkone Oct 28, 2024
6045bb0
GO-4140 Merge remote-tracking branch 'origin/main' into go-4140-epic-…
zarkone Oct 28, 2024
9f76d4a
GO-4140 Merge remote-tracking branch 'origin/main' into go-4140-epic-…
zarkone Nov 12, 2024
04f0f9c
GO-4140 update flake
zarkone Nov 12, 2024
8401ebc
GO-4140 add rootPath file to cid dir
zarkone Nov 25, 2024
1d3fd66
GO-4140 Merge branch 'main' into publish-2
zarkone Dec 11, 2024
c365588
GO-4140 integration with publishing-server, init
zarkone Dec 11, 2024
da0ddff
GO-4685 draft publish-server rpc handlers
zarkone Dec 11, 2024
cb8f31b
Merge pull request #1939 from anyproto/go-4685-update-client-interfac…
zarkone Dec 11, 2024
1e20344
GO-4718 new web publishing format, suitable for publish-server/s3
zarkone Dec 12, 2024
7337a17
GO-4718 gzip json
zarkone Dec 12, 2024
76193ac
GO-4718 remove tmpdirs
zarkone Dec 12, 2024
c64730e
Merge pull request #1944 from anyproto/go-4718-pack-webpublishing-dat…
zarkone Dec 12, 2024
bd9b3b7
GO-4140 fix .gz write
zarkone Dec 17, 2024
3184168
GO-4684 connect drpc client for publish, init
zarkone Dec 18, 2024
a389b17
Merge pull request #1963 from anyproto/go-4684-connect-drpc-client-li…
zarkone Dec 18, 2024
c2dcbb5
GO-4140 use staging config for publish-server
zarkone Dec 18, 2024
2177fc1
GO-4140 set url from client request
zarkone Dec 18, 2024
3792422
GO-4140 update any-sync and pushclient
cheggaaa Jan 10, 2025
e704a9b
GO-4140 merge main
cheggaaa Jan 10, 2025
86f52b7
GO-4140 publishing: production config
cheggaaa Jan 10, 2025
a254c00
GO-4140 Merge remote-tracking branch 'refs/remotes/origin/main' into …
fat-fellow Jan 14, 2025
8b52e3d
GO-4140 Merge remote-tracking branch 'refs/remotes/origin/main' into …
fat-fellow Jan 14, 2025
da9a095
GO-4140 fix go.sum
fat-fellow Jan 14, 2025
87508f0
GO-4140 Merge branch 'main' of github.com:anyproto/anytype-heart into…
AnastasiaShemyakinskaya Jan 15, 2025
c806bcb
GO-4140: add limits
AnastasiaShemyakinskaya Jan 15, 2025
5ff7211
GO-4140: fix middle issues
AnastasiaShemyakinskaya Jan 16, 2025
8fa9147
GO-4140 Merge branch 'main' of github.com:anyproto/anytype-heart into…
AnastasiaShemyakinskaya Jan 16, 2025
f704969
GO-4140: fix export
AnastasiaShemyakinskaya Jan 16, 2025
947f53a
GO-4140: cleaned up code
AnastasiaShemyakinskaya Jan 16, 2025
1f27518
GO-4140: refactoring
AnastasiaShemyakinskaya Jan 16, 2025
617953c
GO-4140: added tests
AnastasiaShemyakinskaya Jan 16, 2025
663a4d6
GO-4140: fixes after tests
AnastasiaShemyakinskaya Jan 16, 2025
8d120bf
GO-4140 Merge branch 'main' of github.com:anyproto/anytype-heart into…
AnastasiaShemyakinskaya Jan 16, 2025
9290de3
GO-4140: fix join space
AnastasiaShemyakinskaya Jan 16, 2025
21ea646
GO-4140 Merge branch 'GO-4140-publish-2' of github.com:anyproto/anyty…
AnastasiaShemyakinskaya Jan 16, 2025
2d3367c
GO-4140: fix conflicts
AnastasiaShemyakinskaya Jan 16, 2025
b3a6caf
GO-4140: remove comment
AnastasiaShemyakinskaya Jan 16, 2025
7151ae0
GO-4140: remove not needed fields
AnastasiaShemyakinskaya Jan 16, 2025
b8eed36
GO-4140: added restriction
AnastasiaShemyakinskaya Jan 16, 2025
aabc126
GO-4140: fixed system relations
AnastasiaShemyakinskaya Jan 16, 2025
63d784a
Merge pull request #2014 from anyproto/GO-4140-fix-middle-issues
AnastasiaShemyakinskaya Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ tests/.cache/
staging.yml
build
/core/anytype/config/nodes/custom.yml
/.direnv/
/.envrc
6 changes: 6 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,9 @@ packages:
github.com/anyproto/anytype-heart/core/kanban:
interfaces:
Service:
github.com/anyproto/anytype-heart/core/core/inviteservice:
interfaces:
InviteService:
github.com/anyproto/anytype-heart/core/identity:
interfaces:
Service:
853 changes: 523 additions & 330 deletions clientlibrary/service/service.pb.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions core/anytype/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/anyproto/any-sync/nodeconf/nodeconfstore"
"github.com/anyproto/any-sync/util/crypto"
"github.com/anyproto/any-sync/util/syncqueues"
"github.com/anyproto/anytype-publish-server/publishclient"
"go.uber.org/zap"

"github.com/anyproto/any-sync/nameservice/nameserviceclient"
Expand Down Expand Up @@ -80,6 +81,7 @@ import (
"github.com/anyproto/anytype-heart/core/payments"
paymentscache "github.com/anyproto/anytype-heart/core/payments/cache"
"github.com/anyproto/anytype-heart/core/peerstatus"
"github.com/anyproto/anytype-heart/core/publish"
"github.com/anyproto/anytype-heart/core/recordsbatcher"
"github.com/anyproto/anytype-heart/core/session"
"github.com/anyproto/anytype-heart/core/spaceview"
Expand Down Expand Up @@ -268,6 +270,8 @@ func Bootstrap(a *app.App, components ...app.Component) {
Register(reconciler.New()).
Register(fileobject.New(200*time.Millisecond, 2*time.Second)).
Register(inviteservice.New()).
Register(publish.New()).
Register(publishclient.New()).
Register(acl.New()).
Register(builtintemplate.New()).
Register(converter.NewLayoutConverter()).
Expand Down
12 changes: 12 additions & 0 deletions core/anytype/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
anystore "github.com/anyproto/any-store"
"github.com/anyproto/any-sync/app"
"github.com/anyproto/any-sync/net/streampool"
"github.com/anyproto/anytype-publish-server/publishclient"

//nolint:misspell
"github.com/anyproto/any-sync/commonspace/config"
Expand Down Expand Up @@ -455,3 +456,14 @@ func (c *Config) GetSpaceStorageMode() storage.SpaceStorageMode {
func (c *Config) GetNetworkMode() pb.RpcAccountNetworkMode {
return c.NetworkMode
}

func (c *Config) GetPublishServer() publishclient.Config {
return publishclient.Config{
Addrs: []publishclient.PublishServerAddr{
{
PeerId: "12D3KooWEQPgbxGPvkny8kikS3zqfziM7JsQBnJHXHL9ByCcATs7",
Addrs: []string{"yamux://anytype-publish-server-yamux-fb3a0765ead8fc08.elb.eu-central-2.amazonaws.com:443"},
},
},
}
}
43 changes: 26 additions & 17 deletions core/block/restriction/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,22 @@ var (
model.Restrictions_TypeChange,
model.Restrictions_Template,
model.Restrictions_Duplicate,
model.Restrictions_Publish,
}
objRestrictEditAndDuplicate = ObjectRestrictions{
objRestrictEditPublishAndDuplicate = ObjectRestrictions{
model.Restrictions_Blocks,
model.Restrictions_LayoutChange,
model.Restrictions_TypeChange,
model.Restrictions_Template,
model.Restrictions_Duplicate,
model.Restrictions_Publish,
}
objRestrictEdit = ObjectRestrictions{
objRestrictEditAndPublish = ObjectRestrictions{
model.Restrictions_Blocks,
model.Restrictions_LayoutChange,
model.Restrictions_TypeChange,
model.Restrictions_Template,
model.Restrictions_Publish,
}
sysTypesRestrictions = ObjectRestrictions{
model.Restrictions_Blocks,
Expand All @@ -44,6 +47,7 @@ var (
model.Restrictions_Template,
model.Restrictions_Details,
model.Restrictions_Delete,
model.Restrictions_Publish,
}
sysRelationsRestrictions = ObjectRestrictions{
model.Restrictions_Blocks,
Expand All @@ -53,17 +57,18 @@ var (
model.Restrictions_Delete,
model.Restrictions_Relations,
model.Restrictions_Details,
model.Restrictions_Publish,
}

objectRestrictionsByLayout = map[model.ObjectTypeLayout]ObjectRestrictions{
model.ObjectType_basic: {},
model.ObjectType_profile: {},
model.ObjectType_todo: {},
model.ObjectType_set: objRestrictEdit,
model.ObjectType_collection: objRestrictEdit,
model.ObjectType_objectType: objRestrictEdit,
model.ObjectType_relation: objRestrictEdit,
model.ObjectType_file: objRestrictEditAndDuplicate,
model.ObjectType_set: objRestrictEditAndPublish,
model.ObjectType_collection: objRestrictEditAndPublish,
model.ObjectType_objectType: objRestrictEditAndPublish,
model.ObjectType_relation: objRestrictEditAndPublish,
model.ObjectType_file: objRestrictEditPublishAndDuplicate,
model.ObjectType_dashboard: {
model.Restrictions_Details,
model.Restrictions_Relations,
Expand All @@ -80,14 +85,14 @@ var (
},

model.ObjectType_bookmark: {},
model.ObjectType_relationOption: objRestrictEdit,
model.ObjectType_relationOption: objRestrictEditAndPublish,
model.ObjectType_relationOptionsList: {
model.Restrictions_Template,
},
model.ObjectType_participant: objRestrictAll,
model.ObjectType_chat: objRestrictEditAndDuplicate,
model.ObjectType_chatDerived: objRestrictEditAndDuplicate,
model.ObjectType_tag: objRestrictEdit,
model.ObjectType_chat: objRestrictEditPublishAndDuplicate,
model.ObjectType_chatDerived: objRestrictEditPublishAndDuplicate,
model.ObjectType_tag: objRestrictEditAndPublish,
}

objectRestrictionsBySBType = map[smartblock.SmartBlockType]ObjectRestrictions{
Expand All @@ -107,6 +112,7 @@ var (
model.Restrictions_TypeChange,
model.Restrictions_Template,
model.Restrictions_Duplicate,
model.Restrictions_Publish,
},
smartblock.SmartBlockTypeWorkspace: {
model.Restrictions_Blocks,
Expand All @@ -116,18 +122,20 @@ var (
model.Restrictions_TypeChange,
model.Restrictions_Template,
model.Restrictions_Duplicate,
model.Restrictions_Publish,
},
smartblock.SmartBlockTypeFileObject: objRestrictEditAndDuplicate,
smartblock.SmartBlockTypeFileObject: objRestrictEditPublishAndDuplicate,
smartblock.SmartBlockTypeArchive: objRestrictAll,
smartblock.SmartBlockTypeBundledRelation: objRestrictAll,
smartblock.SmartBlockTypeSubObject: objRestrictEdit,
smartblock.SmartBlockTypeObjectType: objRestrictEdit,
smartblock.SmartBlockTypeRelation: objRestrictEdit,
smartblock.SmartBlockTypeSubObject: objRestrictEditAndPublish,
smartblock.SmartBlockTypeObjectType: objRestrictEditAndPublish,
smartblock.SmartBlockTypeRelation: objRestrictEditAndPublish,
smartblock.SmartBlockTypeBundledObjectType: objRestrictAll,
smartblock.SmartBlockTypeBundledTemplate: objRestrictAll,
smartblock.SmartBlockTypeTemplate: {
model.Restrictions_TypeChange,
model.Restrictions_Template,
model.Restrictions_Publish,
},
smartblock.SmartBlockTypeWidget: {
model.Restrictions_Relations,
Expand All @@ -137,15 +145,16 @@ var (
model.Restrictions_TypeChange,
model.Restrictions_Template,
model.Restrictions_Duplicate,
model.Restrictions_Publish,
},
smartblock.SmartBlockTypeMissingObject: objRestrictAll,
smartblock.SmartBlockTypeDate: objRestrictAll,
smartblock.SmartBlockTypeAccountOld: {
model.Restrictions_Template,
},
smartblock.SmartBlockTypeParticipant: objRestrictAll,
smartblock.SmartBlockTypeChatObject: objRestrictEditAndDuplicate,
smartblock.SmartBlockTypeChatDerivedObject: objRestrictEditAndDuplicate,
smartblock.SmartBlockTypeChatObject: objRestrictEditPublishAndDuplicate,
smartblock.SmartBlockTypeChatDerivedObject: objRestrictEditPublishAndDuplicate,
}
)

Expand Down
6 changes: 3 additions & 3 deletions core/block/restriction/object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func TestService_ObjectRestrictionsById(t *testing.T) {

t.Run("sets and collections should have edit restrictions", func(t *testing.T) {
collection := givenRestrictionHolder(coresb.SmartBlockTypePage, bundle.TypeKeyCollection)
assert.ErrorIs(t, rs.GetRestrictions(collection).Object.Check(objRestrictEdit...), ErrRestricted)
assert.ErrorIs(t, rs.GetRestrictions(collection).Object.Check(objRestrictEditAndPublish...), ErrRestricted)
set := givenRestrictionHolder(coresb.SmartBlockTypePage, bundle.TypeKeySet)
assert.ErrorIs(t, rs.GetRestrictions(set).Object.Check(objRestrictEdit...), ErrRestricted)
assert.ErrorIs(t, rs.GetRestrictions(set).Object.Check(objRestrictEditAndPublish...), ErrRestricted)
})

t.Run("plain pages should not have any restrictions", func(t *testing.T) {
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestService_ObjectRestrictionsById(t *testing.T) {

t.Run("chat should have edit and duplication restrictions", func(t *testing.T) {
assert.ErrorIs(t, rs.GetRestrictions(givenRestrictionHolder(coresb.SmartBlockTypeChatObject, bundle.TypeKeyChat)).Object.Check(
objRestrictEditAndDuplicate...,
objRestrictEditPublishAndDuplicate...,
), ErrRestricted)
})
}
Expand Down
2 changes: 1 addition & 1 deletion core/date/date_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestBuildDetailsFromTimestamp(t *testing.T) {
assert.Zero(t, tt.Hour())
assert.Zero(t, tt.Minute())
assert.Zero(t, tt.Second())
assert.Len(t, details.GetInt64List(bundle.RelationKeyRestrictions), 8)
assert.Len(t, details.GetInt64List(bundle.RelationKeyRestrictions), 9)
})
}
}
Loading
Loading