Commit graph

187 commits

Author SHA1 Message Date
SleeplessOne1917
643c1f6f01
Make confirm popup for adult consent (#2419)
* Make confirm popup for adult consent

* Fix import

* Fix blur and adjust user settings

* Make confirmation popup more stylish

* Add setting to site settings form

* Fix modal bug

* Put adult consent logic all in one place

* Make modal use markdown

* Fix consent modal showing up for currently logged in admin

* Add go-back redirect countdown

* Center modal title

* Handle enable_nsfw correctly

* Blur background of modal to hide spicy things

* Add translations
2024-04-18 19:54:16 -04:00
matc-pub
70e382b3d9
Rework query parsing (#2396)
* Pass parsed query params as props to components

* Pass parsed query params to fetchInitialData

* Pass router Match to fetchInitialData

* Cast individual routes to their concrete types

Adds an IRoutePropsWithFetch definition for routes with getQueryParams
or fetchInitialData to cause compiler errors when the types no longer
match.

* Don't double decode query parameters.

Problem: A search for "%ab" produces a url with "%25ab". Refreshing
the page results in URLSearchParams turning "%25ab" back into "%ab".
decodeURIComponent() then complains about "%ab" being malformed.

This removes decodeURIComponent() calls for query parameters and
composes all query strings with getQueryString(), which now uses
URLSearchParams. Query parsing already goes through getQueryParams()
which also uses URLSearchParams.

* Fix for PictrsImage when src also has query params

* Small getQueryParams cleanup
2024-03-27 09:25:59 -04:00
matc-pub
9a5f9dd18a
Do most of the theme handling from the Theme component (#2390)
* Set data-bs-theme attribute from Theme component

* Handle temporary theme changes in Theme component

* Fetch theme list on AdminSettings component mount

* Include CodeTheme in Theme component

* Improve handling of browser-compact theme

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-14 08:33:49 -04:00
matc-pub
e832cd2729
Lazy load translations and date-fns, server side support for "Browser Default" language (#2380)
* Lazy load i18n translations.

* Lazy load date-fns

* Fix inconsistent DOMContentLoaded event.

Only when no translations and date-fns have to be dynamically loaded
(e.g. for en-US) the NavBar `componentDidMount` is early enough to
listen for "DOMContentLoaded".

Removes one redundant `requestNotificationPermission()` call.

* Rename interface language code "pt_BR" to "pt-BR".

Browsers ask for "pt-BR", but the "interface_language" saved in the
settings dialog asks for "pt_BR". This change will make the settings
dialog ask for "pt-BR" instead of "pt_BR". For users that already (or
still) have "pt_BR" configured, "pt-BR" will be used, but the settings
dialog will present it as unspecified.

* Use Accept-Language request header

* Prefetch translation and date-fns

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-13 16:39:45 -04:00
Dessalines
1ff4acc049
Changing security.txt to use github security advisories page. (#2334)
* Changing security.txt to use github security advisories page.

- Fixes #2332

* Adding an expires date, one year from build date.

* Add a year to the build date in code.

* Fix dev.dockerfile build date.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-02-16 10:17:15 -05:00
SleeplessOne1917
8a722c939c
Only generate manifest if it isn't already in memory (#2272)
* Only generate manifest if it isn't already in memory

* Remove forward header

---------

Co-authored-by: SleeplessOne <insomnia-void@protonmail.com>
2023-12-06 08:57:31 -05:00
Dessalines
7702c041e5
Move lemmyClient generation into fetchInitialData functions. Fixes #2243 (#2260)
* Trying more ssr fixes. #2243

* Try to enforce cross-fetch again.

* Try to forward cookies.

* Try to forward cookies 2.

* Trying a new cross-fetch.

* Fixing headers

* Fixing some auth issues.

* Fixing isBanned.

* Fix shutdown.

* Pushing up some tries.

* Moving lemmyclient building into fetchInitialData functions.
2023-12-05 03:07:36 +00:00
phiresky
03fcaa0815
fix wrapped http client (#2267)
wrappedhttpclient has two bugs:

1. setHeaders becomes async with errors gobbled up. this is probably not intentional and the result is not awaited at the call site
2. wrappedhttpclient overrides methods in the prototype and not the instance. this means that when a new instance is created, from then on all methdos on all wrappedhttpclients call the inner methods on the newly created client instead of their respective clients

this PR tries to fix both. it is untested so idk if it works

related: #2243
2023-12-04 17:24:15 +00:00
Dessalines
7222632389
Trying another SSR fix. #2243 (#2251) 2023-11-29 09:44:31 -05:00
Dessalines
5ec9baa5a5
Attempting to fix SSR. #2243 (#2247)
Co-authored-by: SleeplessOne1917 <insomnia_void@protonmail.com>
2023-11-28 21:37:56 -05:00
Dessalines
69a3a63dfd
Fixing QR code CSP, try 2. Fixes #2241 (#2242)
Co-authored-by: SleeplessOne1917 <insomnia_void@protonmail.com>
2023-11-28 09:56:28 -05:00
Kroese
aafcfaf649
Fix shutdown behaviour (#2239)
* Handle SIGTERM signal

* Use constants

* Styling

* Prettier

* setTimeout

* Prettier

* Display version

* Display version

* Prettier
2023-11-27 18:37:37 -05:00
SleeplessOne1917
dd3842655a
Update bs theme when site theme is changed (#2226) 2023-11-17 09:35:43 -05:00
Dessalines
b40a3c3e27
Fixing errors. Fixes #2216 (#2219) 2023-11-13 18:47:03 -05:00
Dessalines
fe28c691e3
Fixing QR code CSP. (#2218) 2023-11-13 12:45:27 -05:00
Benjamin Barbeau
2b5068187c
Add code highlighting (#2195)
* Add highlighting

* Adds it to mdNoImages as well

* Revert "Adds it to mdNoImages as well"

This reverts commit 2f8e3bb0cc.

* Revert "Add highlighting"

This reverts commit 80bcddd4df.

* Prevent yarn.lock from massively updating

* Add code themes locally

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-20 11:18:13 -04:00
Dessalines
2c1f4538be
Adding cursor pagination. Fixes #2155 (#2173)
* Adding cursor pagination. Fixes #2155

* Addressing PR comments.

---------

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
2023-10-06 09:08:55 -04:00
SleeplessOne1917
d9fe7d1488
Remote follow (#1875)
* Redirect to page user was trying to access on login

* Make modal

* Make modal look better

* Forgot to include in merge

* Get rid of modal

* Add external interaction page

* Tweak success page

* Add loading screen for remote fetch and refactor loading ellipses

* Add error state for remote fetch page

* Add card to federation success page

* Bring back remote fetch modal

* Add autofocus to remote fetch modal input

* Redirect for remote fetch

* Remove dummy data

* Remove duplicate functions

* Update translations

* Update translations

* Fix linting error

* Fix linting errors

* feat: Add toasts for remote follow error conditions
2023-09-25 23:32:37 -04:00
SleeplessOne1917
65e669035d
Remove auth from API request body params (#2140)
* chore: Remove auth param from API request bodies

* chore: Update client to use bearer token
2023-09-25 21:07:26 -04:00
ab545e0e19
Increase cache-control max-age to 60s (#2124)
Cache headers have been active in production for a while now, and I didnt see any issues reported. So it should be save to increase the max-age to reduce server load further.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-09-12 15:27:56 -04:00
biosfood
8e2609a96d
Add moderator view button (#1993)
* update lemmy-js-client version

* add moderator view to moderator view select

* fix some linting problems introduced in recent lemmy-js-client changes

* remove form id from mardown-textarea submit

* add default delete_content as false

* manually check if a user is an admin

* update lemmy-js-client to 0.19.0-rc.7
2023-09-06 08:43:19 -04:00
Dessalines
9f2289d466
Upgrading deps, running prettier. (#1987) 2023-07-28 16:15:42 -04:00
SleeplessOne1917
dd42bc2a3d
ES-Lint tweak (#2001) 2023-07-28 16:07:16 -04:00
randfur
cd1a11c77a
Fix start_url and scope (#1931)
Remove unused import
2023-07-13 20:01:14 -04:00
Sander Saarend
5d4edf555e
Fix CSP in dev mode (#1918) 2023-07-12 10:03:49 -04:00
Sander Saarend
546f0ad704
Add nonce-based CSP header (#1907)
* Remove websocket config

* Add nonce based CSP
2023-07-10 14:26:41 -04:00
drumlinish
1774ecdf6c
Disallow /modlog since it is not relevant for bots (#1850) 2023-07-10 10:17:24 -04:00
SleeplessOne1917
322a44bf24
Fix data-bs-theme (#1810)
* Fix data-bs-theme

* Add other dark themes

* Add vaporwave-dark to dark theme list
2023-07-04 16:53:28 -04:00
SleeplessOne1917
f6cbc896af
feat(theme): Vaporwave (#1682)
* Make vaporwave dark theme work

* Tweak vaporwave light theme

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-04 12:13:31 -04:00
SleeplessOne1917
a0cf54c0a0
Fix search page breaking on initial load when logged in (#1781)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-03 16:43:52 -04:00
Alec Armbruster
af22947c0f
fix req.cookie nonexistent -.- 2023-06-30 10:35:57 -04:00
Alec Armbruster
0bcb2d77be
wip 2023-06-30 10:04:19 -04:00
Alec Armbruster
7743fa98b9
wip 2023-06-30 10:04:01 -04:00
Alec Armbruster
c804cf958a
Merge branch 'main' of https://github.com/LemmyNet/lemmy-ui into fix-cache-auth 2023-06-30 09:52:15 -04:00
Diamond
a7592d74bb
Enforce SameSite=Strict (#1713) 2023-06-30 09:51:41 -04:00
Alec Armbruster
da45ffb46b
fix cache auth method 2023-06-30 09:42:09 -04:00
SleeplessOne1917
cc184a86c8 Fix authorized route false flag 2023-06-29 18:12:22 -04:00
SleeplessOne1917
2d88e42cab Fix dev caching issue 2023-06-29 16:33:08 -04:00
Alec Armbruster
d8ee0ec78a
change max-age to 5 for non-authed responses 2023-06-29 13:33:30 -04:00
SleeplessOne1917
339cefa2b0 Cache static data for a day 2023-06-29 13:14:48 -04:00
SleeplessOne1917
751495702c
Use git hash to break cache (#1684)
* Use git hash to break cache

* Address PR feedback

* Make hash docker agnostic

* Add trailing slash

* Update .prettierignore

Co-authored-by: Alec Armbruster <35377827+alectrocute@users.noreply.github.com>

* Remove debugging log

* implement getStaticDir util

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Alec Armbruster <35377827+alectrocute@users.noreply.github.com>
2023-06-29 10:29:33 -04:00
SleeplessOne1917
005135d4f2
Allow audio captcha through CSP (#1690)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-29 07:20:45 -04:00
Dessalines
6b1ea447e5
Fixing lints. (#1686) 2023-06-29 01:24:52 -04:00
Robert C. Maehl
9a04d0c58e
Add Security.txt (#1408)
* Create security-handler.ts

https://securitytxt.org/

* Add SecurityHandler

* Update security-handler.ts

* Update index.tsx

* Ensure external domain.tld is used

---------

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
2023-06-28 23:10:13 -04:00
SleeplessOne1917
ef66dfa6fd
Return appropriate error codes (#1665)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-28 16:44:26 -04:00
SleeplessOne1917
5c16be767c
Add i386 theme (#1662)
* Add i386 theme

* Make searchable selects display properly

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-28 16:43:33 -04:00
32063a5794
Set cache-control headers to reduce server load (fixes #412) (#1641)
* Set cache-control headers to reduce server load (fixes #412)

* add missing file

* remove old middleware folder

* use let

---------

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
2023-06-28 16:32:07 -04:00
Alec Armbruster
6d92c07c89
Merge branch 'main' into feat/pureblack-theme 2023-06-26 15:50:14 -04:00
Alec Armbruster
96cf021105
Move password reset form to separate route, view (#1390)
* rework password reset form

* make self-suggested changes

* cleaning

* validate in handlePasswordReset as well

* update submodule

* partially make suggested changes

* make suggested changes

* resolve merge conflicts

* resolve merge conflicts

* resolve merge conflicts

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-26 14:54:38 -04:00
Alec Armbruster
94d223b162
add darkly-pureblack theme 2023-06-26 10:37:39 -04:00