Skip to content

Commit

Permalink
we're not soapbox actually
Browse files Browse the repository at this point in the history
Signed-off-by: marcin mikołajczak <[email protected]>
  • Loading branch information
mkljczk committed Sep 9, 2024
1 parent 63a0288 commit 509d5ef
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Added features:
- [Partial implementation of Mastodon admin API](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3671)
- [Moderators can assign users to reports](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3670)
- [Mastodon-compatible webhooks](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3683)
- UI is restyled to match pl-fe/Soapbox visuals
- UI is restyled to match pl-fe visuals

Features not authored by me:
- [Chat deletion](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3029)
Expand Down
4 changes: 2 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,6 @@ config :geospatial, Geospatial.Providers.Pelias,

config :geospatial, Geospatial.HTTP, user_agent: &Pleroma.Application.user_agent/0

import_config "soapbox.exs"

config :pleroma, Pleroma.Search, module: Pleroma.Search.DatabaseSearch

config :pleroma, Pleroma.Search.Meilisearch,
Expand Down Expand Up @@ -1009,6 +1007,8 @@ config :pleroma, Pleroma.Search.QdrantSearch,
vectors: %{size: 384, distance: "Cosine"}
}

import_config "pl-fe.exs"

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
9 changes: 1 addition & 8 deletions config/soapbox.exs → config/pl-fe.exs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Soapbox default config overrides
# pl-fe default config overrides
# This file gets loaded after config.exs
# and before prod.secret.exs
import Config

# Twitter-like block behavior
config :pleroma, :activitypub, blockers_visible: false

# Sane default upload filters
config :pleroma, Pleroma.Upload,
filters: [
Expand Down Expand Up @@ -45,11 +42,7 @@ config :pleroma, :mrf_hellthread,
# Sane default media attachment limit
config :pleroma, :instance, max_media_attachments: 20

# Use Soapbox branding
config :pleroma, :instance,
name: "Soapbox",
description: "Social media owned by you",
instance_thumbnail: "/instance/thumbnail.png",
account_approval_required: true,
moderator_privileges: [
:users_read,
Expand Down
4 changes: 2 additions & 2 deletions lib/pleroma/web/plugs/http_security_plug.ex
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlug do
static_url = Pleroma.Web.Endpoint.static_url()
websocket_url = Pleroma.Web.Endpoint.websocket_url()
report_uri = @config_impl.get([:http_security, :report_uri])
sentry_dsn = @config_impl.get([:frontend_configurations, :soapbox_fe, "sentryDsn"])
sentry_dsn = @config_impl.get([:frontend_configurations, :pl_fe, "sentryDsn"])

img_src = "img-src 'self' data: blob:"
media_src = "media-src 'self'"
Expand Down Expand Up @@ -200,7 +200,7 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlug do

defp map_tile_server do
with tile_server when is_binary(tile_server) <-
@config_impl.get([:frontend_configurations, :soapbox_fe, "tileServer"]),
@config_impl.get([:frontend_configurations, :pl_fe, "tileServer"]),
%{host: host} <- URI.parse(tile_server) do
["*.#{host}"]
else
Expand Down
10 changes: 5 additions & 5 deletions lib/pleroma/web/templates/layout/app.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
:root {
<%= Pleroma.Web.Utils.Colors.shades_to_css(
"primary",
Pleroma.Config.get([:frontend_configurations, :soapbox_fe, "brandColor"], "#0482d8"),
Pleroma.Config.get([:frontend_configurations, :soapbox_fe, "colors", "primary"], %{})
Pleroma.Config.get([:frontend_configurations, :pl_fe, "brandColor"], "#d80482"),
Pleroma.Config.get([:frontend_configurations, :pl_fe, "colors", "primary"], %{})
) %>
<%= Pleroma.Web.Utils.Colors.shades_to_css(
"accent",
Pleroma.Config.get([:frontend_configurations, :soapbox_fe, "accentColor"], "#2bd110"),
Pleroma.Config.get([:frontend_configurations, :soapbox_fe, "colors", "accent"], %{})
Pleroma.Config.get([:frontend_configurations, :pl_fe, "accentColor"], "#d110b4"),
Pleroma.Config.get([:frontend_configurations, :pl_fe, "colors", "accent"], %{})
) %>
}
</style>
</head>
<body>
<div class="instance-header">
<a class="instance-header__content" href="/">
<img class="instance-header__thumbnail" src="<%= Pleroma.Config.get([:frontend_configurations, :soapbox_fe, "logo"], Pleroma.Config.get([:instance, :instance_thumbnail])) %>">
<img class="instance-header__thumbnail" src="<%= Pleroma.Config.get([:frontend_configurations, :pl_fe, "logo"], Pleroma.Config.get([:instance, :instance_thumbnail])) %>">
<h1 class="instance-header__title"><%= Pleroma.Config.get([:instance, :name]) %></h1>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/pleroma/web/utils/colors.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ defmodule Pleroma.Web.Utils.Colors do
shades
end

def get_shades(_, overrides), do: get_shades("#0482d8", overrides)
def get_shades(_, overrides), do: get_shades("#d80482", overrides)

defp get_override(level, overrides) do
if Map.has_key?(overrides, "#{level}") do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do

describe "instance domain blocks" do
setup do
clear_config([:mrf_simple, :reject], [{"fediverse.pl", "uses Soapbox"}])
clear_config([:mrf_simple, :reject], [{"fediverse.pl", "uses pl-fe"}])
end

test "get instance domain blocks", %{conn: conn} do
conn = get(conn, "/api/v1/instance/domain_blocks")

assert [
%{
"comment" => "uses Soapbox",
"comment" => "uses pl-fe",
"digest" => "55e3f44aefe7eb022d3b1daaf7396cabf7f181bf6093c8ea841e30c9fc7d8226",
"domain" => "fediverse.pl",
"severity" => "suspend"
Expand Down
4 changes: 2 additions & 2 deletions test/pleroma/web/utils/colors_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ defmodule Pleroma.Web.Utils.ColorsTest do
} == Colors.get_shades(@base_color)
end

test "uses soapbox blue if invalid color provided" do
test "uses pl-fe default color if invalid color provided" do
assert %{
500 => "4, 130, 216"
500 => "216, 4, 130"
} = Colors.get_shades("255, 255, 127")
end
end
Expand Down

0 comments on commit 509d5ef

Please sign in to comment.