Commit graph

1155 commits

Author SHA1 Message Date
Johann150 8d78113907
server: fix cache eviction
Previously due to bad logic it was impossible for cache entries to ever
be evicted. Ideally this should not be done again but should just use redis
but that can be done another day.

Changelog: Fixed
2023-11-04 11:52:57 +01:00
Johann150 6367fcca79
fix pagination for shuffled timeline
Some checks failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
2023-10-30 17:41:44 +01:00
Johann150 0bcbb38ecc
add shuffled note timeline
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/test Pipeline failed
Changelog: Added
2023-09-25 21:14:28 +02:00
Johann150 2fcea24817
activitypub: parse MathML to MFM
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
Ref: FEP-dc88
Changelog: Changed
2023-09-24 19:28:55 +02:00
Johann150 f6c3d44265
activitypub: add MathML rendering
Ref: #343 (comment)
Ref: FEP-dc88
Changelog: Changed
2023-09-24 17:58:49 +02:00
Johann150 1e7d2cf54c
move dependency to right package
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/test Pipeline failed
The backend depends on argon2 since it is used for hashing passwords. Since
it is not used for building the package, the dependency is by the backend
package itself.
2023-09-24 17:02:14 +02:00
Johann150 37658f5162
server: try to fix queue errors
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
Some errors in the queue are not properly handled. For example a blocked instance
will cause the respective queue job to be retried. this should of course not happen
and instead the job should be dropped. This is trying to correct that.

Changelog: Fixed
2023-09-24 16:29:27 +02:00
Johann150 2c69cb4a92
server: check inbox URLs
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
This adds a check for inbox and sharedInbox URLs to be both
valid and also absolute URLs. If the normal inbox URL is invalid,
the actor will be rejected. If the sharedInbox URL is invalid, it
will be ignored.

Changelog: Fixed
2023-08-16 19:21:37 +02:00
Johann150 c669e9212f
docs: add descriptions for some endpoints
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-27 18:17:36 +02:00
Norm dbe2b7611d backend: improve removeMentionedRemoteUsersColumn revert query (#403)
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
This is an optimized version made by Volpeon that should run faster if
the instance has a lot of notes.

See <https://is-a.wyvern.rip/notes/9habqldl6j> for a comparison of the
EXPLAIN ANALYZE of the old and new queries.

Co-authored-by: Volpeon <git@volpeon.ink>

Reviewed-on: #403
2023-07-22 14:10:37 +00:00
Johann150 650b797fd6
star is like
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-19 10:27:56 +02:00
Johann150 b61e477c0c
server: fix default arguments for fetch
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-19 10:13:33 +02:00
Johann150 75ab4de41f
server: limit caching time for public keys 2023-07-19 09:43:17 +02:00
Johann150 456a86af8d
remove erroneous variable
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-16 17:43:15 +02:00
Johann150 2fbd31abe6
server: refactor fetching
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
- The `timeout` parameter does not exist in `node-fetch`, so the timeout was not
  working properly.
- Refactor the User-Agent header to be set in a central place instead of several
  different places.
- Refactor more places to use getResult which handles the timeout and everything
  else already instead of the normal `fetch` provided by `node-fetch`.
2023-07-16 17:02:22 +02:00
Johann150 9b4e976bda
activitypub: correctly handle new notes that were edited 2023-07-16 14:32:57 +02:00
Johann150 cc776a6b9b
server: use foundkey-js permissions definition
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-15 09:31:24 +02:00
Johann150 46660abb6a
server: fix thread mutes not working
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
Because of differing string names for the `update` notification in
the application and the database, there were some errors.

Changelog: Fixed
2023-07-10 18:20:40 +02:00
Chloe Kudryavtsev d3eb6a3340 fix reply federation
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-02 14:25:57 +02:00
Chloe Kudryavtsev af1893d71f createaQueryBuilder => createQueryBuilder
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-02 13:57:19 +02:00
Johann150 77358c8f4b
13.0.0-preview6
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/tag/build Pipeline was successful
ci/woodpecker/tag/lint-client Pipeline was successful
ci/woodpecker/tag/lint-foundkey-js Pipeline was successful
ci/woodpecker/tag/lint-sw Pipeline was successful
ci/woodpecker/tag/test Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/lint-backend Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-02 11:13:19 +02:00
Johann150 796adc8599
trigger side effects after updating note
Some checks failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-02 10:06:54 +02:00
Johann150 ff8b9b6651
refactor note creation side effects
Refactoring the side effects in this way should allow them to be
reused for updating notes as well.
2023-07-02 10:06:53 +02:00
Johann150 c1268c04f8
server: add noteStream handling for updated notes 2023-07-02 10:06:53 +02:00
Johann150 42b555e5e4
activitypub: handle incoming Update Note activities
Changelog: Added
2023-07-02 10:06:53 +02:00
Johann150 5c3e7c132a
add function to update a note 2023-07-02 10:06:53 +02:00
Johann150 ca24080596
add update timestamp & notification 2023-07-02 10:06:38 +02:00
Johann150 a12debb7b6
server: replace unzipper with decompress
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
The unzipper package did not seem to work any more and was
mangling the meta.json file in its extracted form and potentially
other files which lead to the emoji import not working properly.

Changelog: Fixed
2023-07-02 00:09:45 +02:00
Johann150 f760426142
fix internal download in emoji import
Changelog: Fixed
2023-07-02 00:09:35 +02:00
Johann150 2f30af1812
server: fix instance actor creation
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
Because findBy returns an array which is always truthy, this would
mean the user is not actually created as requested and instead an
empty array is returned.
2023-06-29 21:21:26 +02:00
Johann150 2ea6daaf7a
rename extractDbHost to extractPunyHost
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-06-27 22:02:32 +02:00
Johann150 597de07465
server: refactor HTTP signature validation
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-06-27 21:46:00 +02:00
Hélène b600efae0d
BREAKING: activitypub: validate fetch signatures
Enforces HTTP signatures on object fetches, and rejects fetches from blocked
instances. This should mean proper and full blocking of remote instances.

This is now default behavior, which makes it a breaking change. To disable
it (mostly for development purposes), the configuration item
`allowUnsignedFetches` can be set to true. It is not the default for
development environments as it is important to have as close as possible
behavior to real environments for ActivityPub development.

Co-authored-by: nullobsi <me@nullob.si>
Co-authored-by: Norm <normandy@biribiri.dev>
Changelog: Added
2023-06-25 20:42:14 +02:00
Johann150 51a319e8ca
use extractDbHost
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-06-23 22:00:31 +02:00
Johann150 cc0915775b
server: add webhook stat to nodeinfo
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
This will show the number of active web hooks in the node info.
This is desired to be able to gauge webhook usage in Foundkey.

Changelog: Added
2023-06-05 23:39:43 +02:00
Johann150 f181a8805d
docs: remove bannerColor
This is a fixup for commit a673647fba.
2023-06-05 23:39:43 +02:00
Johann150 38786b6999
transform tests from ts to js
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline failed
ci/woodpecker/push/test unknown status
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
This allows to get rid of the special loader for ts files. There is
no need for the test files to be written in TypeScript, plain
JavaScript should be fine for this purpose.
2023-06-01 23:21:03 +02:00
Johann150 a0f0bac1ca
make mutes case insensitive
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
closes #392

Changelog: Changed
2023-05-31 13:02:40 +02:00
Johann150 af003fc0fe
try to fix test timeout (again)
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-31 12:42:13 +02:00
Johann150 94cd10365d
Revert "try to fix tests"
This reverts commit c53486a47c.
2023-05-31 12:31:57 +02:00
Johann150 0addcddd6c
server: respect log level environment variable
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-31 11:39:50 +02:00
Johann150 64c4973eca
fixup: removing default exports
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
This is a fixup for commit 410c519953.
2023-05-30 21:14:42 +02:00
Johann150 7272bde464
fix more variable issues in processContent
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 20:58:18 +02:00
Johann150 7c9e118ff1
refactor checkExpired to use Promise.all
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 20:40:25 +02:00
Johann150 bed8286175
fix missing variable in processContent
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 20:25:55 +02:00
Johann150 f00b3cc378
add missing import for emoji parsing
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 19:53:17 +02:00
Johann150 21ab8e75ee
activitypub: improve JSON-LD context
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
Added @type values for most definitions, and made name and value only
scoped to the PropertyValue type. (Blame Volpeon)
2023-05-30 17:57:03 +02:00
Norm 9c5755cf65
backend: fixup another missed import of extractEmojis
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 00:17:56 -04:00
Norm fce14a07da
backend: fix import of extractEmojis in models/person
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 00:12:07 -04:00
Johann150 704651e057
refactor mutedWordsCache and index to separate file
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-29 22:29:37 +02:00
Johann150 eb971de3a7
move extractEmojis to models/tags 2023-05-29 22:29:36 +02:00
Johann150 d74b7d2eec
refactor note content processing
Refactor the content processing into a separate function so it can be
reused in a updateNote function to be created.
2023-05-29 22:29:36 +02:00
Johann150 89fad52272
remove redundant check
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
Whether the actor is suspended is already checked in the performOneActivity
function and does not need to be checked here again since the actor is still
the same as it was there.
2023-05-28 23:31:06 +02:00
Johann150 2696c34f6c
fix some audience parsing assumptions
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
The assumptions made in the comment is actually wrong. The comment says:
"If value is a string, this means it must have passed through the resolver,
which means it must be public." But this is not true because we do signed
GET requests which means we may well get non-public posts using the
resolver.
2023-05-28 23:28:43 +02:00
Johann150 bda8488194
fix messaging messages with multiple recipients
instead of returning early, this should only return after all messaging
messages have been created
2023-05-28 23:28:42 +02:00
Johann150 c9df2fd060
validate that note attributed to is not local 2023-05-28 23:28:42 +02:00
Johann150 cc342f1443
refactor createNote, translate comments
Use the already existing functions isPost and toArray instead of
reimplementing them.
2023-05-28 23:28:42 +02:00
Johann150 f883d2e31b
fix showing follower/following count
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-27 20:42:10 +02:00
Johann150 d55f8742b8
cache when computing note count etc. 2023-05-27 20:34:28 +02:00
Puniko 404bb3b6b6
parseSimple in backend 2023-05-27 12:12:28 +02:00
Puniko f6ff21ee53
update mfm-js lib 2023-05-27 12:12:28 +02:00
Johann150 35e814fab4
fix: don't use psql 13 functions
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
The function GEN_RANDOM_UUID was only introduced to built in postgresql
in version 13, however, the installation guide specifies that version 12
should be sufficient.
2023-05-27 11:18:06 +02:00
Johann150 9859537b02
BREAKING migrate note favorites to clips
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
The following endpoints are removed:
- `api/i/favorites`
- `api/notes/favorites/create`
- `api/notes/favorites/delete`
The following endpoints are changed:
- `api/notes/state`
- `api/users/stats`

closes #374

Changelog: Removed
2023-05-26 21:17:04 +02:00
Johann150 aa7171e116
server: remove favorites 2023-05-26 20:59:53 +02:00
Johann150 a3c7571670
add missing comma
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/lint-backend Pipeline was successful
ci/woodpecker/tag/lint-foundkey-js Pipeline was successful
ci/woodpecker/tag/lint-client Pipeline was successful
ci/woodpecker/tag/build Pipeline was successful
ci/woodpecker/tag/lint-sw Pipeline was successful
ci/woodpecker/tag/test Pipeline was successful
2023-05-23 23:56:30 +02:00
Johann150 79acdd7652
fix: properly await file deletion
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-23 22:56:51 +02:00
Johann150 f54fa0ad02
server: remove unnecessary complex loop 2023-05-23 22:56:27 +02:00
Johann150 dfe12cba75
show stack trace from API handler
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-23 22:44:56 +02:00
Johann150 e75123602f
fix reference error from isNull 2023-05-23 22:44:15 +02:00
Johann150 c81368f617
update changelog and version number
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/tag/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/tag/lint-sw Pipeline was successful
ci/woodpecker/tag/lint-foundkey-js Pipeline was successful
ci/woodpecker/tag/lint-backend Pipeline was successful
ci/woodpecker/tag/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/tag/test Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
2023-05-23 21:59:14 +02:00
Johann150 4307010a9f
fix new occurences of isDeleted
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-23 21:49:34 +02:00
Johann150 e584937b4f
fix: missing paren, type error 2023-05-23 21:49:34 +02:00
Johann150 4312393169
Revert 'Revert "server: fix user deletion race condition"'
This reverts commit bb3ec8bafe.
2023-05-23 21:49:33 +02:00
Johann150 2fde652b4a
server: fix drive quota for remote users
Some checks failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
This deletes as many files as necessary to ensure the drive quota for
remote users is kept. Previously only one file would have been deleted
for each file added.

Changelog: Fixed
Co-authored-by: CGsama <CGsama@outlook.com>
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
2023-05-23 21:36:35 +02:00
Johann150 efa8305e0b
BREAKING rename environment variables from MK_... to FK_...
Changelog: Changed
2023-05-23 19:49:55 +02:00
Johann150 e6a8173378
refactor onlyQueue and onlyServer configuration
Instead of checking this configuration in the respective component (queue)
or not at all (server), the configuration can be checked when starting the
respective workers.
2023-05-23 19:49:55 +02:00
Johann150 239a52eb99
add "quiet" log level
This log level replaces the "MK_QUIET" environment variable to unify
the interface in a sensible way. This also removes the "MK_VERBOSE"
environment variable which was unused.
2023-05-23 19:49:55 +02:00
Johann150 38c2d86983
add log level environment variable
To avoid a circular dependency this requires moving the log level
definitions. Also to avoid a circular dependency the env.ts file cannot
use a logger and instead uses plain `console.log`.
2023-05-23 19:49:55 +02:00
Ignas Kiela 6b9a3259f5
fix: log levels order
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
Most important messages are the ones with the highest value

This is a fixup for commit c5327f74d4.
2023-05-23 18:12:48 +02:00
Ignas Kiela 296c40c5b4
fix: stop sending pings on every pong
This resulted in endless ping-pong traffic on the websocket, happening
every interval of network latency to the server (e.g. for me, with 40ms
latency to my server, it was about every 40ms). On my server this ended
up taking about 20% of foundkey's CPU usage. Now, just send pings every
30s, and check if we have received any pong's in last 60 seconds to
check that the connection is still alive.

Changelog: Fixed
2023-05-23 18:08:08 +02:00
Johann150 fe65cba9be
add "nobody" follower visibility
Adds a new follower/following visibility that hides followers even from
yourself.

Changelog: Added
2023-05-20 23:18:57 +02:00
Johann150 ef4055840b
BREAKING server: respect ffVisibility on stats endpoint
This makes the returned values `localFollowingCount`,
`remoteFollowingCount`, `followingCount`, `localFollowersCount`,
`remotefollowersCount`,  `followersCount` optional on the API endpoint
`users/stats`.

Changelog: Fixed
2023-05-20 23:18:57 +02:00
Johann150 ded48c96d8
server: use foundkey-js definition of ffVisibilities 2023-05-20 23:18:56 +02:00
Johann150 ed9f2f4900
server: refactor ffVisibility checks into function 2023-05-20 23:18:56 +02:00
Johann150 ff66f48ea2
remove syslog
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
closes #19

Changelog: Removed
2023-05-19 23:15:24 +02:00
Johann150 2c3f731ae2
remove more default exports 2023-05-19 23:08:06 +02:00
Johann150 b0d8e15796
fixup: remove some default exports
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
This is a fixup for commit 410c519953.
2023-05-19 20:07:26 +02:00
Johann150 410c519953
remove some default exports
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-19 00:32:11 +02:00
Johann150 d6452795b0
translate more comments 2023-05-19 00:21:47 +02:00
Johann150 85a392ee33
logger: remove unused structured data
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
The `data` field is not used anywhere in the logger. While it would
be possible to send structured data through syslog, it seems unnecessary
at present and also the way in which this structured data would have to be
provided sounds too cumbersome to implement for no real value.
2023-05-18 22:42:30 +02:00
Johann150 c5327f74d4
refactor to check log levels
This will eventually allow the log level to be configured. For now,
the explicit debug flag does not work.
2023-05-18 21:41:32 +02:00
Johann150 1516ddfc9b
refactor: remove CacheableUser & co
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
The CacheableUser, CacheableLocalUser and CacheableRemoteUser are
identical types to User, ILocalUser and IRemoteUser so it seems
nonsensical to have different types for them.
2023-05-18 13:25:57 +02:00
Johann150 9675ced915
translate japanese comment
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-18 02:08:07 +02:00
Johann150 c53486a47c
try to fix tests
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-15 20:14:51 +02:00
Johann150 386d1bbf74
fix: update meta cache between workers
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-12 19:34:08 +02:00
Johann150 e6c7f4b693
refactor: use switch for receiving IPC messages 2023-05-12 19:18:17 +02:00
Johann150 ac81acfe9d
tests: disable timeouts for server setup
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-08 00:07:40 +02:00
Johann150 5a4e300552
tests: fix visibility tests
Some checks failed
ci/woodpecker/push/lint-sw Pipeline is pending
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/test unknown status
ci/woodpecker/push/lint-foundkey-js Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
removed a duplicate test and fixed another that i messed up when
updating tests for the changed visibility
2023-05-07 23:38:29 +02:00
Johann150 d8c2cc2ef0
tests: translate some japanese to english 2023-05-07 23:37:47 +02:00
Johann150 3d4df807b0
tests: refactor ffVisibility tests
Using some closures to partly generate the tests to achieve better coverage
2023-05-07 23:35:29 +02:00