diff --git a/.gitignore b/.gitignore
index 57499f9bc..9591f9976 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,4 +39,6 @@ erl_crash.dump
# Prevent committing docs files
/priv/static/doc/*
+# Code test coverage
/cover
+/Elixir.*.coverdata
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 210aae2e4..b0a761c4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Pleroma API: Healthcheck endpoint
- Admin API: Endpoints for listing/revoking invite tokens
- Admin API: Endpoints for making users follow/unfollow each other
+- Admin API: added filters (role, tags, email, name) for users endpoint
- Mastodon API: [Scheduled statuses](https://docs.joinmastodon.org/api/rest/scheduled-statuses/)
- Mastodon API: `/api/v1/notifications/destroy_multiple` (glitch-soc extension)
- Mastodon API: `/api/v1/pleroma/accounts/:id/favourites` (API extension)
diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md
index 8befa8ea0..2657d1243 100644
--- a/docs/api/admin_api.md
+++ b/docs/api/admin_api.md
@@ -8,15 +8,20 @@ Authentication is required and the user must be an admin.
- Method `GET`
- Query Params:
- - *optional* `query`: **string** search term
+ - *optional* `query`: **string** search term (e.g. nickname, domain, nickname@domain)
- *optional* `filters`: **string** comma-separated string of filters:
- `local`: only local users
- `external`: only external users
- `active`: only active users
- `deactivated`: only deactivated users
+ - `is_admin`: users with admin role
+ - `is_moderator`: users with moderator role
- *optional* `page`: **integer** page number
- *optional* `page_size`: **integer** number of users per page (default is `50`)
-- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10`
+ - *optional* `tags`: **[string]** tags list
+ - *optional* `name`: **string** user display name
+ - *optional* `email`: **string** user email
+- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10&tags[]=some_tag&tags[]=another_tag&name=display_name&email=email@example.com`
- Response:
```JSON
diff --git a/lib/mix/tasks/pleroma/emoji.ex b/lib/mix/tasks/pleroma/emoji.ex
index cced73226..5cb54c3ca 100644
--- a/lib/mix/tasks/pleroma/emoji.ex
+++ b/lib/mix/tasks/pleroma/emoji.ex
@@ -109,7 +109,7 @@ def run(["get-packs" | args]) do
])
)
- binary_archive = Tesla.get!(src_url).body
+ binary_archive = Tesla.get!(client(), src_url).body
archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16()
sha_status_text = ["SHA256 of ", :bright, pack_name, :normal, " source file is ", :bright]
@@ -137,7 +137,7 @@ def run(["get-packs" | args]) do
])
)
- files = Tesla.get!(files_url).body |> Poison.decode!()
+ files = Tesla.get!(client(), files_url).body |> Poison.decode!()
IO.puts(IO.ANSI.format(["Unpacking ", :bright, pack_name]))
@@ -213,7 +213,7 @@ def run(["gen-pack", src]) do
IO.puts("Downloading the pack and generating SHA256")
- binary_archive = Tesla.get!(src).body
+ binary_archive = Tesla.get!(client(), src).body
archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16()
IO.puts("SHA256 is #{archive_sha}")
@@ -272,7 +272,7 @@ def run(["gen-pack", src]) do
defp fetch_manifest(from) do
Poison.decode!(
if String.starts_with?(from, "http") do
- Tesla.get!(from).body
+ Tesla.get!(client(), from).body
else
File.read!(from)
end
@@ -290,4 +290,12 @@ defp parse_global_opts(args) do
]
)
end
+
+ defp client do
+ middleware = [
+ {Tesla.Middleware.FollowRedirects, [max_redirects: 3]}
+ ]
+
+ Tesla.client(middleware)
+ end
end
diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex
index 2b661edc1..c121e800f 100644
--- a/lib/pleroma/activity.ex
+++ b/lib/pleroma/activity.ex
@@ -287,6 +287,29 @@ def all_by_actor_and_id(actor, status_ids) do
|> Repo.all()
end
+ def follow_requests_for_actor(%Pleroma.User{ap_id: ap_id}) do
+ from(
+ a in Activity,
+ where:
+ fragment(
+ "? ->> 'type' = 'Follow'",
+ a.data
+ ),
+ where:
+ fragment(
+ "? ->> 'state' = 'pending'",
+ a.data
+ ),
+ where:
+ fragment(
+ "coalesce((?)->'object'->>'id', (?)->>'object') = ?",
+ a.data,
+ a.data,
+ ^ap_id
+ )
+ )
+ end
+
@spec query_by_actor(actor()) :: Ecto.Query.t()
def query_by_actor(actor) do
from(a in Activity, where: a.actor == ^actor)
diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex
index 2e7d747df..5b242927b 100644
--- a/lib/pleroma/stats.ex
+++ b/lib/pleroma/stats.ex
@@ -34,7 +34,7 @@ def schedule_update do
def update_stats do
peers =
from(
- u in Pleroma.User,
+ u in User,
select: fragment("distinct split_part(?, '@', 2)", u.nickname),
where: u.local != ^true
)
@@ -44,10 +44,13 @@ def update_stats do
domain_count = Enum.count(peers)
status_query =
- from(u in User.local_user_query(), select: fragment("sum((?->>'note_count')::int)", u.info))
+ from(u in User.Query.build(%{local: true}),
+ select: fragment("sum((?->>'note_count')::int)", u.info)
+ )
status_count = Repo.one(status_query)
- user_count = Repo.aggregate(User.active_local_user_query(), :count, :id)
+
+ user_count = Repo.aggregate(User.Query.build(%{local: true, active: true}), :count, :id)
Agent.update(__MODULE__, fn _ ->
{peers, %{domain_count: domain_count, status_count: status_count, user_count: user_count}}
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 6e5473177..b23a70067 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -255,10 +255,7 @@ defp autofollow_users(user) do
candidates = Pleroma.Config.get([:instance, :autofollowed_nicknames])
autofollowed_users =
- from(u in User,
- where: u.local == true,
- where: u.nickname in ^candidates
- )
+ User.Query.build(%{nickname: candidates, local: true})
|> Repo.all()
follow_all(user, autofollowed_users)
@@ -577,19 +574,17 @@ def fetch_initial_posts(user) do
)
end
- def get_followers_query(%User{id: id, follower_address: follower_address}, nil) do
- from(
- u in User,
- where: fragment("? <@ ?", ^[follower_address], u.following),
- where: u.id != ^id
- )
+ @spec get_followers_query(User.t(), pos_integer() | nil) :: Ecto.Query.t()
+ def get_followers_query(%User{} = user, nil) do
+ User.Query.build(%{followers: user})
end
def get_followers_query(user, page) do
from(u in get_followers_query(user, nil))
- |> paginate(page, 20)
+ |> User.Query.paginate(page, 20)
end
+ @spec get_followers_query(User.t()) :: Ecto.Query.t()
def get_followers_query(user), do: get_followers_query(user, nil)
def get_followers(user, page \\ nil) do
@@ -604,19 +599,17 @@ def get_followers_ids(user, page \\ nil) do
Repo.all(from(u in q, select: u.id))
end
- def get_friends_query(%User{id: id, following: following}, nil) do
- from(
- u in User,
- where: u.follower_address in ^following,
- where: u.id != ^id
- )
+ @spec get_friends_query(User.t(), pos_integer() | nil) :: Ecto.Query.t()
+ def get_friends_query(%User{} = user, nil) do
+ User.Query.build(%{friends: user})
end
def get_friends_query(user, page) do
from(u in get_friends_query(user, nil))
- |> paginate(page, 20)
+ |> User.Query.paginate(page, 20)
end
+ @spec get_friends_query(User.t()) :: Ecto.Query.t()
def get_friends_query(user), do: get_friends_query(user, nil)
def get_friends(user, page \\ nil) do
@@ -631,33 +624,10 @@ def get_friends_ids(user, page \\ nil) do
Repo.all(from(u in q, select: u.id))
end
- def get_follow_requests_query(%User{} = user) do
- from(
- a in Activity,
- where:
- fragment(
- "? ->> 'type' = 'Follow'",
- a.data
- ),
- where:
- fragment(
- "? ->> 'state' = 'pending'",
- a.data
- ),
- where:
- fragment(
- "coalesce((?)->'object'->>'id', (?)->>'object') = ?",
- a.data,
- a.data,
- ^user.ap_id
- )
- )
- end
-
+ @spec get_follow_requests(User.t()) :: {:ok, [User.t()]}
def get_follow_requests(%User{} = user) do
users =
- user
- |> User.get_follow_requests_query()
+ Activity.follow_requests_for_actor(user)
|> join(:inner, [a], u in User, on: a.actor == u.ap_id)
|> where([a, u], not fragment("? @> ?", u.following, ^[user.follower_address]))
|> group_by([a, u], u.id)
@@ -730,10 +700,7 @@ def update_note_count(%User{} = user) do
def update_follower_count(%User{} = user) do
follower_count_query =
- User
- |> where([u], ^user.follower_address in u.following)
- |> where([u], u.id != ^user.id)
- |> select([u], %{count: count(u.id)})
+ User.Query.build(%{followers: user}) |> select([u], %{count: count(u.id)})
User
|> where(id: ^user.id)
@@ -756,38 +723,19 @@ def update_follower_count(%User{} = user) do
end
end
- def get_users_from_set_query(ap_ids, false) do
- from(
- u in User,
- where: u.ap_id in ^ap_ids
- )
- end
-
- def get_users_from_set_query(ap_ids, true) do
- query = get_users_from_set_query(ap_ids, false)
-
- from(
- u in query,
- where: u.local == true
- )
- end
-
+ @spec get_users_from_set([String.t()], boolean()) :: [User.t()]
def get_users_from_set(ap_ids, local_only \\ true) do
- get_users_from_set_query(ap_ids, local_only)
+ criteria = %{ap_id: ap_ids}
+ criteria = if local_only, do: Map.put(criteria, :local, true), else: criteria
+
+ User.Query.build(criteria)
|> Repo.all()
end
+ @spec get_recipients_from_activity(Activity.t()) :: [User.t()]
def get_recipients_from_activity(%Activity{recipients: to}) do
- query =
- from(
- u in User,
- where: u.ap_id in ^to,
- or_where: fragment("? && ?", u.following, ^to)
- )
-
- query = from(u in query, where: u.local == true)
-
- Repo.all(query)
+ User.Query.build(%{recipients_from_activity: to, local: true})
+ |> Repo.all()
end
def search(query, resolve \\ false, for_user \\ nil) do
@@ -1049,14 +997,23 @@ def subscribed_to?(user, %{ap_id: ap_id}) do
end
end
- def muted_users(user),
- do: Repo.all(from(u in User, where: u.ap_id in ^user.info.mutes))
+ @spec muted_users(User.t()) :: [User.t()]
+ def muted_users(user) do
+ User.Query.build(%{ap_id: user.info.mutes})
+ |> Repo.all()
+ end
- def blocked_users(user),
- do: Repo.all(from(u in User, where: u.ap_id in ^user.info.blocks))
+ @spec blocked_users(User.t()) :: [User.t()]
+ def blocked_users(user) do
+ User.Query.build(%{ap_id: user.info.blocks})
+ |> Repo.all()
+ end
- def subscribers(user),
- do: Repo.all(from(u in User, where: u.ap_id in ^user.info.subscribers))
+ @spec subscribers(User.t()) :: [User.t()]
+ def subscribers(user) do
+ User.Query.build(%{ap_id: user.info.subscribers})
+ |> Repo.all()
+ end
def block_domain(user, domain) do
info_cng =
@@ -1082,69 +1039,6 @@ def unblock_domain(user, domain) do
update_and_set_cache(cng)
end
- def maybe_local_user_query(query, local) do
- if local, do: local_user_query(query), else: query
- end
-
- def local_user_query(query \\ User) do
- from(
- u in query,
- where: u.local == true,
- where: not is_nil(u.nickname)
- )
- end
-
- def maybe_external_user_query(query, external) do
- if external, do: external_user_query(query), else: query
- end
-
- def external_user_query(query \\ User) do
- from(
- u in query,
- where: u.local == false,
- where: not is_nil(u.nickname)
- )
- end
-
- def maybe_active_user_query(query, active) do
- if active, do: active_user_query(query), else: query
- end
-
- def active_user_query(query \\ User) do
- from(
- u in query,
- where: fragment("not (?->'deactivated' @> 'true')", u.info),
- where: not is_nil(u.nickname)
- )
- end
-
- def maybe_deactivated_user_query(query, deactivated) do
- if deactivated, do: deactivated_user_query(query), else: query
- end
-
- def deactivated_user_query(query \\ User) do
- from(
- u in query,
- where: fragment("(?->'deactivated' @> 'true')", u.info),
- where: not is_nil(u.nickname)
- )
- end
-
- def active_local_user_query do
- from(
- u in local_user_query(),
- where: fragment("not (?->'deactivated' @> 'true')", u.info)
- )
- end
-
- def moderator_user_query do
- from(
- u in User,
- where: u.local == true,
- where: fragment("?->'is_moderator' @> 'true'", u.info)
- )
- end
-
def deactivate(%User{} = user, status \\ true) do
info_cng = User.Info.set_activation_status(user.info, status)
@@ -1307,7 +1201,7 @@ def ap_enabled?(%User{info: info}), do: info.ap_enabled
def ap_enabled?(_), do: false
@doc "Gets or fetch a user by uri or nickname."
- @spec get_or_fetch(String.t()) :: User.t()
+ @spec get_or_fetch(String.t()) :: {:ok, User.t()} | {:error, String.t()}
def get_or_fetch("http" <> _host = uri), do: get_or_fetch_by_ap_id(uri)
def get_or_fetch(nickname), do: get_or_fetch_by_nickname(nickname)
@@ -1424,22 +1318,12 @@ def error_user(ap_id) do
}
end
+ @spec all_superusers() :: [User.t()]
def all_superusers do
- from(
- u in User,
- where: u.local == true,
- where: fragment("?->'is_admin' @> 'true' OR ?->'is_moderator' @> 'true'", u.info, u.info)
- )
+ User.Query.build(%{super_users: true, local: true})
|> Repo.all()
end
- defp paginate(query, page, page_size) do
- from(u in query,
- limit: ^page_size,
- offset: ^((page - 1) * page_size)
- )
- end
-
def showing_reblogs?(%User{} = user, %User{} = target) do
target.ap_id not in user.info.muted_reblogs
end
diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex
new file mode 100644
index 000000000..2dfe5ce92
--- /dev/null
+++ b/lib/pleroma/user/query.ex
@@ -0,0 +1,150 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.User.Query do
+ @moduledoc """
+ User query builder module. Builds query from new query or another user query.
+
+ ## Example:
+ query = Pleroma.User.Query(%{nickname: "nickname"})
+ another_query = Pleroma.User.Query.build(query, %{email: "email@example.com"})
+ Pleroma.Repo.all(query)
+ Pleroma.Repo.all(another_query)
+
+ Adding new rules:
+ - *ilike criteria*
+ - add field to @ilike_criteria list
+ - pass non empty string
+ - e.g. Pleroma.User.Query.build(%{nickname: "nickname"})
+ - *equal criteria*
+ - add field to @equal_criteria list
+ - pass non empty string
+ - e.g. Pleroma.User.Query.build(%{email: "email@example.com"})
+ - *contains criteria*
+ - add field to @containns_criteria list
+ - pass values list
+ - e.g. Pleroma.User.Query.build(%{ap_id: ["http://ap_id1", "http://ap_id2"]})
+ """
+ import Ecto.Query
+ import Pleroma.Web.AdminAPI.Search, only: [not_empty_string: 1]
+ alias Pleroma.User
+
+ @type criteria ::
+ %{
+ query: String.t(),
+ tags: [String.t()],
+ name: String.t(),
+ email: String.t(),
+ local: boolean(),
+ external: boolean(),
+ active: boolean(),
+ deactivated: boolean(),
+ is_admin: boolean(),
+ is_moderator: boolean(),
+ super_users: boolean(),
+ followers: User.t(),
+ friends: User.t(),
+ recipients_from_activity: [String.t()],
+ nickname: [String.t()],
+ ap_id: [String.t()]
+ }
+ | %{}
+
+ @ilike_criteria [:nickname, :name, :query]
+ @equal_criteria [:email]
+ @role_criteria [:is_admin, :is_moderator]
+ @contains_criteria [:ap_id, :nickname]
+
+ @spec build(criteria()) :: Query.t()
+ def build(query \\ base_query(), criteria) do
+ prepare_query(query, criteria)
+ end
+
+ @spec paginate(Ecto.Query.t(), pos_integer(), pos_integer()) :: Ecto.Query.t()
+ def paginate(query, page, page_size) do
+ from(u in query,
+ limit: ^page_size,
+ offset: ^((page - 1) * page_size)
+ )
+ end
+
+ defp base_query do
+ from(u in User)
+ end
+
+ defp prepare_query(query, criteria) do
+ Enum.reduce(criteria, query, &compose_query/2)
+ end
+
+ defp compose_query({key, value}, query)
+ when key in @ilike_criteria and not_empty_string(value) do
+ # hack for :query key
+ key = if key == :query, do: :nickname, else: key
+ where(query, [u], ilike(field(u, ^key), ^"%#{value}%"))
+ end
+
+ defp compose_query({key, value}, query)
+ when key in @equal_criteria and not_empty_string(value) do
+ where(query, [u], ^[{key, value}])
+ end
+
+ defp compose_query({key, values}, query) when key in @contains_criteria and is_list(values) do
+ where(query, [u], field(u, ^key) in ^values)
+ end
+
+ defp compose_query({:tags, tags}, query) when is_list(tags) and length(tags) > 0 do
+ Enum.reduce(tags, query, &prepare_tag_criteria/2)
+ end
+
+ defp compose_query({key, _}, query) when key in @role_criteria do
+ where(query, [u], fragment("(?->? @> 'true')", u.info, ^to_string(key)))
+ end
+
+ defp compose_query({:super_users, _}, query) do
+ where(
+ query,
+ [u],
+ fragment("?->'is_admin' @> 'true' OR ?->'is_moderator' @> 'true'", u.info, u.info)
+ )
+ end
+
+ defp compose_query({:local, _}, query), do: location_query(query, true)
+
+ defp compose_query({:external, _}, query), do: location_query(query, false)
+
+ defp compose_query({:active, _}, query) do
+ where(query, [u], fragment("not (?->'deactivated' @> 'true')", u.info))
+ |> where([u], not is_nil(u.nickname))
+ end
+
+ defp compose_query({:deactivated, _}, query) do
+ where(query, [u], fragment("?->'deactivated' @> 'true'", u.info))
+ |> where([u], not is_nil(u.nickname))
+ end
+
+ defp compose_query({:followers, %User{id: id, follower_address: follower_address}}, query) do
+ where(query, [u], fragment("? <@ ?", ^[follower_address], u.following))
+ |> where([u], u.id != ^id)
+ end
+
+ defp compose_query({:friends, %User{id: id, following: following}}, query) do
+ where(query, [u], u.follower_address in ^following)
+ |> where([u], u.id != ^id)
+ end
+
+ defp compose_query({:recipients_from_activity, to}, query) do
+ where(query, [u], u.ap_id in ^to or fragment("? && ?", u.following, ^to))
+ end
+
+ defp compose_query(_unsupported_param, query), do: query
+
+ defp prepare_tag_criteria(tag, query) do
+ or_where(query, [u], fragment("? = any(?)", ^tag, u.tags))
+ end
+
+ defp location_query(query, local) do
+ where(query, [u], u.local == ^local)
+ |> where([u], not is_nil(u.nickname))
+ end
+end
diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex
index 711f233a6..b553d96a8 100644
--- a/lib/pleroma/web/admin_api/admin_api_controller.ex
+++ b/lib/pleroma/web/admin_api/admin_api_controller.ex
@@ -101,7 +101,10 @@ def list_users(conn, params) do
search_params = %{
query: params["query"],
page: page,
- page_size: page_size
+ page_size: page_size,
+ tags: params["tags"],
+ name: params["name"],
+ email: params["email"]
}
with {:ok, users, count} <- Search.user(Map.merge(search_params, filters)),
@@ -116,11 +119,11 @@ def list_users(conn, params) do
)
end
- @filters ~w(local external active deactivated)
-
- defp maybe_parse_filters(filters) when is_nil(filters) or filters == "", do: %{}
+ @filters ~w(local external active deactivated is_admin is_moderator)
@spec maybe_parse_filters(String.t()) :: %{required(String.t()) => true} | %{}
+ defp maybe_parse_filters(filters) when is_nil(filters) or filters == "", do: %{}
+
defp maybe_parse_filters(filters) do
filters
|> String.split(",")
diff --git a/lib/pleroma/web/admin_api/search.ex b/lib/pleroma/web/admin_api/search.ex
index 9a8e41c2a..ed919833e 100644
--- a/lib/pleroma/web/admin_api/search.ex
+++ b/lib/pleroma/web/admin_api/search.ex
@@ -10,45 +10,23 @@ defmodule Pleroma.Web.AdminAPI.Search do
@page_size 50
- def user(%{query: term} = params) when is_nil(term) or term == "" do
- query = maybe_filtered_query(params)
+ defmacro not_empty_string(string) do
+ quote do
+ is_binary(unquote(string)) and unquote(string) != ""
+ end
+ end
+
+ @spec user(map()) :: {:ok, [User.t()], pos_integer()}
+ def user(params \\ %{}) do
+ query = User.Query.build(params) |> order_by([u], u.nickname)
paginated_query =
- maybe_filtered_query(params)
- |> paginate(params[:page] || 1, params[:page_size] || @page_size)
+ User.Query.paginate(query, params[:page] || 1, params[:page_size] || @page_size)
- count = query |> Repo.aggregate(:count, :id)
+ count = Repo.aggregate(query, :count, :id)
results = Repo.all(paginated_query)
{:ok, results, count}
end
-
- def user(%{query: term} = params) when is_binary(term) do
- search_query = from(u in maybe_filtered_query(params), where: ilike(u.nickname, ^"%#{term}%"))
-
- count = search_query |> Repo.aggregate(:count, :id)
-
- results =
- search_query
- |> paginate(params[:page] || 1, params[:page_size] || @page_size)
- |> Repo.all()
-
- {:ok, results, count}
- end
-
- defp maybe_filtered_query(params) do
- from(u in User, order_by: u.nickname)
- |> User.maybe_local_user_query(params[:local])
- |> User.maybe_external_user_query(params[:external])
- |> User.maybe_active_user_query(params[:active])
- |> User.maybe_deactivated_user_query(params[:deactivated])
- end
-
- defp paginate(query, page, page_size) do
- from(u in query,
- limit: ^page_size,
- offset: ^((page - 1) * page_size)
- )
- end
end
diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex
index 181483664..55706eeb8 100644
--- a/lib/pleroma/web/controller_helper.ex
+++ b/lib/pleroma/web/controller_helper.ex
@@ -10,12 +10,6 @@ defmodule Pleroma.Web.ControllerHelper do
def truthy_param?(blank_value) when blank_value in [nil, ""], do: nil
def truthy_param?(value), do: value not in @falsy_param_values
- def oauth_scopes(params, default) do
- # Note: `scopes` is used by Mastodon — supporting it but sticking to
- # OAuth's standard `scope` wherever we control it
- Pleroma.Web.OAuth.parse_scopes(params["scope"] || params["scopes"], default)
- end
-
def json_response(conn, status, json) do
conn
|> put_status(status)
diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex
index 7f939991d..9ef30e885 100644
--- a/lib/pleroma/web/endpoint.ex
+++ b/lib/pleroma/web/endpoint.ex
@@ -29,6 +29,13 @@ defmodule Pleroma.Web.Endpoint do
# credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength
)
+ plug(Plug.Static.IndexHtml, at: "/pleroma/admin/")
+
+ plug(Plug.Static,
+ at: "/pleroma/admin/",
+ from: {:pleroma, "priv/static/adminfe/"}
+ )
+
# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
if code_reloading? do
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index 83ad90989..956736780 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -37,6 +37,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
alias Pleroma.Web.MediaProxy
alias Pleroma.Web.OAuth.App
alias Pleroma.Web.OAuth.Authorization
+ alias Pleroma.Web.OAuth.Scopes
alias Pleroma.Web.OAuth.Token
alias Pleroma.Web.ControllerHelper
@@ -50,7 +51,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
action_fallback(:errors)
def create_app(conn, params) do
- scopes = ControllerHelper.oauth_scopes(params, ["read"])
+ scopes = Scopes.fetch_scopes(params, ["read"])
app_attrs =
params
diff --git a/lib/pleroma/web/oauth.ex b/lib/pleroma/web/oauth.ex
index d2835a0ba..280cf28c0 100644
--- a/lib/pleroma/web/oauth.ex
+++ b/lib/pleroma/web/oauth.ex
@@ -3,18 +3,4 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.OAuth do
- def parse_scopes(scopes, _default) when is_list(scopes) do
- Enum.filter(scopes, &(&1 not in [nil, ""]))
- end
-
- def parse_scopes(scopes, default) when is_binary(scopes) do
- scopes
- |> String.trim()
- |> String.split(~r/[\s,]+/)
- |> parse_scopes(default)
- end
-
- def parse_scopes(_, default) do
- default
- end
end
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex
index e3c01217d..8ee0da667 100644
--- a/lib/pleroma/web/oauth/oauth_controller.ex
+++ b/lib/pleroma/web/oauth/oauth_controller.ex
@@ -15,8 +15,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
alias Pleroma.Web.OAuth.Token
alias Pleroma.Web.OAuth.Token.Strategy.RefreshToken
alias Pleroma.Web.OAuth.Token.Strategy.Revoke, as: RevokeToken
-
- import Pleroma.Web.ControllerHelper, only: [oauth_scopes: 2]
+ alias Pleroma.Web.OAuth.Scopes
if Pleroma.Config.oauth_consumer_enabled?(), do: plug(Ueberauth)
@@ -57,7 +56,7 @@ def authorize(conn, params), do: do_authorize(conn, params)
defp do_authorize(conn, params) do
app = Repo.get_by(App, client_id: params["client_id"])
available_scopes = (app && app.scopes) || []
- scopes = oauth_scopes(params, nil) || available_scopes
+ scopes = Scopes.fetch_scopes(params, available_scopes)
# Note: `params` might differ from `conn.params`; use `@params` not `@conn.params` in template
render(conn, Authenticator.auth_template(), %{
@@ -113,7 +112,7 @@ def after_create_authorization(conn, auth, %{
defp handle_create_authorization_error(
conn,
- {scopes_issue, _},
+ {:error, scopes_issue},
%{"authorization" => _} = params
)
when scopes_issue in [:unsupported_scopes, :missing_scopes] do
@@ -184,9 +183,7 @@ def token_exchange(
%App{} = app <- get_app_from_request(conn, params),
{:auth_active, true} <- {:auth_active, User.auth_active?(user)},
{:user_active, true} <- {:user_active, !user.info.deactivated},
- scopes <- oauth_scopes(params, app.scopes),
- [] <- scopes -- app.scopes,
- true <- Enum.any?(scopes),
+ {:ok, scopes} <- validate_scopes(app, params),
{:ok, auth} <- Authorization.create_authorization(app, user, scopes),
{:ok, token} <- Token.exchange_token(app, auth) do
json(conn, response_token(user, token))
@@ -247,8 +244,9 @@ defp bad_request(conn, _) do
@doc "Prepares OAuth request to provider for Ueberauth"
def prepare_request(conn, %{"provider" => provider, "authorization" => auth_attrs}) do
scope =
- oauth_scopes(auth_attrs, [])
- |> Enum.join(" ")
+ auth_attrs
+ |> Scopes.fetch_scopes([])
+ |> Scopes.to_string()
state =
auth_attrs
@@ -326,7 +324,7 @@ def registration_details(conn, %{"authorization" => auth_attrs}) do
client_id: auth_attrs["client_id"],
redirect_uri: auth_attrs["redirect_uri"],
state: auth_attrs["state"],
- scopes: oauth_scopes(auth_attrs, []),
+ scopes: Scopes.fetch_scopes(auth_attrs, []),
nickname: auth_attrs["nickname"],
email: auth_attrs["email"]
})
@@ -401,10 +399,7 @@ defp do_create_authorization(
{:get_user, (user && {:ok, user}) || Authenticator.get_user(conn)},
%App{} = app <- Repo.get_by(App, client_id: client_id),
true <- redirect_uri in String.split(app.redirect_uris),
- scopes <- oauth_scopes(auth_attrs, []),
- {:unsupported_scopes, []} <- {:unsupported_scopes, scopes -- app.scopes},
- # Note: `scope` param is intentionally not optional in this context
- {:missing_scopes, false} <- {:missing_scopes, scopes == []},
+ {:ok, scopes} <- validate_scopes(app, auth_attrs),
{:auth_active, true} <- {:auth_active, User.auth_active?(user)} do
Authorization.create_authorization(app, user, scopes)
end
@@ -458,4 +453,12 @@ defp response_token(%User{} = user, token, opts \\ %{}) do
}
|> Map.merge(opts)
end
+
+ @spec validate_scopes(App.t(), map()) ::
+ {:ok, list()} | {:error, :missing_scopes | :unsupported_scopes}
+ defp validate_scopes(app, params) do
+ params
+ |> Scopes.fetch_scopes(app.scopes)
+ |> Scopes.validates(app.scopes)
+ end
end
diff --git a/lib/pleroma/web/oauth/scopes.ex b/lib/pleroma/web/oauth/scopes.ex
new file mode 100644
index 000000000..ad9dfb260
--- /dev/null
+++ b/lib/pleroma/web/oauth/scopes.ex
@@ -0,0 +1,67 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.OAuth.Scopes do
+ @moduledoc """
+ Functions for dealing with scopes.
+ """
+
+ @doc """
+ Fetch scopes from requiest params.
+
+ Note: `scopes` is used by Mastodon — supporting it but sticking to
+ OAuth's standard `scope` wherever we control it
+ """
+ @spec fetch_scopes(map(), list()) :: list()
+ def fetch_scopes(params, default) do
+ parse_scopes(params["scope"] || params["scopes"], default)
+ end
+
+ def parse_scopes(scopes, _default) when is_list(scopes) do
+ Enum.filter(scopes, &(&1 not in [nil, ""]))
+ end
+
+ def parse_scopes(scopes, default) when is_binary(scopes) do
+ scopes
+ |> to_list
+ |> parse_scopes(default)
+ end
+
+ def parse_scopes(_, default) do
+ default
+ end
+
+ @doc """
+ Convert scopes string to list
+ """
+ @spec to_list(binary()) :: [binary()]
+ def to_list(nil), do: []
+
+ def to_list(str) do
+ str
+ |> String.trim()
+ |> String.split(~r/[\s,]+/)
+ end
+
+ @doc """
+ Convert scopes list to string
+ """
+ @spec to_string(list()) :: binary()
+ def to_string(scopes), do: Enum.join(scopes, " ")
+
+ @doc """
+ Validates scopes.
+ """
+ @spec validates(list() | nil, list()) ::
+ {:ok, list()} | {:error, :missing_scopes | :unsupported_scopes}
+ def validates([], _app_scopes), do: {:error, :missing_scopes}
+ def validates(nil, _app_scopes), do: {:error, :missing_scopes}
+
+ def validates(scopes, app_scopes) do
+ case scopes -- app_scopes do
+ [] -> {:ok, scopes}
+ _ -> {:error, :unsupported_scopes}
+ end
+ end
+end
diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex
index c64152da8..d084ad734 100644
--- a/lib/pleroma/web/twitter_api/views/activity_view.ex
+++ b/lib/pleroma/web/twitter_api/views/activity_view.ex
@@ -170,7 +170,7 @@ def render("activity.json", %{activity: %{data: %{"type" => "Announce"}} = activ
created_at = activity.data["published"] |> Utils.date_to_asctime()
announced_activity = Activity.get_create_by_object_ap_id(activity.data["object"])
- text = "#{user.nickname} retweeted a status."
+ text = "#{user.nickname} repeated a status."
retweeted_status = render("activity.json", Map.merge(opts, %{activity: announced_activity}))
diff --git a/mix.exs b/mix.exs
index 66128cfd6..34ce8a307 100644
--- a/mix.exs
+++ b/mix.exs
@@ -116,7 +116,8 @@ defp deps do
{:quantum, "~> 2.3"},
{:joken, "~> 2.0"},
{:benchee, "~> 1.0"},
- {:esshd, "~> 0.1.0"}
+ {:esshd, "~> 0.1.0"},
+ {:plug_static_index_html, "~> 1.0.0"}
] ++ oauth_deps
end
diff --git a/mix.lock b/mix.lock
index 64856062b..37637618c 100644
--- a/mix.lock
+++ b/mix.lock
@@ -65,6 +65,7 @@
"plug": {:hex, :plug, "1.7.2", "d7b7db7fbd755e8283b6c0a50be71ec0a3d67d9213d74422d9372effc8e87fd1", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"},
"plug_cowboy": {:hex, :plug_cowboy, "2.0.2", "6055f16868cc4882b24b6e1d63d2bada94fb4978413377a3b32ac16c18dffba2", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
"plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"},
+ "plug_static_index_html": {:hex, :plug_static_index_html, "1.0.0", "840123d4d3975585133485ea86af73cb2600afd7f2a976f9f5fd8b3808e636a0", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
"postgrex": {:hex, :postgrex, "0.14.2", "6680591bbce28d92f043249205e8b01b36cab9ef2a7911abc43649242e1a3b78", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
"prometheus": {:hex, :prometheus, "4.2.2", "a830e77b79dc6d28183f4db050a7cac926a6c58f1872f9ef94a35cd989aceef8", [:mix, :rebar3], [], "hexpm"},
diff --git a/priv/static/adminfe/favicon.ico b/priv/static/adminfe/favicon.ico
new file mode 100644
index 000000000..34b63ac63
Binary files /dev/null and b/priv/static/adminfe/favicon.ico differ
diff --git a/priv/static/adminfe/index.html b/priv/static/adminfe/index.html
new file mode 100644
index 000000000..44a58a44e
--- /dev/null
+++ b/priv/static/adminfe/index.html
@@ -0,0 +1 @@
+
Admin FE
\ No newline at end of file
diff --git a/priv/static/adminfe/static/css/app.cea15678.css b/priv/static/adminfe/static/css/app.cea15678.css
new file mode 100644
index 000000000..136aa8bb1
Binary files /dev/null and b/priv/static/adminfe/static/css/app.cea15678.css differ
diff --git a/priv/static/adminfe/static/css/chunk-18e1.6aaab273.css b/priv/static/adminfe/static/css/chunk-18e1.6aaab273.css
new file mode 100644
index 000000000..da819ca09
Binary files /dev/null and b/priv/static/adminfe/static/css/chunk-18e1.6aaab273.css differ
diff --git a/priv/static/adminfe/static/css/chunk-50cf.1db1ed5b.css b/priv/static/adminfe/static/css/chunk-50cf.1db1ed5b.css
new file mode 100644
index 000000000..2a2fbd8e4
Binary files /dev/null and b/priv/static/adminfe/static/css/chunk-50cf.1db1ed5b.css differ
diff --git a/priv/static/adminfe/static/css/chunk-8b70.9ba0945c.css b/priv/static/adminfe/static/css/chunk-8b70.9ba0945c.css
new file mode 100644
index 000000000..7fa43bf28
Binary files /dev/null and b/priv/static/adminfe/static/css/chunk-8b70.9ba0945c.css differ
diff --git a/priv/static/adminfe/static/css/chunk-elementUI.4296cedf.css b/priv/static/adminfe/static/css/chunk-elementUI.4296cedf.css
new file mode 100644
index 000000000..fbd926db1
Binary files /dev/null and b/priv/static/adminfe/static/css/chunk-elementUI.4296cedf.css differ
diff --git a/priv/static/adminfe/static/css/chunk-f018.0d22684d.css b/priv/static/adminfe/static/css/chunk-f018.0d22684d.css
new file mode 100644
index 000000000..bdb738700
Binary files /dev/null and b/priv/static/adminfe/static/css/chunk-f018.0d22684d.css differ
diff --git a/priv/static/adminfe/static/css/chunk-libs.bd17d456.css b/priv/static/adminfe/static/css/chunk-libs.bd17d456.css
new file mode 100644
index 000000000..3a7a99679
Binary files /dev/null and b/priv/static/adminfe/static/css/chunk-libs.bd17d456.css differ
diff --git a/priv/static/adminfe/static/fonts/element-icons.2fad952.woff b/priv/static/adminfe/static/fonts/element-icons.2fad952.woff
new file mode 100644
index 000000000..28da65d49
Binary files /dev/null and b/priv/static/adminfe/static/fonts/element-icons.2fad952.woff differ
diff --git a/priv/static/adminfe/static/fonts/element-icons.6f0a763.ttf b/priv/static/adminfe/static/fonts/element-icons.6f0a763.ttf
new file mode 100644
index 000000000..73bc90f4a
Binary files /dev/null and b/priv/static/adminfe/static/fonts/element-icons.6f0a763.ttf differ
diff --git a/priv/static/adminfe/static/img/401.089007e.gif b/priv/static/adminfe/static/img/401.089007e.gif
new file mode 100644
index 000000000..cd6e0d943
Binary files /dev/null and b/priv/static/adminfe/static/img/401.089007e.gif differ
diff --git a/priv/static/adminfe/static/img/404.a57b6f3.png b/priv/static/adminfe/static/img/404.a57b6f3.png
new file mode 100644
index 000000000..3d8e2305c
Binary files /dev/null and b/priv/static/adminfe/static/img/404.a57b6f3.png differ
diff --git a/priv/static/adminfe/static/js/7zzA.e1ae1c94.js b/priv/static/adminfe/static/js/7zzA.e1ae1c94.js
new file mode 100644
index 000000000..4387b8321
Binary files /dev/null and b/priv/static/adminfe/static/js/7zzA.e1ae1c94.js differ
diff --git a/priv/static/adminfe/static/js/JEtC.f9ba4594.js b/priv/static/adminfe/static/js/JEtC.f9ba4594.js
new file mode 100644
index 000000000..504eaef1f
Binary files /dev/null and b/priv/static/adminfe/static/js/JEtC.f9ba4594.js differ
diff --git a/priv/static/adminfe/static/js/app.25699e3d.js b/priv/static/adminfe/static/js/app.25699e3d.js
new file mode 100644
index 000000000..54694bf5e
Binary files /dev/null and b/priv/static/adminfe/static/js/app.25699e3d.js differ
diff --git a/priv/static/adminfe/static/js/chunk-18e1.7f9c377c.js b/priv/static/adminfe/static/js/chunk-18e1.7f9c377c.js
new file mode 100644
index 000000000..1921d0f64
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-18e1.7f9c377c.js differ
diff --git a/priv/static/adminfe/static/js/chunk-50cf.b9b1df43.js b/priv/static/adminfe/static/js/chunk-50cf.b9b1df43.js
new file mode 100644
index 000000000..1b5614639
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-50cf.b9b1df43.js differ
diff --git a/priv/static/adminfe/static/js/chunk-8b70.46525646.js b/priv/static/adminfe/static/js/chunk-8b70.46525646.js
new file mode 100644
index 000000000..68b7ea1a3
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-8b70.46525646.js differ
diff --git a/priv/static/adminfe/static/js/chunk-elementUI.d388c21d.js b/priv/static/adminfe/static/js/chunk-elementUI.d388c21d.js
new file mode 100644
index 000000000..1f40d7e84
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-elementUI.d388c21d.js differ
diff --git a/priv/static/adminfe/static/js/chunk-f018.e1a7a454.js b/priv/static/adminfe/static/js/chunk-f018.e1a7a454.js
new file mode 100644
index 000000000..9c06e442c
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-f018.e1a7a454.js differ
diff --git a/priv/static/adminfe/static/js/chunk-libs.48e79a9e.js b/priv/static/adminfe/static/js/chunk-libs.48e79a9e.js
new file mode 100644
index 000000000..db0b5dc97
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-libs.48e79a9e.js differ
diff --git a/priv/static/adminfe/static/js/runtime.7144b2cf.js b/priv/static/adminfe/static/js/runtime.7144b2cf.js
new file mode 100644
index 000000000..0a58ac351
Binary files /dev/null and b/priv/static/adminfe/static/js/runtime.7144b2cf.js differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/langs/zh_CN.js b/priv/static/adminfe/static/tinymce4.7.5/langs/zh_CN.js
new file mode 100644
index 000000000..e11f322cc
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/langs/zh_CN.js differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/codesample/css/prism.css b/priv/static/adminfe/static/tinymce4.7.5/plugins/codesample/css/prism.css
new file mode 100644
index 000000000..128237fba
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/codesample/css/prism.css differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-cool.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-cool.gif
new file mode 100644
index 000000000..ba90cc36f
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-cool.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-cry.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-cry.gif
new file mode 100644
index 000000000..74d897a4f
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-cry.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-embarassed.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-embarassed.gif
new file mode 100644
index 000000000..963a96b8a
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-embarassed.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-foot-in-mouth.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-foot-in-mouth.gif
new file mode 100644
index 000000000..c7cf1011d
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-foot-in-mouth.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-frown.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-frown.gif
new file mode 100644
index 000000000..716f55e16
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-frown.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-innocent.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-innocent.gif
new file mode 100644
index 000000000..334d49e0e
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-innocent.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-kiss.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-kiss.gif
new file mode 100644
index 000000000..4efd549ed
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-kiss.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-laughing.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-laughing.gif
new file mode 100644
index 000000000..82c5b182e
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-laughing.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-money-mouth.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-money-mouth.gif
new file mode 100644
index 000000000..ca2451e10
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-money-mouth.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-sealed.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-sealed.gif
new file mode 100644
index 000000000..fe66220c2
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-sealed.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-smile.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-smile.gif
new file mode 100644
index 000000000..fd27edfaa
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-smile.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-surprised.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-surprised.gif
new file mode 100644
index 000000000..0cc9bb71c
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-surprised.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-tongue-out.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-tongue-out.gif
new file mode 100644
index 000000000..2075dc160
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-tongue-out.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-undecided.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-undecided.gif
new file mode 100644
index 000000000..bef7e2573
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-undecided.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-wink.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-wink.gif
new file mode 100644
index 000000000..0631c7616
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-wink.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-yell.gif b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-yell.gif
new file mode 100644
index 000000000..648e6e879
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/emoticons/img/smiley-yell.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/plugins/visualblocks/css/visualblocks.css b/priv/static/adminfe/static/tinymce4.7.5/plugins/visualblocks/css/visualblocks.css
new file mode 100644
index 000000000..96e4d7c5d
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/plugins/visualblocks/css/visualblocks.css differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/content.inline.min.css b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/content.inline.min.css
new file mode 100644
index 000000000..7b45d3397
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/content.inline.min.css differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/content.min.css b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/content.min.css
new file mode 100644
index 000000000..bad168cfe
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/content.min.css differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-mobile.woff b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-mobile.woff
new file mode 100644
index 000000000..1e3be038a
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-mobile.woff differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.eot b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.eot
new file mode 100644
index 000000000..b144ba0bd
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.eot differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.svg b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.svg
new file mode 100644
index 000000000..b4ee6f408
--- /dev/null
+++ b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.svg
@@ -0,0 +1,63 @@
+
+
+
\ No newline at end of file
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.ttf b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.ttf
new file mode 100644
index 000000000..a983e2dc4
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.ttf differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.woff b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.woff
new file mode 100644
index 000000000..d8962df76
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce-small.woff differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.eot b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.eot
new file mode 100644
index 000000000..5336c38ff
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.eot differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.svg b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.svg
new file mode 100644
index 000000000..9fa215f3d
--- /dev/null
+++ b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.svg
@@ -0,0 +1,131 @@
+
+
+
\ No newline at end of file
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.ttf b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.ttf
new file mode 100644
index 000000000..61a48a511
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.ttf differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.woff b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.woff
new file mode 100644
index 000000000..aace5d9c5
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/fonts/tinymce.woff differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/anchor.gif b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/anchor.gif
new file mode 100644
index 000000000..606348c7f
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/anchor.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/loader.gif b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/loader.gif
new file mode 100644
index 000000000..c69e93723
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/loader.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/object.gif b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/object.gif
new file mode 100644
index 000000000..cccd7f023
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/object.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/trans.gif b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/trans.gif
new file mode 100644
index 000000000..388486517
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/img/trans.gif differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/skin.min.css b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/skin.min.css
new file mode 100644
index 000000000..4ad815bf5
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/skin.min.css differ
diff --git a/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/skin.min.css.map b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/skin.min.css.map
new file mode 100644
index 000000000..c8763dcc3
--- /dev/null
+++ b/priv/static/adminfe/static/tinymce4.7.5/skins/lightgray/skin.min.css.map
@@ -0,0 +1 @@
+{"version":3,"sources":["./src/skins/lightgray/main/less/desktop/Reset.less","./src/skins/lightgray/main/less/desktop/Variables.less","./src/skins/lightgray/main/less/desktop/Mixins.less","./src/skins/lightgray/main/less/desktop/Animations.less","./src/skins/lightgray/main/less/desktop/TinyMCE.less","./src/skins/lightgray/main/less/desktop/CropRect.less","./src/skins/lightgray/main/less/desktop/ImagePanel.less","./src/skins/lightgray/main/less/desktop/Arrows.less","./src/skins/lightgray/main/less/desktop/Sidebar.less","./src/skins/lightgray/main/less/desktop/Container.less","./src/skins/lightgray/main/less/desktop/Scrollable.less","./src/skins/lightgray/main/less/desktop/Panel.less","./src/skins/lightgray/main/less/desktop/FloatPanel.less","./src/skins/lightgray/main/less/desktop/Window.less","./src/skins/lightgray/main/less/desktop/ToolTip.less","./src/skins/lightgray/main/less/desktop/Progress.less","./src/skins/lightgray/main/less/desktop/Notification.less","./src/skins/lightgray/main/less/desktop/AbsoluteLayout.less","./src/skins/lightgray/main/less/desktop/Button.less","./src/skins/lightgray/main/less/desktop/ButtonGroup.less","./src/skins/lightgray/main/less/desktop/Checkbox.less","./src/skins/lightgray/main/less/desktop/ComboBox.less","./src/skins/lightgray/main/less/desktop/ColorBox.less","./src/skins/lightgray/main/less/desktop/ColorButton.less","./src/skins/lightgray/main/less/desktop/ColorPicker.less","./src/skins/lightgray/main/less/desktop/Path.less","./src/skins/lightgray/main/less/desktop/FieldSet.less","./src/skins/lightgray/main/less/desktop/FitLayout.less","./src/skins/lightgray/main/less/desktop/FlowLayout.less","./src/skins/lightgray/main/less/desktop/Iframe.less","./src/skins/lightgray/main/less/desktop/InfoBox.less","./src/skins/lightgray/main/less/desktop/Label.less","./src/skins/lightgray/main/less/desktop/MenuBar.less","./src/skins/lightgray/main/less/desktop/MenuButton.less","./src/skins/lightgray/main/less/desktop/MenuItem.less","./src/skins/lightgray/main/less/desktop/Throbber.less","./src/skins/lightgray/main/less/desktop/Menu.less","./src/skins/lightgray/main/less/desktop/ListBox.less","./src/skins/lightgray/main/less/desktop/ResizeHandle.less","./src/skins/lightgray/main/less/desktop/SelectBox.less","./src/skins/lightgray/main/less/desktop/Slider.less","./src/skins/lightgray/main/less/desktop/Spacer.less","./src/skins/lightgray/main/less/desktop/SplitButton.less","./src/skins/lightgray/main/less/desktop/StackLayout.less","./src/skins/lightgray/main/less/desktop/TabPanel.less","./src/skins/lightgray/main/less/desktop/TextBox.less","./src/skins/lightgray/main/less/desktop/DropZone.less","./src/skins/lightgray/main/less/desktop/BrowseButton.less","./src/skins/lightgray/main/less/desktop/Icons.less","./src/skins/lightgray/main/less/desktop/FilePicker.less"],"names":[],"mappings":"AAEA,CAAC,GAAS,WAAY,CAAC,GAAS,UAAW,GAAG,CAAC,GAAS,QAAS,CAAC,GAAS,OAAQ,GAAG,CAAC,GAAS,OAC9F,QAAA,CAAW,SAAA,CAAY,QAAA,CAAW,SAAA,CAClC,kBAAA,CAAqB,sBAAA,CACrB,oBAAA,CAAuB,aAAA,CACvB,YCU+B,2CDV/B,CACA,cAAA,CAAuB,gBAAA,CAAmB,UAAA,CAC1C,eAAA,CAAkB,UAAA,CAAa,WAAA,CAC/B,kBAAA,CAAqB,cAAA,CACrB,uCAAA,CACA,kBAAA,CAAqB,kBAAA,CACrB,eAAA,CACA,2BAAA,CACA,8BAAA,CACA,sBAAA,CACA,aAAA,CACA,eAGF,CAAC,GAAS,OAAQ,QAChB,0BAAA,CACA,6BAAA,CACA,sBAGF,CAAC,GAAS,UAAW,EAAC,eACpB,qBAAA,CACA,wBAAA,CACA,mBAAA,CACA,iBEyBF,WACE,oBAAA,CACA,wBAAA,CACA,oBAAA,CACA,qBAAA,CACA,gBAAA,CACA,iBAAA,CACA,oBAAA,CACA,aC7DF,CAAC,GAAS,MACR,SAAA,CDqCA,sCAAA,CACA,+BCnCA,CAJD,GAAS,KAIP,C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AS,QACpD,CAAC,GAAS,SAAS,QAAwB,QAAS,QACpD,CAAC,GAAS,QAAQ,QAAyB,QAAS,QACpD,CAAC,GAAS,QAAQ,QAAyB,QAAS,QACpD,CAAC,GAAS,SAAS,QAAwB,QAAS,QACpD,CAAC,GAAS,MAAM,QAA2B,QAAS,QACpD,CAAC,GAAS,YAAY,QAAqB,QAAS,QACpD,CAAC,GAAS,WAAW,QAAS,CAAC,GAAS,WAAW,QACjD,QAAS,QAGX,CAAC,GAAS,UAA2B,eACrC,CAAC,GAAS,YAA2B,kBACrC,CAAC,CAAC,GAAS,aAA0B,gBAAA,CAAmB,gBCjLxD,CAAC,GAAS,IAAK,EAAC,GAAS,WAAY,OACnC"}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/tinymce4.7.5/tinymce.min.js b/priv/static/adminfe/static/tinymce4.7.5/tinymce.min.js
new file mode 100644
index 000000000..d7fcac80b
Binary files /dev/null and b/priv/static/adminfe/static/tinymce4.7.5/tinymce.min.js differ
diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs
index b89c42327..f433f6be2 100644
--- a/test/web/admin_api/admin_api_controller_test.exs
+++ b/test/web/admin_api/admin_api_controller_test.exs
@@ -419,14 +419,19 @@ test "/api/pleroma/admin/password_reset" do
end
describe "GET /api/pleroma/admin/users" do
- test "renders users array for the first page" do
+ setup do
admin = insert(:user, info: %{is_admin: true})
- user = insert(:user, local: false, tags: ["foo", "bar"])
conn =
build_conn()
|> assign(:user, admin)
- |> get("/api/pleroma/admin/users?page=1")
+
+ {:ok, conn: conn, admin: admin}
+ end
+
+ test "renders users array for the first page", %{conn: conn, admin: admin} do
+ user = insert(:user, local: false, tags: ["foo", "bar"])
+ conn = get(conn, "/api/pleroma/admin/users?page=1")
assert json_response(conn, 200) == %{
"count" => 2,
@@ -452,14 +457,10 @@ test "renders users array for the first page" do
}
end
- test "renders empty array for the second page" do
- admin = insert(:user, info: %{is_admin: true})
+ test "renders empty array for the second page", %{conn: conn} do
insert(:user)
- conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/users?page=2")
+ conn = get(conn, "/api/pleroma/admin/users?page=2")
assert json_response(conn, 200) == %{
"count" => 2,
@@ -468,14 +469,10 @@ test "renders empty array for the second page" do
}
end
- test "regular search" do
- admin = insert(:user, info: %{is_admin: true})
+ test "regular search", %{conn: conn} do
user = insert(:user, nickname: "bob")
- conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/users?query=bo")
+ conn = get(conn, "/api/pleroma/admin/users?query=bo")
assert json_response(conn, 200) == %{
"count" => 1,
@@ -493,17 +490,101 @@ test "regular search" do
}
end
- test "regular search with page size" do
- admin = insert(:user, info: %{is_admin: true})
+ test "search by domain", %{conn: conn} do
+ user = insert(:user, nickname: "nickname@domain.com")
+ insert(:user)
+
+ conn = get(conn, "/api/pleroma/admin/users?query=domain.com")
+
+ assert json_response(conn, 200) == %{
+ "count" => 1,
+ "page_size" => 50,
+ "users" => [
+ %{
+ "deactivated" => user.info.deactivated,
+ "id" => user.id,
+ "nickname" => user.nickname,
+ "roles" => %{"admin" => false, "moderator" => false},
+ "local" => true,
+ "tags" => []
+ }
+ ]
+ }
+ end
+
+ test "search by full nickname", %{conn: conn} do
+ user = insert(:user, nickname: "nickname@domain.com")
+ insert(:user)
+
+ conn = get(conn, "/api/pleroma/admin/users?query=nickname@domain.com")
+
+ assert json_response(conn, 200) == %{
+ "count" => 1,
+ "page_size" => 50,
+ "users" => [
+ %{
+ "deactivated" => user.info.deactivated,
+ "id" => user.id,
+ "nickname" => user.nickname,
+ "roles" => %{"admin" => false, "moderator" => false},
+ "local" => true,
+ "tags" => []
+ }
+ ]
+ }
+ end
+
+ test "search by display name", %{conn: conn} do
+ user = insert(:user, name: "Display name")
+ insert(:user)
+
+ conn = get(conn, "/api/pleroma/admin/users?name=display")
+
+ assert json_response(conn, 200) == %{
+ "count" => 1,
+ "page_size" => 50,
+ "users" => [
+ %{
+ "deactivated" => user.info.deactivated,
+ "id" => user.id,
+ "nickname" => user.nickname,
+ "roles" => %{"admin" => false, "moderator" => false},
+ "local" => true,
+ "tags" => []
+ }
+ ]
+ }
+ end
+
+ test "search by email", %{conn: conn} do
+ user = insert(:user, email: "email@example.com")
+ insert(:user)
+
+ conn = get(conn, "/api/pleroma/admin/users?email=email@example.com")
+
+ assert json_response(conn, 200) == %{
+ "count" => 1,
+ "page_size" => 50,
+ "users" => [
+ %{
+ "deactivated" => user.info.deactivated,
+ "id" => user.id,
+ "nickname" => user.nickname,
+ "roles" => %{"admin" => false, "moderator" => false},
+ "local" => true,
+ "tags" => []
+ }
+ ]
+ }
+ end
+
+ test "regular search with page size", %{conn: conn} do
user = insert(:user, nickname: "aalice")
user2 = insert(:user, nickname: "alice")
- conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/users?query=a&page_size=1&page=1")
+ conn1 = get(conn, "/api/pleroma/admin/users?query=a&page_size=1&page=1")
- assert json_response(conn, 200) == %{
+ assert json_response(conn1, 200) == %{
"count" => 2,
"page_size" => 1,
"users" => [
@@ -518,12 +599,9 @@ test "regular search with page size" do
]
}
- conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/users?query=a&page_size=1&page=2")
+ conn2 = get(conn, "/api/pleroma/admin/users?query=a&page_size=1&page=2")
- assert json_response(conn, 200) == %{
+ assert json_response(conn2, 200) == %{
"count" => 2,
"page_size" => 1,
"users" => [
@@ -566,7 +644,7 @@ test "only local users" do
}
end
- test "only local users with no query" do
+ test "only local users with no query", %{admin: old_admin} do
admin = insert(:user, info: %{is_admin: true}, nickname: "john")
user = insert(:user, nickname: "bob")
@@ -578,7 +656,7 @@ test "only local users with no query" do
|> get("/api/pleroma/admin/users?filters=local")
assert json_response(conn, 200) == %{
- "count" => 2,
+ "count" => 3,
"page_size" => 50,
"users" => [
%{
@@ -596,6 +674,100 @@ test "only local users with no query" do
"roles" => %{"admin" => true, "moderator" => false},
"local" => true,
"tags" => []
+ },
+ %{
+ "deactivated" => false,
+ "id" => old_admin.id,
+ "local" => true,
+ "nickname" => old_admin.nickname,
+ "roles" => %{"admin" => true, "moderator" => false},
+ "tags" => []
+ }
+ ]
+ }
+ end
+
+ test "load only admins", %{conn: conn, admin: admin} do
+ second_admin = insert(:user, info: %{is_admin: true})
+ insert(:user)
+ insert(:user)
+
+ conn = get(conn, "/api/pleroma/admin/users?filters=is_admin")
+
+ assert json_response(conn, 200) == %{
+ "count" => 2,
+ "page_size" => 50,
+ "users" => [
+ %{
+ "deactivated" => false,
+ "id" => admin.id,
+ "nickname" => admin.nickname,
+ "roles" => %{"admin" => true, "moderator" => false},
+ "local" => admin.local,
+ "tags" => []
+ },
+ %{
+ "deactivated" => false,
+ "id" => second_admin.id,
+ "nickname" => second_admin.nickname,
+ "roles" => %{"admin" => true, "moderator" => false},
+ "local" => second_admin.local,
+ "tags" => []
+ }
+ ]
+ }
+ end
+
+ test "load only moderators", %{conn: conn} do
+ moderator = insert(:user, info: %{is_moderator: true})
+ insert(:user)
+ insert(:user)
+
+ conn = get(conn, "/api/pleroma/admin/users?filters=is_moderator")
+
+ assert json_response(conn, 200) == %{
+ "count" => 1,
+ "page_size" => 50,
+ "users" => [
+ %{
+ "deactivated" => false,
+ "id" => moderator.id,
+ "nickname" => moderator.nickname,
+ "roles" => %{"admin" => false, "moderator" => true},
+ "local" => moderator.local,
+ "tags" => []
+ }
+ ]
+ }
+ end
+
+ test "load users with tags list", %{conn: conn} do
+ user1 = insert(:user, tags: ["first"])
+ user2 = insert(:user, tags: ["second"])
+ insert(:user)
+ insert(:user)
+
+ conn = get(conn, "/api/pleroma/admin/users?tags[]=first&tags[]=second")
+
+ assert json_response(conn, 200) == %{
+ "count" => 2,
+ "page_size" => 50,
+ "users" => [
+ %{
+ "deactivated" => false,
+ "id" => user1.id,
+ "nickname" => user1.nickname,
+ "roles" => %{"admin" => false, "moderator" => false},
+ "local" => user1.local,
+ "tags" => ["first"]
+ },
+ %{
+ "deactivated" => false,
+ "id" => user2.id,
+ "nickname" => user2.nickname,
+ "roles" => %{"admin" => false, "moderator" => false},
+ "local" => user2.local,
+ "tags" => ["second"]
}
]
}
@@ -651,13 +823,18 @@ test "PATCH /api/pleroma/admin/users/:nickname/toggle_activation" do
end
describe "GET /api/pleroma/admin/invite_token" do
- test "without options" do
+ setup do
admin = insert(:user, info: %{is_admin: true})
conn =
build_conn()
|> assign(:user, admin)
- |> get("/api/pleroma/admin/invite_token")
+
+ {:ok, conn: conn}
+ end
+
+ test "without options", %{conn: conn} do
+ conn = get(conn, "/api/pleroma/admin/invite_token")
token = json_response(conn, 200)
invite = UserInviteToken.find_by_token!(token)
@@ -667,13 +844,9 @@ test "without options" do
assert invite.invite_type == "one_time"
end
- test "with expires_at" do
- admin = insert(:user, info: %{is_admin: true})
-
+ test "with expires_at", %{conn: conn} do
conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/invite_token", %{
+ get(conn, "/api/pleroma/admin/invite_token", %{
"invite" => %{"expires_at" => Date.to_string(Date.utc_today())}
})
@@ -686,13 +859,9 @@ test "with expires_at" do
assert invite.invite_type == "date_limited"
end
- test "with max_use" do
- admin = insert(:user, info: %{is_admin: true})
-
+ test "with max_use", %{conn: conn} do
conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/invite_token", %{
+ get(conn, "/api/pleroma/admin/invite_token", %{
"invite" => %{"max_use" => 150}
})
@@ -704,13 +873,9 @@ test "with max_use" do
assert invite.invite_type == "reusable"
end
- test "with max use and expires_at" do
- admin = insert(:user, info: %{is_admin: true})
-
+ test "with max use and expires_at", %{conn: conn} do
conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/invite_token", %{
+ get(conn, "/api/pleroma/admin/invite_token", %{
"invite" => %{"max_use" => 150, "expires_at" => Date.to_string(Date.utc_today())}
})
@@ -724,25 +889,26 @@ test "with max use and expires_at" do
end
describe "GET /api/pleroma/admin/invites" do
- test "no invites" do
+ setup do
admin = insert(:user, info: %{is_admin: true})
conn =
build_conn()
|> assign(:user, admin)
- |> get("/api/pleroma/admin/invites")
+
+ {:ok, conn: conn}
+ end
+
+ test "no invites", %{conn: conn} do
+ conn = get(conn, "/api/pleroma/admin/invites")
assert json_response(conn, 200) == %{"invites" => []}
end
- test "with invite" do
- admin = insert(:user, info: %{is_admin: true})
+ test "with invite", %{conn: conn} do
{:ok, invite} = UserInviteToken.create_invite()
- conn =
- build_conn()
- |> assign(:user, admin)
- |> get("/api/pleroma/admin/invites")
+ conn = get(conn, "/api/pleroma/admin/invites")
assert json_response(conn, 200) == %{
"invites" => [
diff --git a/test/web/admin_api/search_test.exs b/test/web/admin_api/search_test.exs
index 3950996ed..501a8d007 100644
--- a/test/web/admin_api/search_test.exs
+++ b/test/web/admin_api/search_test.exs
@@ -70,11 +70,11 @@ test "it returns active/deactivated users" do
test "it returns specific user" do
insert(:user)
insert(:user)
- insert(:user, nickname: "bob", local: true, info: %{deactivated: false})
+ user = insert(:user, nickname: "bob", local: true, info: %{deactivated: false})
{:ok, _results, total_count} = Search.user(%{query: ""})
- {:ok, _results, count} =
+ {:ok, [^user], count} =
Search.user(%{
query: "Bo",
active: true,
@@ -84,5 +84,87 @@ test "it returns specific user" do
assert total_count == 3
assert count == 1
end
+
+ test "it returns user by domain" do
+ insert(:user)
+ insert(:user)
+ user = insert(:user, nickname: "some@domain.com")
+
+ {:ok, _results, total} = Search.user()
+ {:ok, [^user], count} = Search.user(%{query: "domain.com"})
+ assert total == 3
+ assert count == 1
+ end
+
+ test "it return user by full nickname" do
+ insert(:user)
+ insert(:user)
+ user = insert(:user, nickname: "some@domain.com")
+
+ {:ok, _results, total} = Search.user()
+ {:ok, [^user], count} = Search.user(%{query: "some@domain.com"})
+ assert total == 3
+ assert count == 1
+ end
+
+ test "it returns admin user" do
+ admin = insert(:user, info: %{is_admin: true})
+ insert(:user)
+ insert(:user)
+
+ {:ok, _results, total} = Search.user()
+ {:ok, [^admin], count} = Search.user(%{is_admin: true})
+ assert total == 3
+ assert count == 1
+ end
+
+ test "it returns moderator user" do
+ moderator = insert(:user, info: %{is_moderator: true})
+ insert(:user)
+ insert(:user)
+
+ {:ok, _results, total} = Search.user()
+ {:ok, [^moderator], count} = Search.user(%{is_moderator: true})
+ assert total == 3
+ assert count == 1
+ end
+
+ test "it returns users with tags" do
+ user1 = insert(:user, tags: ["first"])
+ user2 = insert(:user, tags: ["second"])
+ insert(:user)
+ insert(:user)
+
+ {:ok, _results, total} = Search.user()
+ {:ok, users, count} = Search.user(%{tags: ["first", "second"]})
+ assert total == 4
+ assert count == 2
+ assert user1 in users
+ assert user2 in users
+ end
+
+ test "it returns user by display name" do
+ user = insert(:user, name: "Display name")
+ insert(:user)
+ insert(:user)
+
+ {:ok, _results, total} = Search.user()
+ {:ok, [^user], count} = Search.user(%{name: "display"})
+
+ assert total == 3
+ assert count == 1
+ end
+
+ test "it returns user by email" do
+ user = insert(:user, email: "some@example.com")
+ insert(:user)
+ insert(:user)
+
+ {:ok, _results, total} = Search.user()
+ {:ok, [^user], count} = Search.user(%{email: "some@example.com"})
+
+ assert total == 3
+ assert count == 1
+ end
end
end
diff --git a/test/web/twitter_api/views/activity_view_test.exs b/test/web/twitter_api/views/activity_view_test.exs
index 1aa533b48..43bd77f78 100644
--- a/test/web/twitter_api/views/activity_view_test.exs
+++ b/test/web/twitter_api/views/activity_view_test.exs
@@ -295,8 +295,8 @@ test "an announce activity" do
"id" => announce.id,
"is_local" => true,
"is_post_verb" => false,
- "statusnet_html" => "shp retweeted a status.",
- "text" => "shp retweeted a status.",
+ "statusnet_html" => "shp repeated a status.",
+ "text" => "shp repeated a status.",
"uri" => "tag:#{announce.data["id"]}:objectType=note",
"user" => UserView.render("show.json", user: other_user),
"retweeted_status" => ActivityView.render("activity.json", activity: activity),