Commit graph

46 commits

Author SHA1 Message Date
Oneric 37e2a35b86 Fix Twitter metadata
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build-amd64 Pipeline was successful
ci/woodpecker/pr/build-arm64 Pipeline was successful
ci/woodpecker/pr/docs Pipeline was successful
This partly reverts 1d884fd914
while fixing both the issue it addressed and the issue it caused.

The above commit successfully fixed OpenGraph metadata tags
which until then always showed the user bio instead of post content
by handing the activities AP ID as url to the Metadata builder
_instead_ of passing the internal ID as activity_id.
However, in doing so the commit instead inflicted this very problem
onto Twitter metadata tags which ironically are used by akkoma-fe.

This is because while the OpenGraph builder wants an URL as url,
the Twitter builder needs the internal ID to build the URL to the
embedded player for videos and has no URL property.

Thanks to twpol for tracking down this root cause in #644.

Now, once identified the problem is simple, but this simplicity
invites multiple possible solutions to bikeshed about.

 1. Just pass both properties to the builder and let them pick

 2. Drop the url parameter from the OpenGraph builder and instead
     a) build static-fe URL of the post from the ID (like Twitter)
     b) use the passed-in object’s AP ID as an URL

Approach 2a has the disadvantage of hardcoding the expected URL outside
the router, which will be problematic should it ever change.
Approach 2b is conceptually similar to how the builder works atm.
However, the og:url is supposed to be a _permanent_ ID, by changing it
we might, afaiui, technically violate OpenGraph specs(?). (Though its
real-world consequence may very well be near non-existent.)

This leaves just approach 1, which this commit implements.
Albeit it too is not without nits to pick, as it leaves the metadata
builders with an inconsistent interface.

Additionally, this will resolve the subotpimal Discord previews for
content-less image posts reported in #664.
Discord already prefers OpenGraph metadata, so it’s mostly unaffected.
However, it appears when encountering an explicitly empty OpenGraph
description and a non-empty Twitter description, it replaces just the
empty field with its Twitter counterpart, resulting in the user’s bio
slipping into the preview.
Secondly, regardless of any OpenGraph tags, Discord uses twitter:card to
decide how prominently images should be, but due to the bug the card
type was stuck as "summary", forcing images to always remain small.

Root cause identified by: twpol

Fixes: #644
Fixes: #664
2024-02-19 21:09:43 +00:00
FloatingGhost 6cb40bee26 Migrate to phoenix 1.7 (#626)
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/build-arm64 Pipeline was successful
ci/woodpecker/push/build-amd64 Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
Closes #612

Co-authored-by: tusooa <tusooa@kazv.moe>
Reviewed-on: #626
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Co-committed-by: FloatingGhost <hannah@coffee-and-dreams.uk>
2023-08-15 10:22:18 +00:00
Sol Fisher Romanoff 1d884fd914
Correct og:description tag in static-fe
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2022-12-30 07:14:54 +02:00
FloatingGhost 0eaec57d3f mix format
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
2022-12-09 10:24:38 +00:00
FloatingGhost 1afba64464 Redirect to standard FE if logged in
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
2022-12-07 13:35:00 +00:00
sfr 7c4b415929 static-fe overhaul (#236)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
makes static-fe look more like pleroma-fe, with the stylesheets matching pleroma-dark and pleroma-light based on `prefers-color-scheme`.

- [x] navbar
- [x] about sidebar
- [x] background image
- [x] statuses
  - [x] "reply to" or "edited" tags
- [x] accounts
  - [x] show more / show less
  - [x] posts / with replies / media / followers / following
    - [x] followers/following would require user card snippets
  - [x] admin/bot indicators
- [x] attachments
  - [x] nsfw attachments
- [x] fontawesome icons
- [x] clean up and sort css
- [x] add pleroma-light
- [x] replace hardcoded strings

also i forgot
- [x] repeated headers

how it looks + sneak peek at statuses:
![](https://akkoma.dev/attachments/c0d3a025-6987-4630-8eb9-5f4db6858359)

Co-authored-by: Sol Fisher Romanoff <sol@solfisher.com>
Reviewed-on: #236
Co-authored-by: sfr <sol@solfisher.com>
Co-committed-by: sfr <sol@solfisher.com>
2022-12-07 11:20:53 +00:00
Alex Gleason db2bf55e9b
Merge remote-tracking branch 'origin/develop' into notice-routes 2021-12-25 19:57:53 -06:00
Alex Gleason c9e4200ed2
Create real Views for all Controllers
This makes views depend on each other at runtime instead of compile-time
2021-05-29 12:15:57 -05:00
Alex Gleason 50e3750758
Add notice compatibility routes for other frontends
Fixes: https://git.pleroma.social/pleroma/pleroma/-/issues/1785
2021-05-05 14:50:10 -05:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
lain e1e7e4d379 Object: Rework how Object.normalize works
Now it defaults to not fetching, and the option is named.
2021-01-04 13:38:31 +01:00
Ivan Tashkinov da4a1e57b1 @doc fix. 2020-10-28 19:09:38 +03:00
Ivan Tashkinov 094edde7c4 [#3053] Unauthenticated access control for OStatus-related controllers and ActivityPubController (base actions: :user, :object, :activity). Tests adjustments. 2020-10-05 23:48:00 +03:00
Ivan Tashkinov f6024252ae [#3053] No auth check in StaticFEController, even on non-federating instances. Adjusted tests. 2020-10-02 22:18:02 +03:00
Egor Kislitsyn 317e2b8d61
Use atoms as keys in ActivityPub.fetch_* functions options 2020-06-04 21:36:26 +04:00
Ivan Tashkinov 2c4844237f Refactoring of :if_func / :unless_func plug options (general availability). Added tests for Pleroma.Web.Plug. 2020-04-30 18:19:51 +03:00
Egor Kislitsyn 5a34dca8ed
Add emoji support in statuses in staticfe 2020-03-23 14:03:31 +04:00
Haelwenn (lanodan) Monnier 8176ca9e40 static_fe: Sanitize HTML in users 2020-03-15 20:44:04 +01:00
Haelwenn (lanodan) Monnier 0ac6e29654 static_fe: Sanitize HTML in posts
Note: Seems to have different sanitization with TwitterCard generator giving
the following:

<meta content=\"“alert(&#39;xss&#39;)”\" property=\"twitter:description\">
2020-03-15 20:44:04 +01:00
Ivan Tashkinov 5b696a8ac1 [#1560] Enforced authentication for non-federating instances in StaticFEController. 2020-03-11 14:05:56 +03:00
Mark Felder 05da5f5cca Update Copyrights 2020-03-03 16:44:49 -06:00
Phil Hagelberg 3c60adbc1f Support redirecting by activity UUID in static FE as well. 2019-11-13 08:22:11 -08:00
Phil Hagelberg 0867cb083e Support redirecting by object ID in static FE.
This matches the behavior of pleroma-fe better.

Fixes #1412.
2019-11-13 08:02:02 -08:00
Phil Hagelberg 62f3a93049 For remote notices, redirect to the original instead of 404.
We shouldn't treat these like local statuses, but I don't think a 404
is the right choice either here, because within pleroma-fe, these are
valid URLs. So with remote notices you have the awkward situation
where clicking a link will behave differently depending on whether you
open it in a new tab or not; the new tab will 404 if it hits static-fe.

This new redirecting behavior should improve that situation.
2019-11-12 09:40:29 -08:00
Phil Hagelberg ef7c3bdc7a Add some further test cases.
Including like ... private visibility, cos that's super important.
2019-11-09 18:08:45 -08:00
Phil Hagelberg 4729027f91 Prevent non-local notices from rendering. 2019-11-09 18:08:45 -08:00
Phil Hagelberg b0080fa730 Render errors in HTML, not with JS. 2019-11-09 18:08:08 -08:00
Phil Hagelberg bfd5d79826 Include metadata in static FE conversations and profiles. 2019-11-09 18:08:08 -08:00
Phil Hagelberg 828259fb65 Catch 404s. 2019-11-09 18:08:08 -08:00
Phil Hagelberg df2f59be91 Pagination for user profiles. 2019-11-09 18:08:08 -08:00
Phil Hagelberg 8969c5522d Make many of the improvements suggested in review. 2019-11-09 18:08:08 -08:00
Phil Hagelberg dc3b87d153 Move static FE routing into its own plug.
Previously it was piggybacking on FallbackRedirectController for users
and OStatusController for notices; now it's all in one place.
2019-11-09 18:08:08 -08:00
Phil Hagelberg c6c706161e Make sure notice link is remote if the post is remote. 2019-11-09 18:08:08 -08:00
Phil Hagelberg 274cc18e8a Visually separate header. 2019-11-09 18:08:08 -08:00
Phil Hagelberg 2ac1ece652 Fix a bug where reblogs were displayed under the wrong user. 2019-11-09 18:08:08 -08:00
Phil Hagelberg e4b9784c39 Show counts for replies, likes, and announces for selected notice.
Using text instead of an icon, for now.
2019-11-09 18:07:50 -08:00
Phil Hagelberg 918e1353f6 Add header to profile/notice pages linking to pleroma-fe. 2019-11-09 18:07:50 -08:00
Phil Hagelberg 33a26b61c3 Remove activity/user representer; move logic to controller. 2019-11-09 18:07:50 -08:00
Phil Hagelberg 41fde63def Get rid of @data in views and use separate fields. 2019-11-09 18:07:50 -08:00
Phil Hagelberg 2d1897e8a7 Apply all suggested changes from reviewers. 2019-11-09 18:07:50 -08:00
Phil Hagelberg cc1b07132f Notices should show entire thread from context. 2019-11-09 18:07:08 -08:00
Phil Hagelberg e79d8985ab Don't show 404 in static-fe controller unless it's actually not found. 2019-11-09 18:06:51 -08:00
William Pitcock 2b5bd5236d static fe: add user profile rendering 2019-11-09 18:06:51 -08:00
William Pitcock 8f08da750a static fe: use a generic activity representer to render activities 2019-11-09 18:06:51 -08:00
William Pitcock ff8d0902f3 static fe: formatting 2019-11-09 18:06:51 -08:00
William Pitcock a4d3a8ec03 static fe: proof of concept 2019-11-09 18:06:51 -08:00