Commit graph

2923 commits

Author SHA1 Message Date
P. Reis
49d815826c refactor(languageSchema): enforce return type 2024-10-08 17:07:05 -03:00
P. Reis
fc5e9b2990 Revert "refactor: move getConfigs() function and frontendConfig logic to 'src/utils/frontendConfig.ts'"
This reverts commit ab85360d2f.

The discussion started publicly in Gitlab: https://gitlab.com/soapbox-pub/ditto/-/merge_requests/537#note_2148430111
Then it kept going in Element, basically the purpose of the commit is
correct, but the way Patrick did it is not good.
2024-10-08 16:58:42 -03:00
P. Reis
20caaa9ebd refactor: LibreTranslate and DeepL with separate environment variables for their configuration 2024-10-08 16:53:30 -03:00
Alex Gleason
1ed6cac1c4
Add a crypto module to convert ECDSA private CryptoKey into a public key 2024-10-08 13:56:46 -05:00
Alex Gleason
8abac7ffa7
InstanceV2: remove supported_mime_types property 2024-10-08 12:52:14 -05:00
P. Reis
dbd590228d fix: typo 2024-10-08 14:39:59 -03:00
Alex Gleason
6430dd11ad
Merge remote-tracking branch 'origin/main' into push 2024-10-08 12:37:11 -05:00
P. Reis
f76ee000b0 refactor: use 'lang' instead of 'target_language' 2024-10-08 14:35:51 -03:00
Alex Gleason
e6495c3687
Also add nostr to InstanceV2 2024-10-08 12:35:03 -05:00
Alex Gleason
248324f642
Add pleroma to InstanceV2 2024-10-08 12:32:00 -05:00
P. Reis
a3bc5ec5c3 refactor: remove translation enabled in instanceV1Controller 2024-10-08 14:27:00 -03:00
P. Reis
ba23931727 refactor: remove unused imports 2024-10-08 14:25:25 -03:00
P. Reis
d4a8ec21fe fix: add 'pure' option in EventsDB
if pure is true, EventsDB will return a Nostr event, otherwise it will return a Ditto event
2024-10-08 14:17:27 -03:00
P. Reis
df27959d35 fix(relay.ts): purify event 2024-10-08 14:15:48 -03:00
P. Reis
17be4ab48f fix(instanceV1Controller): add translation field 2024-10-08 11:11:29 -03:00
P. Reis
3f00f255a5 fix: type assertions in EventsDB 2024-10-08 11:01:34 -03:00
P. Reis
6c93153117 refactor: get language from event itself 2024-10-07 17:55:50 -03:00
P. Reis
acbdae29ae fix(EventsDB): type is correct, ignore type complaint 2024-10-07 17:54:41 -03:00
P. Reis
bfab84d937 refactor: make provider lowercase because supporting case insensitive is allegedly protocol bloat 2024-10-07 17:54:03 -03:00
P. Reis
4712cb1d80 fix: fix language property in the Mastodon API 2024-10-07 16:08:23 -03:00
P. Reis
bbbce958d9 chore: update nostrify:db 2024-10-07 16:04:59 -03:00
P. Reis
01a16473ab Merge branch 'main' into translate-status 2024-10-07 15:02:47 -03:00
P. Reis
b369b2171d feat: create translateController - /api/v1/statuses/:id/translate 2024-10-07 15:02:04 -03:00
P. Reis
8e58b1a7d4 feat: create translatorMiddleware 2024-10-07 15:00:46 -03:00
P. Reis
a2d8478e1a test(LibreTranslateTranslator): create multiple tests 2024-10-07 14:59:05 -03:00
P. Reis
c23ddb7d84 feat: create LibreTranslateTranslator class that implements DittoTranslator 2024-10-07 14:58:33 -03:00
P. Reis
321d26b470 test(DeepLTranslator): create multiple tests 2024-10-07 14:55:12 -03:00
P. Reis
27f435a93c feat: create DeepLTranslator class that implements DittoTranslator 2024-10-07 14:54:10 -03:00
P. Reis
ea4d0f002a feat: create dittoTranslations LRUCache, create DittoTranslator interface, create MastodonTranslation type, create DittoTranslation type, create Provider type and some other minor ones 2024-10-07 14:42:10 -03:00
P. Reis
f434f87584 feat(instanceV2Controller): enable translation 2024-10-07 14:39:42 -03:00
P. Reis
c6626313bc feat: get TRANSLATION_PROVIDER, TRANSLATION_PROVIDER_ENDPOINT & TRANSLATION_PROVIDER_API_KEY enviornment variables 2024-10-07 14:38:55 -03:00
P. Reis
de8eba4079 feat: create getLanguage() function, used for testing purposes 2024-10-07 14:37:53 -03:00
P. Reis
0d126ad3b7 feat(languageSchema): split value to extract only language and not country code
pt-BR becomes pt
en-US becomes en
2024-10-07 14:36:26 -03:00
Alex Gleason
ff2553eb0f
Return a PushSubscription response 2024-10-06 16:07:32 -05:00
Alex Gleason
757b6c7e1c
Merge remote-tracking branch 'origin/main' into push 2024-10-06 15:51:50 -05:00
Alex Gleason
406cc6506b Merge branch 'captcha' into 'main'
Puzzle Captcha API

See merge request soapbox-pub/ditto!536
2024-10-05 20:59:37 +00:00
Alex Gleason
3aaf5030ca
captcha: add a small amount of noise 2024-10-05 15:24:44 -05:00
P. Reis
f3b7f91a07 feat: languageSchema converts value to lowercase and returns type LanguageCode 2024-10-04 23:37:01 -03:00
Alex Gleason
1cd7c99bda
Add account.source.ditto.captch_solved field 2024-10-04 19:26:47 -05:00
Alex Gleason
3b5b4cbd6b
Expose the Ditto pubkey to the policy worker 2024-10-04 19:21:56 -05:00
Alex Gleason
a2e8de6c36
Rate-limit the captcha endpoints 2024-10-04 16:48:24 -05:00
Alex Gleason
5ed683b146
Add puzzle source files 2024-10-04 16:43:33 -05:00
Alex Gleason
18f1a94520
captcha: show a random image, preload backgrounds into memory 2024-10-04 16:42:02 -05:00
Alex Gleason
c81005a050
captcha: refactor canvas size globals 2024-10-04 15:56:32 -05:00
Alex Gleason
6d09f69e26
Move captcha graphics 2024-10-04 15:48:34 -05:00
Alex Gleason
71873997e5
captcha: refactor canvas calls 2024-10-04 15:42:01 -05:00
Alex Gleason
cdf727e5c7
captcha: use an already transparent png with stroke to make the hole 2024-10-04 15:10:42 -05:00
Alex Gleason
030bfa94d6
captcha: rename puzzle to bg, and piece to puzzle 2024-10-04 14:22:17 -05:00
Alex Gleason
68c0d437ee
captcha: resize pieces, require nip98 auth 2024-10-04 13:34:12 -05:00
Alex Gleason
952d5e4370
Publish a label when the user solves a captcha 2024-10-04 12:53:37 -05:00