Mayel de Borniol 2023-07-03 18:15:50 +01:00
parent cbdd229bfa
commit d306439411
7 changed files with 54 additions and 16 deletions

View file

@ -27,7 +27,7 @@ $ cd bonfire
Bonfire is a flexible platform that powers a variety of social networks. The first thing you have to choose is which app (or "flavour") you want to hack on:
- `classic` ("Bonfire Social", a toot-based social network that interoperates with the fediverse)
- `classic` ("Bonfire Social", a basic social network that interoperates with the fediverse)
- `community` (for groups and communities)
- `cooperation` (for building cooperative economic networks)

View file

@ -53,7 +53,6 @@ config :activity_pub, ActivityPub.Web.Endpoint,
]
config :activity_pub, :json_contexts, %{
"Hashtag" => "as:Hashtag",
"ValueFlows" => "https://w3id.org/valueflows#",
"om2" => "http://www.ontology-of-units-of-measure.org/resource/om-2/"
}

View file

@ -159,11 +159,11 @@ alias Bonfire.Data.Identity.Named
alias Bonfire.Data.Identity.Self
alias Bonfire.Data.Identity.Settings
alias Bonfire.Data.Identity.User
alias Bonfire.Data.Identity.Alias
alias Bonfire.Data.Social.Activity
alias Bonfire.Data.Social.APActivity
alias Bonfire.Data.Social.Article
alias Bonfire.Data.Social.Block
alias Bonfire.Data.Social.Bookmark
alias Bonfire.Data.Social.Boost
alias Bonfire.Data.Social.Created
@ -235,6 +235,7 @@ common_assocs = %{
tree: quote(do: has_one(:tree, unquote(Tree), unquote(mixin_updatable))),
# Information that allows the system to identify special system-managed ACLS.
stereotyped: quote(do: has_one(:stereotyped, unquote(Stereotyped), unquote(mixin))),
settings: quote(do: has_one(:settings, unquote(Settings), foreign_key: :id)),
### Multimixins
@ -314,7 +315,7 @@ edges =
:feed_publishes
])
# first up, pointers could have all the mixins we're using. TODO
# first up, Pointer could have all the mixins we're using
pointer_mixins =
common.([
@ -331,7 +332,8 @@ pointer_mixins =
:profile,
:replied,
:tree,
:stereotyped
:stereotyped,
:settings
])
config :pointers, Pointer,
@ -493,11 +495,29 @@ config :bonfire_data_identity, Character,
code:
(quote do
@follow_ulid "70110WTHE1EADER1EADER1EADE"
@alias_ulid "7NA11ASA1S0KN0WNASFACESWAP"
# mixins
unquote_splicing(common.([:actor, :peered, :profile, :tree]))
has_one(:user, unquote(User), unquote(mixin))
has_one(:feed, unquote(Feed), unquote(mixin))
# TODO? link the Edge assocs directly to the subject or object instead of the Edge
# aliases I added
has_many(:aliases, unquote(Edge),
foreign_key: :subject_id,
references: :id,
where: [table_id: @alias_ulid]
)
# aliases others add of me
has_many(:aliased, unquote(Edge),
foreign_key: :object_id,
references: :id,
where: [table_id: @alias_ulid]
)
has_many(:followers, unquote(Edge),
foreign_key: :object_id,
references: :id,
@ -539,12 +559,11 @@ config :bonfire_data_identity, User,
@boost_ulid "300STANN0VNCERESHARESH0VTS"
@follow_ulid "70110WTHE1EADER1EADER1EADE"
# mixins
unquote_splicing(common.([:actor, :character, :created, :peered, :profile]))
unquote_splicing(common.([:actor, :character, :created, :peered, :profile, :settings]))
has_one(:accounted, unquote(Accounted), foreign_key: :id)
has_one(:instance_admin, unquote(InstanceAdmin), foreign_key: :id, on_replace: :update)
has_one(:self, unquote(Self), foreign_key: :id)
has_one(:shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id)
has_one(:settings, unquote(Settings), foreign_key: :id)
# multimixins
unquote_splicing(common.([:controlled]))
@ -593,6 +612,12 @@ config :bonfire_data_identity, User,
config :bonfire_data_identity, Named, []
config :bonfire_data_identity, ExtraInfo, []
config :bonfire_data_identity, Alias,
code:
(quote do
(unquote_splicing(edges))
end)
### bonfire_data_social
config :bonfire_data_social, Activity,
@ -706,12 +731,6 @@ config :bonfire_data_social, Follow,
# belongs_to: [followed_character: {Character, foreign_key: :followed_id, define_field: false}],
# belongs_to: [followed_profile: {Profile, foreign_key: :followed_id, define_field: false}]
config :bonfire_data_social, Block,
code:
(quote do
(unquote_splicing(edges))
end)
config :bonfire_data_social, Boost,
code:
(quote do
@ -1025,14 +1044,15 @@ config :bonfire_classify, Category,
(quote do
# mixins
# TODO :caretaker
unquote_splicing(common.([:activity, :created, :actor, :peered, :profile, :character]))
unquote_splicing(
common.([:activity, :created, :actor, :peered, :profile, :character, :settings])
)
# multimixins
unquote_splicing(common.([:controlled, :feed_publishes]))
has_one(:creator, through: [:created, :creator])
has_one(:settings, unquote(Settings), foreign_key: :id)
# add references of tagged objects to any Category
many_to_many(:tags, unquote(Pointer),
join_through: unquote(Tagged),

View file

@ -70,3 +70,6 @@ bonfire_encrypt = "https://github.com/bonfire-networks/bonfire_encrypt#main"
# ex_doc = "https://github.com/elixir-lang/ex_doc#main"
paper_trail = "https://github.com/bonfire-networks/paper_trail"
# source_inspector = "https://github.com/tmbb/source_inspector"

View file

@ -147,3 +147,5 @@ config :versioce, :changelog,
fixed: ["Bug"],
security: ["Security", "Safety"]
}
config :source_inspector, :enabled, true

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Repo.Migrations.Alias do
@moduledoc false
use Ecto.Migration
require Bonfire.Data.Identity.Alias.Migration
def up do
Bonfire.Data.Identity.Alias.Migration.migrate_alias()
end
def down do
Bonfire.Data.Identity.Alias.Migration.migrate_alias()
end
end

View file

@ -231,6 +231,7 @@
"sleeplocks": {:hex, :sleeplocks, "1.1.2", "d45aa1c5513da48c888715e3381211c859af34bee9b8290490e10c90bb6ff0ca", [:rebar3], [], "hexpm", "9fe5d048c5b781d6305c1a3a0f40bb3dfc06f49bf40571f3d2d0c57eaa7f59a5"},
"sobelow": {:hex, :sobelow, "0.12.2", "45f4d500e09f95fdb5a7b94c2838d6b26625828751d9f1127174055a78542cf5", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "2f0b617dce551db651145662b84c8da4f158e7abe049a76daaaae2282df01c5d"},
"solid": {:hex, :solid, "0.14.1", "61b454dc7e7bf8a56926e805a0d047f817a993c28af71c9b79b840482da1ba5a", [:mix], [{:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5fda2b9176d7a71f52cca7f694d8ca75aed3f1b5b76dd175ada30b2756f96bae"},
"source_inspector": {:git, "https://github.com/tmbb/source_inspector", "6ab0e1f403d52e823e3ff243021756485d49ff9a", []},
"sourceror": {:hex, :sourceror, "0.12.3", "a2ad3a1a4554b486d8a113ae7adad5646f938cad99bf8bfcef26dc0c88e8fade", [:mix], [], "hexpm", "4d4e78010ca046524e8194ffc4683422f34a96f6b82901abbb45acc79ace0316"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
"statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"},