This commit is contained in:
Mayel de Borniol 2021-11-19 11:21:08 +13:00
parent 489726781e
commit 3157da7b2e
132 changed files with 2954 additions and 152 deletions

3
.gitignore vendored
View file

@ -1,5 +1,6 @@
# The directory Mix will write compiled artifacts to.
/_build/
_build
# If you run "mix test --cover", coverage assets end up here.
/cover/
@ -51,6 +52,7 @@ flavours/*/config/dev/
flavours/*/config/prod/
/config
priv/seed_data
assets/static/data
# user-local overrides for mess
deps.path
@ -82,3 +84,4 @@ assets/yarn.lock
flavours/cooperation/cooperation
flavours/cooperation/classic
flavours/cooperation/haha
.DS_Store

View file

@ -1 +0,0 @@
../../classic/config/activity_pub.exs

View file

@ -0,0 +1,43 @@
import Config
config :activity_pub, :adapter, Bonfire.Federate.ActivityPub.Adapter
config :activity_pub, :repo, Bonfire.Repo
config :nodeinfo, :adapter, Bonfire.Federate.ActivityPub.NodeinfoAdapter
config :activity_pub, :mrf_simple,
media_removal: [],
media_nsfw: [],
report_removal: [],
accept: [],
avatar_removal: [],
banner_removal: []
config :activity_pub, :instance,
hostname: "localhost",
federation_publisher_modules: [ActivityPubWeb.Publisher],
federation_reachability_timeout_days: 7,
federating: true,
rewrite_policy: [],
handle_unknown_activities: true
config :activity_pub, :http,
proxy_url: nil,
send_user_agent: true,
adapter: [
ssl_options: [
# Workaround for remote server certificate chain issues
partial_chain: &:hackney_connect.partial_chain/1,
# We don't support TLS v1.3 yet
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
]
]
config :activity_pub, ActivityPubWeb.Endpoint,
render_errors: [view: ActivityPubWeb.ErrorView, accepts: ~w(json), layout: false]
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

@ -1 +0,0 @@
../../classic/config/activity_pub_test.exs

View file

@ -0,0 +1,31 @@
import Config
config :activity_pub, ActivityPub.TestRepo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
password: System.get_env("POSTGRES_PASSWORD", "postgres"),
database: "bonfire_test#{System.get_env("MIX_TEST_PARTITION")}",
hostname: System.get_env("POSTGRES_HOST") || "localhost",
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 60
config :activity_pub, ActivityPubWeb.Endpoint,
http: [port: 4002],
server: false
config :activity_pub, :adapter, Bonfire.Federate.ActivityPub.Adapter
config :activity_pub, :repo, Bonfire.Repo
config :activity_pub, ecto_repos: [Bonfire.Repo]
config :activity_pub, Oban,
repo: Bonfire.Repo,
queues: false
config :activity_pub, :instance, federating: false
config :tesla, adapter: Tesla.Mock
# Print only warnings and errors during test
config :logger, level: :warn

View file

@ -1 +0,0 @@
../../classic/config/bonfire_api_graphql.exs

View file

@ -0,0 +1,9 @@
import Config
schema = Bonfire.GraphQL.Schema
config :bonfire_api_graphql,
graphql_schema_module: schema
config :absinthe,
schema: schema

View file

@ -1 +0,0 @@
../../classic/config/bonfire_boundaries.exs

View file

@ -0,0 +1,31 @@
import Config
config :bonfire_boundaries,
enabled: true
config :bonfire,
verbs: %{
read: "0EAD1NGSVTTER1YFVNDAMENTA1",
see: "0BSERV1NG11ST1NGSEX1STENCE",
create: "4REATE0RP0STBRANDNEW0BJECT",
edit: "4HANG1NGVA1VES0FPR0PERT1ES",
delete: "4AKESTVFFG0AWAYPERMANENT1Y",
follow: "20SVBSCR1BET0THE0VTPVT0F1T",
like: "11KES1ND1CATEAM11DAPPR0VA1",
boost: "300ST0R0RANN0VCEANACT1V1TY",
flag: "71AGSPAM0RVNACCEPTAB1E1TEM",
mention: "0EFERENC1NGTH1NGSE1SEWHERE",
tag: "4ATEG0R1S1NGNGR0VP1NGSTVFF",
},
default_circles: %{
guest: "0AND0MSTRANGERS0FF1NTERNET",
local: "3SERSFR0MY0VR10CA11NSTANCE",
activity_pub: "7EDERATEDW1THANACT1V1TYPVB",
admin: "2DM1NRESP0NS1B1E0F1NSTANCE"
},
circle_names: %{
guest: "Public",
local: "Local Users",
activity_pub: "Federate for Remote Users",
admin: "Instance Admins"
}

View file

@ -1 +0,0 @@
../../classic/config/bonfire_classify.exs

View file

@ -0,0 +1,14 @@
import Config
config :bonfire_classify,
templates_path: "lib"
config :bonfire_classify, Bonfire.Classify.Category,
# for categories to be follow-able and federate activities
has_one: [character: {Bonfire.Data.Identity.Character, references: :id, foreign_key: :id}],
has_one: [actor: {Bonfire.Data.ActivityPub.Actor, references: :id, foreign_key: :id}],
has_one: [follow_count: {Bonfire.Data.Social.FollowCount, references: :id, foreign_key: :id}],
# for likeability
has_one: [like_count: {Bonfire.Data.Social.LikeCount, references: :id, foreign_key: :id}],
# name/description
has_one: [profile: {Bonfire.Data.Social.Profile, references: :id, foreign_key: :id}]

View file

@ -1 +0,0 @@
../../classic/config/bonfire_common.exs

View file

@ -0,0 +1,4 @@
import Config
config :bonfire_common,
otp_app: :bonfire

View file

@ -1 +0,0 @@
../../classic/config/bonfire_data.exs

View file

@ -0,0 +1,378 @@
import Config
#### Base configuration
# Choose password hashing backend
# Note that this corresponds with our dependencies in mix.exs
hasher = if config_env() in [:dev, :test], do: Pbkdf2, else: Argon2
config :bonfire_data_identity, Bonfire.Data.Identity.Credential,
hasher_module: hasher
#### Sentinel Data Services
# Search these apps/extensions for Pointable ecto schema definitions to index
pointable_schema_extensions = [
:bonfire_data_access_control,
:bonfire_data_activity_pub,
:bonfire_data_identity,
:bonfire_data_social,
:bonfire,
:bonfire_quantify,
:bonfire_geolocate,
:bonfire_valueflows,
:bonfire_tag,
:bonfire_classify,
:bonfire_data_shared_users,
:bonfire_files
]
config :pointers, :search_path, pointable_schema_extensions
# Search these apps/extensions for context or queries modules to index (i.e. they contain modules with a queries_module/0 or context_modules/0 function)
context_and_queries_extensions = pointable_schema_extensions ++ [
:bonfire_common,
:bonfire_me,
:bonfire_social,
:bonfire_valueflows
]
config :bonfire, :query_modules_search_path, context_and_queries_extensions
config :bonfire, :context_modules_search_path, context_and_queries_extensions
# Search these apps/extensions for Verbs to index (i.e. they contain modules with a declare_verbs/0 function)
config :bonfire_data_access_control,
search_path: [
# :bonfire_me,
:bonfire_boundaries,
# :bonfire_social,
# :bonfire,
]
#### Alias modules for readability
alias Pointers.{Pointer, Table}
alias Bonfire.Data.AccessControl.{
Access, Acl, Controlled, InstanceAdmin, Grant, Interact, Verb
}
alias Bonfire.Data.ActivityPub.{Actor, Peer, Peered}
alias Bonfire.Data.Identity.{
Account, Accounted, Caretaker, Character, Credential, Email, Self, User, Named
}
alias Bonfire.Data.Social.{
Activity, Article, Block, Bookmark, Circle, Created, Encircle, Feed, FeedPublish, Inbox, Message, Follow, FollowCount, Boost, BoostCount, Like, LikeCount, Flag, FlagCount, Mention, Post, PostContent, Profile, Replied
}
#### Flexto Stitching
## WARNING: This is the flaky magic bit. We use configuration to
## compile extra stuff into modules. If you add new fields or
## relations to ecto models in a dependency, you must recompile that
## dependency for it to show up! You will probably find you need to
## `rm -Rf _build/*/lib/bonfire_data_*` a lot.
## Note: This does not apply to configuration for
## `Pointers.Changesets`, which is read at runtime, not compile time
# first up, pointers could have all the mixins we're using. TODO
config :pointers, Pointer,
has_one: [controlled: {Controlled, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # needs ON clause
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [character: {Character, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
# add references of tags to any tagged Pointer
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
unique: true,
join_keys: [pointer_id: :id, tag_id: :id],
on_replace: :delete
}
]
config :pointers, Table, []
# now let's weave everything else together for convenience
# bonfire_data_access_control
config :bonfire_data_access_control, Access,
has_one: [named: {Named, foreign_key: :id}],
has_one: [caretaker: {Caretaker, foreign_key: :id}]
config :bonfire_data_access_control, Acl,
has_one: [named: {Named, foreign_key: :id}],
has_one: [caretaker: {Caretaker, foreign_key: :id}]
config :bonfire_data_access_control, Controlled, []
config :bonfire_data_access_control, Grant,
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_circle: {Circle, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_named: {Named, foreign_key: :subject_id, define_field: false}]
config :bonfire_data_access_control, Interact, []
config :bonfire_data_access_control, Verb, []
# bonfire_data_activity_pub
config :bonfire_data_activity_pub, Actor,
belongs_to: [character: {Character, foreign_key: :id, define_field: false}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
config :bonfire_data_activity_pub, Peer, []
config :bonfire_data_activity_pub, Peered, []
# bonfire_data_identity
config :bonfire_data_identity, Account,
has_one: [credential: {Credential, foreign_key: :id}],
has_one: [email: {Email, foreign_key: :id}],
has_one: [inbox: {Inbox, foreign_key: :id}],
many_to_many: [users: {User, join_through: "bonfire_data_identity_accounted", join_keys: [account_id: :id, id: :id]}],
many_to_many: [shared_users: {User, join_through: "bonfire_data_shared_user_accounts", join_keys: [account_id: :id, shared_user_id: :id]}]
config :bonfire_data_identity, Accounted,
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
config :bonfire_data_identity, Caretaker, []
config :bonfire_data_identity, Character,
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [user: {User, foreign_key: :id}],
has_one: [feed: {Feed, foreign_key: :id}],
has_one: [inbox: {Inbox, foreign_key: :id}],
has_many: [feed_publishes: {FeedPublish, references: :id, foreign_key: :feed_id}],
has_many: [followers: {Follow, foreign_key: :following_id, references: :id}],
has_many: [followings: {Follow, foreign_key: :follower_id, references: :id}],
has_one: [follow_count: {FollowCount, foreign_key: :id}]
config :bonfire_data_identity, Credential,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
config :bonfire_data_identity, Email,
must_confirm: true,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
config :bonfire_data_identity, Self, []
config :bonfire_data_identity, User,
has_one: [accounted: {Accounted, foreign_key: :id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [character: {Character, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
has_one: [instance_admin: {InstanceAdmin, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liker_id, references: :id}],
has_one: [self: {Self, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_many: [encircles: {Encircle, foreign_key: :subject_id}],
has_one: [shared_user: {Bonfire.Data.SharedUser, foreign_key: :id}],
many_to_many: [caretaker_accounts: {Account, join_through: "bonfire_data_shared_user_accounts", join_keys: [shared_user_id: :id, account_id: :id]}]
# has_one: [geolocation: {Bonfire.Geolocate.Geolocation}]
# bonfire_data_social
config :bonfire_data_social, Activity,
belongs_to: [subject_user: {User, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [object_peered: {Peered, foreign_key: :object_id, define_field: false}],
belongs_to: [object_post: {Post, foreign_key: :object_id, define_field: false}],
# belongs_to: [object_post_content: {PostContent, foreign_key: :object_id, define_field: false}],
belongs_to: [object_message: {Message, foreign_key: :object_id, define_field: false}],
has_one: [boost_count: {BoostCount, foreign_key: :id, references: :object_id}],
has_one: [like_count: {LikeCount, foreign_key: :id, references: :object_id}],
has_many: [boosts: {Boost, foreign_key: :boosted_id, references: :object_id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_boost: {Boost, foreign_key: :boosted_id, references: :object_id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :object_id}],
has_one: [replied: {Replied, foreign_key: :id, references: :object_id}],
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_one: [object_created: {Created, foreign_key: :id, references: :object_id}],
# has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
# has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
# has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :object_id}],
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
unique: true,
join_keys: [pointer_id: :object_id, tag_id: :id],
on_replace: :delete
}
]
config :bonfire_data_social, Circle,
has_one: [caretaker: {Caretaker, foreign_key: :id}],
has_one: [named: {Named, foreign_key: :id}]
# has_many: [encircles: {Encircle, foreign_key: :circle_id}]
config :bonfire_data_social, Encircle,
belongs_to: [subject_user: {User, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}]
config :bonfire_data_social, Feed,
belongs_to: [character: {Character, foreign_key: :id, define_field: false}],
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
config :bonfire_data_social, FeedPublish, []
config :bonfire_data_social, Follow,
belongs_to: [follower_character: {Character, foreign_key: :follower_id, define_field: false}],
belongs_to: [follower_profile: {Profile, foreign_key: :follower_id, define_field: false}],
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, FollowCount, []
config :bonfire_data_social, Block, []
config :bonfire_data_social, Like,
has_one: [activity: {Activity, foreign_key: :object_id, references: :liked_id}] # requires an ON clause
config :bonfire_data_social, LikeCount, []
config :bonfire_data_social, Bookmark, []
config :bonfire_data_social, Message,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # requires an ON clause
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
has_one: [controlled: {Controlled, foreign_key: :id}]
config :bonfire_data_social, Mention, []
config :bonfire_data_social, Named, []
config :bonfire_data_social, Post,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
# has_one: [creator_user: {[through: [:created, :creator_user]]}],
# has_one: [creator_character: {[through: [:created, :creator_character]]}],
# has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # requires an ON clause
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_boost: {Boost, foreign_key: :boosted_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_one: [controlled: {Controlled, foreign_key: :id}]
config :bonfire_data_social, PostContent, []
config :bonfire_data_social, Replied,
belongs_to: [post: {Post, foreign_key: :id, define_field: false}],
belongs_to: [post_content: {PostContent, foreign_key: :id, define_field: false}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}],
has_one: [reply_to_post: {Post, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_post_content: {PostContent, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_created: {Created, foreign_key: :id, references: :reply_to_id}],
# has_one: [reply_to_creator_user: {[through: [:reply_to_created, :creator_user]]}],
# has_one: [reply_to_creator_character: {[through: [:reply_to_created, :creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:reply_to_created, :creator_profile]]}],
# has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id, references: :id}],
has_many: [thread_replies: {Replied, foreign_key: :thread_id, references: :id}],
has_one: [thread_post: {Post, foreign_key: :id, references: :thread_id}],
has_one: [thread_post_content: {PostContent, foreign_key: :id, references: :thread_id}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :id}]
config :bonfire_data_social, Created,
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
belongs_to: [creator_user: {User, foreign_key: :creator_id, define_field: false}],
belongs_to: [creator_character: {Character, foreign_key: :creator_id, define_field: false}],
belongs_to: [creator_profile: {Profile, foreign_key: :creator_id, define_field: false}]
config :bonfire_data_social, Profile,
belongs_to: [user: {User, foreign_key: :id, define_field: false}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :id}]
######### other extensions
# optional mixin relations for tags that are characters (eg Category) or any other type of objects
config :bonfire_tag, Bonfire.Tag,
# for objects that are follow-able and can federate activities
has_one: [character: {Bonfire.Data.Identity.Character, references: :id, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
# has_one: [actor: {Bonfire.Data.ActivityPub.Actor, references: :id, foreign_key: :id}],
has_one: [follow_count: {Bonfire.Data.Social.FollowCount, references: :id, foreign_key: :id}],
# for likeable objects
has_one: [like_count: {Bonfire.Data.Social.LikeCount, references: :id, foreign_key: :id}],
# name/description
has_one: [profile: {Bonfire.Data.Social.Profile, references: :id, foreign_key: :id}],
# for taxonomy categories/topics
has_one: [category: {Bonfire.Classify.Category, references: :id, foreign_key: :id}],
# for locations
has_one: [geolocation: {Bonfire.Geolocate.Geolocation, references: :id, foreign_key: :id}]
# add references of tagged objects to any Category
config :bonfire_classify, Bonfire.Classify.Category,
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
unique: true,
join_keys: [tag_id: :id, pointer_id: :id],
on_replace: :delete
}
]
# add references of tagged objects to any Geolocation
config :bonfire_geolocate, Bonfire.Geolocate.Geolocation,
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
unique: true,
join_keys: [tag_id: :id, pointer_id: :id],
on_replace: :delete
}
]
config :bonfire_files, Bonfire.Files.Media,
field: [
url: {:string, virtual: true}
]
config :bonfire_valueflows, ValueFlows.Planning.Intent,
has_one: [like_count: {LikeCount, foreign_key: :id}]

View file

@ -1 +0,0 @@
../../classic/config/bonfire_fail.exs

View file

@ -0,0 +1,23 @@
import Config
config :bonfire_fail,
common_errors: %{
unauthorized: {403, "You do not have permission to %s."},
not_found: {404, "%s Not Found."},
unauthenticated: {401, "You need to log in first."},
needs_login: {401, "You need to log in first."},
invalid_credentials: {401, "We couldn't find an account with the details you provided."},
deletion_error: {400, "Could not delete:"},
bad_header: {400, "Bad request: malformed header."},
no_access: {403, "This site is by invitation only."},
token_expired: {403, "This link or token has expired, please request a fresh one."},
already_claimed: {403, "This link or token was already used, please request a fresh one if necessary."},
token_not_found: {403, "This token was not found, please request a fresh one."},
user_disabled: {403, "This user account is disabled. Please contact the instance administrator."},
email_not_confirmed: {403, "Please confirm your email address first."},
unknown_resource: {400, "Unknown resource."},
invalid_argument: {400, "Invalid arguments passed."},
password_hash_missing: {401, "Reset your password to login."},
user_not_found: {404, "User not found."},
unknown: {500, "Something went wrong."}
}

View file

@ -1 +0,0 @@
../../classic/config/bonfire_federate_activitypub.exs

View file

@ -0,0 +1,25 @@
import Config
alias Bonfire.Federate.ActivityPub.Adapter
actor_types = ["Person", "Group", "Application", "Service", "Organization"]
config :bonfire,
federation_search_path: [
:bonfire_common,
:bonfire_me,
:bonfire_social,
:bonfire_valueflows,
:bonfire_classify,
:bonfire_geolocate,
:bonfire_quantify
],
log_federation: true, # enable/disable logging of federation logic
federation_fallback_module: Bonfire.Social.APActivities
config :bonfire, Adapter,
actor_types: actor_types
# config :bonfire, Bonfire.Instance,
# hostname: hostname,
# description: desc

View file

@ -1 +0,0 @@
../../classic/config/bonfire_files.exs

View file

@ -0,0 +1,48 @@
use Mix.Config
# where do you want to store files? supports local storage, s3-compatible services, and more
# see https://hexdocs.pm/waffle/Waffle.html#module-setup-a-storage-provider
config :waffle,
storage: Waffle.Storage.Local,
asset_host: "/" # or {:system, "ASSET_HOST"}
image_media_types = ["image/png", "image/jpeg", "image/gif", "image/svg+xml", "image/tiff"]
all_media_types = image_media_types ++ [
"text/plain",
# doc
"text/csv",
"application/pdf",
"application/rtf",
"application/msword",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.oasis.opendocument.presentation",
"application/vnd.oasis.opendocument.spreadsheet",
"application/vnd.oasis.opendocument.text",
"application/epub+zip",
# archives
"application/x-tar",
"application/x-bzip",
"application/x-bzip2",
"application/gzip",
"application/zip",
"application/rar",
"application/x-7z-compressed",
# audio
"audio/mpeg",
"audio/ogg",
"audio/wav",
"audio/webm",
"audio/opus",
# video
"video/mp4",
"video/mpeg",
"video/ogg",
"video/webm",
]
config :bonfire, Bonfire.Files.IconUploader, allowed_media_types: image_media_types
config :bonfire, Bonfire.Files.ImageUploader, allowed_media_types: image_media_types
config :bonfire, Bonfire.Files.DocumentUploader, allowed_media_types: all_media_types

View file

@ -1 +0,0 @@
../../classic/config/bonfire_geolocate.exs

View file

@ -0,0 +1,4 @@
import Config
config :bonfire_geolocate,
templates_path: "lib"

View file

@ -1 +0,0 @@
../../classic/config/bonfire_hooks.exs

View file

@ -0,0 +1,8 @@
import Config
# config :bonfire, :hooks,
# %{
# {Bonfire.Social.Posts, :publish} => %{
# after: {IO, :inspect}
# }
# }

View file

@ -1 +0,0 @@
../../classic/config/bonfire_mailer.exs

View file

@ -0,0 +1,10 @@
import Config
config :bonfire_mailer,
check_mx: true,
check_format: true
config :bonfire, Bonfire.Mailer,
# what service you want to use to send emails, from these: https://github.com/thoughtbot/bamboo#available-adapters
# we recommend leaving LocalAdapter (which is just a fallback which won't actually send emails) and setting the actual adapter in runtime.exs
adapter: Bamboo.LocalAdapter

View file

@ -1 +0,0 @@
../../classic/config/bonfire_me.exs

View file

@ -0,0 +1,13 @@
import Config
config :bonfire_me,
templates_path: "lib"
config :bonfire_me, Bonfire.Me.Identity.Mails,
confirm_email: [subject: "Confirm your email - Bonfire"],
forgot_password: [subject: "Reset your password - Bonfire"]
#### Pointer class configuration
config :bonfire_me, Bonfire.Me.Follows,
followable_types: [Bonfire.Data.Identity.User]

View file

@ -1 +0,0 @@
../../classic/config/bonfire_search.exs

View file

@ -0,0 +1,25 @@
import Config
config :bonfire_search,
disable_indexing: System.get_env("SEARCH_INDEXING_DISABLED", "false"),
adapter: Bonfire.Search.Meili,
instance: System.get_env("SEARCH_MEILI_INSTANCE", "http://search:7700"), # protocol, hostname and port
api_key: System.get_env("MEILI_MASTER_KEY", "make-sure-to-change-me") # secret key
# for use by API client
config :tesla, adapter: Tesla.Adapter.Hackney
config :phoenix, :format_encoders, json: Jason
config :phoenix, :json_library, Jason
config :http_signatures, adapter: ActivityPub.Signature
# Configures http settings, upstream proxy etc.
config :activity_pub, :http,
proxy_url: nil,
send_user_agent: true,
adapter: [
ssl_options: [
# Workaround for remote server certificate chain issues
partial_chain: &:hackney_connect.partial_chain/1,
# We don't support TLS v1.3 yet
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
]
]

View file

@ -1 +0,0 @@
../../classic/config/bonfire_social.exs

View file

@ -0,0 +1,4 @@
import Config
config :bonfire_social,
enabled: true

View file

@ -1 +0,0 @@
../../classic/config/bonfire_tag.exs

View file

@ -0,0 +1,4 @@
import Config
config :bonfire_tag,
templates_path: "lib"

View file

@ -1 +0,0 @@
../../classic/config/config.exs

View file

@ -0,0 +1,87 @@
import Config
default_flavour = "classic"
flavour = System.get_env("FLAVOUR", default_flavour)
flavour_path = System.get_env("FLAVOUR_PATH", "flavours/"<>flavour)
#### Basic configuration
# You probably won't want to touch these. You might override some in
# other config files.
config :bonfire,
otp_app: :bonfire,
env: config_env(),
flavour: flavour,
flavour_path: flavour_path,
app_name: System.get_env("APP_NAME", "Bonfire"),
repo_module: Bonfire.Repo,
web_module: Bonfire.Web,
endpoint_module: Bonfire.Web.Endpoint,
mailer_module: Bonfire.Mailer,
default_web_namespace: Bonfire.UI.Social.Web,
default_layout_module: Bonfire.UI.Social.Web.LayoutView,
graphql_schema_module: Bonfire.GraphQL.Schema,
user_schema: Bonfire.Data.Identity.User,
org_schema: Bonfire.Data.Identity.User,
home_page: Bonfire.Web.HomeLive,
localisation_path: "priv/localisation",
ap_base_path: System.get_env("AP_BASE_PATH", "/pub"),
signing_salt: "this-will-be-overriden-by-a-secure-string-in-runtime.exs",
encryption_salt: "this-will-be-overriden-by-a-secure-string-in-runtime.exs"
config :bonfire, Bonfire.Web.Endpoint,
url: [host: "localhost"],
http: [
port: String.to_integer(System.get_env("SERVER_PORT", "4000")), # this gets overriden in runtime.exs
transport_options: [socket_opts: [:inet6]]
],
render_errors: [view: Bonfire.UI.Social.Web.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: Bonfire.PubSub
config :phoenix, :json_library, Jason
config :bonfire, :ecto_repos, [Bonfire.Repo]
config :bonfire, Bonfire.Repo,
types: Bonfire.PostgresTypes,
priv: flavour_path <> "/repo"
# ecto query filtering
# config :query_elf, :id_types, [:id, :binary_id, Pointers.ULID]
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
config :bonfire, Oban,
repo: Bonfire.Repo,
plugins: [Oban.Plugins.Pruner],
queues: [
federator_incoming: 50,
federator_outgoing: 50,
ap_incoming: 15,
ap_publish: 15
]
config :mime, :types, %{
"application/activity+json" => ["activity+json"],
"application/jrd+json" => ["jrd+json"]
}
config :sentry,
dsn: "this-will-be-overriden-by-a-secure-string-in-runtime.exs",
environment_name: Mix.env,
included_environments: [:prod]
# include config for all used Bonfire extensions
for config <- "bonfire_*.exs" |> Path.expand(__DIR__) |> Path.wildcard() do
# IO.inspect(include_config: config)
import_config config
end
import_config "activity_pub.exs"
# finally, append/override config based on env, which will override any config set above (including from imported files)
import_config "#{config_env()}.exs"

View file

@ -1 +0,0 @@
../../classic/config/config_basics.exs

View file

@ -0,0 +1,3 @@
import Config
config :phoenix, :json_library, Jason

View file

@ -1 +0,0 @@
../../classic/config/dev.exs

View file

@ -0,0 +1,64 @@
import Config
config :bonfire, Bonfire.Repo,
database: System.get_env("POSTGRES_DB", "bonfire_dev"),
# show_sensitive_data_on_connection_error: true,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
path_dep_dirs =
Mess.deps([path: "deps.path"], [])
|> Enum.map(&(Keyword.fetch!(elem(&1, 1), :path) <> "/lib"))
config :phoenix_live_reload,
dirs: path_dep_dirs ++ ["lib/"] # watch the app's lib/ dir + the dep/lib/ dir of every locally-cloned dep
path_dep_patterns = path_dep_dirs |> Enum.map(&(String.slice(&1, 2..1000) <>".*ex")) # to include cloned code in patterns
path_dep_patterns = path_dep_patterns ++ path_dep_dirs |> Enum.map(&(String.slice(&1, 2..1000) <>".*sface")) # Surface views
# Watch static and templates for browser reloading.
config :bonfire, Bonfire.Web.Endpoint,
server: true,
debug_errors: true,
check_origin: false,
code_reloader: true,
watchers: [
pnpm: [
"watch.js",
cd: Path.expand("assets", File.cwd!())
],
pnpm: [
"watch.postcss",
cd: Path.expand("assets", File.cwd!())
],
# pnpm: [
# "watch.assets",
# cd: Path.expand("assets", File.cwd!())
# ]
],
live_reload: [
patterns: [
# ~r"^priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
# ~r"^priv/gettext/.*(po)$",
# ~r"^web/(live|views)/.*ex$",
# ~r"^lib/.*_live\.ex$",
# ~r".*leex$",
~r"lib/.*ex$",
~r".*sface$",
~r"priv/catalogue/.*(ex)$",
] ++ path_dep_patterns
]
# defp elixirc_paths(:dev), do: ["lib"] ++ catalogues()
config :logger, :console,
level: :debug,
# truncate: :infinity,
format: "[$level] $message\n" # Do not include metadata or timestamps
config :phoenix, :stacktrace_depth, 30
config :phoenix, :plug_init_mode, :runtime
config :exsync,
src_monitor: true,
extra_extensions: [".leex", ".js", ".css", ".sface"]

View file

@ -1 +0,0 @@
../../classic/config/prod.exs

View file

@ -0,0 +1,21 @@
import Config
# We include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix phx.digest` task,
# which you should run after static files are built and
# before starting your production server.
config :bonfire, Bonfire.Web.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json"
config :logger,
backends: [:console, Sentry.LoggerBackend]
# Do not print debug messages in production
config :logger, level: :info
config :bonfire, Bonfire.Web.Endpoint, server: true
config :bonfire, Bonfire.Repo,
priv: "priv/repo" # in releases migrations are not in a flavour-specific directory

View file

@ -1 +0,0 @@
../../classic/config/runtime.exs

View file

@ -0,0 +1,218 @@
# In this file, we load production configuration and secrets
# from environment variables. You can also hardcode secrets,
# although such is generally not recommended and you have to
# remember to add this file to your .gitignore.
import Config
host = System.get_env("HOSTNAME", "localhost")
server_port = String.to_integer(System.get_env("SERVER_PORT", "4000"))
public_port = String.to_integer(System.get_env("PUBLIC_PORT", "4000"))
System.get_env("DATABASE_URL") || System.get_env("POSTGRES_PASSWORD") || System.get_env("CI") ||
raise """
Environment variables for database are missing.
For example: DATABASE_URL=ecto://USER:PASS@HOST/DATABASE
You can also set POSTGRES_PASSWORD (required),
and POSTGRES_USER (default: postgres) and POSTGRES_HOST (default: localhost)
"""
if System.get_env("DATABASE_URL") do
config :bonfire, Bonfire.Repo,
url: System.get_env("DATABASE_URL")
else
config :bonfire, Bonfire.Repo,
# ssl: true,
username: System.get_env("POSTGRES_USER", "postgres"),
password: System.get_env("POSTGRES_PASSWORD", "postgres"),
hostname: System.get_env("POSTGRES_HOST", "localhost")
end
secret_key_base =
System.get_env("SECRET_KEY_BASE") ||System.get_env("CI") ||
raise """
environment variable SECRET_KEY_BASE is missing.
You can generate one by calling: mix phx.gen.secret
"""
signing_salt = System.get_env("SIGNING_SALT") || System.get_env("CI") ||
raise """
environment variable SIGNING_SALT is missing.
"""
encryption_salt = System.get_env("ENCRYPTION_SALT") || System.get_env("CI") ||
raise """
environment variable ENCRYPTION_SALT is missing.
"""
config :bonfire,
host: host,
app_name: System.get_env("APP_NAME", "Bonfire"),
ap_base_path: System.get_env("AP_BASE_PATH", "/pub"),
github_token: System.get_env("GITHUB_TOKEN"),
encryption_salt: encryption_salt,
signing_salt: signing_salt
config :bonfire, Bonfire.Web.Endpoint,
url: [
host: host,
port: public_port
],
http: [
port: server_port
],
secret_key_base: secret_key_base,
live_view: [signing_salt: signing_salt]
# start prod-only config
if config_env() == :prod do
config :bonfire, Bonfire.Repo,
# ssl: true,
database: System.get_env("POSTGRES_DB", "bonfire"),
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
log: String.to_atom(System.get_env("DB_QUERIES_LOG_LEVEL", "debug"))
config :sentry,
dsn: System.get_env("SENTRY_DSN")
if System.get_env("SENTRY_NAME") do
config :sentry, server_name: System.get_env("SENTRY_NAME")
end
end # prod only config
# start prod and dev only config
if config_env() != :test do
config :bonfire, Bonfire.Repo,
slow_query_ms: String.to_integer(System.get_env("SLOW_QUERY_MS", "100"))
# transactional emails
mail_blackhole = fn var ->
IO.puts(
"WARNING: The environment variable #{var} was not set or was set incorrectly, mail will NOT be sent."
)
config :bonfire, Bonfire.Mailer, adapter: Bamboo.LocalAdapter
end
mail_mailgun = fn ->
# API URI depends on whether you're registered with Mailgun in EU, US, etc (defaults to EU)
base_uri = System.get_env("MAIL_BASE_URI", "https://api.eu.mailgun.net/v3")
case System.get_env("MAIL_KEY") do
nil ->
mail_blackhole.("MAIL_KEY")
key ->
case System.get_env("MAIL_DOMAIN") do
nil ->
mail_blackhole.("MAIL_DOMAIN")
domain ->
case System.get_env("MAIL_FROM") do
nil ->
mail_blackhole.("MAIL_FROM")
from ->
IO.puts("NOTE: Transactional emails will be sent through Mailgun.")
config :bonfire, Bonfire.Mailer,
adapter: Bamboo.MailgunAdapter,
api_key: key,
base_uri: base_uri,
domain: domain,
reply_to: from
end
end
end
end
mail_smtp = fn ->
case System.get_env("MAIL_SERVER") do
nil ->
mail_blackhole.("MAIL_SERVER")
server ->
case System.get_env("MAIL_DOMAIN") do
nil ->
mail_blackhole.("MAIL_DOMAIN")
domain ->
case System.get_env("MAIL_USER") do
nil ->
mail_blackhole.("MAIL_USER")
user ->
case System.get_env("MAIL_PASSWORD") do
nil ->
mail_blackhole.("MAIL_PASSWORD")
password ->
case System.get_env("MAIL_FROM") do
nil ->
mail_blackhole.("MAIL_FROM")
from ->
IO.puts("NOTE: Transactional emails will be sent through SMTP.")
config :bonfire, Bonfire.Mailer,
adapter: Bamboo.SMTPAdapter,
server: server,
hostname: domain,
port: String.to_integer(System.get_env("MAIL_PORT", "587")),
username: user,
password: password,
tls: :always,
allowed_tls_versions: [:"tlsv1.2"],
ssl: false,
retries: 1,
auth: :always,
reply_to: from
end
end
end
end
end
end
case System.get_env("MAIL_BACKEND") do
"mailgun" -> mail_mailgun.()
"smtp" -> mail_smtp.()
_ -> mail_blackhole.("MAIL_BACKEND")
end
end
### copy-paste Bonfire extension configs that need to read env at runtime
## bonfire_search
config :bonfire_search,
disable_indexing: System.get_env("SEARCH_INDEXING_DISABLED", "false"),
instance: System.get_env("SEARCH_MEILI_INSTANCE", "http://localhost:7700"), # protocol, hostname and port
api_key: System.get_env("MEILI_MASTER_KEY", "make-sure-to-change-me") # secret key
## bonfire_livebook
if Code.ensure_loaded?(Livebook.Config) do
config :livebook, :root_path, Livebook.Config.root_path!("LIVEBOOK_ROOT_PATH")
if password = Livebook.Config.password!("LIVEBOOK_PASSWORD") do
config :livebook, authentication_mode: :password, password: password
else
config :livebook, authentication_mode: :token
config :livebook, token: System.get_env("LIVEBOOK_TOKEN", Livebook.Utils.random_id())
end
config :livebook,
:cookie,
Livebook.Config.cookie!("LIVEBOOK_COOKIE") || Livebook.Utils.random_cookie()
config :livebook,
:default_runtime,
Livebook.Config.default_runtime!("LIVEBOOK_DEFAULT_RUNTIME") ||
{Livebook.Runtime.Embedded, []}
end

View file

@ -1 +0,0 @@
../../classic/config/test.exs

View file

@ -0,0 +1,54 @@
import Config
## Import or set test configs for extensions
import_config "activity_pub_test.exs"
config :bonfire, Bonfire.Mailer, adapter: Bamboo.TestAdapter
config :bonfire_search,
disabled: true,
disable_indexing: true
## Other general test config
config :logger, level: :info
# config :logger, level: :notice
# Configure your database
db = "bonfire_test#{System.get_env("MIX_TEST_PARTITION")}"
#
# The MIX_TEST_PARTITION environment variable can be used
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :bonfire, Bonfire.Repo,
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 60,
# show_sensitive_data_on_connection_error: true,
database: db,
slow_query_ms: 500
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :bonfire, Bonfire.Web.Endpoint,
http: [port: 4002],
server: false
config :bonfire, Oban,
crontab: false,
plugins: false,
queues: false
config :pbkdf2_elixir, :rounds, 1
config :mix_test_interactive,
clear: true
config :paginator, ecto_repos: [Bonfire.Repo]
config :paginator, Paginator.Repo,
pool: Ecto.Adapters.SQL.Sandbox,
username: System.get_env("POSTGRES_USER", "postgres"),
password: System.get_env("POSTGRES_PASSWORD", "postgres"),
hostname: System.get_env("POSTGRES_HOST", "localhost"),
database: db

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200523081010_hello_world.exs

View file

@ -0,0 +1,12 @@
defmodule Bonfire.Repo.Migrations.HelloWorld do
use Ecto.Migration
def up do
execute "CREATE EXTENSION IF NOT EXISTS \"citext\""
end
def down do
execute "DROP EXTENSION IF EXISTS \"citext\""
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200523081012_init_pointers.exs

View file

@ -0,0 +1,12 @@
defmodule Bonfire.Repo.Migrations.InitPointers do
use Ecto.Migration
import Pointers.Migration
# import Pointers.ULID.Migration
def up do
init_pointers()
end
def down do
init_pointers()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200523081013_init_pointers_ulid.exs

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.InitPointersULID do
use Ecto.Migration
# import Pointers.Migration
import Pointers.ULID.Migration
def change do
init_pointers_ulid_extra()
# init_pointers()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200805090401_create_ap_tables.exs

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.CreateApTables do
use Ecto.Migration
def up do
ActivityPub.Migrations.up()
end
def down do
ActivityPub.Migrations.down()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200817072952_create_oban_tables.exs

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.CreateObanTables do
use Ecto.Migration
def up do
Oban.Migrations.up()
end
def down do
Oban.Migrations.down(version: 1)
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200818094943_import_ap.exs

View file

@ -0,0 +1,10 @@
defmodule Bonfire.Federate.ActivityPub.Repo.Migrations.ImportMe do
use Ecto.Migration
import Bonfire.Federate.ActivityPub.Migrations
# accounts & users
def up, do: migrate_activity_pub
def down, do: migrate_activity_pub
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200820094941_import_boundaries.exs

View file

@ -0,0 +1,9 @@
defmodule Bonfire.Boundaries.Repo.Migrations.ImportBoundaries do
use Ecto.Migration
import Bonfire.Boundaries.Migrations
def up, do: migrate_boundaries
def down, do: migrate_boundaries
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200828094943_add_files.exs

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Repo.Migrations.AddFiles do
use Ecto.Migration
import Bonfire.Files.Media.Migration
import Pointers.Migration
def up do
Bonfire.Files.Media.Migration.migrate_media()
end
def down do
Bonfire.Files.Media.Migration.migrate_media()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200828094944_import_me.exs

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Repo.Migrations.ImportMe do
use Ecto.Migration
import Bonfire.Me.Migrations
def up do
# accounts & users
migrate_me()
end
def down, do: migrate_me()
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200828094945_import_social.exs

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Social.Repo.Migrations.ImportSocial do
use Ecto.Migration
import Bonfire.Social.Migrations
import Pointers.Migration
def up do
migrate_social()
end
def down, do: migrate_social()
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200829004946_boundaries_fixtures.exs

View file

@ -0,0 +1,9 @@
defmodule Bonfire.Boundaries.Repo.Migrations.BoundariesFixtures do
use Ecto.Migration
import Bonfire.Boundaries.Fixtures
def up, do: Bonfire.Boundaries.Fixtures.insert()
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200924084501_tagged.exs

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Repo.Migrations.Tagged do
use Ecto.Migration
def up do
Bonfire.Tag.Migrations.up()
Bonfire.Tag.Migrations.tagged_up()
end
def down do
Bonfire.Tag.Migrations.up()
Bonfire.Tag.Migrations.tagged_down()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210201094944_import_replied.exs

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Repo.Migrations.ImportReplied do
use Ecto.Migration
import Bonfire.Data.Social.Replied.Migration
def up do
migrate_replied(:up)
migrate_functions()
end
def down, do: migrate_replied(:down)
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210302094944_import_boost.exs

View file

@ -0,0 +1,16 @@
defmodule Bonfire.Repo.Migrations.ImportBoost do
use Ecto.Migration
import Bonfire.Data.Social.Boost.Migration
import Bonfire.Data.Social.BoostCount.Migration
def up do
migrate_boost()
migrate_boost_count()
end
def down do
migrate_boost_count()
migrate_boost()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210302094945_import_flag.exs

View file

@ -0,0 +1,17 @@
defmodule Bonfire.Repo.Migrations.ImportFlag do
use Ecto.Migration
import Bonfire.Data.Social.Flag.Migration
import Bonfire.Data.Social.FlagCount.Migration
def up do
migrate_flag()
migrate_flag_count()
end
def down do
migrate_flag_count()
migrate_flag()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210302094946_import_inbox.exs

View file

@ -0,0 +1,9 @@
defmodule Bonfire.Repo.Migrations.ImportInbox do
use Ecto.Migration
import Bonfire.Data.Social.Inbox.Migration
def up, do: migrate_inbox()
def down, do: migrate_inbox()
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210401094942_count_functions.exs

View file

@ -0,0 +1,22 @@
defmodule Bonfire.Social.Repo.Migrations.CountFunctions do
use Ecto.Migration
require Bonfire.Data.Social.Replied.Migration
def up do
Bonfire.Data.Social.FollowCount.Migration.migrate_functions()
Bonfire.Data.Social.BoostCount.Migration.migrate_functions()
Bonfire.Data.Social.LikeCount.Migration.migrate_functions()
Bonfire.Data.Social.Replied.Migration.migrate_functions()
end
def down do
Bonfire.Data.Social.FollowCount.Migration.migrate_functions()
Bonfire.Data.Social.BoostCount.Migration.migrate_functions()
Bonfire.Data.Social.LikeCount.Migration.migrate_functions()
Bonfire.Data.Social.Replied.Migration.migrate_functions()
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210402105128_ap_test_table.exs

View file

@ -0,0 +1,15 @@
defmodule ActivityPub.Repo.Migrations.APTestTable do
use Ecto.Migration
def change do
# This table only exists for test purposes
create table("local_actor", primary_key: false) do
add :id, :uuid, primary_key: true
add :username, :citext
add :data, :map
add :local, :boolean
add :keys, :text
add :followers, {:array, :string}
end
end
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210407094946_message.exs

View file

@ -0,0 +1,9 @@
defmodule Bonfire.Repo.Migrations.Message do
use Ecto.Migration
import Bonfire.Data.Social.Message.Migration
def up, do: migrate_message()
def down, do: migrate_message()
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210410094945_profile_images.exs

View file

@ -0,0 +1,18 @@
defmodule Bonfire.Social.Repo.Migrations.ProfileImages do
use Ecto.Migration
import Pointers.Migration
def up do
drop_if_exists constraint "bonfire_data_social_profile", "bonfire_data_social_profile_icon_id_fkey"
drop_if_exists constraint "bonfire_data_social_profile", "bonfire_data_social_profile_image_id_fkey"
alter table("bonfire_data_social_profile") do
Ecto.Migration.add_if_not_exists :icon_id, strong_pointer(Bonfire.Files.Media)
Ecto.Migration.add_if_not_exists :image_id, strong_pointer(Bonfire.Files.Media)
end
end
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210412094946_fp.exs

View file

@ -0,0 +1,40 @@
defmodule Bonfire.Repo.Migrations.FP do
use Ecto.Migration
def up do
execute("create or replace function
column_exists(ptable text, pcolumn text, pschema text default 'public')
returns boolean
language sql stable strict
as $body$
-- does the requested table.column exist in schema?
select exists
( select null
from information_schema.columns
where table_name=ptable
and column_name=pcolumn
and table_schema=pschema
);
$body$;")
execute("CREATE OR REPLACE FUNCTION rename_column_if_exists(ptable TEXT, pcolumn TEXT, new_name TEXT)
RETURNS VOID AS $BODY$
BEGIN
-- Rename the column if it exists.
IF column_exists(ptable, pcolumn) THEN
EXECUTE FORMAT('ALTER TABLE IF EXISTS %I RENAME COLUMN %I TO %I;',
ptable, pcolumn, new_name);
END IF;
END$BODY$
LANGUAGE plpgsql VOLATILE;")
flush()
execute("SELECT rename_column_if_exists('bonfire_data_social_feed_publish', 'object_id', 'activity_id') ")
end
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210618094945_peered_uri.exs

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Social.Repo.Migrations.PeeredURI do
use Ecto.Migration
import Pointers.Migration
def up do
alter table("bonfire_data_activity_pub_peered") do
Ecto.Migration.add_if_not_exists :canonical_uri, :text, null: true
end
end
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210831134330_update_oban_jobs_table.exs

View file

@ -0,0 +1,7 @@
defmodule Bonfire.Repo.Migrations.UpdateObanJobsTable do
use Ecto.Migration
def up, do: Oban.Migrations.up()
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20210923093415_import_ap_activity.exs

View file

@ -0,0 +1,7 @@
defmodule Bonfire.Repo.Migrations.ImportApActivity do
use Ecto.Migration
import Bonfire.Data.Social.APActivity.Migration
def up(), do: migrate_apactivity()
def down(), do: migrate_apactivity()
end

View file

@ -1 +0,0 @@
../../cooperation/config/config_basics.exs

View file

@ -0,0 +1,3 @@
import Config
config :phoenix, :json_library, Jason

View file

@ -1 +0,0 @@
../../classic/config/hooks.js

View file

@ -0,0 +1,8 @@
let ExtensionHooks = {};
// TODO: make this more configurable? ie. don't import disabled extensions
// import { MyHooks } from "../../../deps/some_extension/assets/js/extension"
// Object.assign(ExtensionHooks, MyHooks)
export { ExtensionHooks }

View file

@ -1 +0,0 @@
../../../classic/repo/migrations/20200523081010_hello_world.exs

Some files were not shown because too many files have changed in this diff Show more