total rebase
[anni] / lib / pleroma / constants.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Constants do
6   use Const
7
8   const(as_public, do: "https://www.w3.org/ns/activitystreams#Public")
9
10   const(object_internal_fields,
11     do: [
12       "reactions",
13       "reaction_count",
14       "likes",
15       "like_count",
16       "announcements",
17       "announcement_count",
18       "emoji",
19       "context_id",
20       "deleted_activity_id",
21       "pleroma_internal",
22       "generator"
23     ]
24   )
25
26   const(static_only_files,
27     do:
28       ~w(index.html robots.txt static static-fe finmoji emoji packs sounds images instance sw.js sw-pleroma.js favicon.png schemas doc embed.js embed.css)
29   )
30
31   const(status_updatable_fields,
32     do: [
33       "source",
34       "tag",
35       "updated",
36       "emoji",
37       "content",
38       "summary",
39       "sensitive",
40       "attachment",
41       "generator"
42     ]
43   )
44
45   const(status_object_types,
46     do: [
47       "Note",
48       "Question",
49       "Audio",
50       "Video",
51       "Event",
52       "Article",
53       "Page"
54     ]
55   )
56
57   const(updatable_object_types,
58     do: [
59       "Note",
60       "Question",
61       "Audio",
62       "Video",
63       "Event",
64       "Article",
65       "Page"
66     ]
67   )
68
69   const(actor_types,
70     do: [
71       "Application",
72       "Group",
73       "Organization",
74       "Person",
75       "Service"
76     ]
77   )
78
79   const(allowed_user_actor_types,
80     do: [
81       "Person",
82       "Service",
83       "Group"
84     ]
85   )
86
87   # basic regex, just there to weed out potential mistakes
88   # https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
89   const(mime_regex,
90     do: ~r/^[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+\/[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+(; .*)?$/
91   )
92
93   const(upload_object_types, do: ["Document", "Image"])
94
95   const(activity_json_canonical_mime_type,
96     do: "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""
97   )
98
99   const(activity_json_mime_types,
100     do: [
101       "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
102       "application/activity+json"
103     ]
104   )
105
106   const(public_streams,
107     do: ["public", "public:local", "public:media", "public:local:media"]
108   )
109 end