Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70d1ffe9a2 | ||
|
|
f67e2ae35e | ||
|
|
1f3bb27e17 | ||
|
|
cff75e3a47 | ||
|
|
ff5e635dda | ||
|
|
6727e1817a | ||
|
|
c42229f78c | ||
|
|
8156c1927c | ||
|
|
088c54ddf3 | ||
|
|
6fccb6fe35 | ||
|
|
3b3f1f6b93 | ||
|
|
62189bf11d | ||
|
|
fb4949b511 | ||
|
|
d4b1788a4f | ||
|
|
587997dd67 | ||
|
|
6fc2d001b2 | ||
|
|
4eda3da75d | ||
|
|
163f7e4e2b | ||
|
|
44a5895b0c | ||
|
|
3d7d406834 | ||
|
|
bdc8be4508 | ||
|
|
9ad96f560d | ||
|
|
bc5f2beaf7 | ||
|
|
fba57318fa | ||
|
|
12bb75809f | ||
|
|
37b12c5fee | ||
|
|
830385ea2b | ||
|
|
dc63fa57b8 | ||
|
|
5252b8f320 | ||
|
|
a4ced664cf | ||
|
|
8fecf7de2d | ||
|
|
3ca29603ed | ||
|
|
8e59145826 | ||
|
|
e4f9d0b61e | ||
|
|
65938bb2a0 | ||
|
|
bb680e8cb8 | ||
|
|
52d201eee9 | ||
|
|
402f9e0d75 | ||
|
|
8492f24064 | ||
|
|
6f240828cf | ||
|
|
5ecf2d9629 | ||
|
|
f105d1f7ea | ||
|
|
f66c280b0b | ||
|
|
10ff4b3d2a | ||
|
|
bebb4d6370 | ||
|
|
cb34ab88f7 | ||
|
|
af2c61292b | ||
|
|
a3a66b6db2 | ||
|
|
5d5f1d6909 | ||
|
|
9872b78677 | ||
|
|
b478049303 | ||
|
|
b66f0acf4e | ||
|
|
679463eb3f | ||
|
|
02928caac1 | ||
|
|
e708f1ad2e | ||
|
|
0310bbe0f9 | ||
|
|
69ab8e50eb | ||
|
|
3df3c333bf | ||
|
|
99b5e2dbf3 | ||
|
|
d06f684f0d | ||
|
|
b39eadffeb | ||
|
|
9d0b5fac3e | ||
|
|
9ab87b2779 | ||
|
|
c47b6e5533 | ||
|
|
e0682fa868 | ||
|
|
bd18de35a6 | ||
|
|
bf37223849 | ||
|
|
93e13e5563 | ||
|
|
b45321f28d | ||
|
|
b218768904 | ||
|
|
53158b4cf4 | ||
|
|
12b51a211a | ||
|
|
a584134858 | ||
|
|
0aea550c6c | ||
|
|
5721bfd796 | ||
|
|
1c0dfeb9a4 | ||
|
|
f6fc0c535c | ||
|
|
1c7d1ece9c | ||
|
|
5f150b7a59 | ||
|
|
7b0377c85f | ||
|
|
f3e8cce2ed | ||
|
|
eeb873b816 | ||
|
|
f1e743c331 | ||
|
|
1265611f9e | ||
|
|
f38ac73615 | ||
|
|
a85ebd30c0 | ||
|
|
bd5901d15e | ||
|
|
6b08da458a | ||
|
|
26346cde30 | ||
|
|
47d6e22988 | ||
|
|
0646de22bd | ||
|
|
2b42377b3f | ||
|
|
8ae265c8f8 | ||
|
|
9f0b25e92b | ||
|
|
3866558d1d | ||
|
|
fb90558dec | ||
|
|
5860b71223 | ||
|
|
c65a44ba88 | ||
|
|
761cfc2cce | ||
|
|
2d293a6148 | ||
|
|
7f6837ccb1 | ||
|
|
206506f5e9 | ||
|
|
a5d493a8c9 | ||
|
|
e485f7bd47 | ||
|
|
7eb7c017a5 | ||
|
|
01808fa644 | ||
|
|
7e37f56db6 | ||
|
|
8686275b69 | ||
|
|
01e5aa4ddd | ||
|
|
c5a69d240a | ||
|
|
26dac40720 | ||
|
|
34c0f696af | ||
|
|
4a9a3d3235 | ||
|
|
17922f4dfd | ||
|
|
ea5e607779 | ||
|
|
b146e182c6 | ||
|
|
0695c08ac3 | ||
|
|
bbeeda7268 | ||
|
|
325f7605f2 | ||
|
|
1d12dff033 | ||
|
|
aecbf620a8 | ||
|
|
9268968fd4 | ||
|
|
b274ce1268 | ||
|
|
40217f3261 | ||
|
|
d61eac0a01 | ||
|
|
b2570eab38 | ||
|
|
71ca134599 | ||
|
|
d4226a289c | ||
|
|
83d4148de1 | ||
|
|
5f72435bfb | ||
|
|
7bfd7ce285 | ||
|
|
864dae4469 | ||
|
|
cafd2e6db3 | ||
|
|
73c362de96 | ||
|
|
5b3e456e09 | ||
|
|
b710493701 | ||
|
|
ce473f2741 | ||
|
|
02a05d7a9a | ||
|
|
0614bdcf18 | ||
|
|
4b6d261739 | ||
|
|
f70ec59359 | ||
|
|
ed08f80f05 | ||
|
|
2873344690 | ||
|
|
d6131af289 | ||
|
|
6b55b5c35c | ||
|
|
d405269526 | ||
|
|
08acdc0503 | ||
|
|
b9286c2c6e | ||
|
|
128ff89426 | ||
|
|
436f7da464 | ||
|
|
5d7edc4a4c | ||
|
|
eb7552e8f3 | ||
|
|
31d1d21d1e | ||
|
|
d9fb5c582f | ||
|
|
2cd75176a4 | ||
|
|
c7e8760ffe | ||
|
|
ad8d353f9a | ||
|
|
e2f61ede56 | ||
|
|
8f25bf056d | ||
|
|
123ba39520 | ||
|
|
f6dbf71964 | ||
|
|
8c2eba6cbb | ||
|
|
fcd35f5043 | ||
|
|
5f56681c01 | ||
|
|
cd5eb25948 | ||
|
|
ab526ed291 | ||
|
|
aa7e43a61e | ||
|
|
e29da1b47a | ||
|
|
d4e9acdb79 | ||
|
|
5f31dbd521 | ||
|
|
e0f2eb7da7 | ||
|
|
d0a13d9cc2 | ||
|
|
4f5df743ae | ||
|
|
c8a305ae92 | ||
|
|
fc5bb9511f | ||
|
|
31d614efd4 | ||
|
|
2645dea26f | ||
|
|
2cfea7b60c | ||
|
|
c5e4934ba6 | ||
|
|
c301f0c498 | ||
|
|
6ef7e2891a | ||
|
|
cee85309b8 | ||
|
|
fc15f6356d | ||
|
|
bc8ce63707 | ||
|
|
90a7e38ce9 | ||
|
|
d37999970c | ||
|
|
e247001bdb | ||
|
|
ac7cbd136b | ||
|
|
4fa53f63bd | ||
|
|
15cd034b29 | ||
|
|
125a49a1a0 | ||
|
|
5e34517e73 | ||
|
|
85fdff606d | ||
|
|
00b2685cf4 | ||
|
|
7c6fe80f1b | ||
|
|
e6729c77e7 | ||
|
|
f9658a8e7a | ||
|
|
6f1ab0073c | ||
|
|
001fdac3be | ||
|
|
fdcf5176bc |
No files matched your search
@@ -14,6 +14,3 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build PrivaPub.sln -c Release
|
run: dotnet build PrivaPub.sln -c Release
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: dotnet test PrivaPub.sln -c Release --no-build
|
|
||||||
+50
-10
@@ -12,8 +12,7 @@ env:
|
|||||||
BACKUPS: /var/backups/privapub.thepra.dev
|
BACKUPS: /var/backups/privapub.thepra.dev
|
||||||
LOCAL_URL: http://127.0.0.1:6970
|
LOCAL_URL: http://127.0.0.1:6970
|
||||||
PUBLIC_URL: https://privapub.thepra.dev
|
PUBLIC_URL: https://privapub.thepra.dev
|
||||||
MONGO_URI: mongodb://127.0.0.1:27022
|
SERVER_BACKUPS: /var/lib/privapub/backups
|
||||||
MONGO_DB: PrivaPub
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
site:
|
site:
|
||||||
@@ -28,9 +27,6 @@ jobs:
|
|||||||
echo "BUILD_REF=${GITHUB_REF_NAME:-master}" >> "$GITHUB_ENV"
|
echo "BUILD_REF=${GITHUB_REF_NAME:-master}" >> "$GITHUB_ENV"
|
||||||
echo "BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_ENV"
|
echo "BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: dotnet test PrivaPub.sln -c Release
|
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: |
|
run: |
|
||||||
rm -rf "$GITHUB_WORKSPACE/publish"
|
rm -rf "$GITHUB_WORKSPACE/publish"
|
||||||
@@ -57,12 +53,24 @@ jobs:
|
|||||||
echo "SNAPSHOT=$BACKUPS/site-$STAMP" >> "$GITHUB_ENV"
|
echo "SNAPSHOT=$BACKUPS/site-$STAMP" >> "$GITHUB_ENV"
|
||||||
ls -1dt "$BACKUPS"/site-* 2>/dev/null | tail -n +4 | xargs -r rm -rf || true
|
ls -1dt "$BACKUPS"/site-* 2>/dev/null | tail -n +4 | xargs -r rm -rf || true
|
||||||
|
|
||||||
- name: Dump the database
|
# The server's own backup (PrivaPub admin backup, owner decision 2026-10-07) of the database as the live build left it:
|
||||||
|
# the new build's command runs before its migrations. The media are listed, not linked (the runner may not link
|
||||||
|
# www-data's files; the nightly backups hold them). Never the statistics salt, which must not outlive its day (owner
|
||||||
|
# rule), nor the configuration's copy with its secrets. No deploy while a restore waits for its boot.
|
||||||
|
- name: Back up the database
|
||||||
run: |
|
run: |
|
||||||
DUMP="$BACKUPS/mongo-$(date +%Y%m%d-%H%M%S).archive.gz"
|
[ ! -e "$SERVER_BACKUPS/restore.json" ] || { echo "::error::a restore is pending or running ($SERVER_BACKUPS/restore.json): deploy after it"; exit 1; }
|
||||||
mongodump --quiet --uri "$MONGO_URI" --db "$MONGO_DB" --gzip --archive="$DUMP"
|
out=$(cd "$GITHUB_WORKSPACE/publish" && ASPNETCORE_ENVIRONMENT=Production ./PrivaPub admin backup --kind pre-deploy --db-only)
|
||||||
echo "::notice::database dumped to $DUMP ($(du -h "$DUMP" | cut -f1))"
|
echo "$out"
|
||||||
ls -1t "$BACKUPS"/mongo-*.archive.gz 2>/dev/null | tail -n +8 | xargs -r rm -f || true
|
id=$(echo "$out" | grep -oE '^[0-9]{8}-[0-9]{6}-pre-deploy' | tail -1)
|
||||||
|
[ -d "$SERVER_BACKUPS/$id" ] || { echo "::error::the backup was not made"; exit 1; }
|
||||||
|
(cd "$GITHUB_WORKSPACE/publish" && ASPNETCORE_ENVIRONMENT=Production ./PrivaPub admin backup verify "$id")
|
||||||
|
if [ -e "$SERVER_BACKUPS/$id/db/InteractionSalt.jsonl.gz" ]; then
|
||||||
|
echo "::error::the backup holds the statistics salt"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "BACKUP_ID=$id" >> "$GITHUB_ENV"
|
||||||
|
echo "::notice::database backed up as $id"
|
||||||
|
|
||||||
- name: Stop, sync, start
|
- name: Stop, sync, start
|
||||||
run: |
|
run: |
|
||||||
@@ -95,6 +103,18 @@ jobs:
|
|||||||
[ "$served" = "$BUILD_COMMIT" ] || { echo "::error::served build is '$served', expected '$BUILD_COMMIT'"; exit 1; }
|
[ "$served" = "$BUILD_COMMIT" ] || { echo "::error::served build is '$served', expected '$BUILD_COMMIT'"; exit 1; }
|
||||||
code=$(curl -s -o /dev/null -w '%{http_code}' -H 'Accept: application/activity+json' "$PUBLIC_URL/peasants/privapub")
|
code=$(curl -s -o /dev/null -w '%{http_code}' -H 'Accept: application/activity+json' "$PUBLIC_URL/peasants/privapub")
|
||||||
[ "$code" = "200" ] || { echo "::error::the instance actor answered $code"; exit 1; }
|
[ "$code" = "200" ] || { echo "::error::the instance actor answered $code"; exit 1; }
|
||||||
|
# SecureMode (owner decision 2026-10-04): an unsigned reader gets 401 before any lookup, so a name no persona can have
|
||||||
|
# (a hyphen is outside UserNameRegex) checks it without naming anyone; a browser asking for a persona gets its page
|
||||||
|
code=$(curl -s -o /dev/null -w '%{http_code}' -H 'Accept: application/activity+json' "$PUBLIC_URL/peasants/no-such-persona")
|
||||||
|
[ "$code" = "401" ] || { echo "::error::an unsigned GET of a persona answered $code, not 401: SecureMode is off"; exit 1; }
|
||||||
|
directory=$(curl -fsS "$PUBLIC_URL/api/v1/directory?local=true&limit=1") || { echo "::error::the directory did not answer"; exit 1; }
|
||||||
|
persona=$(echo "$directory" | python3 -c "import json,sys; d=json.load(sys.stdin); print(d[0]['username'] if d else '')")
|
||||||
|
if [ -z "$persona" ]; then
|
||||||
|
echo "::notice::no persona in the directory: the browser redirect is not checked"
|
||||||
|
else
|
||||||
|
code=$(curl -s -o /dev/null -w '%{http_code}' -H 'Accept: text/html' "$PUBLIC_URL/peasants/$persona")
|
||||||
|
[ "$code" = "302" ] || { echo "::error::a browser asking for @$persona got $code, not a redirect"; exit 1; }
|
||||||
|
fi
|
||||||
code=$(curl -s -o /dev/null -w '%{http_code}' "$PUBLIC_URL/.well-known/nodeinfo")
|
code=$(curl -s -o /dev/null -w '%{http_code}' "$PUBLIC_URL/.well-known/nodeinfo")
|
||||||
[ "$code" = "200" ] || { echo "::error::nodeinfo answered $code"; exit 1; }
|
[ "$code" = "200" ] || { echo "::error::nodeinfo answered $code"; exit 1; }
|
||||||
code=$(curl -s -o /dev/null -w '%{http_code}' "$PUBLIC_URL/swagger/index.html")
|
code=$(curl -s -o /dev/null -w '%{http_code}' "$PUBLIC_URL/swagger/index.html")
|
||||||
@@ -105,4 +125,24 @@ jobs:
|
|||||||
--data '{"type":"Follow","actor":"https://example.org/users/x","object":"'"$PUBLIC_URL"'/peasants/privapub"}' "$PUBLIC_URL/human-centipede")
|
--data '{"type":"Follow","actor":"https://example.org/users/x","object":"'"$PUBLIC_URL"'/peasants/privapub"}' "$PUBLIC_URL/human-centipede")
|
||||||
[ "$code" = "401" ] || { echo "::error::an unsigned inbox POST answered $code"; exit 1; }
|
[ "$code" = "401" ] || { echo "::error::an unsigned inbox POST answered $code"; exit 1; }
|
||||||
tools/smoke/mastodon-api.sh "$PUBLIC_URL"
|
tools/smoke/mastodon-api.sh "$PUBLIC_URL"
|
||||||
|
open=$(curl -fsS "$PUBLIC_URL/nodeinfo/2.1" | python3 -c "import json,sys; print(json.load(sys.stdin)['openRegistrations'])")
|
||||||
|
enabled=$(curl -fsS "$PUBLIC_URL/api/v2/instance" | python3 -c "import json,sys; print(json.load(sys.stdin)['registrations']['enabled'])")
|
||||||
|
[ "$open" = "$enabled" ] || { echo "::error::NodeInfo says registrations are $open, the instance API $enabled"; exit 1; }
|
||||||
|
curl -fsS "$PUBLIC_URL/stargazing" | grep -q 'The crawler is <strong>on</strong>' \
|
||||||
|
|| { echo "::error::/stargazing does not say the crawler is on"; exit 1; }
|
||||||
echo "::notice::serving $served"
|
echo "::notice::serving $served"
|
||||||
|
|
||||||
|
# The deploy no longer signs in (owner decision 2026-10-17): it kept a login of its own, deploy-smoke, whose @thepra
|
||||||
|
# is the administrator's now. Its checks are the anonymous ones above.
|
||||||
|
|
||||||
|
# The server fetches DB-IP Lite itself (GeoUpdater) about 30 s after it starts and then daily; the deploy only checks.
|
||||||
|
- name: Geolocation databases are current
|
||||||
|
run: |
|
||||||
|
for kind in city asn; do
|
||||||
|
db="/var/lib/privapub/geo/dbip-$kind-lite.mmdb"
|
||||||
|
for i in $(seq 1 60); do [ -s "$db" ] && break; sleep 10; done
|
||||||
|
[ -s "$db" ] || { echo "::error::$db is missing: the server has not fetched DB-IP Lite"; exit 1; }
|
||||||
|
days=$(( ($(date +%s) - $(stat -c %Y "$db")) / 86400 ))
|
||||||
|
[ "$days" -le 40 ] || { echo "::error::$db was installed $days days ago"; exit 1; }
|
||||||
|
done
|
||||||
|
curl -fsS "$PUBLIC_URL/stargazing" | grep -o 'DB-IP Lite [0-9-]*' | head -1 | sed 's/^/::notice::locating with /'
|
||||||
@@ -257,6 +257,7 @@ Generated_Code/
|
|||||||
# because we have git ;-)
|
# because we have git ;-)
|
||||||
_UpgradeReport_Files/
|
_UpgradeReport_Files/
|
||||||
Backup*/
|
Backup*/
|
||||||
|
!PrivaPub/Infrastructure/Backup/
|
||||||
UpgradeLog*.XML
|
UpgradeLog*.XML
|
||||||
UpgradeLog*.htm
|
UpgradeLog*.htm
|
||||||
ServiceFabricBackup/
|
ServiceFabricBackup/
|
||||||
@@ -401,4 +402,12 @@ FodyWeavers.xsd
|
|||||||
|
|
||||||
PrivaPub/media-store/
|
PrivaPub/media-store/
|
||||||
PrivaPub/media-store-proxy/
|
PrivaPub/media-store-proxy/
|
||||||
|
PrivaPub/media-store-trash/
|
||||||
|
PrivaPub/media-store-incoming/
|
||||||
|
PrivaPub/media-store-backups/
|
||||||
tools/pasture/.publish/
|
tools/pasture/.publish/
|
||||||
|
tools/pasture/.flood/
|
||||||
|
.claude/worktrees/
|
||||||
|
tools/pasture/.ca/
|
||||||
|
tools/pasture/.state/
|
||||||
|
tools/pasture/out/
|
||||||
+360
-40
@@ -8,33 +8,109 @@ PrivaPub is an ActivityPub server written in C#. This document follows
|
|||||||
- [ActivityPub](https://www.w3.org/TR/activitypub/) (server-to-server)
|
- [ActivityPub](https://www.w3.org/TR/activitypub/) (server-to-server)
|
||||||
- [WebFinger](https://webfinger.net/)
|
- [WebFinger](https://webfinger.net/)
|
||||||
- [HTTP Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures), `rsa-sha256` / `hs2019` with RSA keys
|
- [HTTP Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures), `rsa-sha256` / `hs2019` with RSA keys
|
||||||
|
(`hs2019` hashed with SHA-256, or SHA-512 as some sign it; a `SHA-256=` or `SHA-512=` digest)
|
||||||
|
- [HTTP Message Signatures](https://www.rfc-editor.org/rfc/rfc9421) (RFC 9421) and Content-Digest (RFC 9530), verified on
|
||||||
|
deliveries and signed fetches: `rsa-v1_5-sha256` and `rsa-pss-sha512` with RSA keys
|
||||||
- [NodeInfo](https://nodeinfo.diaspora.software/) 2.0 and 2.1
|
- [NodeInfo](https://nodeinfo.diaspora.software/) 2.0 and 2.1
|
||||||
|
- Object integrity proofs ([FEP-8b32](https://codeberg.org/fediverse/fep/src/branch/main/fep/8b32/fep-8b32.md),
|
||||||
|
`eddsa-jcs-2022`, JSON canonicalised by [RFC 8785](https://www.rfc-editor.org/rfc/rfc8785)) by Ed25519 keys published
|
||||||
|
as Multikeys ([FEP-521a](https://codeberg.org/fediverse/fep/src/branch/main/fep/521a/fep-521a.md)), on what personas
|
||||||
|
send to relays and verified on what is forwarded
|
||||||
|
|
||||||
## Tested against
|
## Tested against
|
||||||
|
|
||||||
- **GoToSocial 0.22.1, end to end.** It runs in a private network on the workstation (`tools/pasture/`) and is driven
|
End to end, in a private network on the workstation (`tools/pasture/`), each peer driven through its own client API
|
||||||
through its own client API. Checked both ways:
|
and every run starting clean, with signed fetches required (as privapub.thepra.dev runs):
|
||||||
- follows, including to a locked account;
|
- **GoToSocial 0.22.1**
|
||||||
- public posts with a content warning;
|
- **Mastodon 4.7.3**
|
||||||
- replies with notifications;
|
- **Misskey 2026.10**
|
||||||
- likes and boosts;
|
- **Sharkey 2025.4.7**
|
||||||
- direct messages;
|
- **Akkoma 3.20.1**
|
||||||
- edits and deletes;
|
- **Lemmy 1.0.0-beta.2**, and **Lemmy 0.19.20** (built with the platform's roots, so it trusts the pasture's CA)
|
||||||
- unfollow.
|
- **PeerTube 8.3.1**
|
||||||
- **Mastodon, Misskey, Lemmy and PeerTube, by unit tests only.** The tests feed the parser documents written in each
|
- **Pixelfed 0.14.4**
|
||||||
server's shape. No live exchange with any of them has run yet.
|
- **WordPress 7.1.2 with ActivityPub 9.3.1**
|
||||||
|
- **Friendica 2026.05**
|
||||||
|
- **Mobilizon 5.2.4**
|
||||||
|
- **Gancio 1.28.2**
|
||||||
|
- **Funkwhale 2.0.11**
|
||||||
|
- **PieFed 1.7.17**
|
||||||
|
- **Mbin 1.10.1**
|
||||||
|
- **NodeBB 4.16.1**
|
||||||
|
- **Smithereen 1.0.3**
|
||||||
|
- **Mitra 5.9.1**
|
||||||
|
- **snac2 2.95**
|
||||||
|
- **WriteFreely 0.17.2**
|
||||||
|
- **Owncast 0.3.0**
|
||||||
|
- **Ghost 6.67** with its ActivityPub service 1.2.14
|
||||||
|
- **BookWyrm 0.9.3**
|
||||||
|
- **Vernissage 1.43.0**
|
||||||
|
- **Hubzilla 11.4.1** with its pubcrawl addon
|
||||||
|
- **Forte 26.9.10** (portable identities: actors served through `/.well-known/apgateway/did:key:…`)
|
||||||
|
- **Castopod 1.15.5** (podcasts as actors, their episodes with the sound)
|
||||||
|
- **Ktistec 3.13.0**
|
||||||
|
- **Activity-Relay 2.0.9** and **aode-relay 0.3.129**, as relays PrivaPub reads from
|
||||||
|
- in the town only (a seeded community checked server by server): **Hollo 0.9.19**, **Iceshrimp.NET 2026.1.2-beta**,
|
||||||
|
**Pleroma 2.10.2**
|
||||||
|
|
||||||
|
Checked both ways, where the peer has the feature:
|
||||||
|
- follows, locked accounts included;
|
||||||
|
- every visibility, content warnings, replies and their notifications;
|
||||||
|
- likes, boosts and emoji reactions with their undos;
|
||||||
|
- direct messages;
|
||||||
|
- polls;
|
||||||
|
- quotes;
|
||||||
|
- images with alt text;
|
||||||
|
- edits with history and deletes;
|
||||||
|
- communities and circles;
|
||||||
|
- blocks and unfollows.
|
||||||
|
|
||||||
|
`docs/INTEROP.md` has each peer's evidence and what is still expected to fail. The platforms not in the pasture are
|
||||||
|
read from documents in their published shape (`docs/INTEROP.md` records each one); there is no test project.
|
||||||
|
|
||||||
## Supported FEPs
|
## Supported FEPs
|
||||||
|
|
||||||
- [FEP-67ff: FEDERATION.md](https://codeberg.org/fediverse/fep/src/branch/main/fep/67ff/fep-67ff.md)
|
- [FEP-67ff: FEDERATION.md](https://codeberg.org/fediverse/fep/src/branch/main/fep/67ff/fep-67ff.md)
|
||||||
- [FEP-f1d5: NodeInfo in Fediverse Software](https://codeberg.org/fediverse/fep/src/branch/main/fep/f1d5/fep-f1d5.md)
|
- [FEP-f1d5: NodeInfo in Fediverse Software](https://codeberg.org/fediverse/fep/src/branch/main/fep/f1d5/fep-f1d5.md)
|
||||||
- [FEP-2c59: Discovery of a WebFinger address from an ActivityPub actor](https://codeberg.org/fediverse/fep/src/branch/main/fep/2c59/fep-2c59.md)
|
- [FEP-2c59: Discovery of a WebFinger address from an ActivityPub actor](https://codeberg.org/fediverse/fep/src/branch/main/fep/2c59/fep-2c59.md):
|
||||||
|
every actor names its handle, and a peer's `webfinger` on another domain than its actor's host (Mastodon's
|
||||||
|
`LOCAL_DOMAIN`) is the handle shown once that domain's WebFinger points back to the actor; asked again on a rename
|
||||||
|
- [FEP-d556: Server-Level Actor Discovery Using WebFinger](https://codeberg.org/fediverse/fep/src/branch/main/fep/d556/fep-d556.md)
|
||||||
|
(WebFinger for the server's origin links its instance actor as `…#Service`) and
|
||||||
|
[FEP-2677: Identifying the Application Actor](https://codeberg.org/fediverse/fep/src/branch/main/fep/2677/fep-2677.md)
|
||||||
|
(`/.well-known/nodeinfo` links it as `…#Application`)
|
||||||
|
- [FEP-844e: Capability discovery](https://codeberg.org/fediverse/fep/src/branch/main/fep/844e/fep-844e.md): the instance
|
||||||
|
actor's `implements`, and every other actor's `generator`, name RFC 9421 (verified with RSA keys)
|
||||||
- [FEP-1b12: Group federation](https://codeberg.org/fediverse/fep/src/branch/main/fep/1b12/fep-1b12.md) (communities; see "Groups")
|
- [FEP-1b12: Group federation](https://codeberg.org/fediverse/fep/src/branch/main/fep/1b12/fep-1b12.md) (communities; see "Groups")
|
||||||
|
- [FEP-044f: Consent-respecting quote posts](https://codeberg.org/fediverse/fep/src/branch/main/fep/044f/fep-044f.md)
|
||||||
|
(`QuoteAuthorization` at `/parrot-licences/{id}`; checked with Mastodon both ways)
|
||||||
|
- [FEP-9967: Polls](https://codeberg.org/fediverse/fep/src/branch/main/fep/9967/fep-9967.md)
|
||||||
|
- [FEP-c0e0: Emoji reactions](https://codeberg.org/fediverse/fep/src/branch/main/fep/c0e0/fep-c0e0.md) (`EmojiReact`, and Misskey's
|
||||||
|
`Like` with content)
|
||||||
|
- [FEP-5feb: Search indexing consent](https://codeberg.org/fediverse/fep/src/branch/main/fep/5feb/fep-5feb.md) (`indexable`)
|
||||||
|
- [FEP-521a: Representing actor's public keys](https://codeberg.org/fediverse/fep/src/branch/main/fep/521a/fep-521a.md) and
|
||||||
|
[FEP-8b32: Object Integrity Proofs](https://codeberg.org/fediverse/fep/src/branch/main/fep/8b32/fep-8b32.md) (see
|
||||||
|
"Integrity proofs")
|
||||||
|
- [FEP-171b: Conversation Containers](https://codeberg.org/fediverse/fep/src/branch/main/fep/171b/fep-171b.md), received:
|
||||||
|
a thread owner's `Add` of someone's `Create`, `Update` or `Delete` to the thread's context is taken as that activity
|
||||||
|
passed on by the owner (on its FEP-8b32 proof, or as its origin has it)
|
||||||
|
- [FEP-8fcf: Followers collection synchronization across servers](https://codeberg.org/fediverse/fep/src/branch/main/fep/8fcf/fep-8fcf.md)
|
||||||
|
(sent and honoured; see "Followers synchronisation")
|
||||||
|
- [FEP-5624: Per-object reply control policies](https://codeberg.org/fediverse/fep/src/branch/main/fep/5624/fep-5624.md):
|
||||||
|
read (see "Replies its author approves")
|
||||||
|
- [FEP-7888: Demystifying the context property](https://codeberg.org/fediverse/fep/src/branch/main/fep/7888/fep-7888.md)
|
||||||
|
and [FEP-f228: Backfilling conversations](https://codeberg.org/fediverse/fep/src/branch/main/fep/f228/fep-f228.md):
|
||||||
|
a root post serves its `context` collection, and a remote thread is read from its `context` (or `contextHistory`)
|
||||||
|
before its `replies` (see "Activities")
|
||||||
|
- [FEP-7628: Move actor](https://codeberg.org/fediverse/fep/src/branch/main/fep/7628/fep-7628.md): received; a persona's
|
||||||
|
follows move with the account (see `Move` under "Activities")
|
||||||
|
- [FEP-ae0c: Fediverse Relay Protocols](https://codeberg.org/fediverse/fep/src/branch/main/fep/ae0c/fep-ae0c.md): the
|
||||||
|
instance actor follows the relays configured, and their `Announce`s are taken as their origin vouches (see "Relays")
|
||||||
|
- [FEP-8967: Generic attachments, link previews](https://codeberg.org/fediverse/fep/src/branch/main/fep/8967/fep-8967.md):
|
||||||
|
received; a `preview` builds the card
|
||||||
|
|
||||||
Planned (see `docs/ROADMAP.md`, phases P5 to P8, and the per-platform notes in `docs/INTEROP.md`): FEP-044f (quotes),
|
Planned (see `docs/ROADMAP.md`, the completion program, and the per-platform notes in `docs/INTEROP.md`): FEP-9098
|
||||||
FEP-9967 (polls), FEP-c0e0 (emoji reactions), FEP-9098 (custom emoji), FEP-7888 and FEP-f228 (threads), FEP-7628 (Move),
|
custom emoji offered (R7) and FEP-8967 link attachments sent (R10).
|
||||||
FEP-8fcf (followers synchronisation), FEP-5feb (`indexable`), FEP-8967 (link attachments), FEP-521a and FEP-8b32 (keys
|
|
||||||
and integrity proofs), FEP-ae0c (relays).
|
|
||||||
|
|
||||||
## Actors
|
## Actors
|
||||||
|
|
||||||
@@ -50,16 +126,30 @@ actor document, a collection, NodeInfo or a delivery relates two avatars of the
|
|||||||
| Followers / following | `/peasants/{name}/groupies`, `/peasants/{name}/stalking` |
|
| Followers / following | `/peasants/{name}/groupies`, `/peasants/{name}/stalking` |
|
||||||
| Objects | `/peasants/{name}/scribbles/{id}` |
|
| Objects | `/peasants/{name}/scribbles/{id}` |
|
||||||
| Activities | `/peasants/{name}/grunts/{id}` |
|
| Activities | `/peasants/{name}/grunts/{id}` |
|
||||||
|
| Quote permissions (`QuoteAuthorization`) | `/peasants/{name}/parrot-licences/{id}` |
|
||||||
| Direct-message context | `/peasants/{name}/whispers/{id}` |
|
| Direct-message context | `/peasants/{name}/whispers/{id}` |
|
||||||
|
| A persona's wall (FEP-400e) | `/peasants/{name}/graffiti` |
|
||||||
|
| Followers on the asking server (FEP-8fcf) | `/peasants/{name}/groupies/roll-call` |
|
||||||
| Profile and post pages | `/@{name}`, `/@{name}/{id}` |
|
| Profile and post pages | `/@{name}`, `/@{name}/{id}` |
|
||||||
|
|
||||||
The names are the project's own and are stable; resolve actors through WebFinger, not by guessing a path.
|
The names are the project's own and are stable; resolve actors through WebFinger, not by guessing a path.
|
||||||
|
|
||||||
- The key is `{actor}#main-key`, RSA 2048, served as SPKI PEM with `owner` set to the actor.
|
- The key is `{actor}#main-key`, RSA 2048, served as SPKI PEM with `owner` set to the actor.
|
||||||
- `published` on an actor is a whole day, chosen at random up to two weeks before the account was made, so two
|
- `published` on an actor is a whole day, chosen at random up to two weeks before the account was made, so two
|
||||||
personas made on the same day do not share a date. `indexable` is `false`.
|
personas made on the same day do not share a date. `indexable` is `false` unless the persona turns it on, and
|
||||||
|
`discoverable` is `true` unless it turns that off.
|
||||||
- The instance actor is `/peasants/privapub` (type `Application`). It signs every fetch PrivaPub makes, so no avatar's key
|
- The instance actor is `/peasants/privapub` (type `Application`). It signs every fetch PrivaPub makes, so no avatar's key
|
||||||
is used to read another server's content.
|
is used to read another server's content. Its `name` is the server's name and its `summary` the server's short
|
||||||
|
description, as the administrator sets them (the server's settings; until then "PrivaPub" and a sentence saying what it
|
||||||
|
does); NodeInfo's `metadata.nodeName` and `nodeDescription` come from the same settings. It also answers at the server's root (`/`) for a request that asks for
|
||||||
|
ActivityPub, as Lemmy's site actor does: PieFed sends a community's announces to the inbox of the Application at a
|
||||||
|
peer's root, and to `/inbox` when there is none.
|
||||||
|
- The reporter is `/peasants/privapub_reports` (type `Service`, "Reports from <host>"), one for the whole server with
|
||||||
|
its own key. It sends the reports Lemmy, PieFed and Mbin take in Lemmy's shape (see **Reports** below) and does
|
||||||
|
nothing else: nobody follows or mentions it, the Mastodon API has no account for it, and it has no page.
|
||||||
|
- The reader of feeds is `/peasants/privapub_feeds` (type `Service`, "Feeds read on <host>"), one for the whole server
|
||||||
|
with its own key. When a persona here follows a feed, the reader follows each community in it, and stops following one
|
||||||
|
no feed read here holds any more; no community and no feed learns which persona reads it. It does nothing else.
|
||||||
|
|
||||||
## Groups
|
## Groups
|
||||||
|
|
||||||
@@ -67,16 +157,38 @@ A group is either a **community** or a **circle**.
|
|||||||
|
|
||||||
- A **community** follows [FEP-1b12](https://codeberg.org/fediverse/fep/src/branch/main/fep/1b12/fep-1b12.md). Posts
|
- A **community** follows [FEP-1b12](https://codeberg.org/fediverse/fep/src/branch/main/fep/1b12/fep-1b12.md). Posts
|
||||||
addressed to it (in `to`, `cc` or `audience`) are accepted according to its posting policy (followers, anyone, or
|
addressed to it (in `to`, `cc` or `audience`) are accepted according to its posting policy (followers, anyone, or
|
||||||
moderators only) and the group `Announce`s the whole activity, with `audience` set, to its followers. A new post is
|
moderators only) and the group `Announce`s the whole activity, with `audience` set, to its followers and to the
|
||||||
|
author's own server, whether anyone there follows it or not (Lemmy keeps its user's post pending until then). A new post is
|
||||||
also announced as an object so Mastodon shows it. Updates and deletes of community content are announced too. A
|
also announced as an object so Mastodon shows it. Updates and deletes of community content are announced too. A
|
||||||
top-level post is a `Page` with a `name`. Members are counted at `/flock`; moderators are listed at `/wardens`, which
|
top-level post is a `Page` with a `name`. Members are counted at `/flock`; moderators are listed at `/wardens`, which
|
||||||
the actor's `attributedTo` points to, with `postingRestrictedToMods` as Lemmy expects. A mention of a community posts into it.
|
the actor's `attributedTo` points to, with `postingRestrictedToMods` as Lemmy expects. A mention of a community posts into it.
|
||||||
- A **circle** is private. Its actor is not discoverable and every follow is a request. Its posts are addressed to the
|
- A **circle** is private. Its actor is not discoverable and every follow is a request. Its posts are addressed to the
|
||||||
circle and its members collection, delivered to each member's own inbox and never announced. They are served only
|
circle and its members collection, delivered to each member's own inbox and never announced. Each member's copy also
|
||||||
to a signed request from a member, or from the instance actor of a member's server; anyone else gets 404. A
|
names that member in `cc`, so servers that keep only posts naming one of their accounts (Mastodon, GoToSocial) keep
|
||||||
Mastodon member's replies reach only the people they mention.
|
it; it names no other member. The posts are served only to a signed request from a member, or from the instance actor
|
||||||
|
of a member's server, and that copy names the member (or the members on that server); anyone else gets 404. A
|
||||||
|
Mastodon member's replies reach only the people they mention. Its owner lets a request in with an `Accept` of the
|
||||||
|
Follow, and declines one or takes a member from elsewhere out with a `Reject` of it, as Mastodon removes a follower.
|
||||||
- Announces from **remote** groups (Lemmy communities) are followed through to the activity: the object is fetched
|
- Announces from **remote** groups (Lemmy communities) are followed through to the activity: the object is fetched
|
||||||
from its own origin, never taken from the announce.
|
from its own origin, never taken from the announce. They are taken from a group someone here follows, and also when
|
||||||
|
they relay a vote on one of our posts in a thread of that group (Lemmy sends a vote to the community alone). A post
|
||||||
|
keeps the group its `audience` names, however it arrived.
|
||||||
|
- A post in a remote group followed here that the group's own server delivers itself, as its author's `Create` with the
|
||||||
|
group as its `audience` (Mbin sends a magazine's threads that way, with no announce), is kept as if announced: the
|
||||||
|
group's server speaks for posts in it. The same from another server is not.
|
||||||
|
- A remote community's **moderation** reaches the posts it holds. A removal (`Announce{Delete}`) is believed at once
|
||||||
|
from a community on the post's own server, which speaks for it (PieFed keeps serving a thread its moderator removed),
|
||||||
|
and from a community elsewhere once the post's origin answers it gone. A lock sent as it is (`Lock`, Mbin) is taken
|
||||||
|
from the post's own server only. A lock (`Announce{Lock}`, or `commentsEnabled: false` on the post) refuses replies,
|
||||||
|
ours included, until `Undo{Lock}`. A ban of a persona (`Announce{Block}` with the community as `target`) shows as
|
||||||
|
`blocked_by` on the community and refuses the persona's posts and replies there until the `Undo`. A post moved to
|
||||||
|
another community (PieFed's `Announce{Move{object: post, origin, target}}`, relayed by the community it leaves) goes
|
||||||
|
there with its thread; a move into a community this server hosts is not taken.
|
||||||
|
- **Feeds** (Lemmy 1.0's multi-communities and PieFed's feeds, `type: Feed`) are read as accounts whose following is
|
||||||
|
their communities: the feed's `following` collection, read once a day with its counts, and each community in it read in
|
||||||
|
turn. A persona following a feed is followed through the server (owner decision 2026-10-07): the reader of feeds
|
||||||
|
follows its communities, the feed itself is sent nothing, and the persona reads the feed's threads in a timeline of
|
||||||
|
its own (`GET /api/v1/timelines/feed/:id`; the feeds it reads are `GET /api/v1/feeds`), not in its home.
|
||||||
|
|
||||||
## Activities
|
## Activities
|
||||||
|
|
||||||
@@ -85,27 +197,97 @@ Received:
|
|||||||
| Activity | Effect |
|
| Activity | Effect |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `Follow` | follows an avatar or community; `Accept` is sent unless the community approves members by hand |
|
| `Follow` | follows an avatar or community; `Accept` is sent unless the community approves members by hand |
|
||||||
| `Accept{Follow}`, `Reject{Follow}` | completes or ends a follow an avatar requested |
|
| `Accept{Follow}`, `Reject{Follow}` | completes or ends a follow an avatar requested; once a follow holds, the account's latest public posts are read from its outbox's first page (twenty at most, once a day), so its profile is not empty; homes get only what arrives from then on |
|
||||||
|
| `Accept{Join}`, `Reject{Join}` | from the event's server: a persona's participation in the event is accepted or refused |
|
||||||
| `Undo{Follow, Like, Announce}` | reverses it |
|
| `Undo{Follow, Like, Announce}` | reverses it |
|
||||||
| `Create{Note, Article, Page, Question, Video, Audio, Event, ChatMessage, …}` | stored when a local avatar follows the author, is addressed or mentioned, when it replies to a local post, or when it is addressed to a community the author follows; a public parent is fetched to complete the thread |
|
| `Create{Note, Article, Page, Question, Video, Audio, Event, ChatMessage, …}` | stored when a local avatar follows the author, is addressed or mentioned, when it replies to a local post, or when it is addressed to a community the author follows (a persona is addressed by its actor id or by its profile page, as Mbin addresses its private messages); a public parent is fetched to complete the thread |
|
||||||
| `Update{Note}` | replaces the content; the previous version is kept |
|
| `Update{Note}` | replaces the content; the previous version is kept |
|
||||||
| `Update{Person}` | refetches the actor |
|
| `Update{Person}` | refetches the actor |
|
||||||
| `Like` | counted and notified, on posts the liker could see |
|
| `Like` | counted and notified, on posts the liker could see |
|
||||||
| `Dislike` | counted as a downvote (Lemmy, PieFed, Mbin, Friendica); `Undo` takes it back |
|
| `Dislike` | counted as a downvote (Lemmy, PieFed, Mbin, Friendica); `Undo` takes it back |
|
||||||
| `Join` | answered with `Ignore`: PrivaPub hosts no events yet (FEP-8a8e) |
|
| `EmojiReact`, `Like` with an emoji `content` | an emoji reaction (FEP-c0e0; Pleroma, Akkoma, Iceshrimp.NET, Misskey, Sharkey), Unicode or a custom emoji from its `tag`; a `Like` whose content is ❤ stays a favourite; `Undo` takes it back |
|
||||||
|
| `Warn` (Lemmy 1.0) | a community moderator's warning about a persona's post there becomes the persona's `moderation_warning` notification, believed from the community's own server or an account its moderators collection lists |
|
||||||
|
| `Resolve{Flag}` (Lemmy 1.0) | a report we sent is marked resolved by the server holding what was reported (kept beside our own moderators' resolution) |
|
||||||
|
| `Join` | answered with `Ignore`: PrivaPub hosts no events of its own yet (FEP-8a8e) |
|
||||||
| `Announce` | counted and notified for local posts; shown to followers of the announcer, with the original refetched from its origin |
|
| `Announce` | counted and notified for local posts; shown to followers of the announcer, with the original refetched from its origin |
|
||||||
| `Delete` | deletes the object, or the actor and its follows; a deleted object id is remembered for 90 days, so a late `Create` cannot bring it back |
|
| `Delete` | deletes the object, or the actor and its follows; a deleted object id is remembered for 90 days, so a late `Create` cannot bring it back, though a new post its server publishes under that id after the deletion (Gancio numbers events from the last one kept) is kept |
|
||||||
| `Flag` | becomes a report for this server's moderators |
|
| `Flag` | becomes a report for this server's moderators |
|
||||||
|
| `Move` | an account moving: believed as Mastodon believes it, when the account sends it about itself and the new account, read again from its server, names it in `alsoKnownAs`. The old account then shows where it went (`moved`), and, as Mastodon does it (owner decision 2026-10-05), the personas following it follow the new one instead (a Follow to its server, an Undo to the old), in the same lists; a mute or a block of the old account carries over |
|
||||||
|
| `Add`/`Remove` on the actor's `featured` | the account pins or unpins one of its own posts (fetched from its server when not held); inside a community's announce, the community features a post made in it. Its profile shows them first (`pinned=true`). The collection itself is read with the account's counts, at most once a day. On the account's wall (`sm:wall`), see "Walls". Any other target (a community's moderators) is dropped; one on the account's own server that PrivaPub does not know has its document read again first, at most hourly |
|
||||||
|
| `Block` of a persona | the follows between them end, the blocker's posts and notifications are hidden from the persona, nothing of the persona's is addressed to the blocker, and the relationship says `blocked_by`; `Undo{Block}` lifts it |
|
||||||
|
|
||||||
Sent: `Follow`, `Undo{Follow}`, `Create{Note}`, `Update{Note}`, `Update{Person}`, `Delete{Tombstone}`, `Accept{Follow}`,
|
Sent: `Follow`, `Undo{Follow}`, `Create{Note}`, `Create{Question}` and poll votes, `EmojiReact` and its `Undo`, `Update{Note}`, `Update{Person}`, `Delete{Tombstone}`, `Accept{Follow}`,
|
||||||
`Reject{Follow}`, `Like`, `Announce` and their `Undo`, `Flag`. A deleted post answers 410 with a `Tombstone`.
|
`Reject{Follow}`, `Like`, `Dislike`, `Announce` and their `Undo`, `Flag`, `Join` and `Leave` of a remote event, and the
|
||||||
|
replies to a persona's posts passed on to its followers. A deleted post answers 410 with a `Tombstone`.
|
||||||
|
|
||||||
|
- **Votes.** A favourite is a `Like`, a downvote a `Dislike`; a persona has one vote a post, and a changed vote is sent
|
||||||
|
as the new vote alone, as Lemmy sends one (an `Undo` of the old one beside it could arrive after it and take the new
|
||||||
|
one away). `Undo` is sent only when the vote is taken back. A vote on a post in a remote community goes to the
|
||||||
|
community, which counts it and passes it on, as Lemmy sends one, and to the post's author only when it lives on
|
||||||
|
another server: one copy a server, since PieFed drops a second copy of an activity it has just seen.
|
||||||
|
|
||||||
- **Attachments** are `Document`s with `mediaType`, `name` (alt text), `blurhash`, `focalPoint`, `width` and `height`.
|
- **Attachments** are `Document`s with `mediaType`, `name` (alt text), `blurhash`, `focalPoint`, `width` and `height`.
|
||||||
Uploaded files have all metadata removed.
|
Uploaded files have all metadata removed.
|
||||||
- **Pinned posts** are the actor's `featured` collection (`/trophies`); `featuredTags` is `/tattoos`.
|
- **Threads** (owner decision 2026-10-06). A persona's public or unlisted post outside any group names its `replies`
|
||||||
|
(`…/scribbles/{id}/replies`) and its conversation, `context` (FEP-7888): the root post's `…/scribbles/{id}/context`,
|
||||||
|
which a reply inherits from its parent, ours or another server's. Both list only the public and unlisted posts
|
||||||
|
PrivaPub holds, the context every one under the root (at most 500); followers-only, circle, direct and local-only posts
|
||||||
|
name neither, and their collections answer 404. Mastodon completes a thread from them.
|
||||||
|
- **Followers synchronisation** (FEP-8fcf, owner decision 2026-10-06). A persona's delivery addressed to its followers
|
||||||
|
carries a signed `Collection-Synchronization` header: its `followers`, its roll-call (`…/groupies/roll-call`) and the
|
||||||
|
digest (XOR of each id's SHA-256) of its accepted followers on the receiving server only. The roll-call answers a
|
||||||
|
signed request with the persona's followers on the signer's server and nobody else's; unsigned, 401. A server whose
|
||||||
|
view differs mends itself from it, Mastodon both ways (checked live). Mastodon's `Undo{Follow}` for a follow it never
|
||||||
|
knew of has one id per account (`…#follows//undo`); when it comes again after a new follow, it ends that follow too.
|
||||||
|
Honoured the other way: when a delivery's header digests the sender's followers here otherwise than the personas
|
||||||
|
following it, PrivaPub reads the list it names (same origin, signed by the instance actor). A follow the list leaves out
|
||||||
|
ends, but only when the list is the one the digest describes; a request it lists is taken as accepted; a persona it
|
||||||
|
lists that follows nothing there sends `Undo{Follow}`, as Mastodon does.
|
||||||
|
- **Walls** (FEP-400e, Smithereen's; owner decision 2026-10-06). A persona's actor names its `wall`
|
||||||
|
(`…/graffiti`, `sm:wall`) and Smithereen's `privacySettings`: its followers may write on it (`wallPosting`), everyone
|
||||||
|
may read it (`wallPostVisibility`). A public post that is not a reply, sent with the wall as its `target` by an account
|
||||||
|
following the persona, is hosted: the persona is notified (as a mention), it reaches the persona's home and its
|
||||||
|
followers' here, and the persona's followers' servers and the author's are told with `Add{Note}` (the wall as the
|
||||||
|
target). Anything else written there is dropped. The persona may delete it (`DELETE /api/v1/statuses/:id`), which
|
||||||
|
sends `Remove{Note}` with the wall as a plain id; Smithereen deletes the post then, as it does when an owner deletes a
|
||||||
|
post on its wall. The wall lists the persona's public posts that start a thread and what was written on it, newest
|
||||||
|
first. An account elsewhere that tells its followers here, with `Add{Note}` on its own wall, of a post written there
|
||||||
|
has it shown to them as on its wall (`privapub.wall` on the status); a `Remove` there takes it away.
|
||||||
|
- **Pinned posts** are the actor's `featured` collection (`/trophies`); `featuredTags` is `/tattoos`. A pin or an unpin
|
||||||
|
is told to the post's audience as `Add` or `Remove` on `featured`, as Mastodon tells it.
|
||||||
- **Blocks are sent.** A blocked remote account receives `Block` from the blocking account (and `Reject{Follow}` if it
|
- **Blocks are sent.** A blocked remote account receives `Block` from the blocking account (and `Reject{Follow}` if it
|
||||||
followed); an unblock sends `Undo{Block}`.
|
followed); an unblock sends `Undo{Block}`. A server's block of a whole server sends that server nothing; the
|
||||||
- **Reports** are sent as `Flag` by the instance actor, never by the reporting account.
|
administrator may list it at `/api/v1/instance/domain_blocks` (off for each block by default, its name partly hidden
|
||||||
|
when asked, with its SHA-256 digest), as Mastodon lists its blocks.
|
||||||
|
- **Reports** are sent as `Flag`, never by the reporting account and never naming it.
|
||||||
|
- To the reported account's server: from the instance actor, with the account and the posts as `object` and the
|
||||||
|
persona's words in `content`.
|
||||||
|
- To a community on a server whose NodeInfo names Lemmy, PieFed or Mbin (owner decision 2026-10-06, the second place
|
||||||
|
PrivaPub decides by a server's software; PieFed and Mbin once the pasture showed each keeps such a report with its
|
||||||
|
reason): one `Flag` per reported post or comment that was made in that community (its own
|
||||||
|
`audience`, else its thread's), from the reporter, `to` the community, the post alone as `object`, the words (or,
|
||||||
|
with none, the category) in `summary` and `content`, sent to the community's inbox. Lemmy refuses a Flag from an
|
||||||
|
`Application`, with no `to` or with no reason; PieFed drops one from an `Application`; Mbin reads the reason from
|
||||||
|
`summary` alone. Such a server gets no instance actor's Flag: an account alone, or a post outside its communities,
|
||||||
|
is not reported there, since Lemmy takes neither (PieFed would take an account alone from the reporter; that is not
|
||||||
|
sent yet).
|
||||||
|
- **Direct messages** go out as a `Note` addressed to their recipients, except a message to one account elsewhere that
|
||||||
|
writes to us as `ChatMessage`s (Pleroma's type), or whose server takes nothing else: Lemmy before 1.0 and Mbin, as
|
||||||
|
their NodeInfo names them (owner decision 2026-10-05, the first place PrivaPub decides by a server's software). That
|
||||||
|
message goes out as a `ChatMessage`, to the account alone, without a mention in its text.
|
||||||
|
- **Replies are passed on** (inbox forwarding; owner decision 2026-10-05). A public or unlisted reply from another server
|
||||||
|
to a persona's public, unlisted or followers-only post goes on to the persona's followers as its author's server sent
|
||||||
|
and signed it, the way Mastodon forwards it: to every follower's server but the replier's own. Its `Update` and
|
||||||
|
`Delete` follow the same way. Nothing is passed on for a local-only post, a group's post or a reply that is not public
|
||||||
|
or unlisted. A server that receives it checks it as it checks any forwarded activity: Mastodon, Misskey and Sharkey
|
||||||
|
keep it only when its author LD-signed it (Mastodon does; Misskey 2026.10 and Akkoma do not), others read the reply
|
||||||
|
from its origin.
|
||||||
|
- **Events** (owner decision 2026-10-05). A persona joins another server's event with a `Join` and leaves it with a
|
||||||
|
`Leave`, both sent to the event's organiser only (`…/grunts/join-<id>`, `…/grunts/leave-<id>`). The organiser's
|
||||||
|
server answers `Accept` (Mobilizon at once for an open event) or `Reject`, which the persona sees as
|
||||||
|
`privapub.event.participation`: `pending`, `accepted` or `rejected`. An event that takes participants by invitation
|
||||||
|
or on another site (Mobilizon's `joinMode` `invite` or `external`) is refused before anything is sent (422). Who
|
||||||
|
takes part is public on the event's server.
|
||||||
|
|
||||||
A `Create`'s `Note` carries Mastodon's `content`, `contentMap`, `summary` and `sensitive`, plus `Mention` and `Hashtag`
|
A `Create`'s `Note` carries Mastodon's `content`, `contentMap`, `summary` and `sensitive`, plus `Mention` and `Hashtag`
|
||||||
tags.
|
tags.
|
||||||
@@ -115,6 +297,51 @@ tags.
|
|||||||
content, one per choice, counted once per voter. Counts are refreshed with an `Update{Question}` at most every three
|
content, one per choice, counted once per voter. Counts are refreshed with an `Update{Question}` at most every three
|
||||||
minutes. Our own votes on other servers' polls are sent the same way to the poll's author only, without `published`.
|
minutes. Our own votes on other servers' polls are sent the same way to the poll's author only, without `published`.
|
||||||
An incoming `Update` without a newer `updated` only refreshes counts and details; it is never recorded as an edit.
|
An incoming `Update` without a newer `updated` only refreshes counts and details; it is never recorded as an edit.
|
||||||
|
A post's earlier versions in `formerRepresentations` (Pleroma, Akkoma) are its edit history, read as the post itself is:
|
||||||
|
a post first met after its edits has them, and an edit that carries them brings the versions missed in between.
|
||||||
|
|
||||||
|
**Quotes** (FEP-044f, with the older keys):
|
||||||
|
- **Received.** A quote is read from `quote`, `quoteUrl`, `quoteUri`, `_misskey_quote` or a FEP-e232 `Link` tag.
|
||||||
|
- With a `quoteAuthorization`, the stamp is fetched and must be a `QuoteAuthorization` on the quoted author's origin,
|
||||||
|
attributed to them, naming exactly the two posts.
|
||||||
|
- A FEP-044f `quote` without a stamp is pending until an `Update` brings one.
|
||||||
|
- A quote made with the older keys only, by software that asks nobody, is shown when the quoted post is public.
|
||||||
|
- A `Delete` of a stamp revokes the quote.
|
||||||
|
- **Sent.** Our accounts quote with every key, plus the `RE:` fallback.
|
||||||
|
- When the quoted post states an `interactionPolicy.canQuote` that allows us, `quote` is included and a `QuoteRequest`
|
||||||
|
(with the quoting post as `instrument`) goes to the quoted author. The quote stays pending until their `Accept` brings a
|
||||||
|
stamp we can verify; the post is then updated with `quoteAuthorization`.
|
||||||
|
- Posts that state no policy are quoted the older way, without `quote`.
|
||||||
|
- Quoting posts are also delivered to the quoted author.
|
||||||
|
- **Quoting our accounts.** Our public and unlisted posts state `interactionPolicy.canQuote`. By default anyone may quote,
|
||||||
|
automatically (as on Mastodon); an account can choose followers only or nobody, and so can each post.
|
||||||
|
- A `QuoteRequest` is answered with `Accept{result}` naming a stamp at `/peasants/{name}/parrot-licences/{id}`, or
|
||||||
|
with `Reject`.
|
||||||
|
- A stamp is a `QuoteAuthorization` naming both posts. A revoked stamp answers 410 and is announced with
|
||||||
|
`Delete{stamp}`.
|
||||||
|
- Followers-only posts and DMs can never be quoted.
|
||||||
|
|
||||||
|
**Interaction policies** (GoToSocial's `canReply`, `canLike`, `canAnnounce`, with the older `always` and
|
||||||
|
`approvalRequired`):
|
||||||
|
- **Read** on every remote post; one left out means anyone, automatically. A persona is let in at once when the rule
|
||||||
|
names the public, the persona itself, the author's followers while it follows the author, or the accounts the author
|
||||||
|
follows while the author follows it.
|
||||||
|
- **Shut out:** the client API answers 422 to a reply, favourite or boost the rule does not allow at all.
|
||||||
|
- **Asked first:** a `ReplyRequest`, `LikeRequest` or `AnnounceRequest` (the interaction as its `instrument`) goes to the
|
||||||
|
author alone, and the interaction waits (`privapub.approval: pending`). The author's `Accept` brings an authorization
|
||||||
|
(`result`), which must be on the author's origin, attributed to them and naming the interaction and the post; only then
|
||||||
|
does the reply go out with `replyAuthorization`, the boost with `announceAuthorization` and the like with
|
||||||
|
`likeAuthorization`. A `Reject` leaves it ours alone (`rejected`), and takes a like or a boost back.
|
||||||
|
- **As a third party,** a reply that a post's policy does not let in at once is kept only with an authorization that
|
||||||
|
verifies the same way. A rule naming a collection we cannot list (followers, following) lets the reply in.
|
||||||
|
- **Shown** to clients as GoToSocial's `interaction_policy` (`can_favourite`, `can_reply`, `can_reblog`).
|
||||||
|
- Our own posts state only `canQuote`: anyone may reply to, like and boost them.
|
||||||
|
|
||||||
|
**Replies its author approves** (FEP-5624's `canReply`, as PeerTube sets it on a video whose comments are moderated; a
|
||||||
|
`null` one says nothing): a persona it names, or that the post mentions, may reply, and the reply waits
|
||||||
|
(`privapub.approval: pending`), its `Create` going to the author alone. The author's `ApproveReply`, signed by the author
|
||||||
|
and naming the post answered, lets it out to its audience with `replyApproval`; a `RejectReply` leaves it ours alone
|
||||||
|
(`rejected`). An empty `canReply` refuses every reply (422).
|
||||||
|
|
||||||
**Custom emoji** (`Emoji` tags) are read on posts, display names, bios and profile fields, at most 64 per object.
|
**Custom emoji** (`Emoji` tags) are read on posts, display names, bios and profile fields, at most 64 per object.
|
||||||
**Profiles** keep their header, profile fields, `manuallyApprovesFollowers`, `published`, `movedTo`, `indexable`,
|
**Profiles** keep their header, profile fields, `manuallyApprovesFollowers`, `published`, `movedTo`, `indexable`,
|
||||||
@@ -127,6 +354,48 @@ Received `summary` is a content warning only on a `Note` or `Question`, or when
|
|||||||
Visibility is expressed in `to`/`cc` the way Mastodon does it: public, unlisted, followers-only and direct. Inbound
|
Visibility is expressed in `to`/`cc` the way Mastodon does it: public, unlisted, followers-only and direct. Inbound
|
||||||
followers-only posts are recognised by the author's own `followers` collection.
|
followers-only posts are recognised by the author's own `followers` collection.
|
||||||
|
|
||||||
|
## Link previews
|
||||||
|
|
||||||
|
For a public post that links to a page, PrivaPub builds a preview card. It uses, in order:
|
||||||
|
1. a Link attachment's own `preview` (FEP-8967) or the post's own image, title and summary;
|
||||||
|
2. otherwise, the linked page, read once by the server between 0 and 60 seconds after the post arrives (never when
|
||||||
|
someone reads it), with an `Accept: text/html` request that reads at most 512 KB, through the same address checks as
|
||||||
|
every other fetch.
|
||||||
|
|
||||||
|
The page's OpenGraph and Twitter tags give the title, description and image; the result is cached per address for 7
|
||||||
|
days and shared by every account on the server. Images are served to clients only through PrivaPub's media proxy.
|
||||||
|
`Federation:FetchLinkPreviews=false` turns page fetching off.
|
||||||
|
|
||||||
|
## Relays
|
||||||
|
|
||||||
|
PrivaPub reads from the relays `Federation:Relays` names, and those its administrator adds in the server's settings (by
|
||||||
|
their actor's address, or their inbox's), none by default. Its instance actor follows `Public` at each, as Mastodon
|
||||||
|
subscribes (`Federation/Relays/Relays.cs`, a minute after start, every six hours and at once when the administrator adds
|
||||||
|
or removes one: an unanswered or refused subscription is asked again a day later, and a relay no longer named gets the
|
||||||
|
`Undo`, unless the same relay is still named under another address). What an accepted relay passes on comes to the federated timeline, never to anyone's home: a public post it
|
||||||
|
forwards as its author sent it (Activity-Relay), read again from its origin like any forwarded post, and a post it
|
||||||
|
announces (aode-relay), kept as its author's and never as the relay's boost. Nothing else is taken from a relay. A
|
||||||
|
persona's public post outside any group, its edit and its deletion also go to the relays that accepted us (owner decision
|
||||||
|
2026-10-06), as Mastodon sends them; nothing less public, and no boost. Mastodon takes a post Activity-Relay forwards
|
||||||
|
only with an LD signature or an FEP-8b32 proof: PrivaPub's carry a proof, so they reach Mastodon through both kinds of
|
||||||
|
relay (checked live).
|
||||||
|
|
||||||
|
## Server descriptions and the crawler
|
||||||
|
|
||||||
|
PrivaPub keeps statistics about servers, never about accounts (see `/stargazing` on the server).
|
||||||
|
- **Describing a server:** a server it exchanges activities with is described at most once a week, from:
|
||||||
|
- `/.well-known/nodeinfo` and the NodeInfo document it links;
|
||||||
|
- `/api/v2/instance`, falling back to `/api/v1/instance`.
|
||||||
|
|
||||||
|
These requests are unsigned, because they are not ActivityPub documents.
|
||||||
|
- **The crawler** is on at privapub.thepra.dev. It identifies as
|
||||||
|
`PrivaPub-Stargazer/<version> (+https://privapub.thepra.dev/stargazing)`.
|
||||||
|
- **What it reads:** `/robots.txt`, then the documents above and `/api/v1/instance/peers`, and nothing else: no
|
||||||
|
accounts, posts or directories.
|
||||||
|
- **How often:** one server a minute, each at most weekly.
|
||||||
|
- **Opting out:** in robots.txt, the crawler obeys the group `PrivaPub-Stargazer`, then `PrivaPub`, then `*`. A
|
||||||
|
robots.txt that answers with a server error or times out also keeps it out, as do this server's domain blocks.
|
||||||
|
|
||||||
## Local-only posts
|
## Local-only posts
|
||||||
|
|
||||||
Posts with a location (shown to nearby users of this server) never leave the server, in any form.
|
Posts with a location (shown to nearby users of this server) never leave the server, in any form.
|
||||||
@@ -139,20 +408,71 @@ Posts with a location (shown to nearby users of this server) never leave the ser
|
|||||||
- **Origins.** An actor document is accepted only from the address it names as its `id`. A key only if its actor lists
|
- **Origins.** An actor document is accepted only from the address it names as its `id`. A key only if its actor lists
|
||||||
it with `owner` set to the actor and on the actor's origin. An activity's `id`, and any object it creates, updates or
|
it with `owner` set to the actor and on the actor's origin. An activity's `id`, and any object it creates, updates or
|
||||||
deletes, must be on its actor's origin. An embedded object from another origin is fetched from that origin.
|
deletes, must be on its actor's origin. An embedded object from another origin is fetched from that origin.
|
||||||
|
- **Another account of the same server.** An object attributed to another account of the actor's own server (Mobilizon's
|
||||||
|
organiser creates, edits and deletes the group's event) is that server's to vouch for: a creation or an edit is
|
||||||
|
taken as the server has the object, a deletion once it answers 404 or 410. Attributed to an account elsewhere, it is
|
||||||
|
refused (400).
|
||||||
|
- **Forwarded activities** (ActivityPub's inbox forwarding: a thread's server passing on the replies in it, signed with
|
||||||
|
its own key) are answered 202 and believed only as far as their origin vouches for them: a created or edited post
|
||||||
|
is read again from its author's server, a deletion of a public or unlisted post is applied once that server answers
|
||||||
|
404 or 410, and anything else is dropped. LD signatures are not verified. A reply forwarded this way is kept when
|
||||||
|
someone here follows the author of the post it answers, as Mastodon does.
|
||||||
|
- **Follow requests** still unanswered are sent again after 15 minutes, an hour, 6 hours, a day, two and four days: a
|
||||||
|
server can take a Follow and lose its answer (Lemmy 1.0 sends nothing it queued for a server before it started
|
||||||
|
sending there), and one that holds the follow answers it again. Each is the same follow under a new id
|
||||||
|
(`…/follow-<id>-again-<n>`), since Lemmy ignores an id it has seen; an answer naming any of them counts.
|
||||||
- **Fetching.** All fetches are signed by the instance actor. They go only to public addresses, follow at most three
|
- **Fetching.** All fetches are signed by the instance actor. They go only to public addresses, follow at most three
|
||||||
redirects and read at most 1 MB.
|
redirects and read at most 1 MB.
|
||||||
|
- **Threads.** A reply's missing parents are fetched, up to 10 levels. When someone here opens a public remote thread,
|
||||||
|
its replies are read from their servers, at most once an hour: the thread's conversation container (FEP-171b's
|
||||||
|
`contextHistory`: the posts its owner's `Add`s brought in) or its `context` collection (FEP-7888) if it has one, else
|
||||||
|
its `replies` (PeerTube's `comments`) and theirs, two levels down; 5 pages and 100 posts at most. Only public and
|
||||||
|
unlisted replies are kept, each fetched from its own origin. A thread collection read whole, which counts its posts or
|
||||||
|
holds them all, is asked again with `If-None-Match` and its last ETag; a 304 ends the read.
|
||||||
|
- **Reading our documents (SecureMode).** privapub.thepra.dev answers ActivityPub GETs only when they are signed, like
|
||||||
|
Mastodon's authorized fetch; the server's own actors (the instance actor `/peasants/privapub`, the reporter
|
||||||
|
`/peasants/privapub_reports` and the reader of feeds `/peasants/privapub_feeds`) are the exception, since their keys
|
||||||
|
are needed first.
|
||||||
|
A browser asking for HTML is redirected to the public page instead.
|
||||||
|
- **Posts that are not public** (followers-only, direct, circle) are served to a signed request from someone they were
|
||||||
|
for, or from the instance actor of a server where someone they were for lives, and to nobody else (404). Once deleted
|
||||||
|
they answer those same readers 410. A direct message's `context`, `/peasants/{name}/whispers/{id}`, is an
|
||||||
|
`OrderedCollection` of the conversation's posts for its participants.
|
||||||
- **HTML.** Received HTML is sanitised to Mastodon's allowlist.
|
- **HTML.** Received HTML is sanitised to Mastodon's allowlist.
|
||||||
- **Keys we cannot fetch for now.** When a sender's key cannot be fetched because its server timed out or answered
|
- **Keys we cannot fetch for now.** When a sender's key cannot be fetched because its server timed out or answered
|
||||||
5xx, the inbox answers 503 with `Retry-After: 300` rather than 401.
|
5xx, the inbox answers 503 with `Retry-After: 300` rather than 401.
|
||||||
- **Activity ids.** `Create` and `Announce` ids dereference. `Follow`, `Like`, `Block` and the `Accept`, `Reject` and
|
- **Activity ids.** `Create` and `Announce` ids dereference, a community's announces included, until the post they
|
||||||
`Undo` that answer them do not, because serving them would reveal who follows, likes and blocks whom; they are always
|
carry is deleted (then 410); a persona's boost id sends a browser to the boosted post. `Follow`, `Like`, `Block` and
|
||||||
sent with their object embedded.
|
the `Accept`, `Reject` and `Undo` that answer them do not, because serving them would reveal who follows, likes and
|
||||||
- **Delivery.** Failed deliveries are retried with Mastodon's backoff (16 attempts). A host that keeps failing is paused,
|
blocks whom. Neither do `Update`, `Delete`, `EmojiReact`, `QuoteRequest` and its answers, `Flag`, `Ignore` or poll
|
||||||
starting at an hour and growing to a week.
|
votes. All of them are always sent with their object embedded. Every boost and every favourite is an activity of its
|
||||||
|
own (`announce-{boost}`, `like-{favourite}`), so one given again after its `Undo` is new to the server it reaches.
|
||||||
|
- **Hashtags.** A post's `Hashtag` links go to `/tags/{tag}`, a public page of this server's public posts with that tag.
|
||||||
|
- **Delivery.** An activity goes once to each server, to its shared inbox when the server has one, whoever there it
|
||||||
|
follows, names or answers (a circle post excepted: each member's copy names that member). Failed deliveries are
|
||||||
|
retried with Mastodon's backoff (16 attempts). A host that keeps failing is paused,
|
||||||
|
starting at an hour and growing to a week: unreachable, timing out, or a gateway answering 502, 503 or 504. A 500 is
|
||||||
|
the server failing on that one activity, retried on its own while its other deliveries go on. A server can also take a Follow (202) and drop it afterwards, as Pleroma
|
||||||
|
does when it cannot yet fetch our actor, so a follow request still unanswered is sent again, same activity, when the
|
||||||
|
persona follows once more, at most once an hour.
|
||||||
|
|
||||||
## Known limitations
|
## Known limitations
|
||||||
|
|
||||||
- Our own posts carry no custom emoji: emoji are received and shown, not offered.
|
- Our own posts carry no custom emoji: emoji are received and shown, not offered.
|
||||||
- Remote media is fetched through this server's proxy when a local client displays it.
|
- Remote media is fetched through this server's proxy when a local client displays it. Video and audio are streamed
|
||||||
- Collections expose counts, not members.
|
through it with byte ranges passed on, so a PeerTube file is never fetched whole for one viewer.
|
||||||
- Only `rsa-sha256`-style keys are verified. RFC 9421 signatures are planned.
|
- Collections expose counts, not members: `/groupies` and `/stalking` give the same totals as the Mastodon API's
|
||||||
|
follower and following counts, and the outbox's `totalItems` is the persona's post count, though only public posts
|
||||||
|
are listed. `/api/v1/instance/peers` is empty: which servers this one talks to is not published.
|
||||||
|
- HTTP signatures are verified with RSA keys only, under draft-cavage or RFC 9421. What PrivaPub sends is signed with
|
||||||
|
draft-cavage only, which every server reads.
|
||||||
|
- **Integrity proofs** (FEP-8b32, FEP-521a). Every persona has an Ed25519 key of its own (never shared between personas),
|
||||||
|
named in its actor's `assertionMethod` as a `Multikey` (`…#ed25519-key`, `publicKeyMultibase`); the terms are defined
|
||||||
|
in the actor's own context, so no context document has to be fetched. A persona's activity going to a relay carries a
|
||||||
|
`DataIntegrityProof` (`eddsa-jcs-2022`, `proofPurpose` `assertionMethod`) over the activity as delivered; Mastodon
|
||||||
|
4.7 verifies it (checked against its own verifier), so what the relay forwards reaches it. Nothing else carries one:
|
||||||
|
Mitra takes a proof over the HTTP signature, and refuses one by a key it has not read yet without reading the actor
|
||||||
|
again, which every server that knew a persona before it had its key would do. What a persona passes on of others'
|
||||||
|
carries theirs or none. Received: an actor's own Multikeys (at most five, under its id, controlled by it) are kept;
|
||||||
|
a forwarded activity whose proof one of them verifies is taken as it came, instead of being read again from its origin
|
||||||
|
(an unknown key of the actor's has the actor read again first).
|
||||||
@@ -12,6 +12,9 @@ namespace PrivaPub.ClientModels.Admin
|
|||||||
|
|
||||||
public bool Suspend { get; set; } = true;
|
public bool Suspend { get; set; } = true;
|
||||||
public bool RejectMedia { get; set; }
|
public bool RejectMedia { get; set; }
|
||||||
|
// listed at /api/v1/instance/domain_blocks (off by default: it tells the blocked server, and everyone, of the block)
|
||||||
|
public bool Published { get; set; } = false;
|
||||||
|
public bool Obfuscate { get; set; } = false;//listed with part of its name hidden
|
||||||
|
|
||||||
[StringLength(1000, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
[StringLength(1000, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
public string PublicComment { get; set; }
|
public string PublicComment { get; set; }
|
||||||
@@ -28,6 +31,8 @@ namespace PrivaPub.ClientModels.Admin
|
|||||||
public bool RejectMedia { get; set; }
|
public bool RejectMedia { get; set; }
|
||||||
public string PublicComment { get; set; }
|
public string PublicComment { get; set; }
|
||||||
public string PrivateComment { get; set; }
|
public string PrivateComment { get; set; }
|
||||||
|
public bool Published { get; set; } = false;
|
||||||
|
public bool Obfuscate { get; set; } = false;
|
||||||
public DateTime CreatedAt { get; set; }
|
public DateTime CreatedAt { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
namespace PrivaPub.ClientModels.Admin
|
||||||
|
{
|
||||||
|
// the staff's log, newest first (GET /clientapi/moderator/log?before=&limit=): Next is the `before` of the next page,
|
||||||
|
// null on the last
|
||||||
|
public class ViewAdminActionsPage
|
||||||
|
{
|
||||||
|
public List<ViewAdminAction> Items { get; set; } = [];
|
||||||
|
public string Next { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewAdminAction
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public DateTime At { get; set; }
|
||||||
|
// who acted: a login name (to administrators; to a moderator only its own), "cli" for the command line, null when not
|
||||||
|
// told (an act on a persona of the acting login keeps nobody's name)
|
||||||
|
public string By { get; set; }
|
||||||
|
public bool ByYou { get; set; } = false;
|
||||||
|
public string Action { get; set; }//e.g. domain_block.insert, settings.update, report.resolve, root.promote
|
||||||
|
public string TargetKind { get; set; }//root, persona, account, domain, report, settings, rule, announcement, emoji, relay, backup
|
||||||
|
public string TargetId { get; set; }
|
||||||
|
public string TargetLabel { get; set; }
|
||||||
|
public string ReportId { get; set; }
|
||||||
|
public string Note { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using PrivaPub.ClientModels.Resources;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace PrivaPub.ClientModels.Admin
|
||||||
|
{
|
||||||
|
// an announcement as the administrator's page shows it (/clientapi/admin/announcements/list): its Markdown and what it
|
||||||
|
// renders to, whether it is published and shown now, how many personas dismissed it and its reactions
|
||||||
|
public class ViewAnnouncement
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public string Text { get; set; }
|
||||||
|
public string Html { get; set; }
|
||||||
|
public DateTime? StartsAt { get; set; }
|
||||||
|
public DateTime? EndsAt { get; set; }
|
||||||
|
public bool AllDay { get; set; } = false;
|
||||||
|
public bool IsPublished { get; set; } = false;
|
||||||
|
public bool IsShown { get; set; } = false;//published and not ended
|
||||||
|
public DateTime? PublishedAt { get; set; }
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
public DateTime UpdatedAt { get; set; }
|
||||||
|
public long Reads { get; set; } = 0;
|
||||||
|
public List<ViewAnnouncementReaction> Reactions { get; set; } = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewAnnouncementReaction
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public long Count { get; set; } = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// insert (no Id) and update (its Id)
|
||||||
|
public class AnnouncementForm
|
||||||
|
{
|
||||||
|
[StringLength(64, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(5000, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Text { get; set; }//Markdown
|
||||||
|
|
||||||
|
public DateTime? StartsAt { get; set; }
|
||||||
|
public DateTime? EndsAt { get; set; }//once past, it is no longer shown
|
||||||
|
public bool AllDay { get; set; } = false;
|
||||||
|
public bool IsPublished { get; set; } = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
using PrivaPub.ClientModels.Resources;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace PrivaPub.ClientModels.Admin
|
||||||
|
{
|
||||||
|
// the server's backups as the administrator's page shows them, with what is running and the last restore
|
||||||
|
public class ViewBackups
|
||||||
|
{
|
||||||
|
public List<ViewBackup> Backups { get; set; } = [];
|
||||||
|
public string Running { get; set; }//"backup" or "restore" while one runs
|
||||||
|
public ViewRestoreWaiting Waiting { get; set; }
|
||||||
|
public ViewRestore LastRestore { get; set; }
|
||||||
|
public string Host { get; set; }//what a restore asks to be typed
|
||||||
|
public long FreeBytes { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewBackup
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public string Kind { get; set; }//nightly, manual, pre-deploy, pre-restore, uploaded
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
public long Bytes { get; set; }//the database's files
|
||||||
|
public long MediaBytes { get; set; }
|
||||||
|
public int MediaFiles { get; set; }
|
||||||
|
public int MediaMissing { get; set; }
|
||||||
|
public bool DbOnly { get; set; }
|
||||||
|
public bool Consistent { get; set; }
|
||||||
|
public int Collections { get; set; }
|
||||||
|
public long Documents { get; set; }
|
||||||
|
public string AppCommit { get; set; }
|
||||||
|
public int MigrationNumber { get; set; }
|
||||||
|
public int RootsDeletedSince { get; set; }//logins deleted after it, which a restore deletes again
|
||||||
|
public string NotRestorable { get; set; }//why not, from its manifest; hashes are checked when asked
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewRestoreWaiting
|
||||||
|
{
|
||||||
|
public string Backup { get; set; }
|
||||||
|
public string State { get; set; }
|
||||||
|
public int Attempts { get; set; }
|
||||||
|
public string RequestedBy { get; set; }
|
||||||
|
public DateTime RequestedAt { get; set; }
|
||||||
|
public string Error { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewRestore
|
||||||
|
{
|
||||||
|
public string Backup { get; set; }
|
||||||
|
public DateTime BackupCreatedAt { get; set; }
|
||||||
|
public string PreRestore { get; set; }
|
||||||
|
public string RequestedBy { get; set; }
|
||||||
|
public DateTime RestoredAt { get; set; }
|
||||||
|
public bool Abandoned { get; set; }
|
||||||
|
public string Error { get; set; }
|
||||||
|
public long Documents { get; set; }
|
||||||
|
public int Collections { get; set; }
|
||||||
|
public int MediaRestored { get; set; }
|
||||||
|
public int MediaMissing { get; set; }
|
||||||
|
public int RootsDeleted { get; set; }
|
||||||
|
public int PersonasDeleted { get; set; }
|
||||||
|
public int GroupsDeleted { get; set; }
|
||||||
|
public int PostsDeleted { get; set; }
|
||||||
|
public List<string> RootsTombstoned { get; set; } = [];
|
||||||
|
public List<string> PersonasTombstoned { get; set; } = [];
|
||||||
|
public List<string> GroupsTombstoned { get; set; } = [];
|
||||||
|
public int PostsGone { get; set; }
|
||||||
|
public int MediaTrashed { get; set; }
|
||||||
|
public int ProtectiveKept { get; set; }
|
||||||
|
public int SessionsEnded { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// a backup downloaded or restored: the administrator's password again, and for a restore the server's host typed out
|
||||||
|
public class BackupPasswordForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(200, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RestoreBackupForm : BackupPasswordForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(253, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Host { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// a download link good for a while, for one backup
|
||||||
|
public class ViewBackupTicket
|
||||||
|
{
|
||||||
|
public string Url { get; set; }
|
||||||
|
public DateTime ExpiresAt { get; set; }
|
||||||
|
public long Bytes { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// a backup being uploaded in pieces: how much has arrived
|
||||||
|
public class ViewBackupUpload
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public long Received { get; set; }
|
||||||
|
public long ChunkBytes { get; set; }//the largest piece accepted
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
namespace PrivaPub.ClientModels.Admin
|
||||||
|
{
|
||||||
|
// a report as moderators read it: who sent it ("local" for a persona here, never which one; or the remote actor), whom
|
||||||
|
// and which posts it is about, and whether it was resolved
|
||||||
|
public class ViewReport
|
||||||
|
{
|
||||||
|
public string ID { get; set; }
|
||||||
|
public string Reporter { get; set; }
|
||||||
|
public string TargetAccountId { get; set; }
|
||||||
|
public string TargetActorURI { get; set; }
|
||||||
|
public List<string> PostIds { get; set; } = new();
|
||||||
|
public List<string> ObjectURIs { get; set; } = new();
|
||||||
|
public string Category { get; set; }
|
||||||
|
public List<string> RuleIds { get; set; } = [];//the server's rules it says were broken
|
||||||
|
public List<string> Rules { get; set; } = [];//their texts, in the same order (a deleted rule's too)
|
||||||
|
public string Comment { get; set; }
|
||||||
|
public bool Forwarded { get; set; }
|
||||||
|
public bool IsResolved { get; set; }
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
public DateTime? ResolvedAt { get; set; }
|
||||||
|
public DateTime? RemoteResolvedAt { get; set; }//the server holding what was reported said it dealt with it
|
||||||
|
public string RemoteResolvedBy { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
using PrivaPub.ClientModels.Resources;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace PrivaPub.ClientModels.Admin
|
||||||
|
{
|
||||||
|
// The server's own settings as the administrator's page shows them (GET /clientapi/admin/settings): what the instance
|
||||||
|
// API, NodeInfo, the instance actor, the web pages and the emails say of the server, its rules, its relays, its media
|
||||||
|
// limits next to the configured ones, and whether its weekly activity is published. Registrations are read-only: they
|
||||||
|
// stay in the configuration (Registrations:Mode).
|
||||||
|
public class ViewServerSettings
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string ShortDescription { get; set; }
|
||||||
|
public string Description { get; set; }//Markdown
|
||||||
|
public DateTime? DescriptionUpdatedAt { get; set; }
|
||||||
|
public string ContactEmail { get; set; }
|
||||||
|
public string ContactAccountId { get; set; }
|
||||||
|
public ViewContactAccount ContactAccount { get; set; }//null when none is set, or it is gone
|
||||||
|
public string ThumbnailUrl { get; set; }//what the instance API shows (the default picture when none was uploaded)
|
||||||
|
public bool ThumbnailIsDefault { get; set; } = true;
|
||||||
|
public string PrivacyPolicy { get; set; }//Markdown
|
||||||
|
public DateTime? PrivacyPolicyUpdatedAt { get; set; }
|
||||||
|
public string TermsOfService { get; set; }//Markdown; null: none
|
||||||
|
public DateTime? TermsEffectiveAt { get; set; }
|
||||||
|
public List<ViewServerRule> Rules { get; set; } = [];//deleted ones too (IsDeleted), as old reports name them
|
||||||
|
public List<ViewRelay> Relays { get; set; } = [];
|
||||||
|
public ViewMediaLimits Media { get; set; } = new();
|
||||||
|
public string RegistrationMode { get; set; }//"Invitations" or "Open", from the configuration
|
||||||
|
public bool PublishActivity { get; set; } = false;
|
||||||
|
public DateTime? UpdatedAt { get; set; }//null: never saved, every value is the default
|
||||||
|
public string UpdatedBy { get; set; }//the administrator's login, or "cli"
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewContactAccount
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public string UserName { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Handle { get; set; }//user@host
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewServerRule
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public string Text { get; set; }
|
||||||
|
public string Hint { get; set; }
|
||||||
|
public int Position { get; set; } = 0;
|
||||||
|
public bool IsDeleted { get; set; } = false;
|
||||||
|
public DateTime? DeletedAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// the administrator's overrides (null: the configured value holds), what the configuration says, and the hard caps
|
||||||
|
public class ViewMediaLimits
|
||||||
|
{
|
||||||
|
public long? QuotaBytesPerRoot { get; set; }
|
||||||
|
public long? MaxImageBytes { get; set; }
|
||||||
|
public long? MaxVideoBytes { get; set; }
|
||||||
|
public int? MaxSeconds { get; set; }
|
||||||
|
public long ConfiguredQuotaBytesPerRoot { get; set; } = 0;//0: no quota
|
||||||
|
public long ConfiguredMaxImageBytes { get; set; } = 0;
|
||||||
|
public long ConfiguredMaxVideoBytes { get; set; } = 0;
|
||||||
|
public int ConfiguredMaxSeconds { get; set; } = 0;
|
||||||
|
public long EffectiveQuotaBytesPerRoot { get; set; } = 0;
|
||||||
|
public long EffectiveMaxImageBytes { get; set; } = 0;
|
||||||
|
public long EffectiveMaxVideoBytes { get; set; } = 0;
|
||||||
|
public int EffectiveMaxSeconds { get; set; } = 0;
|
||||||
|
public long HardMaxImageBytes { get; set; } = ServerMediaLimitsForm.HardMaxImageBytes;
|
||||||
|
public long HardMaxVideoBytes { get; set; } = ServerMediaLimitsForm.HardMaxVideoBytes;
|
||||||
|
public int HardMaxSeconds { get; set; } = ServerMediaLimitsForm.HardMaxSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST /clientapi/admin/settings: everything the page edits at once (relays and the thumbnail have their own routes).
|
||||||
|
// A rule keeps its id when the form names it; one without an id is new; one left out is deleted (kept, marked).
|
||||||
|
public class ServerSettingsForm
|
||||||
|
{
|
||||||
|
public const int MaxRules = 50;
|
||||||
|
public const int MaxText = 20000;
|
||||||
|
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(64, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Title", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
[StringLength(500, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string ShortDescription { get; set; }
|
||||||
|
|
||||||
|
[StringLength(MaxText, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Description", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
[EmailAddress(ErrorMessageResourceName = "InvalidEmail", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(254, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Email", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string ContactEmail { get; set; }
|
||||||
|
|
||||||
|
[StringLength(64, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string ContactAccountId { get; set; }//a local persona's account id (its Mastodon id), or none
|
||||||
|
|
||||||
|
[StringLength(MaxText, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string PrivacyPolicy { get; set; }
|
||||||
|
|
||||||
|
[StringLength(MaxText, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string TermsOfService { get; set; }//empty: none
|
||||||
|
|
||||||
|
public DateTime? TermsEffectiveAt { get; set; }//a date; today when terms are given without one
|
||||||
|
|
||||||
|
[MaxLength(MaxRules, ErrorMessageResourceName = "MaxLengthArray", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public List<ServerRuleForm> Rules { get; set; } = [];
|
||||||
|
|
||||||
|
public ServerMediaLimitsForm Media { get; set; } = new();
|
||||||
|
|
||||||
|
public bool PublishActivity { get; set; } = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ServerRuleForm
|
||||||
|
{
|
||||||
|
[StringLength(64, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Id { get; set; }//an existing rule's id, or none for a new rule
|
||||||
|
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(500, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Text { get; set; }
|
||||||
|
|
||||||
|
[StringLength(1000, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Hint { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// null keeps the configured value
|
||||||
|
public class ServerMediaLimitsForm
|
||||||
|
{
|
||||||
|
public const long HardMaxImageBytes = 40L * 1024 * 1024;
|
||||||
|
public const long HardMaxVideoBytes = 99L * 1024 * 1024;
|
||||||
|
public const int HardMaxSeconds = 4 * 3600;
|
||||||
|
|
||||||
|
[Range(0L, long.MaxValue, ErrorMessageResourceName = "Range", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public long? QuotaBytesPerRoot { get; set; }//0: no quota
|
||||||
|
|
||||||
|
[Range(1L, HardMaxImageBytes, ErrorMessageResourceName = "Range", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public long? MaxImageBytes { get; set; }
|
||||||
|
|
||||||
|
[Range(1L, HardMaxVideoBytes, ErrorMessageResourceName = "Range", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public long? MaxVideoBytes { get; set; }
|
||||||
|
|
||||||
|
[Range(1, HardMaxSeconds, ErrorMessageResourceName = "Range", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public int? MaxSeconds { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// a relay the instance actor subscribes to: named by the configuration (Federation:Relays, removed only there) or by
|
||||||
|
// the settings (added and removed from the page)
|
||||||
|
public class ViewRelay
|
||||||
|
{
|
||||||
|
public string Address { get; set; }
|
||||||
|
public string Source { get; set; }//"configuration" or "settings"
|
||||||
|
public string State { get; set; }//"pending", "accepted", "rejected", or "none" before its first request
|
||||||
|
public string ActorURI { get; set; }
|
||||||
|
public DateTime? RequestedAt { get; set; }
|
||||||
|
public DateTime? AnsweredAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RelayForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(2048, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string Address { get; set; }//the relay's actor (https://relay.example/actor) or its inbox
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
namespace PrivaPub.ClientModels.Admin
|
||||||
|
{
|
||||||
|
// /clientapi/admin/statistics/overview: the last days' federation at a glance; counters keyed as the ledger keys them
|
||||||
|
public class ViewStatisticsOverview
|
||||||
|
{
|
||||||
|
public int Days { get; set; }
|
||||||
|
public Dictionary<string, long> Channels { get; set; } = new();
|
||||||
|
public Dictionary<string, long> Inbound { get; set; } = new();
|
||||||
|
public Dictionary<string, long> Outbound { get; set; } = new();
|
||||||
|
public double? DeliverySuccess { get; set; }
|
||||||
|
public ViewLatency DeliveryLatencyMs { get; set; } = new();
|
||||||
|
public ViewHostCounts Hosts { get; set; } = new();
|
||||||
|
public int Accounts { get; set; }
|
||||||
|
public ViewLedgerCounts Ledger { get; set; } = new();
|
||||||
|
public ViewMediaTotals Media { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
// what media take on the server: the uploads and pictures kept, the remote media cache, the trash waiting its grace
|
||||||
|
public class ViewMediaTotals
|
||||||
|
{
|
||||||
|
public long MediaBytes { get; set; }
|
||||||
|
public long MediaFiles { get; set; }
|
||||||
|
public long ProxyCacheBytes { get; set; }
|
||||||
|
public long TrashBytes { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewLatency
|
||||||
|
{
|
||||||
|
public int? P50 { get; set; }
|
||||||
|
public int? P95 { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHostCounts
|
||||||
|
{
|
||||||
|
public int Active { get; set; }
|
||||||
|
public long Known { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewLedgerCounts
|
||||||
|
{
|
||||||
|
public long Written { get; set; }
|
||||||
|
public long Dropped { get; set; }
|
||||||
|
public long Failed { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// /clientapi/admin/statistics/hosts: one page of the servers we exchanged with
|
||||||
|
public class ViewHostsPage
|
||||||
|
{
|
||||||
|
public int Total { get; set; }
|
||||||
|
public int Page { get; set; }
|
||||||
|
public List<ViewHostRow> Hosts { get; set; } = new();
|
||||||
|
public string Attribution { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHostRow
|
||||||
|
{
|
||||||
|
public string Host { get; set; }
|
||||||
|
public string Software { get; set; }
|
||||||
|
public string Version { get; set; }
|
||||||
|
public long In { get; set; }
|
||||||
|
public long Out { get; set; }
|
||||||
|
public long Refused { get; set; }
|
||||||
|
public long Failures { get; set; }
|
||||||
|
public int? LatencyP50 { get; set; }
|
||||||
|
public int Accounts { get; set; }
|
||||||
|
public DateTime? DescribedAt { get; set; }
|
||||||
|
public ViewHostDelivery Delivery { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHostDelivery
|
||||||
|
{
|
||||||
|
public int ConsecutiveFailures { get; set; }
|
||||||
|
public DateTime? UnavailableUntil { get; set; }
|
||||||
|
public DateTime? LastSuccessAt { get; set; }
|
||||||
|
public DateTime? LastFailureAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// /clientapi/admin/statistics/crawler: how far the crawler got
|
||||||
|
public class ViewCrawler
|
||||||
|
{
|
||||||
|
public bool Enabled { get; set; }
|
||||||
|
public long Touched { get; set; }
|
||||||
|
public long Crawled { get; set; }
|
||||||
|
public long Due { get; set; }
|
||||||
|
public long RobotsDisallowed { get; set; }
|
||||||
|
public List<ViewCrawledHost> Recent { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewCrawledHost
|
||||||
|
{
|
||||||
|
public string Host { get; set; }
|
||||||
|
public string Seen { get; set; }
|
||||||
|
public DateTime? LastCrawledAt { get; set; }
|
||||||
|
public int? PeersCount { get; set; }
|
||||||
|
public bool? RobotsDisallowed { get; set; }
|
||||||
|
public string CrawlError { get; set; }
|
||||||
|
public string Software { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// /clientapi/admin/statistics/hosts/{host}: one server, what it says of itself, its days and its latest events
|
||||||
|
public class ViewHostDetail
|
||||||
|
{
|
||||||
|
public string Host { get; set; }
|
||||||
|
public ViewHostInstance Instance { get; set; }
|
||||||
|
public List<ViewHostDay> Days { get; set; } = [];
|
||||||
|
public List<ViewInteractionEvent> Events { get; set; } = [];
|
||||||
|
public string Attribution { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHostInstance
|
||||||
|
{
|
||||||
|
public string Software { get; set; }
|
||||||
|
public string SoftwareVersion { get; set; }
|
||||||
|
public string NodeName { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string NodeDescription { get; set; }
|
||||||
|
public bool? OpenRegistrations { get; set; }
|
||||||
|
public string RegistrationMode { get; set; }
|
||||||
|
public long? UsersTotal { get; set; }
|
||||||
|
public long? UsersActiveMonth { get; set; }
|
||||||
|
public long? LocalPosts { get; set; }
|
||||||
|
public List<string> Languages { get; set; } = [];
|
||||||
|
public string Seen { get; set; }
|
||||||
|
public DateTime? FirstSeenAt { get; set; }
|
||||||
|
public DateTime? LastSeenAt { get; set; }
|
||||||
|
public DateTime? DescribedAt { get; set; }
|
||||||
|
public string DescriptionError { get; set; }
|
||||||
|
public DateTime? LastSuccessAt { get; set; }
|
||||||
|
public DateTime? LastFailureAt { get; set; }
|
||||||
|
public string LastError { get; set; }
|
||||||
|
public int ConsecutiveFailures { get; set; }
|
||||||
|
public DateTime? UnavailableUntil { get; set; }
|
||||||
|
public string Country { get; set; }
|
||||||
|
public string City { get; set; }
|
||||||
|
public int? Asn { get; set; }
|
||||||
|
public string AsnOrg { get; set; }
|
||||||
|
public string Cdn { get; set; }
|
||||||
|
public string InstanceApi { get; set; }
|
||||||
|
public string SourceUrl { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHostDay
|
||||||
|
{
|
||||||
|
public DateTime Day { get; set; }
|
||||||
|
public Dictionary<string, long> Counters { get; set; } = new();
|
||||||
|
public Dictionary<string, long> Latency { get; set; } = new();
|
||||||
|
public Dictionary<string, long> Bytes { get; set; } = new();
|
||||||
|
public Dictionary<string, long> Reads { get; set; } = new();
|
||||||
|
public int Accounts { get; set; }
|
||||||
|
public bool Live { get; set; }//today's or a day not rolled up yet, folded from its events
|
||||||
|
}
|
||||||
|
|
||||||
|
// one ledger entry: what was received, delivered or fetched, and how it ended; never who
|
||||||
|
public class ViewInteractionEvent
|
||||||
|
{
|
||||||
|
public DateTime At { get; set; }
|
||||||
|
public string Host { get; set; }
|
||||||
|
public string Channel { get; set; }
|
||||||
|
public string Activity { get; set; }
|
||||||
|
public string Object { get; set; }
|
||||||
|
public string Purpose { get; set; }
|
||||||
|
public string Trigger { get; set; }
|
||||||
|
public string Outcome { get; set; }
|
||||||
|
public string Reason { get; set; }
|
||||||
|
public int? Status { get; set; }
|
||||||
|
public int? LatencyMs { get; set; }
|
||||||
|
public int? WaitMs { get; set; }
|
||||||
|
public long? Bytes { get; set; }
|
||||||
|
public int? Attempt { get; set; }
|
||||||
|
public string Audience { get; set; }
|
||||||
|
public string LocalKind { get; set; }
|
||||||
|
public string Inbox { get; set; }
|
||||||
|
public string Signature { get; set; }
|
||||||
|
public List<string> Features { get; set; } = [];
|
||||||
|
public long? AgeSeconds { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// /clientapi/admin/statistics/server: the server's own day, its client API and the documents it served
|
||||||
|
public class ViewServerDay
|
||||||
|
{
|
||||||
|
public DateTime Day { get; set; }
|
||||||
|
public Dictionary<string, long> Client { get; set; } = new();
|
||||||
|
public Dictionary<string, long> ClientLatency { get; set; } = new();
|
||||||
|
public Dictionary<string, long> Served { get; set; } = new();
|
||||||
|
public long LedgerWritten { get; set; }
|
||||||
|
public long LedgerDropped { get; set; }
|
||||||
|
public long LedgerFailed { get; set; }
|
||||||
|
public int Accounts { get; set; }
|
||||||
|
public int Hosts { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
namespace PrivaPub.ClientModels.Group
|
||||||
|
{
|
||||||
|
// someone in a group, or asking to join it, as its owner and moderators see them
|
||||||
|
public class ViewGroupMember
|
||||||
|
{
|
||||||
|
public string ActorUri { get; set; }
|
||||||
|
public string Handle { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string PictureUrl { get; set; }
|
||||||
|
public bool IsLocal { get; set; }
|
||||||
|
public bool IsPending { get; set; }
|
||||||
|
public string Role { get; set; }//owner, moderator, member
|
||||||
|
public DateTime Since { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,5 +34,10 @@ namespace PrivaPub.ClientModels
|
|||||||
public bool ThemeIsDarkMode { get; set; } = false;
|
public bool ThemeIsDarkMode { get; set; } = false;
|
||||||
|
|
||||||
public string InvitationPassword { get; set; }
|
public string InvitationPassword { get; set; }
|
||||||
|
|
||||||
|
// the authenticator app's code, or one of the recovery codes, for a login with two-factor sign-in; asked for with a
|
||||||
|
// 428 once the password was right
|
||||||
|
[StringLength(32, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string OneTimeCode { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,132 +60,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to (necessary in case of password recovery).
|
|
||||||
/// </summary>
|
|
||||||
public static string _necessary_in_case_of_password_recovery_ {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("(necessary in case of password recovery)", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to (<a class="is-underlined has-text-info" tabindex="-1" target="_blank" href="https://keepassxc.org/">password manager</a> suggested).
|
|
||||||
/// </summary>
|
|
||||||
public static string _password_manager_suggested_ {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("(password manager suggested)", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Amount.
|
|
||||||
/// </summary>
|
|
||||||
public static string Amount {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Amount", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Answer id.
|
|
||||||
/// </summary>
|
|
||||||
public static string AnswerId {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("AnswerId", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Answer text.
|
|
||||||
/// </summary>
|
|
||||||
public static string AnswerText {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("AnswerText", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Custom character(emoji).
|
|
||||||
/// </summary>
|
|
||||||
public static string Character {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Character", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Colour.
|
|
||||||
/// </summary>
|
|
||||||
public static string ColourIndex {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ColourIndex", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Comment id.
|
|
||||||
/// </summary>
|
|
||||||
public static string CommentId {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("CommentId", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Comment text.
|
|
||||||
/// </summary>
|
|
||||||
public static string CommentText {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("CommentText", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Confrontation.
|
|
||||||
/// </summary>
|
|
||||||
public static string Confrontation {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Confrontation", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Confrontation id.
|
|
||||||
/// </summary>
|
|
||||||
public static string ConfrontationId {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ConfrontationId", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Context.
|
|
||||||
/// </summary>
|
|
||||||
public static string Context {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Context", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to End date.
|
|
||||||
/// </summary>
|
|
||||||
public static string DateEnd {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("DateEnd", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Start date.
|
|
||||||
/// </summary>
|
|
||||||
public static string DateStart {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("DateStart", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Description.
|
/// Looks up a localized string similar to Description.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -195,60 +69,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Discussion.
|
|
||||||
/// </summary>
|
|
||||||
public static string Discussion {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Discussion", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to End date.
|
|
||||||
/// </summary>
|
|
||||||
public static string DiscussionEndDate {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("DiscussionEndDate", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to End time.
|
|
||||||
/// </summary>
|
|
||||||
public static string DiscussionEndTime {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("DiscussionEndTime", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Discussion id.
|
|
||||||
/// </summary>
|
|
||||||
public static string DiscussionId {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("DiscussionId", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Discussion text.
|
|
||||||
/// </summary>
|
|
||||||
public static string DiscussionText {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("DiscussionText", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Discussion title.
|
|
||||||
/// </summary>
|
|
||||||
public static string DiscussionTitle {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("DiscussionTitle", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Email.
|
/// Looks up a localized string similar to Email.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -267,42 +87,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Max amount of confrontations.
|
|
||||||
/// </summary>
|
|
||||||
public static string ExpectedMaxConfrontationsBeforeClosingAndShowing {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ExpectedMaxConfrontationsBeforeClosingAndShowing", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Fact.
|
|
||||||
/// </summary>
|
|
||||||
public static string Fact {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Fact", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Facts.
|
|
||||||
/// </summary>
|
|
||||||
public static string Facts {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Facts", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to File id.
|
|
||||||
/// </summary>
|
|
||||||
public static string FileId {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("FileId", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Groups.
|
/// Looks up a localized string similar to Groups.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -312,15 +96,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Include the first answer in the invitation preview? (making it more engaging to join the discussion).
|
|
||||||
/// </summary>
|
|
||||||
public static string IncludeFirstAnswerInInvitation {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("IncludeFirstAnswerInInvitation", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Invitation code.
|
/// Looks up a localized string similar to Invitation code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -330,15 +105,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Invitation code or link.
|
|
||||||
/// </summary>
|
|
||||||
public static string InvitationCodeLink {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("InvitationCodeLink", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Invitation password.
|
/// Looks up a localized string similar to Invitation password.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -348,42 +114,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Require password for preview.
|
|
||||||
/// </summary>
|
|
||||||
public static string IsPasswordProtectedForPreview {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("IsPasswordProtectedForPreview", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Require password to show the preview.
|
|
||||||
/// </summary>
|
|
||||||
public static string IsPasswordProtectedForPreviewText {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("IsPasswordProtectedForPreviewText", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Add password protection.
|
|
||||||
/// </summary>
|
|
||||||
public static string IsPasswordProtectedText {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("IsPasswordProtectedText", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to IsStructured.
|
|
||||||
/// </summary>
|
|
||||||
public static string IsStructured {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("IsStructured", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Language id.
|
/// Looks up a localized string similar to Language id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -426,15 +156,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Enable notifications?(useful to receive app updates).
|
|
||||||
/// </summary>
|
|
||||||
public static string NativeNotificationsEnabled {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("NativeNotificationsEnabled", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to New password.
|
/// Looks up a localized string similar to New password.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -462,15 +183,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to One time only.
|
|
||||||
/// </summary>
|
|
||||||
public static string OneTime {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("OneTime", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Password.
|
/// Looks up a localized string similar to Password.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -480,24 +192,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Perception.
|
|
||||||
/// </summary>
|
|
||||||
public static string Perception {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Perception", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Perceptions.
|
|
||||||
/// </summary>
|
|
||||||
public static string Perceptions {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Perceptions", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Prefer system theme.
|
/// Looks up a localized string similar to Prefer system theme.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -516,96 +210,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Recurring.
|
|
||||||
/// </summary>
|
|
||||||
public static string Recurring {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Recurring", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Scan for:.
|
|
||||||
/// </summary>
|
|
||||||
public static string Scan_for_ {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Scan for:", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Search.
|
|
||||||
/// </summary>
|
|
||||||
public static string SearchText {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("SearchText", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Sharing Secret Code.
|
|
||||||
/// </summary>
|
|
||||||
public static string ShareCode {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ShareCode", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Show donator badge.
|
|
||||||
/// </summary>
|
|
||||||
public static string ShowDonatorBadge {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ShowDonatorBadge", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Show the logs tab to support troubleshooting..
|
|
||||||
/// </summary>
|
|
||||||
public static string ShowLogs {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ShowLogs", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Take type.
|
|
||||||
/// </summary>
|
|
||||||
public static string TakeType {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TakeType", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Simple.
|
|
||||||
/// </summary>
|
|
||||||
public static string TakeTypeSimple {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TakeTypeSimple", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Structured.
|
|
||||||
/// </summary>
|
|
||||||
public static string TakeTypeStructured {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TakeTypeStructured", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Theme image.
|
|
||||||
/// </summary>
|
|
||||||
public static string Theme_image {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Theme image", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Dark mode.
|
/// Looks up a localized string similar to Dark mode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -615,15 +219,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Ticks.
|
|
||||||
/// </summary>
|
|
||||||
public static string Ticks {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Ticks", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Title.
|
/// Looks up a localized string similar to Title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -633,24 +228,6 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Update reason.
|
|
||||||
/// </summary>
|
|
||||||
public static string UpdateReason {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("UpdateReason", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Submit anonymously.
|
|
||||||
/// </summary>
|
|
||||||
public static string UpsertUserTakeIsAnonymous {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("UpsertUserTakeIsAnonymous", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Username.
|
/// Looks up a localized string similar to Username.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -659,23 +236,5 @@ namespace PrivaPub.ClientModels.Resources {
|
|||||||
return ResourceManager.GetString("Username", resourceCulture);
|
return ResourceManager.GetString("Username", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Username to search and add.
|
|
||||||
/// </summary>
|
|
||||||
public static string Username_to_search_and_add {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Username to search and add", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Usernames to search and add.
|
|
||||||
/// </summary>
|
|
||||||
public static string Usernames_to_search_and_add {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Usernames to search and add", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(необходимо в случай на възстановяване на парола)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">предложен мениджър на пароли</a>)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Сума</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Отговор id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Текст на отговора</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Персонализиран символ (емотикон)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Цвят</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Коментар id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Текст на коментара</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Конфронтация</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Конфронтация id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Контекст</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Крайна дата</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Начална дата</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Описание</value>
|
<value>Описание</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Дискусия</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Крайна дата</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Краен час</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Дискусия id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Текст за обсъждане</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Заглавие на дискусията</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Имейл</value>
|
<value>Имейл</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Емотикони</value>
|
<value>Емотикони</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Максимален брой конфронтации</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Факт</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Факти</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Идентификатор на файла</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Групи</value>
|
<value>Групи</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Да включите първия отговор в предварителния преглед на поканата? (за да се включите в дискусията по-ангажиращо)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Код на поканата</value>
|
<value>Код на поканата</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Код или връзка за покана</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Парола за покана</value>
|
<value>Парола за покана</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Изискване на парола за предварителен преглед</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Изискване на парола за показване на предварителния преглед</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Добавяне на защита с парола</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Идентификатор на езика</value>
|
<value>Идентификатор на езика</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Име</value>
|
<value>Име</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Активиране на известията?(полезно за получаване на актуализации на приложението)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Нова парола</value>
|
<value>Нова парола</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Стара парола</value>
|
<value>Стара парола</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Само веднъж</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Парола</value>
|
<value>Парола</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Възприемане</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Възприятия</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Предпочитайте темата на системата</value>
|
<value>Предпочитайте темата на системата</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Код за възстановяване</value>
|
<value>Код за възстановяване</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Повтарящи се</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Сканиране за:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Търсене</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Споделяне на тайния код</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Покажи значката на дарителя</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Покажете раздела с дневници, за да подпомогнете отстраняването на неизправности.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Вид на вземането</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Прост</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Структуриран</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Изображение на темата</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Тъмен режим</value>
|
<value>Тъмен режим</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Кърлежи</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Заглавие</value>
|
<value>Заглавие</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Причина за актуализиране</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Подайте анонимно</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Потребителско име</value>
|
<value>Потребителско име</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Потребителско име за търсене и добавяне</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Потребителски имена за търсене и добавяне</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(nutné v případě obnovení hesla)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">správce hesel</a> navrženo)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Částka</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Odpověď id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Text odpovědi</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Vlastní znak(emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Barva</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Komentář id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Text komentáře</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontace</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Id konfrontace</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontext</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Datum ukončení</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Datum zahájení</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Popis</value>
|
<value>Popis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Diskuse</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Datum ukončení</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Čas ukončení</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Diskuze id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Text k diskusi</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Název diskuse</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-mail</value>
|
<value>E-mail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Maximální počet konfrontací</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fakta</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fakta</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Identifikátor souboru</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Skupiny</value>
|
<value>Skupiny</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Zahrnout první odpověď do náhledu pozvánky? (abyste se mohli zapojit do diskuse)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Kód pozvánky</value>
|
<value>Kód pozvánky</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Pozvánkový kód nebo odkaz</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Heslo pozvánky</value>
|
<value>Heslo pozvánky</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Vyžadovat heslo pro náhled</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Vyžadování hesla pro zobrazení náhledu</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Přidání ochrany heslem</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Identifikace jazyka</value>
|
<value>Identifikace jazyka</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Název</value>
|
<value>Název</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Povolit oznámení?(užitečné pro příjem aktualizací aplikace)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nové heslo</value>
|
<value>Nové heslo</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Staré heslo</value>
|
<value>Staré heslo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Pouze jednou</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Heslo</value>
|
<value>Heslo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Vnímání</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Vnímání</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Preferovat systémové téma</value>
|
<value>Preferovat systémové téma</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Kód obnovy</value>
|
<value>Kód obnovy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Opakující se</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Vyhledat:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Vyhledávání</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Sdílení tajného kódu</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Zobrazit odznak dárce</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Zobrazit kartu protokolů pro podporu řešení problémů.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Vezměte si typ</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Jednoduché</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturovaný</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Tématický obrázek</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Tmavý režim</value>
|
<value>Tmavý režim</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Klíšťata</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Název</value>
|
<value>Název</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Důvod aktualizace</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Anonymní odeslání</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Uživatelské jméno</value>
|
<value>Uživatelské jméno</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Uživatelské jméno pro vyhledávání a přidávání</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Uživatelská jména pro vyhledávání a přidávání</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(nødvendig i tilfælde af inddrivelse af adgangskode)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">password manager</a> foreslået)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Beløb</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Svar id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Svar tekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Brugerdefineret tegn (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Farve</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Kommentar id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Kommentar tekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontation</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Konfrontation id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Slutdato</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Startdato</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Beskrivelse</value>
|
<value>Beskrivelse</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Diskussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Slutdato</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Sluttidspunkt</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Diskussion id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Tekst til drøftelse</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Diskussionstitel</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-mail</value>
|
<value>E-mail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Maksimalt antal konfrontationer</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fakta</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fakta</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Fil id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupper</value>
|
<value>Grupper</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Medtage det første svar i forhåndsvisningen af invitationen? (gør det mere indbydende at deltage i diskussionen)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Kode for indbydelse</value>
|
<value>Kode for indbydelse</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Indbydelseskode eller link</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Adgangskode til invitationen</value>
|
<value>Adgangskode til invitationen</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Kræver adgangskode til visning af preview</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Kræver adgangskode for at vise forhåndsvisningen</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Tilføj adgangskodebeskyttelse</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Sprog-id</value>
|
<value>Sprog-id</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Navn</value>
|
<value>Navn</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Aktiver notifikationer? (nyttigt for at modtage opdateringer til appen)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Ny adgangskode</value>
|
<value>Ny adgangskode</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Gammel adgangskode</value>
|
<value>Gammel adgangskode</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Kun én gang</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Adgangskode</value>
|
<value>Adgangskode</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Opfattelse</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Opfattelser</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Foretrækker systemtema</value>
|
<value>Foretrækker systemtema</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Kode for inddrivelse</value>
|
<value>Kode for inddrivelse</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Tilbagevendende</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Scan efter:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Søg på</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Deling af den hemmelige kode</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Vis donator-badge</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Vis fanen Logfiler for at støtte fejlfinding.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Tag type</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Enkel</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Struktureret</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Temabillede</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Mørk tilstand</value>
|
<value>Mørk tilstand</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Flåter</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Titel</value>
|
<value>Titel</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Årsag til opdatering</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Indsend anonymt</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Brugernavn</value>
|
<value>Brugernavn</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Brugernavn til at søge og tilføje</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Brugernavne til at søge og tilføje</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(notwendig für die Wiederherstellung des Passworts)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">Passwortmanager</a> vorgeschlagen)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Betrag</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Antwort id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Antwort-Text</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Benutzerdefiniertes Zeichen (Emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Farbe</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Kommentar</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Text kommentieren</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontation</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Konfrontation id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontext</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Datum des Endes</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Datum des Beginns</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Beschreibung</value>
|
<value>Beschreibung</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Diskussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Datum des Endes</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Endzeit</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Diskussion id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Text zur Diskussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Titel der Diskussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-Mail</value>
|
<value>E-Mail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Maximale Anzahl von Konfrontationen</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Tatsache</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fakten</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Datei-ID</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Gruppen</value>
|
<value>Gruppen</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Die erste Antwort in die Vorschau der Einladung aufnehmen? (um den Anreiz zur Teilnahme an der Diskussion zu erhöhen)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Einladungs-Code</value>
|
<value>Einladungs-Code</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Einladungscode oder Link</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Passwort für die Einladung</value>
|
<value>Passwort für die Einladung</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Passwort für Vorschau erforderlich</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Passwort erforderlich, um die Vorschau anzuzeigen</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Passwortschutz hinzufügen</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Sprache id</value>
|
<value>Sprache id</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Name</value>
|
<value>Name</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Benachrichtigungen aktivieren?(nützlich, um App-Updates zu erhalten)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Neues Passwort</value>
|
<value>Neues Passwort</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Altes Passwort</value>
|
<value>Altes Passwort</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Nur einmalig</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Passwort</value>
|
<value>Passwort</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Wahrnehmung</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Wahrnehmungen</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Systemthema bevorzugen</value>
|
<value>Systemthema bevorzugen</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Wiederherstellungscode</value>
|
<value>Wiederherstellungscode</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Wiederkehrende</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Scannen Sie nach:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Suche</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Gemeinsamer Geheimcode</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Spenderausweis anzeigen</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Zeigen Sie die Registerkarte Protokolle an, um die Fehlersuche zu unterstützen.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Typ nehmen</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Einfach</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturiert</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Thema Bild</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Dunkler Modus</value>
|
<value>Dunkler Modus</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Zecken</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Titel</value>
|
<value>Titel</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Grund für die Aktualisierung</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Anonym einreichen</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Benutzername</value>
|
<value>Benutzername</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Benutzername zum Suchen und Hinzufügen</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Nutzernamen zum Suchen und Hinzufügen</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(απαραίτητο σε περίπτωση ανάκτησης κωδικού πρόσβασης)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">διαχειριστής κωδικών πρόσβασης</a> προτείνεται)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Ποσό</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Απάντηση id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Κείμενο απάντησης</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Προσαρμοσμένος χαρακτήρας (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Χρώμα</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Σχόλιο id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Κείμενο σχολιασμού</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Αντιπαράθεση</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>id αντιπαράθεσης</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Πλαίσιο</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Ημερομηνία λήξης</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Ημερομηνία έναρξης</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Περιγραφή</value>
|
<value>Περιγραφή</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Συζήτηση</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Ημερομηνία λήξης</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Ώρα λήξης</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Συζήτηση id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Κείμενο συζήτησης</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Τίτλος συζήτησης</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Ηλεκτρονικό ταχυδρομείο</value>
|
<value>Ηλεκτρονικό ταχυδρομείο</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Μέγιστος αριθμός αντιπαραθέσεων</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Γεγονός</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Γεγονότα</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>id αρχείου</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Ομάδες</value>
|
<value>Ομάδες</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Να συμπεριλάβετε την πρώτη απάντηση στην προεπισκόπηση της πρόσκλησης; (καθιστώντας την πιο ελκυστική για να συμμετάσχετε στη συζήτηση)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Κωδικός πρόσκλησης</value>
|
<value>Κωδικός πρόσκλησης</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Κωδικός πρόσκλησης ή σύνδεσμος</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Κωδικός πρόσκλησης</value>
|
<value>Κωδικός πρόσκλησης</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Απαίτηση κωδικού πρόσβασης για προεπισκόπηση</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Απαιτείται κωδικός πρόσβασης για την εμφάνιση της προεπισκόπησης</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Προσθήκη προστασίας με κωδικό πρόσβασης</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Id γλώσσας</value>
|
<value>Id γλώσσας</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Όνομα</value>
|
<value>Όνομα</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Ενεργοποίηση ειδοποιήσεων; (χρήσιμο για να λαμβάνετε ενημερώσεις εφαρμογών)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Νέος κωδικός πρόσβασης</value>
|
<value>Νέος κωδικός πρόσβασης</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Παλαιός κωδικός πρόσβασης</value>
|
<value>Παλαιός κωδικός πρόσβασης</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Μόνο μία φορά</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Κωδικός πρόσβασης</value>
|
<value>Κωδικός πρόσβασης</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Αντίληψη</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Αντιλήψεις</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Προτιμήστε το θέμα του συστήματος</value>
|
<value>Προτιμήστε το θέμα του συστήματος</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Κωδικός ανάκτησης</value>
|
<value>Κωδικός ανάκτησης</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Επαναλαμβανόμενο</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Σάρωση για:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Αναζήτηση</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Κοινή χρήση μυστικού κώδικα</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Εμφάνιση σήματος δωρητή</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Εμφάνιση της καρτέλας αρχείων καταγραφής για την υποστήριξη της αντιμετώπισης προβλημάτων.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Πάρτε τον τύπο</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Απλό</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Δομημένο</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Εικόνα θέματος</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Σκοτεινή λειτουργία</value>
|
<value>Σκοτεινή λειτουργία</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Κρότωνες</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Τίτλος</value>
|
<value>Τίτλος</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Αιτία ενημέρωσης</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Υποβάλετε ανώνυμα</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Όνομα χρήστη</value>
|
<value>Όνομα χρήστη</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Όνομα χρήστη για αναζήτηση και προσθήκη</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Ονόματα χρηστών για αναζήτηση και προσθήκη</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(necesario en caso de recuperación de la contraseña)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">gestor de contraseñas</a> sugerido)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Importe</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Respuesta</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Texto de respuesta</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Carácter personalizado (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Color</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Comentario id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Texto de los comentarios</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Confrontación</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Identificación de la confrontación</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Contexto</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Fecha de finalización</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Fecha de inicio</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Descripción</value>
|
<value>Descripción</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Discusión</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Fecha de finalización</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Hora de finalización</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Discusión</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Texto de debate</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Título del debate</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Envíe un correo electrónico a</value>
|
<value>Envíe un correo electrónico a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Máxima cantidad de enfrentamientos</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Datos</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Hechos</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>ID de archivo</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupos</value>
|
<value>Grupos</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>¿Incluir la primera respuesta en la vista previa de la invitación? (para que sea más atractivo participar en el debate)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Código de invitación</value>
|
<value>Código de invitación</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Código o enlace de invitación</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Contraseña de la invitación</value>
|
<value>Contraseña de la invitación</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Requerir contraseña para la vista previa</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Requiere contraseña para mostrar la vista previa</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Añadir protección por contraseña</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Id. de idioma</value>
|
<value>Id. de idioma</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nombre</value>
|
<value>Nombre</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Activar las notificaciones (útiles para recibir las actualizaciones de la aplicación)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nueva contraseña</value>
|
<value>Nueva contraseña</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Contraseña antigua</value>
|
<value>Contraseña antigua</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Una sola vez</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Contraseña</value>
|
<value>Contraseña</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Percepción</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Percepciones</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Prefiero el tema del sistema</value>
|
<value>Prefiero el tema del sistema</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Código de recuperación</value>
|
<value>Código de recuperación</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Recurrente</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Busca:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Buscar en</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Compartir el código secreto</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Mostrar el distintivo de donante</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Mostrar la pestaña de registros para apoyar la resolución de problemas.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Toma de tipo</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Simple</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Estructurado</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Imagen del tema</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Modo oscuro</value>
|
<value>Modo oscuro</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Garrapatas</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Título</value>
|
<value>Título</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Motivo de actualización</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Presentar de forma anónima</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Nombre de usuario</value>
|
<value>Nombre de usuario</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Nombre de usuario para buscar y añadir</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Nombres de usuario para buscar y añadir</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(vajalik parooli taastamise korral)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">Password manager</a> soovitatav)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Summa</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Vastus id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Vastuse tekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Kohandatud märk (emotikoni)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Värv</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Kommentaar id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Kommentaaride tekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Vastasseis</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Vastasseisu id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Lõppkuupäev</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Alguskuupäev</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Kirjeldus</value>
|
<value>Kirjeldus</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Arutelu</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Lõppkuupäev</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Lõpuaeg</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Arutelu id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Arutelu tekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Arutelu pealkiri</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-post</value>
|
<value>E-post</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Vastasseisude maksimaalne arv</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fakt</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Faktid</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Faili id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Rühmad</value>
|
<value>Rühmad</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Lisage esimene vastus kutse eelvaates? (muudab aruteluga liitumise atraktiivsemaks)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Kutse kood</value>
|
<value>Kutse kood</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Kutse kood või link</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Kutse parool</value>
|
<value>Kutse parool</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Nõuab eelvaate jaoks parooli</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Eelvaate kuvamiseks nõutakse parooli</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Lisage paroolikaitse</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Keele id</value>
|
<value>Keele id</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nimi</value>
|
<value>Nimi</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Teavituste lubamine?(kasulik, et saada rakenduse uuendusi)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Uus parool</value>
|
<value>Uus parool</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Vana parool</value>
|
<value>Vana parool</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Ainult üks kord</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Parool</value>
|
<value>Parool</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Tajumine</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Arvamused</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Eelistage süsteemi teemat</value>
|
<value>Eelistage süsteemi teemat</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Taastamiskood</value>
|
<value>Taastamiskood</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Korduvad</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Skaneeri:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Otsi</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Salajase koodi jagamine</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Näita doonori märki</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Näidake veaotsingu toetamiseks logide vahekaarti.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Võtke tüüp</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Lihtne</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Struktureeritud</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Teema pilt</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Tume režiim</value>
|
<value>Tume režiim</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Puugid</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Pealkiri</value>
|
<value>Pealkiri</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Uuendamise põhjus</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Esitage anonüümselt</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Kasutajanimi</value>
|
<value>Kasutajanimi</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Kasutajanimi otsimiseks ja lisamiseks</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Kasutajanimed otsimiseks ja lisamiseks</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(tarvitaan salasanan palautuksen yhteydessä)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">salasananhallinta</a> ehdotettu)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Määrä</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Vastaa id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Vastaus teksti</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Mukautettu merkki (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Väri</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Kommentti id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Kommenttiteksti</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Vastakkainasettelu</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Vastakkainasettelu id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Konteksti</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Loppupäivä</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Aloituspäivä</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Kuvaus</value>
|
<value>Kuvaus</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Keskustelu</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Loppupäivä</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Loppuaika</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Keskustelu id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Keskusteluteksti</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Keskustelun otsikko</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Sähköposti</value>
|
<value>Sähköposti</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Vastakkainasettelujen enimmäismäärä</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fakta</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Faktat</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Tiedoston id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Ryhmät</value>
|
<value>Ryhmät</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Sisällytä ensimmäinen vastaus kutsun esikatseluun? (mikä tekee keskusteluun osallistumisesta houkuttelevampaa)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Kutsun koodi</value>
|
<value>Kutsun koodi</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Kutsukoodi tai linkki</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Kutsun salasana</value>
|
<value>Kutsun salasana</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Vaadi salasana esikatselua varten</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Vaadi salasana esikatselun näyttämiseksi</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Lisää salasanasuojaus</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Kielitunnus</value>
|
<value>Kielitunnus</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nimi</value>
|
<value>Nimi</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Ota ilmoitukset käyttöön?(hyödyllinen sovelluksen päivitysten saamiseksi)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Uusi salasana</value>
|
<value>Uusi salasana</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Vanha salasana</value>
|
<value>Vanha salasana</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Vain kerran</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Salasana</value>
|
<value>Salasana</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Havainto</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Käsitykset</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Suositeltava järjestelmäteema</value>
|
<value>Suositeltava järjestelmäteema</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Palautuskoodi</value>
|
<value>Palautuskoodi</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Toistuvat</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Etsi:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Etsi</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Salaisen koodin jakaminen</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Näytä lahjoittajan merkki</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Näytä lokit-välilehti vianmäärityksen tueksi.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Ota tyyppi</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Yksinkertainen</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturoitu</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Aiheen kuva</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Tumma tila</value>
|
<value>Tumma tila</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Punkit</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Otsikko</value>
|
<value>Otsikko</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Päivityksen syy</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Lähetä nimettömänä</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Käyttäjätunnus</value>
|
<value>Käyttäjätunnus</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Käyttäjätunnus hakuun ja lisäämiseen</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Käyttäjätunnukset, joita voit etsiä ja lisätä</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(nécessaire en cas de récupération du mot de passe)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">gestionnaire de mots de passe</a> suggéré)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Montant</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Réponse id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Texte de réponse</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Caractère personnalisé (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Couleur</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Commentaire</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Texte du commentaire</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Confrontation</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Confrontation id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Contexte</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Date de fin</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Date de début</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Description</value>
|
<value>Description</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Discussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Date de fin</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Heure de fin</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>ID de discussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Texte de discussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Titre de la discussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Courriel</value>
|
<value>Courriel</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Nombre maximal de confrontations</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fait</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Faits et chiffres</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Identifiant du fichier</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Groupes</value>
|
<value>Groupes</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Inclure la première réponse dans l'aperçu de l'invitation ? (ce qui rend plus attrayant le fait de rejoindre la discussion)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Code d'invitation</value>
|
<value>Code d'invitation</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Code ou lien d'invitation</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Mot de passe de l'invitation</value>
|
<value>Mot de passe de l'invitation</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Exiger un mot de passe pour la prévisualisation</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Exiger un mot de passe pour afficher l'aperçu</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Ajouter une protection par mot de passe</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>EstStructuré</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Identifiant de langue</value>
|
<value>Identifiant de langue</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nom</value>
|
<value>Nom</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Activer les notifications ? (utile pour recevoir les mises à jour de l'application)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nouveau mot de passe</value>
|
<value>Nouveau mot de passe</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Ancien mot de passe</value>
|
<value>Ancien mot de passe</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>En une seule fois</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Mot de passe</value>
|
<value>Mot de passe</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Perception</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Perceptions</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Préférer le thème du système</value>
|
<value>Préférer le thème du système</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Code de récupération</value>
|
<value>Code de récupération</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Récurrent</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Scanner pour :</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Recherche</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Partage du code secret</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Afficher le badge de donateur</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Affichez l'onglet des journaux pour faciliter le dépannage.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Type de prise</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Simple</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Structuré</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Image du thème</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Mode foncé</value>
|
<value>Mode foncé</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Tiques</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Titre</value>
|
<value>Titre</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Raison de la mise à jour</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Soumettre anonymement</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Nom d'utilisateur</value>
|
<value>Nom d'utilisateur</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Nom d'utilisateur pour rechercher et ajouter</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Noms d'utilisateur à rechercher et à ajouter</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(jelszó helyreállítása esetén szükséges)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">jelszókezelő</a> javasolt)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Összeg</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Válasz id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Válasz szöveg</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Egyéni karakter (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Színes</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Megjegyzés id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Megjegyzés szövege</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontáció</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Konfrontációs azonosító</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontextus</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Végdátum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Kezdeti időpont</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Leírás</value>
|
<value>Leírás</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Megbeszélés</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Végdátum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Végidő</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Megbeszélés id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Megbeszélés szövege</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Vita címe</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-mail</value>
|
<value>E-mail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>A konfrontációk maximális száma</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Tény</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Tények</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Fájl azonosító</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Csoportok</value>
|
<value>Csoportok</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Az első válasz szerepeljen a meghívó előnézetében? (így vonzóbbá teszi a vitához való csatlakozást)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Meghívó kód</value>
|
<value>Meghívó kód</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Meghívó kód vagy link</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Meghívó jelszó</value>
|
<value>Meghívó jelszó</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Jelszó megkövetelése az előnézethez</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Jelszó megkövetelése az előnézet megjelenítéséhez</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Jelszóvédelem hozzáadása</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Nyelvi azonosító</value>
|
<value>Nyelvi azonosító</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Név</value>
|
<value>Név</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Értesítések engedélyezése?(hasznos az alkalmazás frissítéseinek fogadásához)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Új jelszó</value>
|
<value>Új jelszó</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Régi jelszó</value>
|
<value>Régi jelszó</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Csak egyszeri alkalom</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Jelszó</value>
|
<value>Jelszó</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Percepció</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Perceptions</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>A rendszer témájának előnyben részesítése</value>
|
<value>A rendszer témájának előnyben részesítése</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Helyreállítási kód</value>
|
<value>Helyreállítási kód</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Visszatérő</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Keresés:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Keresés</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Titkos kód megosztása</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Adományozói jelvény megjelenítése</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>A naplók lap megjelenítése a hibaelhárítás támogatására.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Vegye a típust</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Egyszerű</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturált</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Témakép</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Sötét üzemmód</value>
|
<value>Sötét üzemmód</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Kullancsok</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Cím</value>
|
<value>Cím</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Frissítés oka</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Névtelenül beküldeni</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Felhasználónév</value>
|
<value>Felhasználónév</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Felhasználónév kereséshez és hozzáadáshoz</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Felhasználónevek keresése és hozzáadása</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(necessaria in caso di recupero password)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(è suggerito l'uso del <a class="is-underlined has-text-info" tabindex="-1" target="_blank" href="https://keepassxc.org/">gestore password</a>)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Importo</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>ID risposta</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Testo risposta</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Carattere personalizzato (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Colore</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>ID commento</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Testo commento</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Confronto</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Id confronto</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Contesto</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Data di fine</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Data di inizio</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Descrizione</value>
|
<value>Descrizione</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Discussione</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Data di fine</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Tempo di fine</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>ID discussione</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Testo discussione</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Titolo discussione</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Email</value>
|
<value>Email</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Quantità massima di scontri</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fatto</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>I fatti</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>ID file</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Gruppi</value>
|
<value>Gruppi</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Includere la prima risposta nell'anteprima dell'invito? (rendendo più coinvolgente l'adesione alla discussione)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Codice d'invito</value>
|
<value>Codice d'invito</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Collegamento o codice di invito</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Password dell'invito</value>
|
<value>Password dell'invito</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Richiedi la password per l'anteprima</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Richiedi la password per l'anteprima della discussione</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Aggiungere la protezione con password</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>È strutturato</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>ID lingua</value>
|
<value>ID lingua</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nome</value>
|
<value>Nome</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Abilitare le notifiche?(utili per percepire aggiornamenti)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nuova password</value>
|
<value>Nuova password</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,78 +150,24 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Attuale password</value>
|
<value>Attuale password</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Paga una volta</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Password</value>
|
<value>Password</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>La percezione</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Percezioni</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Preferire il tema di sistema</value>
|
<value>Preferire il tema di sistema</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Codice di recupero</value>
|
<value>Codice di recupero</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Ricorrente</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Scansione per:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Ricerca</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Condivisione del codice segreto</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Mostra il badge del donatore</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Mostra il tab dei log a supporto della risoluzione dei problemi.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Prendi il tipo</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Semplice</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strutturato</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Immagine a tema</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Modalità scura</value>
|
<value>Modalità scura</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Zecche</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Titolo</value>
|
<value>Titolo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Motivo dell'aggiornamento</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Invia in forma anonima</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Soprannome</value>
|
<value>Soprannome</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Soprannome da ricercare e aggiungere</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Soprannomi da ricercare e aggiungere</value>
|
|
||||||
</data>
|
|
||||||
<data name="AvatarId" xml:space="preserve">
|
<data name="AvatarId" xml:space="preserve">
|
||||||
<value>Avatar</value>
|
<value>Avatar</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(パスワード復旧時に必要)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">パスワードマネージャー</a>の提案)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>金額</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>回答ID</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>回答テキスト</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>カスタムキャラクター(絵文字)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>カラー</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>コメントID</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>コメント文</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>対決</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>コンフロンティアID</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>コンテキスト</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>終了日</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>開始日</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>商品説明</value>
|
<value>商品説明</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>ディスカッション</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>終了日</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>終了時間</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>ディスカッションID</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>ディスカッションテキスト</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>議論のタイトル</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>電子メール</value>
|
<value>電子メール</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>絵文字</value>
|
<value>絵文字</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>対決の最大量</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>事実</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>事実</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>ファイルID</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>グループ</value>
|
<value>グループ</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>招待状のプレビューに最初の回答を含める?(議論への参加をより魅力的にするために)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>招待状コード</value>
|
<value>招待状コード</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>招待コードまたはリンク</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>招待状のパスワード</value>
|
<value>招待状のパスワード</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>プレビューにパスワードが必要</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>プレビューを表示するにはパスワードが必要です</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>パスワード保護機能の追加</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>言語ID</value>
|
<value>言語ID</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>名前</value>
|
<value>名前</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>通知を有効にしますか?(アプリの更新情報を受け取るのに便利です)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>新しいパスワード</value>
|
<value>新しいパスワード</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>古いパスワード</value>
|
<value>古いパスワード</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>1回限り</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>パスワード</value>
|
<value>パスワード</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>パーセプション</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>認知度</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>システムテーマを優先する</value>
|
<value>システムテーマを優先する</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>リカバリーコード</value>
|
<value>リカバリーコード</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>リカーリング</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>スキャンしてください:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>検索</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>秘密の暗号を共有する</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>寄付者バッジを表示する</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>トラブルシューティングをサポートするために、ログタブを表示します。</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>テイクタイプ</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>シンプル</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>構造化</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>テーマイメージ</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>ダークモード</value>
|
<value>ダークモード</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>ダニ</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>タイトル</value>
|
<value>タイトル</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>更新理由</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>匿名で投稿する</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>ユーザー名</value>
|
<value>ユーザー名</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>検索して追加するユーザー名</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>検索して追加するユーザー名</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(būtina slaptažodžio atkūrimo atveju)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">paslapčių tvarkyklė</a> siūloma)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Suma</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Atsakymas id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Atsakymo tekstas</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Pasirinktinis simbolis (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Spalva</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Komentaras id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Komentaro tekstas</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontacija</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Konfrontacijos id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontekstas</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Galutinė data</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Pradžios data</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Aprašymas</value>
|
<value>Aprašymas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Diskusija</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Galutinė data</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Pabaigos laikas</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Diskusijos id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Diskusijos tekstas</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Diskusijos pavadinimas</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>El. paštas</value>
|
<value>El. paštas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Didžiausias konfrontacijų skaičius</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Faktas</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Faktai</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Failo ID</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupės</value>
|
<value>Grupės</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Įtraukti pirmąjį atsakymą į kvietimo peržiūrą? (kad būtų patraukliau prisijungti prie diskusijos)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Kvietimo kodas</value>
|
<value>Kvietimo kodas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Kvietimo kodas arba nuoroda</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Kvietimo slaptažodis</value>
|
<value>Kvietimo slaptažodis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Reikalauti slaptažodžio peržiūrai</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Reikalauti slaptažodžio, kad būtų rodoma peržiūra</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Pridėti apsaugą slaptažodžiu</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Kalbos ID</value>
|
<value>Kalbos ID</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Pavadinimas</value>
|
<value>Pavadinimas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Įjungti pranešimus? (naudinga norint gauti programėlės atnaujinimus)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Naujas slaptažodis</value>
|
<value>Naujas slaptažodis</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Senasis slaptažodis</value>
|
<value>Senasis slaptažodis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Tik vieną kartą</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Slaptažodis</value>
|
<value>Slaptažodis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Suvokimas</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Suvokimas</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Pirmenybė sistemos temai</value>
|
<value>Pirmenybė sistemos temai</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Atkūrimo kodas</value>
|
<value>Atkūrimo kodas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Pasikartojantis</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Ieškoti:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Paieška</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Dalijimasis slaptuoju kodu</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Rodyti rėmėjo ženklelį</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Parodykite skirtuką "Žurnalai", kad galėtumėte padėti šalinti trikdžius.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Paimkite tipą</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Paprastas</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Struktūrinis</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Temos vaizdas</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Tamsus režimas</value>
|
<value>Tamsus režimas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Erkės</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Pavadinimas</value>
|
<value>Pavadinimas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Atnaujinimo priežastis</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Pateikti anonimiškai</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Vartotojo vardas</value>
|
<value>Vartotojo vardas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Vartotojo vardas paieškai ir pridėjimui</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Vartotojų vardų paieška ir pridėjimas</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(nepieciešams paroles atjaunošanas gadījumā)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">vārdu pārvaldnieks</a> ierosināts)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Summa</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Atbilde id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Atbildes teksts</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Pielāgots raksturs (emodži)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Krāsa</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Komentārs id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Komentāru teksts</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontācija</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Konfrontācijas id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Konteksts</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Beigu datums</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Sākuma datums</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Apraksts</value>
|
<value>Apraksts</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Diskusija</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Beigu datums</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Beigu laiks</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Diskusijas id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Diskusijas teksts</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Diskusijas nosaukums</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-pasts</value>
|
<value>E-pasts</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emocijas</value>
|
<value>Emocijas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Maksimālais konfrontāciju skaits</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fakti</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fakti</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Faila id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupas</value>
|
<value>Grupas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Iekļaut pirmo atbildi uzaicinājuma priekšskatījumā? (lai iesaistīšanās diskusijā būtu saistošāka)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Uzaicinājuma kods</value>
|
<value>Uzaicinājuma kods</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Uzaicinājuma kods vai saite</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Uzaicinājuma parole</value>
|
<value>Uzaicinājuma parole</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Pieprasīt paroli priekšskatīšanai</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Pieprasīt paroli, lai parādītu priekšskatījumu</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Pievienojiet paroles aizsardzību</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Valodas identifikators</value>
|
<value>Valodas identifikators</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nosaukums</value>
|
<value>Nosaukums</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Ieslēgt paziņojumus?(noderīgi, lai saņemtu lietotnes atjauninājumus)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Jauna parole</value>
|
<value>Jauna parole</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Vecā parole</value>
|
<value>Vecā parole</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Tikai vienu reizi</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Parole</value>
|
<value>Parole</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Uztvere</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Uzskati</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Dodiet priekšroku sistēmas tēmai</value>
|
<value>Dodiet priekšroku sistēmas tēmai</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Atgūšanas kods</value>
|
<value>Atgūšanas kods</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Atkārtoti</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Skenēt, lai atrastu:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Meklēšana</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Koplietošanas slepenais kods</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Rādīt ziedotāja nozīmīti</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Parādiet cilni žurnāli, lai atbalstītu problēmu novēršanu.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Veikt veidu</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Vienkāršs</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturēts</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Tēmas attēls</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Tumšais režīms</value>
|
<value>Tumšais režīms</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Ērces</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Nosaukums</value>
|
<value>Nosaukums</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Atjaunināšanas iemesls</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Iesniedziet anonīmi</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Lietotājvārds</value>
|
<value>Lietotājvārds</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Lietotājvārds, lai meklētu un pievienotu</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Meklēšanas un pievienošanas lietotājvārdi</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(nodig in geval van wachtwoordherstel)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">wachtwoord manager</a> voorgesteld)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Bedrag</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Antwoord id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Antwoord tekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Aangepast karakter (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Kleur</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Commentaar id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Commentaar tekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Confrontatie</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Confrontatie id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Context</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Einddatum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Startdatum</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Beschrijving</value>
|
<value>Beschrijving</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Discussie</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Einddatum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Eindtijd</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Discussie id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Besprekingstekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Titel van de discussie</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-mail</value>
|
<value>E-mail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Maximum aantal confrontaties</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Feit</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Feiten</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Bestand id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Groepen</value>
|
<value>Groepen</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Het eerste antwoord opnemen in de preview van de uitnodiging? (maakt het aantrekkelijker om deel te nemen aan de discussie)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Uitnodiging code</value>
|
<value>Uitnodiging code</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Uitnodigingscode of link</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Uitnodiging wachtwoord</value>
|
<value>Uitnodiging wachtwoord</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Wachtwoord nodig voor preview</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Wachtwoord vereist om de preview te tonen</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Wachtwoordbeveiliging toevoegen</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Taal id</value>
|
<value>Taal id</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Naam</value>
|
<value>Naam</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Meldingen inschakelen?(handig om app updates te ontvangen)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nieuw wachtwoord</value>
|
<value>Nieuw wachtwoord</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Oud wachtwoord</value>
|
<value>Oud wachtwoord</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Eenmalig</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Wachtwoord</value>
|
<value>Wachtwoord</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Perceptie</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Percepties</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Voorkeur systeemthema</value>
|
<value>Voorkeur systeemthema</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Herstelcode</value>
|
<value>Herstelcode</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Terugkerend</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Scan voor:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Zoeken op</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Het delen van de geheime code</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Toon donateur badge</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Toon de logs tab ter ondersteuning van troubleshooting.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Neem type</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Eenvoudig</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Gestructureerd</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Thema-afbeelding</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Donkere modus</value>
|
<value>Donkere modus</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Teken</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Titel</value>
|
<value>Titel</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Update reden</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Anoniem indienen</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Gebruikersnaam</value>
|
<value>Gebruikersnaam</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Gebruikersnaam om te zoeken en toe te voegen</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Gebruikersnamen om te zoeken en toe te voegen</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(konieczne w przypadku odzyskiwania hasła)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">password manager</a> sugerowane)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Kwota</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Odpowiedź</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Odpowiedź</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Znak niestandardowy (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Kolor</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Komentarz id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Tekst komentarza</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontacja</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Konfrontacja id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Data końcowa</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Data rozpoczęcia</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Opis</value>
|
<value>Opis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Dyskusja</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Data końcowa</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Czas zakończenia</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Dyskusja id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Tekst do dyskusji</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Tytuł dyskusji</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-mail</value>
|
<value>E-mail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Maksymalna ilość konfrontacji</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fakt</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fakty</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Id pliku</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupy</value>
|
<value>Grupy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Zamieścić pierwszą odpowiedź w podglądzie zaproszenia? (sprawia, że dołączenie do dyskusji jest bardziej zachęcające)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Kod zaproszenia</value>
|
<value>Kod zaproszenia</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Kod lub link do zaproszenia</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Hasło do zaproszenia</value>
|
<value>Hasło do zaproszenia</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Wymagaj hasła do podglądu</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Wymagaj hasła, aby wyświetlić podgląd</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Dodaj ochronę hasłem</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Język id</value>
|
<value>Język id</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nazwa</value>
|
<value>Nazwa</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Włączyć powiadomienia? (przydatne do otrzymywania aktualizacji aplikacji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nowe hasło</value>
|
<value>Nowe hasło</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Stare hasło</value>
|
<value>Stare hasło</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Tylko jeden raz</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Hasło</value>
|
<value>Hasło</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Percepcja</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Spostrzeżenia</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Preferowany motyw systemowy</value>
|
<value>Preferowany motyw systemowy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Kod odzyskiwania</value>
|
<value>Kod odzyskiwania</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Powtarzające się</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Skanuj dla:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Szukaj</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Dzielenie się tajnym kodem</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Pokaż odznakę darczyńcy</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Pokaż kartę logów, aby ułatwić rozwiązywanie problemów.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Rodzaj ujęcia</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Proste</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturalne</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Obrazek tematyczny</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Tryb ciemny</value>
|
<value>Tryb ciemny</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Kleszcze</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Tytuł</value>
|
<value>Tytuł</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Powód aktualizacji</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Zgłoś się anonimowo</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Nazwa użytkownika</value>
|
<value>Nazwa użytkownika</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Nazwa użytkownika do wyszukiwania i dodawania</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Nazwy użytkowników do wyszukiwania i dodawania</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(necessário em caso de recuperação de senha)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">gerenciador de palavras-passe</a> sugerido)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Montante</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Responder id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Responder texto</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Personalidade(emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Cor</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Comentar id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Comentar texto</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Confrontação</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Id de confronto</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Contexto</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Data final</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Data de início</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Descrição</value>
|
<value>Descrição</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Discussão</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Data final</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Tempo final</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Id de discussão</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Texto para discussão</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Título do debate</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Email</value>
|
<value>Email</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Quantidade máxima de confrontos</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Facto</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fatos</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Identificação do arquivo</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupos</value>
|
<value>Grupos</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Incluir a primeira resposta na pré-visualização do convite? (tornando-a mais envolvente para participar da discussão)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Código de convite</value>
|
<value>Código de convite</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Código do convite ou link</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Senha do convite</value>
|
<value>Senha do convite</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Exigir senha para visualização</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Exigir senha para mostrar a visualização</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Adicionar proteção por senha</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Identificação do idioma</value>
|
<value>Identificação do idioma</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nome</value>
|
<value>Nome</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Habilitar notificações?(útil para receber atualizações de aplicativos)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nova senha</value>
|
<value>Nova senha</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Senha antiga</value>
|
<value>Senha antiga</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Só uma vez</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Senha</value>
|
<value>Senha</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Percepção</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Percepções</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Tema do sistema de preferências</value>
|
<value>Tema do sistema de preferências</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Código de recuperação</value>
|
<value>Código de recuperação</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Recurrente</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Procura por:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Pesquisa</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Partilha do Código Secreto</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Mostrar crachá do doador</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Mostrar o separador de registos para suportar a resolução de problemas.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Tirar tipo</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Simples</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Estruturado</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Imagem temática</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Modo escuro</value>
|
<value>Modo escuro</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Carraças</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Título</value>
|
<value>Título</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Motivo da actualização</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Submeter de forma anónima</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Nome de usuário</value>
|
<value>Nome de usuário</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Nome de usuário para pesquisar e adicionar</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Nomes de usuário para pesquisar e adicionar</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(necessary in case of password recovery)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="_blank" href="https://keepassxc.org/">password manager</a> suggested)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Amount</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Answer id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Answer text</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Custom character(emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Colour</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Comment id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Comment text</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Confrontation</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Confrontation id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Context</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>End date</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Start date</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Description</value>
|
<value>Description</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Discussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>End date</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>End time</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Discussion id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Discussion text</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Discussion title</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Email</value>
|
<value>Email</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Max amount of confrontations</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fact</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Facts</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>File id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Groups</value>
|
<value>Groups</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Include the first answer in the invitation preview? (making it more engaging to join the discussion)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Invitation code</value>
|
<value>Invitation code</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Invitation code or link</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Invitation password</value>
|
<value>Invitation password</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Require password for preview</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Require password to show the preview</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Add password protection</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Language id</value>
|
<value>Language id</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Name</value>
|
<value>Name</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Enable notifications?(useful to receive app updates)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>New password</value>
|
<value>New password</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,78 +150,24 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Old password</value>
|
<value>Old password</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>One time only</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Password</value>
|
<value>Password</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Perception</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Perceptions</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Prefer system theme</value>
|
<value>Prefer system theme</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Recovery code</value>
|
<value>Recovery code</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Recurring</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Scan for:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Search</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Sharing Secret Code</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Show donator badge</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Show the logs tab to support troubleshooting.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Take type</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Simple</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Structured</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Theme image</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Dark mode</value>
|
<value>Dark mode</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Ticks</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Title</value>
|
<value>Title</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Update reason</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Submit anonymously</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Username</value>
|
<value>Username</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Username to search and add</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Usernames to search and add</value>
|
|
||||||
</data>
|
|
||||||
<data name="AvatarId" xml:space="preserve">
|
<data name="AvatarId" xml:space="preserve">
|
||||||
<value>Avatar</value>
|
<value>Avatar</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(necesar în cazul recuperării parolei)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">manager de parole</a> sugerat)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Suma</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Răspuns id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Text de răspuns</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Caracter personalizat (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Culoare</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Comentariu id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Comentariu text</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Confruntare</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Id de confruntare</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Context</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Data de încheiere</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Data de începere</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Descriere</value>
|
<value>Descriere</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Discuție</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Data de încheiere</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Ora de sfârșit</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Discuție id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Text de discuție</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Titlul discuției</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Email</value>
|
<value>Email</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Numărul maxim de confruntări</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fapt</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fapte</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>ID fișier</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupuri</value>
|
<value>Grupuri</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Includeți primul răspuns în previzualizarea invitației? (pentru a face mai atractivă participarea la discuție)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Codul de invitație</value>
|
<value>Codul de invitație</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Cod sau link de invitație</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Parola de invitație</value>
|
<value>Parola de invitație</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Necesită o parolă pentru previzualizare</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Necesită o parolă pentru a afișa previzualizarea</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Adăugați protecție prin parolă</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>ID-ul limbii</value>
|
<value>ID-ul limbii</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Nume</value>
|
<value>Nume</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Activați notificările?(util pentru a primi actualizări ale aplicației)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Parolă nouă</value>
|
<value>Parolă nouă</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Parolă veche</value>
|
<value>Parolă veche</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>O singură dată</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Parola</value>
|
<value>Parola</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Percepție</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Percepții</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Preferați tema de sistem</value>
|
<value>Preferați tema de sistem</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Cod de recuperare</value>
|
<value>Cod de recuperare</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Recurent</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Scanează pentru:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Căutare</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Partajarea codului secret</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Arată insigna de donator</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Afișați fila jurnale pentru a sprijini depanarea.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Tipul de luare</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Simplu</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Structurat</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Imagine tematică</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Mod întunecat</value>
|
<value>Mod întunecat</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Căpușe</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Titlu</value>
|
<value>Titlu</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Motivul actualizării</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Trimiteți în mod anonim</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Nume utilizator</value>
|
<value>Nume utilizator</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Nume de utilizator pentru a căuta și adăuga</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Nume de utilizator pentru căutare și adăugare</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(необходимо в случае восстановления пароля)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(Предлагается <a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">password manager</a>)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Сумма</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Идентификатор ответа</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Текст ответа</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Пользовательский символ (эмодзи)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Цвет</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Идентификатор комментария</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Текст комментария</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Противостояние</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Идентификатор противостояния</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Контекст</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Дата окончания</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Дата начала</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Описание</value>
|
<value>Описание</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Обсуждение</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Дата окончания</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Время окончания</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Обсуждаемый иди</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Текст для обсуждения</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Название дискуссии</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>Электронная почта</value>
|
<value>Электронная почта</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Максимальное количество противостояний</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Факт</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Факты</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Идентификатор файла</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Группы</value>
|
<value>Группы</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Включить первый ответ в предварительный просмотр приглашения? (что делает его более привлекательным для участия в обсуждении)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Код приглашения</value>
|
<value>Код приглашения</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Код приглашения или ссылка</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Пароль приглашения</value>
|
<value>Пароль приглашения</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Требуется пароль для предварительного просмотра</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Требуется пароль для показа предварительного просмотра</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Добавить защиту паролем</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Языковой идентификатор</value>
|
<value>Языковой идентификатор</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Имя</value>
|
<value>Имя</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Включить уведомления? (полезно для получения обновлений приложения)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Новый пароль</value>
|
<value>Новый пароль</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Старый пароль</value>
|
<value>Старый пароль</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Только один раз</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Пароль</value>
|
<value>Пароль</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Восприятие</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Восприятие</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Предпочитайте системную тему</value>
|
<value>Предпочитайте системную тему</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Код восстановления</value>
|
<value>Код восстановления</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Повторяющийся</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Сканирование для:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Поиск</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Обмен секретным кодом</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Показать значок жертвователя</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Покажите вкладку журналов для поддержки поиска и устранения неисправностей.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Возьмите тип</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Простой</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Структурированный</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Тематическое изображение</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Темный режим</value>
|
<value>Темный режим</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Клещи</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Название</value>
|
<value>Название</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Причина обновления</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Подавать анонимно</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Имя пользователя</value>
|
<value>Имя пользователя</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Имя пользователя для поиска и добавления</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Имена пользователей для поиска и добавления</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(potrebné v prípade obnovenia hesla)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">správca hesiel</a> navrhnuté)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Suma</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Odpoveď id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Text odpovede</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Vlastný znak (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Farba</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Komentár id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Text komentára</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontácia</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Id konfrontácie</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontext</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Dátum ukončenia</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Dátum začiatku</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Popis</value>
|
<value>Popis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Diskusia</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Dátum ukončenia</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Čas ukončenia</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Diskusia id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Text diskusie</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Názov diskusie</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-mail</value>
|
<value>E-mail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Maximálny počet konfrontácií</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Skutočnosť</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fakty</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Identifikátor súboru</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Skupiny</value>
|
<value>Skupiny</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Zahrnúť prvú odpoveď do náhľadu pozvánky? (aby bolo zapojenie do diskusie pútavejšie)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Pozývací kód</value>
|
<value>Pozývací kód</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Pozývací kód alebo odkaz</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Heslo pozvánky</value>
|
<value>Heslo pozvánky</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Vyžadovať heslo pre náhľad</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Vyžadovať heslo na zobrazenie náhľadu</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Pridanie ochrany heslom</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Identifikátor jazyka</value>
|
<value>Identifikátor jazyka</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Názov</value>
|
<value>Názov</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Povolenie oznámení?(užitočné na prijímanie aktualizácií aplikácie)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nové heslo</value>
|
<value>Nové heslo</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Staré heslo</value>
|
<value>Staré heslo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Iba jedenkrát</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Heslo</value>
|
<value>Heslo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Vnímanie</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Vnímanie</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Uprednostniť tému systému</value>
|
<value>Uprednostniť tému systému</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Kód obnovy</value>
|
<value>Kód obnovy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Opakujúce sa</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Vyhľadávanie:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Vyhľadávanie</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Zdieľanie tajného kódu</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Zobraziť odznak darcu</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Zobrazenie karty protokolov na podporu riešenia problémov.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Vezmite si typ</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Jednoduché</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Štruktúrované</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Obrázok témy</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Tmavý režim</value>
|
<value>Tmavý režim</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Kliešte</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Názov</value>
|
<value>Názov</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Dôvod aktualizácie</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Odoslať anonymne</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Používateľské meno</value>
|
<value>Používateľské meno</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Používateľské meno na vyhľadávanie a pridávanie</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Používateľské mená na vyhľadávanie a pridávanie</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(potrebno v primeru obnovitve gesla)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">predlagani upravitelj gesel</a>)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Znesek</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Odgovor id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Besedilo odgovora</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Znak po meri (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Barva</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Id komentarja</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Besedilo komentarja</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontacija</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Id konfrontacije</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontekst</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Končni datum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Datum začetka</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Opis</value>
|
<value>Opis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Razprava</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Končni datum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Končni čas</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Razprava id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Besedilo za razpravo</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Naslov razprave</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-pošta</value>
|
<value>E-pošta</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Največje število soočenj</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Dejstva</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Dejstva</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Id datoteke</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Skupine</value>
|
<value>Skupine</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Vključiti prvi odgovor v predogled vabila? (da bo vključitev v razpravo bolj privlačna)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Koda vabila</value>
|
<value>Koda vabila</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Koda vabila ali povezava</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Geslo za povabilo</value>
|
<value>Geslo za povabilo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Zahtevajte geslo za predogled</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Zahtevajte geslo za prikaz predogleda</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Dodajanje zaščite z geslom</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Id jezika</value>
|
<value>Id jezika</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Ime</value>
|
<value>Ime</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Omogočite obvestila? (koristno za prejemanje posodobitev aplikacije)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Novo geslo</value>
|
<value>Novo geslo</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Staro geslo</value>
|
<value>Staro geslo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Samo enkrat</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Geslo</value>
|
<value>Geslo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Zaznavanje</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Dojemanje</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Prednost sistemske teme</value>
|
<value>Prednost sistemske teme</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Koda za obnovitev</value>
|
<value>Koda za obnovitev</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Ponavljajoče se</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Iskanje za:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Iskanje</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Deljenje skrivne kode</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Prikaži značko donatorja</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Prikažite zavihek dnevniki za podporo pri odpravljanju težav.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Vrsta posnetka</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Enostavno</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturiran</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Slika teme</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Temni način</value>
|
<value>Temni način</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Klopi</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Naslov</value>
|
<value>Naslov</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Razlog za posodobitev</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Pošlji anonimno</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Uporabniško ime</value>
|
<value>Uporabniško ime</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Uporabniško ime za iskanje in dodajanje</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Uporabniška imena za iskanje in dodajanje</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(nödvändig vid återställning av lösenord)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">password manager</a> föreslås)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>Belopp</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>Svar id</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>Svarstext</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>Anpassat tecken (emoji)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>Färg</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>Kommentar id</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>Kommentar</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>Konfrontation</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>Konfrontation id</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>Kontext</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>Slutdatum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>Startdatum</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>Beskrivning</value>
|
<value>Beskrivning</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>Diskussion</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>Slutdatum</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>Sluttid</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>Diskussion id</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>Diskussionstext</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>Titel på diskussionen</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>E-post</value>
|
<value>E-post</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>Emoji</value>
|
<value>Emoji</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>Max antal konfrontationer</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>Fakta</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>Fakta</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>Filid</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>Grupper</value>
|
<value>Grupper</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>Inkludera det första svaret i förhandsgranskningen av inbjudan? (för att göra det mer lockande att delta i diskussionen)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>Kod för inbjudan</value>
|
<value>Kod för inbjudan</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>Inbjudningskod eller länk</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>Lösenord för inbjudan</value>
|
<value>Lösenord för inbjudan</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>Kräver lösenord för förhandsgranskning</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>Kräver lösenord för att visa förhandsgranskningen</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>Lägg till lösenordsskydd</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>IsStructured</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>Språk-id</value>
|
<value>Språk-id</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>Namn</value>
|
<value>Namn</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>Aktivera meddelanden (användbart för att få uppdateringar av appen)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>Nytt lösenord</value>
|
<value>Nytt lösenord</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>Gammalt lösenord</value>
|
<value>Gammalt lösenord</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>Endast en gång</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>Lösenord</value>
|
<value>Lösenord</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>Uppfattning</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>Uppfattningar</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>Föredrar systemtema</value>
|
<value>Föredrar systemtema</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>Kod för återvinning</value>
|
<value>Kod för återvinning</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>Återkommande</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>Skanna efter:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>Sök på</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>Att dela med sig av den hemliga koden</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>Visa donatormärket</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>Visa fliken Loggar för att underlätta felsökning.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>Typ av tagning</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>Enkelt</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>Strukturerad</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>Tema bild</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>Mörkt läge</value>
|
<value>Mörkt läge</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>Fästingar</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>Titel</value>
|
<value>Titel</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>Orsak till uppdatering</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>Skicka in anonymt</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>Användarnamn</value>
|
<value>Användarnamn</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>Användarnamn för att söka och lägga till</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>Användarnamn att söka och lägga till</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -117,123 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="(necessary in case of password recovery)" xml:space="preserve">
|
|
||||||
<value>(在恢复密码的情况下是必要的)</value>
|
|
||||||
</data>
|
|
||||||
<data name="(password manager suggested)" xml:space="preserve">
|
|
||||||
<value>(<a class="is-underlined has-text-info" tabindex="-1" target="blank" href="https://keepassxc.org/">密码管理器</a>建议)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Amount" xml:space="preserve">
|
|
||||||
<value>数量</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerId" xml:space="preserve">
|
|
||||||
<value>答案是</value>
|
|
||||||
</data>
|
|
||||||
<data name="AnswerText" xml:space="preserve">
|
|
||||||
<value>回答文本</value>
|
|
||||||
</data>
|
|
||||||
<data name="Character" xml:space="preserve">
|
|
||||||
<value>自定义字符(表情符号)</value>
|
|
||||||
</data>
|
|
||||||
<data name="ColourIndex" xml:space="preserve">
|
|
||||||
<value>颜色</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentId" xml:space="preserve">
|
|
||||||
<value>评论编号</value>
|
|
||||||
</data>
|
|
||||||
<data name="CommentText" xml:space="preserve">
|
|
||||||
<value>评论文本</value>
|
|
||||||
</data>
|
|
||||||
<data name="Confrontation" xml:space="preserve">
|
|
||||||
<value>对抗</value>
|
|
||||||
</data>
|
|
||||||
<data name="ConfrontationId" xml:space="preserve">
|
|
||||||
<value>对抗的身份</value>
|
|
||||||
</data>
|
|
||||||
<data name="Context" xml:space="preserve">
|
|
||||||
<value>背景介绍</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateEnd" xml:space="preserve">
|
|
||||||
<value>结束日期</value>
|
|
||||||
</data>
|
|
||||||
<data name="DateStart" xml:space="preserve">
|
|
||||||
<value>开始日期</value>
|
|
||||||
</data>
|
|
||||||
<data name="Description" xml:space="preserve">
|
<data name="Description" xml:space="preserve">
|
||||||
<value>描述</value>
|
<value>描述</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discussion" xml:space="preserve">
|
|
||||||
<value>讨论</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndDate" xml:space="preserve">
|
|
||||||
<value>结束日期</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionEndTime" xml:space="preserve">
|
|
||||||
<value>结束时间</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionId" xml:space="preserve">
|
|
||||||
<value>讨论的内容</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionText" xml:space="preserve">
|
|
||||||
<value>讨论文本</value>
|
|
||||||
</data>
|
|
||||||
<data name="DiscussionTitle" xml:space="preserve">
|
|
||||||
<value>讨论题目</value>
|
|
||||||
</data>
|
|
||||||
<data name="Email" xml:space="preserve">
|
<data name="Email" xml:space="preserve">
|
||||||
<value>电子邮件</value>
|
<value>电子邮件</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Emoji" xml:space="preserve">
|
<data name="Emoji" xml:space="preserve">
|
||||||
<value>表情符号</value>
|
<value>表情符号</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExpectedMaxConfrontationsBeforeClosingAndShowing" xml:space="preserve">
|
|
||||||
<value>对抗的最大数量</value>
|
|
||||||
</data>
|
|
||||||
<data name="Fact" xml:space="preserve">
|
|
||||||
<value>事实</value>
|
|
||||||
</data>
|
|
||||||
<data name="Facts" xml:space="preserve">
|
|
||||||
<value>事实</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileId" xml:space="preserve">
|
|
||||||
<value>文件编号</value>
|
|
||||||
</data>
|
|
||||||
<data name="Groups" xml:space="preserve">
|
<data name="Groups" xml:space="preserve">
|
||||||
<value>群体</value>
|
<value>群体</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IncludeFirstAnswerInInvitation" xml:space="preserve">
|
|
||||||
<value>在邀请预览中包括第一个答案?(使其更加吸引人加入讨论)</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationCode" xml:space="preserve">
|
<data name="InvitationCode" xml:space="preserve">
|
||||||
<value>邀请函代码</value>
|
<value>邀请函代码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="InvitationCodeLink" xml:space="preserve">
|
|
||||||
<value>邀请函代码或链接</value>
|
|
||||||
</data>
|
|
||||||
<data name="InvitationPassword" xml:space="preserve">
|
<data name="InvitationPassword" xml:space="preserve">
|
||||||
<value>邀请函密码</value>
|
<value>邀请函密码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="IsPasswordProtectedForPreview" xml:space="preserve">
|
|
||||||
<value>预览时需要密码</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedForPreviewText" xml:space="preserve">
|
|
||||||
<value>需要密码才能显示预览</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsPasswordProtectedText" xml:space="preserve">
|
|
||||||
<value>添加密码保护</value>
|
|
||||||
</data>
|
|
||||||
<data name="IsStructured" xml:space="preserve">
|
|
||||||
<value>是结构化的</value>
|
|
||||||
</data>
|
|
||||||
<data name="LanguageId" xml:space="preserve">
|
<data name="LanguageId" xml:space="preserve">
|
||||||
<value>语言标识</value>
|
<value>语言标识</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Name" xml:space="preserve">
|
<data name="Name" xml:space="preserve">
|
||||||
<value>命名</value>
|
<value>命名</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NativeNotificationsEnabled" xml:space="preserve">
|
|
||||||
<value>启用通知?(对接收应用程序的更新很有用)</value>
|
|
||||||
</data>
|
|
||||||
<data name="NewPassword" xml:space="preserve">
|
<data name="NewPassword" xml:space="preserve">
|
||||||
<value>新密码</value>
|
<value>新密码</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -243,76 +150,22 @@
|
|||||||
<data name="OldPassword" xml:space="preserve">
|
<data name="OldPassword" xml:space="preserve">
|
||||||
<value>旧密码</value>
|
<value>旧密码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneTime" xml:space="preserve">
|
|
||||||
<value>仅限一次</value>
|
|
||||||
</data>
|
|
||||||
<data name="Password" xml:space="preserve">
|
<data name="Password" xml:space="preserve">
|
||||||
<value>密码</value>
|
<value>密码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Perception" xml:space="preserve">
|
|
||||||
<value>感知</value>
|
|
||||||
</data>
|
|
||||||
<data name="Perceptions" xml:space="preserve">
|
|
||||||
<value>观念</value>
|
|
||||||
</data>
|
|
||||||
<data name="PreferSystemTheming" xml:space="preserve">
|
<data name="PreferSystemTheming" xml:space="preserve">
|
||||||
<value>倾向于系统主题</value>
|
<value>倾向于系统主题</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RecoveryCode" xml:space="preserve">
|
<data name="RecoveryCode" xml:space="preserve">
|
||||||
<value>恢复代码</value>
|
<value>恢复代码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Recurring" xml:space="preserve">
|
|
||||||
<value>经常性的</value>
|
|
||||||
</data>
|
|
||||||
<data name="Scan for:" xml:space="preserve">
|
|
||||||
<value>进行扫描:</value>
|
|
||||||
</data>
|
|
||||||
<data name="SearchText" xml:space="preserve">
|
|
||||||
<value>搜索</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShareCode" xml:space="preserve">
|
|
||||||
<value>分享秘密代码</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowDonatorBadge" xml:space="preserve">
|
|
||||||
<value>显示捐赠者徽章</value>
|
|
||||||
</data>
|
|
||||||
<data name="ShowLogs" xml:space="preserve">
|
|
||||||
<value>显示日志标签以支持故障排除。</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeType" xml:space="preserve">
|
|
||||||
<value>采取类型</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeSimple" xml:space="preserve">
|
|
||||||
<value>简单</value>
|
|
||||||
</data>
|
|
||||||
<data name="TakeTypeStructured" xml:space="preserve">
|
|
||||||
<value>结构化</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme image" xml:space="preserve">
|
|
||||||
<value>主题图片</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemeIsDarkMode" xml:space="preserve">
|
<data name="ThemeIsDarkMode" xml:space="preserve">
|
||||||
<value>黑暗模式</value>
|
<value>黑暗模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ticks" xml:space="preserve">
|
|
||||||
<value>蜱虫</value>
|
|
||||||
</data>
|
|
||||||
<data name="Title" xml:space="preserve">
|
<data name="Title" xml:space="preserve">
|
||||||
<value>标题</value>
|
<value>标题</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateReason" xml:space="preserve">
|
|
||||||
<value>更新原因</value>
|
|
||||||
</data>
|
|
||||||
<data name="UpsertUserTakeIsAnonymous" xml:space="preserve">
|
|
||||||
<value>匿名提交</value>
|
|
||||||
</data>
|
|
||||||
<data name="Username" xml:space="preserve">
|
<data name="Username" xml:space="preserve">
|
||||||
<value>帐号</value>
|
<value>帐号</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Username to search and add" xml:space="preserve">
|
|
||||||
<value>搜索和添加的用户名</value>
|
|
||||||
</data>
|
|
||||||
<data name="Usernames to search and add" xml:space="preserve">
|
|
||||||
<value>搜索和添加的用户名</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using PrivaPub.ClientModels.Resources;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace PrivaPub.ClientModels
|
||||||
|
{
|
||||||
|
// The server's first login, made while it has no administrator (/clientapi/user/setup), with its first persona.
|
||||||
|
public class SetupForm : LoginForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(32, MinimumLength = 3, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
RegularExpression(Constants.UserNameRegex, ErrorMessageResourceName = "InvalidUserName", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string AvatarUserName { get; set; }
|
||||||
|
|
||||||
|
[StringLength(64, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||||
|
public string AvatarName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
using PrivaPub.ClientModels.Resources;
|
||||||
|
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace PrivaPub.ClientModels.User
|
||||||
|
{
|
||||||
|
// The login's email address, set only with its password and only once a code sent to it comes back
|
||||||
|
// (/clientapi/user/email, /email/verify).
|
||||||
|
public class EmailChangeForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
EmailAddress(ErrorMessageResourceName = "InvalidEmail", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(254, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Email", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
DataType(DataType.Password),
|
||||||
|
PasswordPropertyText(true),
|
||||||
|
StringLength(Constants.MaxPasswordLength, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Password", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EmailCodeForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(16, MinimumLength = 6, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "RecoveryCode", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Code { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// what only the login's password may do (removing its email address)
|
||||||
|
public class PasswordForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
DataType(DataType.Password),
|
||||||
|
PasswordPropertyText(true),
|
||||||
|
StringLength(Constants.MaxPasswordLength, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Password", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewAccount
|
||||||
|
{
|
||||||
|
public string UserName { get; set; }
|
||||||
|
public string Email { get; set; }
|
||||||
|
public bool IsEmailValidated { get; set; } = false;
|
||||||
|
public string PendingEmail { get; set; }//waiting for its code
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
public bool TwoFactorEnabled { get; set; } = false;
|
||||||
|
public int RecoveryCodesLeft { get; set; } = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// a code from the authenticator app (six digits) or a recovery code
|
||||||
|
public class TotpCodeForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(32, MinimumLength = 6, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "RecoveryCode", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Code { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TotpDisableForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
DataType(DataType.Password),
|
||||||
|
PasswordPropertyText(true),
|
||||||
|
StringLength(Constants.MaxPasswordLength, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Password", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
StringLength(32, MinimumLength = 6, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "RecoveryCode", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Code { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// what an authenticator app needs: the secret, as text and as the otpauth:// URI its QR code holds
|
||||||
|
public class ViewTotpSetup
|
||||||
|
{
|
||||||
|
public string Secret { get; set; }
|
||||||
|
public string OtpAuthUri { get; set; }
|
||||||
|
public string QrDataUri { get; set; }//an SVG image, as a data: URI
|
||||||
|
}
|
||||||
|
|
||||||
|
// shown once: the recovery codes, and this device's new session (turning two-factor on ends every other one)
|
||||||
|
public class ViewTotpEnabled
|
||||||
|
{
|
||||||
|
public List<string> RecoveryCodes { get; set; } = [];
|
||||||
|
public JwtUser Session { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using PrivaPub.ClientModels.Resources;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace PrivaPub.ClientModels.User
|
||||||
|
{
|
||||||
|
// Deleting one's own login, and with it every persona and group it owns, asks for the password again.
|
||||||
|
public class RemoveSelfForm
|
||||||
|
{
|
||||||
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||||
|
Display(Name = "Password", ResourceType = typeof(FieldsNameResource))]
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,6 @@
|
|||||||
{
|
{
|
||||||
public class UsersIds
|
public class UsersIds
|
||||||
{
|
{
|
||||||
public IList<string> UserIdList { get; set; } = Array.Empty<string>();
|
public List<string> UserIdList { get; set; } = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
namespace PrivaPub.ClientModels.User
|
||||||
|
{
|
||||||
|
// A persona's archive (owner decision 2026-10-07): made for it to take away, in Mastodon's account-archive layout, and
|
||||||
|
// restored into it. States: none, queued, running, ready (export) or done (import), failed, stopped.
|
||||||
|
public class ViewPersonaArchive
|
||||||
|
{
|
||||||
|
public string ExportState { get; set; }
|
||||||
|
public DateTime? ExportAskedAt { get; set; }
|
||||||
|
public DateTime? ExportReadyAt { get; set; }
|
||||||
|
public DateTime? ExportExpiresAt { get; set; }
|
||||||
|
public long ExportBytes { get; set; }
|
||||||
|
public string ExportError { get; set; }
|
||||||
|
|
||||||
|
public string ImportState { get; set; }
|
||||||
|
public DateTime? ImportAskedAt { get; set; }
|
||||||
|
public DateTime? ImportEndedAt { get; set; }
|
||||||
|
public List<string> ImportParts { get; set; } = [];
|
||||||
|
public long ImportDone { get; set; }
|
||||||
|
public long ImportTotal { get; set; }
|
||||||
|
public Dictionary<string, int> ImportCounts { get; set; } = [];//what was imported and what skipped, by why
|
||||||
|
public string ImportError { get; set; }
|
||||||
|
public string ImportFrom { get; set; }//the archive's actor
|
||||||
|
public bool ImportSameActor { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// the parts of an archive to import: posts (with their media), profile, follows, blocks, mutes, domainblocks, lists,
|
||||||
|
// bookmarks, filters, tags, notificationpolicy, pins; and only when asked, located, scheduled, likes (which tell their
|
||||||
|
// authors)
|
||||||
|
public class ImportPersonaArchiveForm
|
||||||
|
{
|
||||||
|
public string UploadId { get; set; }
|
||||||
|
public List<string> Parts { get; set; } = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewArchiveTicket
|
||||||
|
{
|
||||||
|
public string Url { get; set; }
|
||||||
|
public DateTime ExpiresAt { get; set; }
|
||||||
|
public long Bytes { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewArchiveUpload
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public long Received { get; set; }
|
||||||
|
public long ChunkBytes { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace PrivaPub.ClientModels.User
|
||||||
|
{
|
||||||
|
public class ViewServerSetup
|
||||||
|
{
|
||||||
|
// no administrator yet: the first login made through /clientapi/user/setup becomes it
|
||||||
|
public bool IsPending { get; set; } = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace PrivaPub.ClientModels.User
|
||||||
|
{
|
||||||
|
// /clientapi/user/storage: what the login's media take (every persona's uploads and pictures), and its quota when the
|
||||||
|
// server sets one
|
||||||
|
public class ViewStorage
|
||||||
|
{
|
||||||
|
public long MediaBytes { get; set; }
|
||||||
|
public long MediaFiles { get; set; }
|
||||||
|
public long? QuotaBytes { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,5 +21,8 @@ namespace PrivaPub.ClientModels.User
|
|||||||
public bool ThemeIsDarkMode { get; set; } = false;
|
public bool ThemeIsDarkMode { get; set; } = false;
|
||||||
public bool ThemeIsLightGray { get; set; } = false;
|
public bool ThemeIsLightGray { get; set; } = false;
|
||||||
public bool ThemeIsDarkGray { get; set; } = false;
|
public bool ThemeIsDarkGray { get; set; } = false;
|
||||||
|
|
||||||
|
// when a client last saved these; null until one did, so a client signing in keeps its own until then
|
||||||
|
public DateTime? SavedAt { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
|
|
||||||
using PrivaPub.Api.Mastodon.Auth;
|
|
||||||
using PrivaPub.Api.Mastodon.Infrastructure;
|
|
||||||
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Api
|
|
||||||
{
|
|
||||||
public class MastodonParamsTests
|
|
||||||
{
|
|
||||||
static async Task<MastodonParams> Read(string query = "", string contentType = default, string body = default)
|
|
||||||
{
|
|
||||||
var context = new DefaultHttpContext();
|
|
||||||
context.Request.QueryString = new QueryString(query);
|
|
||||||
if (body != default)
|
|
||||||
{
|
|
||||||
context.Request.ContentType = contentType;
|
|
||||||
var bytes = Encoding.UTF8.GetBytes(body);
|
|
||||||
context.Request.Body = new MemoryStream(bytes);
|
|
||||||
context.Request.ContentLength = bytes.Length;
|
|
||||||
}
|
|
||||||
return await MastodonParams.Read(context.Request, TestContext.Current.CancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Absent_values_are_null_not_false_or_zero()
|
|
||||||
{
|
|
||||||
var parameters = await Read();
|
|
||||||
|
|
||||||
Assert.Null(parameters.Bool("sensitive"));
|
|
||||||
Assert.Null(parameters.Int("limit"));
|
|
||||||
Assert.Null(parameters.Get("status"));
|
|
||||||
Assert.Empty(parameters.List("media_ids"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Reads_rails_style_arrays_from_the_query()
|
|
||||||
{
|
|
||||||
var parameters = await Read("?id[]=1&id[]=2&limit=5&local=true");
|
|
||||||
|
|
||||||
Assert.Equal(new[] { "1", "2" }, parameters.List("id"));
|
|
||||||
Assert.Equal(5, parameters.Int("limit"));
|
|
||||||
Assert.True(parameters.Bool("local"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Reads_forms_and_nested_keys()
|
|
||||||
{
|
|
||||||
var parameters = await Read(contentType: "application/x-www-form-urlencoded",
|
|
||||||
body: "status=hi&media_ids[]=a&media_ids[]=b&poll[options][]=x&poll[options][]=y&sensitive=0");
|
|
||||||
|
|
||||||
Assert.Equal("hi", parameters.Get("status"));
|
|
||||||
Assert.Equal(new[] { "a", "b" }, parameters.List("media_ids"));
|
|
||||||
Assert.Equal(new[] { "x", "y" }, parameters.List("poll[options]"));
|
|
||||||
Assert.False(parameters.Bool("sensitive"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Reads_json_bodies_the_same_way()
|
|
||||||
{
|
|
||||||
var parameters = await Read(contentType: "application/json",
|
|
||||||
body: """{"status":"hi","media_ids":["a","b"],"poll":{"options":["x","y"],"expires_in":300},"sensitive":true,"source":{"privacy":"unlisted"}}""");
|
|
||||||
|
|
||||||
Assert.Equal(new[] { "a", "b" }, parameters.List("media_ids"));
|
|
||||||
Assert.Equal(new[] { "x", "y" }, parameters.List("poll[options]"));
|
|
||||||
Assert.Equal(300, parameters.Int("poll[expires_in]"));
|
|
||||||
Assert.True(parameters.Bool("sensitive"));
|
|
||||||
Assert.Equal("unlisted", parameters.Get("source[privacy]"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(new[] { "read" }, "read:statuses", true)]
|
|
||||||
[InlineData(new[] { "read:statuses" }, "read:statuses", true)]
|
|
||||||
[InlineData(new[] { "read:accounts" }, "read:statuses", false)]
|
|
||||||
[InlineData(new[] { "write" }, "read:statuses", false)]
|
|
||||||
[InlineData(new[] { "follow" }, "write:follows", true)]
|
|
||||||
[InlineData(new[] { "follow" }, "write:statuses", false)]
|
|
||||||
public void Scopes_grant_like_mastodons(string[] granted, string required, bool expected) =>
|
|
||||||
Assert.Equal(expected, MastodonScopes.Grants(granted, required));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
|
|
||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Api.Mastodon.Infrastructure;
|
|
||||||
using PrivaPub.Api.Mastodon.Mappers;
|
|
||||||
using PrivaPub.ClientModels.Post;
|
|
||||||
using PrivaPub.ClientModels.Social;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Api
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class PersonaSeparationTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Nothing_shown_to_one_persona_names_its_sibling()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var (_, sibling) = await _harness.Persona("sibling", root);
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
await _harness.Follows.Follow(root, new FollowForm { AvatarId = alice.Id, Target = bob.UserName }, token);
|
|
||||||
await _harness.Follows.Follow(root, new FollowForm { AvatarId = sibling.Id, Target = bob.UserName }, token);
|
|
||||||
await _harness.Posts.InsertPost(root, new InsertPostForm { AvatarId = sibling.Id, Text = "from the sibling" }, token);
|
|
||||||
await _harness.Posts.InsertPost(root, new InsertPostForm { AvatarId = alice.Id, Text = "from alice" }, token);
|
|
||||||
await _harness.Posts.InsertPost(bobRoot, new InsertPostForm { AvatarId = bob.Id, Text = "hi both" }, token);
|
|
||||||
|
|
||||||
var mapper = new MastodonMapper(_harness.Db, _harness.Local);
|
|
||||||
var account = await mapper.Local(alice, withSource: true, token);
|
|
||||||
var homeIds = (await _harness.Db.TimelineEntries.Match(e => e.AvatarId == alice.Id).ExecuteAsync(token)).Select(e => e.PostId).ToList();
|
|
||||||
var home = await _harness.Db.Posts.Match(p => homeIds.Contains(p.ID)).ExecuteAsync(token);
|
|
||||||
var statuses = await mapper.Statuses(home, alice.Id, token);
|
|
||||||
var bobAsSeenByAlice = await mapper.Account(bob.Id, token);
|
|
||||||
|
|
||||||
var json = JsonSerializer.Serialize(new object[] { account, statuses, bobAsSeenByAlice }, MastodonJson.Options);
|
|
||||||
Assert.DoesNotContain(sibling.Id, json);
|
|
||||||
Assert.DoesNotContain(sibling.UserName, json);
|
|
||||||
Assert.DoesNotContain(root, json);
|
|
||||||
Assert.Contains("hi both", json);
|
|
||||||
Assert.Equal(2, bobAsSeenByAlice.FollowersCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using PrivaPub.Api.Mastodon.Mappers;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Api
|
|
||||||
{
|
|
||||||
public class StatusContentTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public void A_remote_article_shows_its_title_above_its_body() =>
|
|
||||||
Assert.Equal("<p><strong>Rain & sun</strong></p><p>body</p>", MastodonMapper.Content(new Post
|
|
||||||
{
|
|
||||||
IsFederatedCopy = true, ObjectType = "Article", Title = "Rain & sun", ContentHtml = "<p>body</p>"
|
|
||||||
}));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_remote_note_keeps_its_content_alone() =>
|
|
||||||
Assert.Equal("<p>body</p>", MastodonMapper.Content(new Post
|
|
||||||
{
|
|
||||||
IsFederatedCopy = true, ObjectType = "Note", Title = "a poll choice", ContentHtml = "<p>body</p>"
|
|
||||||
}));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_remote_event_without_a_body_shows_its_excerpt() =>
|
|
||||||
Assert.Equal("<p><strong>Meetup</strong></p><p>Saturday <10:00></p>", MastodonMapper.Content(new Post
|
|
||||||
{
|
|
||||||
IsFederatedCopy = true, ObjectType = "Event", Title = "Meetup", Excerpt = "Saturday <10:00>", ContentHtml = string.Empty
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
using PrivaPub.Domain.Content;
|
|
||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Infrastructure.Http;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.User;
|
|
||||||
|
|
||||||
using GroupEntity = PrivaPub.Models.Group.Group;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
public class ContentRendererTests
|
|
||||||
{
|
|
||||||
const string Base = "https://privapub.test";
|
|
||||||
readonly ContentRenderer _renderer = new(new StubLocalActors(), new StubRemoteActors());
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Decorates_local_and_remote_mentions_and_hashtags()
|
|
||||||
{
|
|
||||||
var rendered = await _renderer.Markdown("hello @alice and @bob@m.example about #Fedi **now** <script>x</script>", TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.Contains("<span class=\"h-card\" translate=\"no\"><a href=\"https://privapub.test/peasants/alice\" class=\"u-url mention\"", rendered.Html);
|
|
||||||
Assert.Contains("href=\"https://m.example/@bob\"", rendered.Html);
|
|
||||||
Assert.Contains("href=\"https://privapub.test/tags/fedi\" class=\"mention hashtag\"", rendered.Html);
|
|
||||||
Assert.Contains("<strong>now</strong>", rendered.Html);
|
|
||||||
Assert.DoesNotContain("<script>", rendered.Html);
|
|
||||||
Assert.Equal(new[] { "https://m.example/users/bob", "https://privapub.test/peasants/alice" }, rendered.Mentions.Select(m => m.ActorUri).Order(StringComparer.Ordinal));
|
|
||||||
Assert.Equal("fedi", Assert.Single(rendered.Tags));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("`@alice` in code")]
|
|
||||||
[InlineData("mail me@alice.example")]
|
|
||||||
[InlineData("@nobody is unknown")]
|
|
||||||
[InlineData("see https://x.example/page#alice")]
|
|
||||||
public async Task Leaves_what_is_not_a_mention_alone(string text)
|
|
||||||
{
|
|
||||||
var rendered = await _renderer.Markdown(text, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.Empty(rendered.Mentions);
|
|
||||||
Assert.DoesNotContain("h-card", rendered.Html);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("issue #123")]
|
|
||||||
[InlineData("it's fine")]
|
|
||||||
[InlineData("[link](https://x.example/#tag)")]
|
|
||||||
public async Task Leaves_what_is_not_a_hashtag_alone(string text) =>
|
|
||||||
Assert.Empty((await _renderer.Markdown(text, TestContext.Current.CancellationToken)).Tags);
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Renders_plain_text_like_mastodon()
|
|
||||||
{
|
|
||||||
var rendered = await _renderer.PlainText("line one\nline <two>\n\nsee https://x.example/a?b=1. #Tag", TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.Equal("<p>line one<br>line <two></p><p>see <a href=\"https://x.example/a?b=1\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https://x.example/a?b=1</a>. "
|
|
||||||
+ "<a href=\"https://privapub.test/tags/tag\" class=\"mention hashtag\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">#<span>Tag</span></a></p>", rendered.Html);
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class StubLocalActors : ILocalActorService
|
|
||||||
{
|
|
||||||
public string BaseAddress => Base;
|
|
||||||
|
|
||||||
public Task<LocalActor> FindByUserName(string userName, CancellationToken token) =>
|
|
||||||
Task.FromResult(userName.Equals("alice", StringComparison.OrdinalIgnoreCase)
|
|
||||||
? new LocalActor { Id = "a1", UserName = "alice", BaseAddress = Base, Kind = LocalActorKind.Person }
|
|
||||||
: default);
|
|
||||||
|
|
||||||
public Task<LocalActor> FindById(LocalActorKind kind, string id, CancellationToken token) => throw new NotSupportedException();
|
|
||||||
public Task<LocalActor> FindByUri(string actorUri, CancellationToken token) => throw new NotSupportedException();
|
|
||||||
public Task<LocalActor> GetInstanceActor(CancellationToken token) => throw new NotSupportedException();
|
|
||||||
public Task<bool> IsUserNameTaken(string userName, CancellationToken token) => throw new NotSupportedException();
|
|
||||||
public Task<bool> TryReserveUserName(string userName, LocalActorKind kind, string ownerId, CancellationToken token) => throw new NotSupportedException();
|
|
||||||
public LocalActor FromAvatar(Avatar avatar) => throw new NotSupportedException();
|
|
||||||
public LocalActor FromGroup(GroupEntity group) => throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class StubRemoteActors : IRemoteActorService
|
|
||||||
{
|
|
||||||
public Task<string> ResolveHandle(string handle, CancellationToken token) =>
|
|
||||||
Task.FromResult(handle == "bob@m.example" ? "https://m.example/users/bob" : default);
|
|
||||||
|
|
||||||
public Task<ForeignAvatar> GetActor(string actorUri, bool refresh, CancellationToken token) =>
|
|
||||||
Task.FromResult(actorUri == "https://m.example/users/bob"
|
|
||||||
? new ForeignAvatar { ID = "f1", ActorURI = actorUri, UserName = "bob", Url = "https://m.example/@bob", InboxURL = actorUri + "/inbox" }
|
|
||||||
: default);
|
|
||||||
|
|
||||||
public Task<FetchedJson> FetchObject(string uri, CancellationToken token) => throw new NotSupportedException();
|
|
||||||
public Task<ForeignAvatar> GetActorByKeyId(string keyId, bool refresh, CancellationToken token) => throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Social;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.Social;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class FollowTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_local_follow_is_accepted_at_once_and_notified()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var (_, bob) = await _harness.Persona("bob");
|
|
||||||
|
|
||||||
var result = await _harness.Follows.Follow(root, new FollowForm { AvatarId = alice.Id, Target = "@" + bob.UserName }, token);
|
|
||||||
|
|
||||||
Assert.True(result.IsValid);
|
|
||||||
var following = await DB.Default.Find<Following>().Match(f => f.AvatarId == alice.Id).ExecuteSingleAsync(token);
|
|
||||||
Assert.Equal(FollowState.Accepted, following.State);
|
|
||||||
Assert.True(following.TargetIsLocal);
|
|
||||||
Assert.True((await DB.Default.Find<Follower>().Match(f => f.LocalActorId == bob.Id && f.ActorURI == alice.Uri).ExecuteSingleAsync(token)).IsAccepted);
|
|
||||||
Assert.Equal(NotificationType.Follow, (await DB.Default.Find<Notification>().Match(n => n.AvatarId == bob.Id).ExecuteSingleAsync(token)).Type);
|
|
||||||
Assert.Empty(await _harness.Outgoing(bob.Inbox));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Someone_elses_persona_cannot_be_made_to_follow()
|
|
||||||
{
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var (_, bob) = await _harness.Persona("bob");
|
|
||||||
|
|
||||||
var result = await _harness.Follows.Follow("someone-else", new FollowForm { AvatarId = alice.Id, Target = bob.UserName }, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.False(result.IsValid);
|
|
||||||
Assert.Equal(404, result.StatusCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_remote_follow_is_requested_then_accepted()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
|
|
||||||
await _harness.Follows.Follow(root, new FollowForm { AvatarId = alice.Id, Target = carol.Id }, token);
|
|
||||||
|
|
||||||
var following = await DB.Default.Find<Following>().Match(f => f.AvatarId == alice.Id).ExecuteSingleAsync(token);
|
|
||||||
Assert.Equal(FollowState.Requested, following.State);
|
|
||||||
var follow = Assert.Single(await _harness.Outgoing(carol.Id + "/inbox"));
|
|
||||||
Assert.Equal("Follow", follow["type"]!.GetValue<string>());
|
|
||||||
Assert.Equal(alice.Uri, follow["actor"]!.GetValue<string>());
|
|
||||||
Assert.StartsWith(alice.Uri + "/grunts/follow-", follow["id"]!.GetValue<string>());
|
|
||||||
|
|
||||||
var accept = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{carol.Id}#accepts/{Guid.NewGuid():N}",
|
|
||||||
["type"] = "Accept",
|
|
||||||
["actor"] = carol.Id,
|
|
||||||
["object"] = follow.DeepClone()
|
|
||||||
};
|
|
||||||
Assert.Equal(202, (await _harness.Deliver(carol, $"/peasants/{alice.UserName}/mouth", accept)).StatusCode);
|
|
||||||
Assert.Equal(FollowState.Accepted, (await DB.Default.Find<Following>().OneAsync(following.ID, token)).State);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task An_accept_from_someone_else_changes_nothing_and_a_reject_ends_the_request()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
await _harness.Follows.Follow(root, new FollowForm { AvatarId = alice.Id, Target = carol.Id }, token);
|
|
||||||
var following = await DB.Default.Find<Following>().Match(f => f.AvatarId == alice.Id).ExecuteSingleAsync(token);
|
|
||||||
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{mallory.Id}#accepts/{Guid.NewGuid():N}", ["type"] = "Accept", ["actor"] = mallory.Id, ["object"] = following.FollowActivityURI
|
|
||||||
});
|
|
||||||
Assert.Equal(FollowState.Requested, (await DB.Default.Find<Following>().OneAsync(following.ID, token)).State);
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{carol.Id}#rejects/{Guid.NewGuid():N}", ["type"] = "Reject", ["actor"] = carol.Id, ["object"] = following.FollowActivityURI
|
|
||||||
});
|
|
||||||
Assert.Null(await DB.Default.Find<Following>().OneAsync(following.ID, token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Unfollowing_a_remote_account_sends_an_undo()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
await _harness.Follows.Follow(root, new FollowForm { AvatarId = alice.Id, Target = carol.Id }, token);
|
|
||||||
|
|
||||||
await _harness.Follows.Unfollow(root, new FollowForm { AvatarId = alice.Id, Target = carol.Id }, token);
|
|
||||||
|
|
||||||
Assert.False(await DB.Default.Find<Following>().Match(f => f.AvatarId == alice.Id).ExecuteAnyAsync(token));
|
|
||||||
var undo = (await _harness.Outgoing(carol.Id + "/inbox")).Single(a => a["type"]!.GetValue<string>() == "Undo");
|
|
||||||
Assert.Equal("Follow", undo["object"]!["type"]!.GetValue<string>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
|
|
||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using NetVips;
|
|
||||||
|
|
||||||
using PrivaPub.Domain.Media;
|
|
||||||
using PrivaPub.Domain.Statuses;
|
|
||||||
using PrivaPub.Federation.Rendering;
|
|
||||||
using PrivaPub.Models.Media;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class MediaFlowTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
static byte[] Png(int width, int height)
|
|
||||||
{
|
|
||||||
using var image = (Image.Black(width, height, bands: 3) + new double[] { 10, 120, 200 }).Cast(Enums.BandFormat.Uchar);
|
|
||||||
return image.WriteToBuffer(".png");
|
|
||||||
}
|
|
||||||
|
|
||||||
static IFormFile Upload(byte[] bytes, string contentType) =>
|
|
||||||
new FormFile(new MemoryStream(bytes), 0, bytes.Length, "file", "picture") { Headers = new HeaderDictionary(), ContentType = contentType };
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task An_upload_is_attached_once_and_federated_with_its_alt_text()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var (_, mallory) = await _harness.Persona("mallory");
|
|
||||||
|
|
||||||
var upload = await _harness.Media.Upload(alice, Upload(Png(300, 200), "image/png"), "a blue square", "0.25,-0.5", token);
|
|
||||||
Assert.True(upload.Ok);
|
|
||||||
Assert.True(File.Exists(Path.Combine(_harness.Media.Root, upload.Attachment.FilePath)));
|
|
||||||
|
|
||||||
var stolen = await _harness.Statuses.Publish(mallory, new StatusDraft { Text = "mine", MediaIds = new[] { upload.Attachment.ID } }, token);
|
|
||||||
Assert.False(stolen.Ok);
|
|
||||||
|
|
||||||
var posted = await _harness.Statuses.Publish(alice, new StatusDraft { Text = "look", MediaIds = new[] { upload.Attachment.ID } }, token);
|
|
||||||
Assert.True(posted.Ok);
|
|
||||||
Assert.Equal(posted.Post.ID, (await DB.Default.Find<MediaAttachment>().OneAsync(upload.Attachment.ID, token)).PostId);
|
|
||||||
|
|
||||||
var note = ActivityPubRenderer.Note(posted.Post, alice, default, default);
|
|
||||||
var attachment = note["attachment"]![0]!;
|
|
||||||
Assert.Equal("a blue square", attachment["name"]!.GetValue<string>());
|
|
||||||
Assert.Equal(300, attachment["width"]!.GetValue<int>());
|
|
||||||
Assert.Equal(-0.5f, attachment["focalPoint"]![1]!.GetValue<float>());
|
|
||||||
Assert.StartsWith("https://privapub.test/media/files/", attachment["url"]!.GetValue<string>());
|
|
||||||
|
|
||||||
var reused = await _harness.Statuses.Publish(alice, new StatusDraft { Text = "again", MediaIds = new[] { upload.Attachment.ID } }, token);
|
|
||||||
Assert.False(reused.Ok);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Unsupported_files_are_refused()
|
|
||||||
{
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
|
|
||||||
var outcome = await _harness.Media.Upload(alice, Upload(System.Text.Encoding.UTF8.GetBytes("<svg/>"), "image/svg+xml"), default, default, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.False(outcome.Ok);
|
|
||||||
Assert.Equal(422, outcome.Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task The_proxy_serves_signed_remote_media_and_nothing_else()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var path = $"/files/{Guid.NewGuid():N}.png";
|
|
||||||
_harness.Peer.ServeFile(path, Png(10, 10), "image/png");
|
|
||||||
var proxy = new MediaProxy(_harness.Local, Peer.Http(), _harness.Media, new StaticOptions<MediaOptions>(new MediaOptions()));
|
|
||||||
|
|
||||||
var wrapped = proxy.Wrap(_harness.Peer.A + path);
|
|
||||||
var parts = new Uri(wrapped).AbsolutePath.Split('/');
|
|
||||||
var (file, contentType) = await proxy.Fetch(parts[3], parts[4], token);
|
|
||||||
var (tampered, _) = await proxy.Fetch(parts[3].Replace(parts[3][0], parts[3][0] == 'A' ? 'B' : 'A'), parts[4], token);
|
|
||||||
|
|
||||||
Assert.StartsWith("https://privapub.test/media/proxy/", wrapped);
|
|
||||||
Assert.Equal("image/png", contentType);
|
|
||||||
Assert.True(File.Exists(file));
|
|
||||||
Assert.StartsWith(_harness.Media.ProxyRoot, file);
|
|
||||||
Assert.Null(tampered);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
using NetVips;
|
|
||||||
|
|
||||||
using PrivaPub.Domain.Media;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
public class MediaProcessingTests
|
|
||||||
{
|
|
||||||
static byte[] JpegWithMetadata(int width, int height)
|
|
||||||
{
|
|
||||||
using var image = (Image.Black(width, height, bands: 3) + new double[] { 200, 40, 90 }).Cast(Enums.BandFormat.Uchar);
|
|
||||||
using var tagged = image.Mutate(m =>
|
|
||||||
{
|
|
||||||
m.Set(GValue.GStrType, "exif-ifd0-ImageDescription", "where I live");
|
|
||||||
m.Set(GValue.GStrType, "exif-ifd0-Artist", "Alice Smith");
|
|
||||||
m.Set(GValue.GStrType, "exif-ifd2-UserComment", "at home");
|
|
||||||
m.Set(GValue.BlobType, "xmp-data", System.Text.Encoding.UTF8.GetBytes("<x:xmpmeta xmlns:x='adobe:ns:meta/'><secret/></x:xmpmeta>"));
|
|
||||||
});
|
|
||||||
return tagged.WriteToBuffer(".jpg");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Uploaded_images_lose_every_kind_of_metadata()
|
|
||||||
{
|
|
||||||
var input = JpegWithMetadata(800, 600);
|
|
||||||
using (var original = Image.NewFromBuffer(input))
|
|
||||||
Assert.Contains("exif-data", original.GetFields());
|
|
||||||
|
|
||||||
var processed = MediaService.ProcessImage(input, 4096, 640, animated: false);
|
|
||||||
|
|
||||||
using var output = Image.NewFromBuffer(processed.Bytes);
|
|
||||||
var fields = output.GetFields();
|
|
||||||
Assert.DoesNotContain("exif-data", fields);
|
|
||||||
Assert.DoesNotContain("xmp-data", fields);
|
|
||||||
Assert.DoesNotContain("iptc-data", fields);
|
|
||||||
Assert.DoesNotContain(fields, f => f.StartsWith("exif-ifd"));
|
|
||||||
Assert.Equal((800, 600), (processed.Width, processed.Height));
|
|
||||||
Assert.Equal("image/jpeg", processed.ContentType);
|
|
||||||
using var preview = Image.NewFromBuffer(processed.Preview);
|
|
||||||
Assert.Equal(640, Math.Max(preview.Width, preview.Height));
|
|
||||||
Assert.DoesNotContain("exif-data", preview.GetFields());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Large_images_are_capped()
|
|
||||||
{
|
|
||||||
var processed = MediaService.ProcessImage(JpegWithMetadata(5000, 2500), 4096, 640, animated: false);
|
|
||||||
|
|
||||||
Assert.Equal((4096, 2048), (processed.Width, processed.Height));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_blurhash_is_well_formed()
|
|
||||||
{
|
|
||||||
var processed = MediaService.ProcessImage(JpegWithMetadata(64, 64), 4096, 640, animated: false);
|
|
||||||
|
|
||||||
Assert.Equal(28, processed.Blurhash.Length);
|
|
||||||
Assert.Equal('L', processed.Blurhash[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_white_image_encodes_white_as_its_average()
|
|
||||||
{
|
|
||||||
var pixels = Enumerable.Range(0, 16 * 16).SelectMany(_ => new byte[] { 255, 255, 255 }).ToArray();
|
|
||||||
|
|
||||||
var hash = Blurhash.Encode(pixels, 16, 16);
|
|
||||||
|
|
||||||
Assert.Equal(28, hash.Length);
|
|
||||||
Assert.Equal("TSUA", hash[2..6]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Post;
|
|
||||||
using PrivaPub.Domain.Privacy;
|
|
||||||
using PrivaPub.Federation.Outbox;
|
|
||||||
using PrivaPub.Models.Jobs;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class NearbyTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_located_post_reaches_only_those_within_its_radius_and_never_leaves_the_server()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var latitude = 10 + Random.Shared.NextDouble() * 50;
|
|
||||||
var longitude = 10 + Random.Shared.NextDouble() * 50;
|
|
||||||
var (aliceRoot, alice) = await _harness.Persona("alice");
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var (carolRoot, carol) = await _harness.Persona("carol");
|
|
||||||
var follower = new RemoteActor(_harness.Peer, "follower");
|
|
||||||
await _harness.FollowedBy(alice, follower);
|
|
||||||
|
|
||||||
var created = await _harness.Posts.InsertPost(aliceRoot, new InsertPostForm
|
|
||||||
{
|
|
||||||
AvatarId = alice.Id, Text = "free bread at the bakery", Latitude = latitude, Longitude = longitude, RangeKm = 5
|
|
||||||
}, token);
|
|
||||||
var post = await DB.Default.Find<Post>().OneAsync(((ViewPost)created.Data).Id, token);
|
|
||||||
|
|
||||||
var three = (List<ViewPost>)(await _harness.Posts.Nearby(bobRoot, bob.Id, latitude + 0.027, longitude, token)).Data;
|
|
||||||
var eight = (List<ViewPost>)(await _harness.Posts.Nearby(carolRoot, carol.Id, latitude + 0.072, longitude, token)).Data;
|
|
||||||
|
|
||||||
Assert.Equal(PostVisibility.LocalGeo, post.Visibility);
|
|
||||||
Assert.Equal(Math.Round(latitude, 2), post.Geo.Coordinates[1]);
|
|
||||||
Assert.Contains(three, p => p.Id == post.ID);
|
|
||||||
Assert.InRange(three.First(p => p.Id == post.ID).DistanceKm.Value, 2.0, 4.0);
|
|
||||||
Assert.DoesNotContain(eight, p => p.Id == post.ID);
|
|
||||||
Assert.False(await VisibilityPolicy.CanSee(post, bob.Id, token));
|
|
||||||
var outgoing = (await DB.Default.Find<Job>().Match(j => j.Kind == JobKind.Deliver).ExecuteAsync(token))
|
|
||||||
.Select(j => JsonSerializer.Deserialize<DeliveryPayload>(j.Payload))
|
|
||||||
.Where(p => p.Body.Contains(post.ID));
|
|
||||||
Assert.Empty(outgoing);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_located_post_cannot_be_direct_or_in_a_group()
|
|
||||||
{
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
|
|
||||||
var result = await _harness.Statuses.Publish(alice, new PrivaPub.Domain.Statuses.StatusDraft
|
|
||||||
{
|
|
||||||
Text = "x", Latitude = 45, Longitude = 7, Visibility = PostVisibility.Direct
|
|
||||||
}, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.False(result.Ok);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Post;
|
|
||||||
using PrivaPub.ClientModels;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Models.User;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class OutboxTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
async Task<ForeignAvatar> Known(RemoteActor actor) =>
|
|
||||||
await _harness.Remote.GetActor(actor.Id, refresh: false, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task The_audience_follows_mastodons_table()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var follower = new RemoteActor(_harness.Peer, "follower");
|
|
||||||
var mentioned = await Known(new RemoteActor(_harness.Peer, "mentioned"));
|
|
||||||
var parentAuthor = await Known(new RemoteActor(_harness.Peer, "parent"));
|
|
||||||
await _harness.FollowedBy(alice, follower);
|
|
||||||
var mention = new PostMention { ActorURI = mentioned.ActorURI };
|
|
||||||
|
|
||||||
async Task<IReadOnlyList<string>> Audience(PostVisibility visibility, string replyTo = default) =>
|
|
||||||
await _harness.Outbox.Audience(alice, new Post { Visibility = visibility, Mentions = new() { mention }, To = new() { mentioned.ActorURI }, InReplyToAccountId = replyTo }, token);
|
|
||||||
|
|
||||||
Assert.Equal(new[] { follower.SharedInbox, mentioned.InboxURL }, await Audience(PostVisibility.Public));
|
|
||||||
Assert.Equal(new[] { follower.SharedInbox, mentioned.InboxURL, parentAuthor.InboxURL }, await Audience(PostVisibility.Unlisted, parentAuthor.ID));
|
|
||||||
Assert.Equal(new[] { follower.SharedInbox, mentioned.InboxURL }, await Audience(PostVisibility.FollowersOnly));
|
|
||||||
Assert.Equal(new[] { mentioned.InboxURL }, await Audience(PostVisibility.Direct, parentAuthor.ID));
|
|
||||||
Assert.Empty(await Audience(PostVisibility.Circle));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_post_is_created_edited_and_deleted_for_its_audience()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var follower = new RemoteActor(_harness.Peer, "follower");
|
|
||||||
await _harness.FollowedBy(alice, follower);
|
|
||||||
|
|
||||||
var created = await _harness.Posts.InsertPost(root, new InsertPostForm { AvatarId = alice.Id, Text = "first", Visibility = "followersonly" }, token);
|
|
||||||
var postId = ((ViewPost)created.Data).Id;
|
|
||||||
await _harness.Posts.UpdatePost(root, new UpdatePostForm { AvatarId = alice.Id, PostId = postId, Text = "second", SpoilerText = "cw" }, token);
|
|
||||||
await _harness.Posts.DeletePost(root, new DeletePostForm { AvatarId = alice.Id, PostId = postId }, token);
|
|
||||||
|
|
||||||
var sent = await _harness.Outgoing(follower.SharedInbox);
|
|
||||||
Assert.Equal(new[] { "Create", "Update", "Delete" }, sent.Select(a => a["type"]!.GetValue<string>()));
|
|
||||||
Assert.DoesNotContain(sent[0]["to"]!.AsArray(), n => n!.GetValue<string>().EndsWith("#Public"));
|
|
||||||
Assert.Equal("cw", sent[1]["object"]!["summary"]!.GetValue<string>());
|
|
||||||
Assert.NotNull(sent[1]["object"]!["updated"]);
|
|
||||||
Assert.Equal(sent[0]["to"]!.ToJsonString(), sent[2]["to"]!.ToJsonString());
|
|
||||||
|
|
||||||
var stored = await DB.Default.Find<Post>().OneAsync(postId, token);
|
|
||||||
Assert.NotNull(stored.DeletedAt);
|
|
||||||
Assert.Null(stored.ContentHtml);
|
|
||||||
Assert.Empty(stored.Revisions);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Someone_elses_post_cannot_be_edited()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var (otherRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var created = await _harness.Posts.InsertPost(root, new InsertPostForm { AvatarId = alice.Id, Text = "mine" }, token);
|
|
||||||
|
|
||||||
var result = await _harness.Posts.UpdatePost(otherRoot, new UpdatePostForm { AvatarId = bob.Id, PostId = ((ViewPost)created.Data).Id, Text = "yours" }, token);
|
|
||||||
|
|
||||||
Assert.False(result.IsValid);
|
|
||||||
Assert.Equal(404, result.StatusCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Post;
|
|
||||||
using PrivaPub.ClientModels.Social;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.Social;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class RelationshipTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
static string Origin(RemoteActor actor) => new Uri(actor.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_block_cuts_follows_both_ways_and_hides_the_account()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (aliceRoot, alice) = await _harness.Persona("alice");
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
await _harness.Follows.Follow(aliceRoot, new FollowForm { AvatarId = alice.Id, Target = bob.UserName }, token);
|
|
||||||
await _harness.Follows.Follow(bobRoot, new FollowForm { AvatarId = bob.Id, Target = alice.UserName }, token);
|
|
||||||
|
|
||||||
await _harness.Relationships.Block(alice, bob.Uri, bob.Id, token);
|
|
||||||
await _harness.Posts.InsertPost(bobRoot, new InsertPostForm { AvatarId = bob.Id, Text = $"hey @{alice.UserName}" }, token);
|
|
||||||
|
|
||||||
Assert.False(await DB.Default.Find<Following>().Match(f => f.AvatarId == alice.Id || f.AvatarId == bob.Id).ExecuteAnyAsync(token));
|
|
||||||
Assert.False(await DB.Default.Find<Follower>().Match(f => f.LocalActorId == alice.Id || f.LocalActorId == bob.Id).ExecuteAnyAsync(token));
|
|
||||||
Assert.False(await DB.Default.Find<TimelineEntry>().Match(e => e.AvatarId == alice.Id && e.AuthorAccountId == bob.Id).ExecuteAnyAsync(token));
|
|
||||||
Assert.False(await DB.Default.Find<Notification>().Match(n => n.AvatarId == alice.Id).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_blocked_remote_account_is_refused_when_it_follows()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
await _harness.Relationships.Block(alice, mallory.Id, default, token);
|
|
||||||
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(mallory)}/follows/{Guid.NewGuid():N}", ["type"] = "Follow", ["actor"] = mallory.Id, ["object"] = alice.Uri
|
|
||||||
});
|
|
||||||
|
|
||||||
Assert.False(await DB.Default.Find<Follower>().Match(f => f.LocalActorId == alice.Id).ExecuteAnyAsync(token));
|
|
||||||
var sent = (await _harness.Outgoing(mallory.Id + "/inbox")).Select(a => a["type"]!.GetValue<string>()).ToList();
|
|
||||||
Assert.Equal(new[] { "Block", "Reject" }, sent.Order());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_block_is_told_to_the_blocked_server_and_so_is_the_unblock()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(mallory)}/follows/{Guid.NewGuid():N}", ["type"] = "Follow", ["actor"] = mallory.Id, ["object"] = alice.Uri
|
|
||||||
});
|
|
||||||
|
|
||||||
await _harness.Relationships.Block(alice, mallory.Id, default, token);
|
|
||||||
await _harness.Relationships.Unblock(alice, mallory.Id, token);
|
|
||||||
|
|
||||||
var sent = await _harness.Outgoing(mallory.Id + "/inbox");
|
|
||||||
var block = Assert.Single(sent, a => a["type"]!.GetValue<string>() == "Block");
|
|
||||||
Assert.Equal(mallory.Id, block["object"]!.GetValue<string>());
|
|
||||||
Assert.Equal(alice.Uri, block["actor"]!.GetValue<string>());
|
|
||||||
var undo = Assert.Single(sent, a => a["type"]!.GetValue<string>() == "Undo");
|
|
||||||
Assert.Equal(block["id"]!.GetValue<string>(), undo["object"]!["id"]!.GetValue<string>());
|
|
||||||
Assert.False(await DB.Default.Find<Block>().Match(b => b.AvatarId == alice.Id).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_muted_account_stays_out_of_home_and_notifications()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (aliceRoot, alice) = await _harness.Persona("alice");
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
await _harness.Follows.Follow(aliceRoot, new FollowForm { AvatarId = alice.Id, Target = bob.UserName }, token);
|
|
||||||
await _harness.Relationships.Mute(alice, bob.Uri, bob.Id, hideNotifications: true, default, token);
|
|
||||||
|
|
||||||
await _harness.Posts.InsertPost(bobRoot, new InsertPostForm { AvatarId = bob.Id, Text = $"hey @{alice.UserName}" }, token);
|
|
||||||
|
|
||||||
Assert.False(await DB.Default.Find<TimelineEntry>().Match(e => e.AvatarId == alice.Id).ExecuteAnyAsync(token));
|
|
||||||
Assert.False(await DB.Default.Find<Notification>().Match(n => n.AvatarId == alice.Id && n.Type == NotificationType.Mention).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_report_is_forwarded_by_the_instance_not_the_persona()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
var foreign = await _harness.Remote.GetActor(mallory.Id, refresh: false, token);
|
|
||||||
|
|
||||||
var report = await _harness.Reports.File(alice, foreign.ID, Array.Empty<string>(), "spam everywhere", "spam", forward: true, token);
|
|
||||||
|
|
||||||
Assert.True(report.Forwarded);
|
|
||||||
var flag = Assert.Single(await _harness.Outgoing(mallory.Id + "/inbox"));
|
|
||||||
Assert.Equal("Flag", flag["type"]!.GetValue<string>());
|
|
||||||
Assert.EndsWith("/peasants/privapub", flag["actor"]!.GetValue<string>());
|
|
||||||
Assert.DoesNotContain(alice.UserName, flag.ToJsonString());
|
|
||||||
Assert.DoesNotContain(alice.Id, flag.ToJsonString());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task An_inbound_flag_becomes_a_report_for_moderators()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var reporter = new RemoteActor(_harness.Peer, "reporter");
|
|
||||||
await _harness.Posts.InsertPost(root, new InsertPostForm { AvatarId = alice.Id, Text = "bad post" }, token);
|
|
||||||
var post = await DB.Default.Find<PrivaPub.Models.Post.Post>().Match(p => p.GroupUserId == alice.Id).ExecuteSingleAsync(token);
|
|
||||||
|
|
||||||
await _harness.Deliver(reporter, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(reporter)}/flags/{Guid.NewGuid():N}", ["type"] = "Flag", ["actor"] = reporter.Id,
|
|
||||||
["content"] = "please look", ["object"] = new JsonArray(alice.Uri, post.ObjectURI)
|
|
||||||
});
|
|
||||||
|
|
||||||
var report = await DB.Default.Find<Report>().Match(r => r.TargetAccountId == alice.Id).ExecuteSingleAsync(token);
|
|
||||||
Assert.Equal(reporter.Id, report.ReporterActorURI);
|
|
||||||
Assert.Equal(new[] { post.ID }, report.PostIds);
|
|
||||||
Assert.Equal("please look", report.Comment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Post;
|
|
||||||
using PrivaPub.ClientModels.Social;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Social;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class TimelineTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
async Task<List<ViewPost>> Home(string root, string avatarId) =>
|
|
||||||
(List<ViewPost>)(await _harness.Timelines.Home(root, avatarId, default, 40, TestContext.Current.CancellationToken)).Data;
|
|
||||||
|
|
||||||
async Task Accepted(string root, string avatarId, RemoteActor target)
|
|
||||||
{
|
|
||||||
await _harness.Follows.Follow(root, new FollowForm { AvatarId = avatarId, Target = target.Id }, TestContext.Current.CancellationToken);
|
|
||||||
await DB.Default.Update<Following>().Match(f => f.AvatarId == avatarId && f.TargetActorURI == target.Id)
|
|
||||||
.Modify(f => f.State, FollowState.Accepted).ExecuteAsync(TestContext.Current.CancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
static JsonObject Create(RemoteActor author, string inReplyTo = default, string text = "hello", params (string Uri, string Name)[] mentions)
|
|
||||||
{
|
|
||||||
var origin = new Uri(author.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
var note = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{origin}/notes/{Guid.NewGuid():N}",
|
|
||||||
["type"] = "Note",
|
|
||||||
["attributedTo"] = author.Id,
|
|
||||||
["content"] = $"<p>{text}</p>",
|
|
||||||
["to"] = new JsonArray(Addressing.Public),
|
|
||||||
["cc"] = new JsonArray(mentions.Select(m => (JsonNode)m.Uri).Prepend(author.Id + "/followers").ToArray()),
|
|
||||||
["tag"] = new JsonArray(mentions.Select(m => (JsonNode)new JsonObject { ["type"] = "Mention", ["href"] = m.Uri, ["name"] = m.Name }).ToArray())
|
|
||||||
};
|
|
||||||
if (inReplyTo != default)
|
|
||||||
note["inReplyTo"] = inReplyTo;
|
|
||||||
return new JsonObject { ["id"] = $"{origin}/activities/{Guid.NewGuid():N}", ["type"] = "Create", ["actor"] = author.Id, ["object"] = note };
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_local_post_reaches_the_author_and_local_followers_only()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (aliceRoot, alice) = await _harness.Persona("alice");
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var (carolRoot, carol) = await _harness.Persona("carol");
|
|
||||||
await _harness.Follows.Follow(bobRoot, new FollowForm { AvatarId = bob.Id, Target = alice.UserName }, token);
|
|
||||||
|
|
||||||
await _harness.Posts.InsertPost(aliceRoot, new InsertPostForm { AvatarId = alice.Id, Text = "for my followers" }, token);
|
|
||||||
|
|
||||||
Assert.Single(await Home(aliceRoot, alice.Id));
|
|
||||||
Assert.Equal("<p>for my followers</p>", Assert.Single(await Home(bobRoot, bob.Id)).ContentHtml);
|
|
||||||
Assert.Empty(await Home(carolRoot, carol.Id));
|
|
||||||
Assert.Equal(404, (await _harness.Timelines.Home(carolRoot, bob.Id, default, 20, token)).StatusCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_followed_remote_account_is_kept_and_its_replies_follow_mastodons_rule()
|
|
||||||
{
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
var dave = new RemoteActor(_harness.Peer, "dave");
|
|
||||||
await Accepted(bobRoot, bob.Id, carol);
|
|
||||||
|
|
||||||
var top = Create(carol, text: "top");
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", top);
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", Create(carol, top["object"]!["id"]!.GetValue<string>(), "self reply"));
|
|
||||||
await _harness.Deliver(dave, "/human-centipede", Create(dave, text: "dave alone"));
|
|
||||||
var daveRoot = Create(dave, text: "unfollowed root");
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", Create(carol, $"{new Uri(dave.Id).GetLeftPart(UriPartial.Authority)}/notes/unknown", "reply to a stranger"));
|
|
||||||
|
|
||||||
var home = (await Home(bobRoot, bob.Id)).Select(p => p.ContentHtml).ToList();
|
|
||||||
Assert.Contains("<p>top</p>", home);
|
|
||||||
Assert.Contains("<p>self reply</p>", home);
|
|
||||||
Assert.DoesNotContain("<p>dave alone</p>", home);
|
|
||||||
Assert.DoesNotContain("<p>reply to a stranger</p>", home);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_reply_brings_its_public_parent_and_the_grandparent_is_queued()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
var dave = new RemoteActor(_harness.Peer, "dave");
|
|
||||||
await Accepted(bobRoot, bob.Id, carol);
|
|
||||||
var origin = new Uri(dave.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
var grandparentId = $"{origin}/notes/{Guid.NewGuid():N}";
|
|
||||||
var parentId = $"{origin}/notes/{Guid.NewGuid():N}";
|
|
||||||
_harness.Peer.Serve(new Uri(parentId).AbsolutePath, new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = parentId, ["type"] = "Note", ["attributedTo"] = dave.Id, ["content"] = "<p>parent</p>",
|
|
||||||
["to"] = new JsonArray(Addressing.Public), ["inReplyTo"] = grandparentId
|
|
||||||
}.ToJsonString());
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", Create(carol, parentId, "reply to dave"));
|
|
||||||
|
|
||||||
var parent = await DB.Default.Find<PrivaPub.Models.Post.Post>().Match(p => p.ObjectURI == parentId).ExecuteSingleAsync(token);
|
|
||||||
var reply = await DB.Default.Find<PrivaPub.Models.Post.Post>().Match(p => p.InReplyToURI == parentId).ExecuteSingleAsync(token);
|
|
||||||
Assert.Equal(parent.ID, reply.AnsweringToPostId);
|
|
||||||
Assert.Equal(parent.AuthorAccountId, reply.InReplyToAccountId);
|
|
||||||
Assert.True(await DB.Default.Find<PrivaPub.Models.Jobs.Job>().Match(j => j.DedupeKey == "ancestors|" + parent.ID).ExecuteAnyAsync(token));
|
|
||||||
Assert.DoesNotContain("<p>reply to dave</p>", (await Home(bobRoot, bob.Id)).Select(p => p.ContentHtml));
|
|
||||||
Assert.DoesNotContain("<p>parent</p>", (await Home(bobRoot, bob.Id)).Select(p => p.ContentHtml));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_remote_delete_takes_the_post_out_of_home()
|
|
||||||
{
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
await Accepted(bobRoot, bob.Id, carol);
|
|
||||||
var create = Create(carol, text: "soon gone");
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", create);
|
|
||||||
Assert.Single(await Home(bobRoot, bob.Id));
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{new Uri(carol.Id).GetLeftPart(UriPartial.Authority)}/deletes/{Guid.NewGuid():N}", ["type"] = "Delete", ["actor"] = carol.Id,
|
|
||||||
["object"] = new JsonObject { ["id"] = create["object"]!["id"]!.GetValue<string>(), ["type"] = "Tombstone" }
|
|
||||||
});
|
|
||||||
|
|
||||||
Assert.Empty(await Home(bobRoot, bob.Id));
|
|
||||||
Assert.False(await DB.Default.Find<TimelineEntry>().Match(e => e.AvatarId == bob.Id).ExecuteAnyAsync(TestContext.Current.CancellationToken));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_mention_notifies_the_persona()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", Create(carol, mentions: (bob.Uri, "@" + bob.Handle)));
|
|
||||||
|
|
||||||
var notifications = (List<ViewNotification>)(await _harness.Timelines.Notifications(bobRoot, bob.Id, default, 20, token)).Data;
|
|
||||||
var mention = Assert.Single(notifications);
|
|
||||||
Assert.Equal("Mention", mention.Type);
|
|
||||||
Assert.Equal(carol.Id, mention.FromActorURI);
|
|
||||||
await _harness.Timelines.MarkNotificationsRead(bobRoot, bob.Id, token);
|
|
||||||
Assert.True(((List<ViewNotification>)(await _harness.Timelines.Notifications(bobRoot, bob.Id, default, 20, token)).Data).Single().IsRead);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Domain.Privacy;
|
|
||||||
using PrivaPub.Models.Group;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using GroupEntity = PrivaPub.Models.Group.Group;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Domain
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public class VisibilityPolicyTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public async Task Who_sees_what()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var conversation = new DmGroup { Members = new() { new GroupMember { AvatarId = "alice" }, new GroupMember { AvatarId = "https://r.example/u/bob", IsForeign = true } } };
|
|
||||||
var circle = new GroupEntity { UserName = $"c{Guid.NewGuid():N}"[..20], Members = new() { new GroupMember { AvatarId = "carol" } } };
|
|
||||||
await DB.Default.SaveAsync(conversation, token);
|
|
||||||
await DB.Default.SaveAsync(circle, token);
|
|
||||||
|
|
||||||
var direct = new Post { Visibility = PostVisibility.Direct, ConversationId = conversation.ID, GroupUserId = "dave" };
|
|
||||||
var circlePost = new Post { Visibility = PostVisibility.Circle, GroupId = circle.ID };
|
|
||||||
var followersOnly = new Post { Visibility = PostVisibility.FollowersOnly, Mentions = new() { new PostMention { IsLocal = true, AccountId = "erin" } } };
|
|
||||||
var deleted = new Post { Visibility = PostVisibility.Public, DeletedAt = DateTime.UtcNow };
|
|
||||||
|
|
||||||
Assert.True(await VisibilityPolicy.CanSee(new Post(), default, token));
|
|
||||||
Assert.True(await VisibilityPolicy.CanSee(direct, "alice", token));
|
|
||||||
Assert.True(await VisibilityPolicy.CanSee(direct, "dave", token));
|
|
||||||
Assert.False(await VisibilityPolicy.CanSee(direct, "carol", token));
|
|
||||||
Assert.False(await VisibilityPolicy.CanSee(direct, default, token));
|
|
||||||
Assert.True(await VisibilityPolicy.CanSee(circlePost, "carol", token));
|
|
||||||
Assert.False(await VisibilityPolicy.CanSee(circlePost, "alice", token));
|
|
||||||
Assert.True(await VisibilityPolicy.CanSee(followersOnly, "erin", token));
|
|
||||||
Assert.False(await VisibilityPolicy.CanSee(followersOnly, "alice", token));
|
|
||||||
Assert.False(await VisibilityPolicy.CanSee(deleted, "alice", token));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
using PrivaPub.Federation.Actors;
|
|
||||||
|
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
public class ActorProfileTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public void Reads_a_mastodon_profile_with_its_header_fields_emoji_and_lock()
|
|
||||||
{
|
|
||||||
using var json = JsonDocument.Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://m.example/users/ann", "type": "Person", "preferredUsername": "ann", "name": "Ann :sparkle:",
|
|
||||||
"inbox": "https://m.example/users/ann/inbox", "manuallyApprovesFollowers": true, "indexable": true, "memorial": false,
|
|
||||||
"published": "2023-04-01T00:00:00Z", "movedTo": "https://n.example/users/ann",
|
|
||||||
"icon": { "type": "Image", "url": "https://m.example/a.png", "summary": "a cat" },
|
|
||||||
"image": { "type": "Image", "url": "https://m.example/h.png", "name": "mountains" },
|
|
||||||
"tag": [{ "type": "Emoji", "name": ":sparkle:", "icon": { "type": "Image", "url": "https://m.example/emoji/sparkle.png" } }],
|
|
||||||
"attachment": [
|
|
||||||
{ "type": "PropertyValue", "name": "Site", "value": "<a href=\"https://ann.example\" rel=\"me\">ann.example</a><script>x</script>" },
|
|
||||||
{ "type": "PropertyValue", "name": "Pronouns", "value": "she/her" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
var actor = ActorDocument.Parse(json.RootElement);
|
|
||||||
|
|
||||||
Assert.True(actor.Locked);
|
|
||||||
Assert.True(actor.Indexable);
|
|
||||||
Assert.Equal("https://m.example/h.png", actor.Header);
|
|
||||||
Assert.Equal("a cat", actor.IconDescription);
|
|
||||||
Assert.Equal("mountains", actor.HeaderDescription);
|
|
||||||
Assert.Equal("https://n.example/users/ann", actor.MovedTo);
|
|
||||||
Assert.Equal(new DateTime(2023, 4, 1, 0, 0, 0, DateTimeKind.Utc), actor.Published);
|
|
||||||
Assert.Equal("sparkle", Assert.Single(actor.Emojis).Shortcode);
|
|
||||||
Assert.Equal(new[] { "Site", "Pronouns" }, actor.Fields.Keys);
|
|
||||||
Assert.DoesNotContain("<script>", actor.Fields["Site"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
using PrivaPub.Federation.Objects;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
public class ContentSanitizerTests
|
|
||||||
{
|
|
||||||
[Theory]
|
|
||||||
[InlineData("<script>alert(1)</script><p>hi</p>", "<p>hi</p>")]
|
|
||||||
[InlineData("<p onclick=\"alert(1)\">hi</p>", "<p>hi</p>")]
|
|
||||||
[InlineData("<img src=x onerror=alert(1)>", "")]
|
|
||||||
[InlineData("<a href=\"javascript:alert(1)\">x</a>", "<a rel=\"nofollow noopener noreferrer\" target=\"_blank\">x</a>")]
|
|
||||||
[InlineData("<a href=\"data:text/html,<script>alert(1)</script>\">x</a>", "<a rel=\"nofollow noopener noreferrer\" target=\"_blank\">x</a>")]
|
|
||||||
[InlineData("<a href=\"/relative\">x</a>", "<a rel=\"nofollow noopener noreferrer\" target=\"_blank\">x</a>")]
|
|
||||||
[InlineData("<iframe src=\"https://evil.example\"></iframe>text", "text")]
|
|
||||||
[InlineData("<style>body{display:none}</style><p>x</p>", "<p>x</p>")]
|
|
||||||
[InlineData("<svg><script>alert(1)</script></svg>", "")]
|
|
||||||
[InlineData("<p style=\"position:fixed\">x</p>", "<p>x</p>")]
|
|
||||||
[InlineData("<form action=\"https://evil.example\"><input name=p></form>ok", "ok")]
|
|
||||||
[InlineData("<p>a<!-- comment -->b</p>", "<p>ab</p>")]
|
|
||||||
[InlineData("<div><p>kept</p></div>", "<p>kept</p>")]
|
|
||||||
[InlineData("<h2>Title</h2>", "<p><strong>Title</strong></p>")]
|
|
||||||
[InlineData("<span class=\"evil big\">x</span>", "<span>x</span>")]
|
|
||||||
public void Removes_what_is_not_allowed(string input, string expected) =>
|
|
||||||
Assert.Equal(expected, ContentSanitizer.Html(input));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Keeps_mastodon_mention_and_hashtag_markup()
|
|
||||||
{
|
|
||||||
var html = "<p><span class=\"h-card\" translate=\"no\"><a href=\"https://m.example/@alice\" class=\"u-url mention\">@<span>alice</span></a></span> "
|
|
||||||
+ "<a href=\"https://m.example/tags/fedi\" class=\"mention hashtag\" rel=\"tag\">#<span>fedi</span></a> "
|
|
||||||
+ "<a href=\"https://example.org/a-long-link\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">example.org/a-long</span></a></p>";
|
|
||||||
|
|
||||||
var sanitized = ContentSanitizer.Html(html);
|
|
||||||
|
|
||||||
Assert.Contains("class=\"h-card\"", sanitized);
|
|
||||||
Assert.Contains("class=\"u-url mention\"", sanitized);
|
|
||||||
Assert.Contains("class=\"mention hashtag\"", sanitized);
|
|
||||||
Assert.Contains("class=\"invisible\"", sanitized);
|
|
||||||
Assert.Contains("class=\"ellipsis\"", sanitized);
|
|
||||||
Assert.Contains("href=\"https://m.example/@alice\"", sanitized);
|
|
||||||
Assert.DoesNotContain("rel=\"tag\"", sanitized);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("")]
|
|
||||||
[InlineData(" ")]
|
|
||||||
[InlineData(null)]
|
|
||||||
public void Empty_input_is_empty(string input) =>
|
|
||||||
Assert.Equal(string.Empty, ContentSanitizer.Html(input));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Social;
|
|
||||||
using PrivaPub.Domain.Statuses;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Federation.Rendering;
|
|
||||||
using PrivaPub.Federation.Signing;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.Group;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Models.Social;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
using GroupEntity = PrivaPub.Models.Group.Group;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class GroupTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
async Task<(GroupEntity Entity, PrivaPub.Federation.Actors.LocalActor Actor)> Group(GroupKind kind, PostingPolicy policy, string ownerId, params string[] remoteMembers)
|
|
||||||
{
|
|
||||||
var (privateKey, publicKey) = PrivaPub.Federation.Actors.Keys.NewKeyPair();
|
|
||||||
var group = new GroupEntity
|
|
||||||
{
|
|
||||||
UserName = $"{kind}{Guid.NewGuid():N}"[..20].ToLowerInvariant(),
|
|
||||||
Kind = kind,
|
|
||||||
PostingPolicy = policy,
|
|
||||||
PrivateKey = privateKey,
|
|
||||||
PublicKey = publicKey,
|
|
||||||
Members = new() { new GroupMember { AvatarId = ownerId, Role = GroupRole.Owner } }
|
|
||||||
};
|
|
||||||
group.Members.AddRange(remoteMembers.Select(m => new GroupMember { AvatarId = m, IsForeign = true }));
|
|
||||||
await DB.Default.SaveAsync(group);
|
|
||||||
return (group, _harness.Local.FromGroup(group));
|
|
||||||
}
|
|
||||||
|
|
||||||
static string Origin(RemoteActor actor) => new Uri(actor.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
|
|
||||||
static JsonObject Create(RemoteActor author, IEnumerable<string> to, string audience = default)
|
|
||||||
{
|
|
||||||
var note = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(author)}/notes/{Guid.NewGuid():N}",
|
|
||||||
["type"] = "Note",
|
|
||||||
["attributedTo"] = author.Id,
|
|
||||||
["content"] = "<p>to the group</p>",
|
|
||||||
["to"] = new JsonArray(to.Select(t => (JsonNode)t).ToArray())
|
|
||||||
};
|
|
||||||
if (audience != default)
|
|
||||||
note["audience"] = audience;
|
|
||||||
return new JsonObject { ["id"] = $"{Origin(author)}/activities/{Guid.NewGuid():N}", ["type"] = "Create", ["actor"] = author.Id, ["object"] = note };
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_follower_posting_to_a_community_is_announced_activity_and_object()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, owner) = await _harness.Persona("owner");
|
|
||||||
var (_, community) = await Group(GroupKind.Community, PostingPolicy.Followers, owner.Id);
|
|
||||||
var lemmy = new RemoteActor(_harness.Peer, "lemmy");
|
|
||||||
var stranger = new RemoteActor(_harness.Peer, "stranger");
|
|
||||||
await _harness.FollowedBy(community, lemmy);
|
|
||||||
|
|
||||||
await _harness.Deliver(lemmy, "/human-centipede", Create(lemmy, new[] { community.Uri, Addressing.Public }, community.Uri));
|
|
||||||
await _harness.Deliver(stranger, "/human-centipede", Create(stranger, new[] { community.Uri, Addressing.Public }, community.Uri));
|
|
||||||
|
|
||||||
Assert.True(await DB.Default.Find<Post>().Match(p => p.GroupId == community.Id && p.ActorURI == lemmy.Id).ExecuteAnyAsync(token));
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.GroupId == community.Id && p.ActorURI == stranger.Id).ExecuteAnyAsync(token));
|
|
||||||
var announces = (await _harness.Outgoing(lemmy.SharedInbox)).Where(a => a["actor"]!.GetValue<string>() == community.Uri).ToList();
|
|
||||||
Assert.Equal(2, announces.Count);
|
|
||||||
Assert.Contains(announces, a => a["object"] is JsonObject inner && inner["type"]!.GetValue<string>() == "Create" && a["audience"]!.GetValue<string>() == community.Uri);
|
|
||||||
Assert.Contains(announces, a => a["object"] is JsonValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task An_open_community_takes_posts_from_anyone()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, owner) = await _harness.Persona("owner");
|
|
||||||
var (_, community) = await Group(GroupKind.Community, PostingPolicy.Anyone, owner.Id);
|
|
||||||
var stranger = new RemoteActor(_harness.Peer, "stranger");
|
|
||||||
|
|
||||||
await _harness.Deliver(stranger, "/human-centipede", Create(stranger, new[] { community.Uri, Addressing.Public }));
|
|
||||||
|
|
||||||
Assert.True(await DB.Default.Find<Post>().Match(p => p.GroupId == community.Id && p.ActorURI == stranger.Id).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Mentioning_a_community_posts_into_it_as_a_titled_page()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var (_, community) = await Group(GroupKind.Community, PostingPolicy.Anyone, alice.Id);
|
|
||||||
var follower = new RemoteActor(_harness.Peer, "follower");
|
|
||||||
await _harness.FollowedBy(community, follower);
|
|
||||||
|
|
||||||
var outcome = await _harness.Statuses.Publish(alice, new StatusDraft { Text = $"@{community.UserName} a new thread", PlainText = true }, token);
|
|
||||||
|
|
||||||
Assert.Equal(community.Id, outcome.Post.GroupId);
|
|
||||||
var note = ActivityPubRenderer.Note(outcome.Post, alice, community, default);
|
|
||||||
Assert.Equal("Page", note["type"]!.GetValue<string>());
|
|
||||||
Assert.Equal(community.Uri, note["audience"]!.GetValue<string>());
|
|
||||||
Assert.False(string.IsNullOrEmpty(note["name"]!.GetValue<string>()));
|
|
||||||
Assert.Contains(await _harness.Outgoing(follower.SharedInbox), a => a["type"]!.GetValue<string>() == "Announce");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_circle_post_goes_only_to_members_and_only_members_may_read_it()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var member = new RemoteActor(_harness.Peer, "member");
|
|
||||||
var outsider = new RemoteActor(_harness.Peer, "outsider");
|
|
||||||
var (circleEntity, circle) = await Group(GroupKind.Circle, PostingPolicy.Followers, alice.Id, member.Id);
|
|
||||||
await _harness.Remote.GetActor(member.Id, refresh: false, token);
|
|
||||||
var follower = new RemoteActor(_harness.Peer, "follower");
|
|
||||||
await _harness.FollowedBy(alice, follower);
|
|
||||||
|
|
||||||
var outcome = await _harness.Statuses.Publish(alice, new StatusDraft { Text = "just us", GroupId = circle.Id }, token);
|
|
||||||
|
|
||||||
Assert.Equal(PostVisibility.Circle, outcome.Post.Visibility);
|
|
||||||
var create = Assert.Single(await _harness.Outgoing(member.Id + "/inbox"));
|
|
||||||
Assert.Equal(new[] { circle.Uri, circle.Flock }, create["object"]!["to"]!.AsArray().Select(t => t!.GetValue<string>()));
|
|
||||||
Assert.DoesNotContain(Addressing.Public, create.ToJsonString());
|
|
||||||
Assert.Empty(await _harness.Outgoing(follower.SharedInbox));
|
|
||||||
Assert.Empty((await _harness.Outgoing(member.SharedInbox)).Where(a => a["type"]!.GetValue<string>() == "Announce"));
|
|
||||||
|
|
||||||
var authorizer = new SignedFetchAuthorizer(_harness.Remote);
|
|
||||||
var path = new Uri(outcome.Post.ObjectURI).AbsolutePath;
|
|
||||||
var asMember = await authorizer.Requester(member.Get(Harness.Host, path), token);
|
|
||||||
var asOutsider = await authorizer.Requester(outsider.Get(Harness.Host, path), token);
|
|
||||||
Assert.True(SignedFetchAuthorizer.MayReadCircle(circleEntity, asMember));
|
|
||||||
Assert.False(SignedFetchAuthorizer.MayReadCircle(circleEntity, asOutsider));
|
|
||||||
Assert.False(SignedFetchAuthorizer.MayReadCircle(circleEntity, default));
|
|
||||||
Assert.True(circle.IsCircle);
|
|
||||||
Assert.False(circle.Discoverable);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Only_circle_members_can_post_into_a_circle()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (aliceRoot, alice) = await _harness.Persona("alice");
|
|
||||||
var member = new RemoteActor(_harness.Peer, "member");
|
|
||||||
var outsider = new RemoteActor(_harness.Peer, "outsider");
|
|
||||||
var (_, circle) = await Group(GroupKind.Circle, PostingPolicy.Followers, alice.Id, member.Id);
|
|
||||||
|
|
||||||
await _harness.Deliver(member, "/human-centipede", Create(member, new[] { circle.Uri, circle.Flock }));
|
|
||||||
await _harness.Deliver(outsider, "/human-centipede", Create(outsider, new[] { circle.Uri, circle.Flock }));
|
|
||||||
|
|
||||||
var stored = await DB.Default.Find<Post>().Match(p => p.GroupId == circle.Id).ExecuteAsync(token);
|
|
||||||
Assert.Equal(member.Id, Assert.Single(stored).ActorURI);
|
|
||||||
Assert.Equal(PostVisibility.Circle, stored[0].Visibility);
|
|
||||||
Assert.True(await DB.Default.Find<TimelineEntry>().Match(e => e.AvatarId == alice.Id && e.PostId == stored[0].ID).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_followed_remote_community_announcing_a_post_puts_it_in_home()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var lemmyCommunity = new RemoteActor(_harness.Peer, "cats", type: "Group");
|
|
||||||
var poster = new RemoteActor(_harness.Peer, "poster");
|
|
||||||
await _harness.Follows.Follow(root, new FollowForm { AvatarId = alice.Id, Target = lemmyCommunity.Id }, token);
|
|
||||||
await DB.Default.Update<Following>().Match(f => f.AvatarId == alice.Id).Modify(f => f.State, FollowState.Accepted).ExecuteAsync(token);
|
|
||||||
var create = Create(poster, new[] { lemmyCommunity.Id, Addressing.Public }, lemmyCommunity.Id);
|
|
||||||
var noteId = create["object"]!["id"]!.GetValue<string>();
|
|
||||||
_harness.Peer.Serve(new Uri(noteId).AbsolutePath, create["object"]!.ToJsonString());
|
|
||||||
|
|
||||||
await _harness.Deliver(lemmyCommunity, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(lemmyCommunity)}/activities/announce/{Guid.NewGuid():N}", ["type"] = "Announce", ["actor"] = lemmyCommunity.Id,
|
|
||||||
["to"] = new JsonArray(Addressing.Public), ["object"] = create
|
|
||||||
});
|
|
||||||
|
|
||||||
var post = await DB.Default.Find<Post>().Match(p => p.ObjectURI == noteId).ExecuteSingleAsync(token);
|
|
||||||
Assert.Equal(lemmyCommunity.Id, post.AudienceURI);
|
|
||||||
Assert.True(await DB.Default.Find<TimelineEntry>().Match(e => e.AvatarId == alice.Id && e.PostId == post.ID).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Federation.Signing;
|
|
||||||
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
public class HttpSignaturesTests
|
|
||||||
{
|
|
||||||
const string Host = "privapub.test";
|
|
||||||
const string KeyId = "https://mastodon.example/users/alice#main-key";
|
|
||||||
static readonly DateTimeOffset Now = new(2026, 10, 1, 12, 0, 0, TimeSpan.Zero);
|
|
||||||
static readonly byte[] Body = Encoding.UTF8.GetBytes("""{"type":"Follow","actor":"https://mastodon.example/users/alice"}""");
|
|
||||||
|
|
||||||
readonly RSA _key = RSA.Create(2048);
|
|
||||||
|
|
||||||
string PublicKey => _key.ExportSubjectPublicKeyInfoPem();
|
|
||||||
|
|
||||||
DefaultHttpContext MastodonRequest(string signedTarget = "/peasants/bob/mouth", DateTimeOffset? signedAt = default,
|
|
||||||
string headers = "(request-target) host date digest content-type", byte[] signedBody = default, string extra = "")
|
|
||||||
{
|
|
||||||
var date = (signedAt ?? Now).ToString("r", CultureInfo.InvariantCulture);
|
|
||||||
var digest = HttpSignatures.Digest(signedBody ?? Body);
|
|
||||||
var values = new Dictionary<string, string>
|
|
||||||
{
|
|
||||||
["(request-target)"] = $"post {signedTarget}",
|
|
||||||
["host"] = Host,
|
|
||||||
["date"] = date,
|
|
||||||
["digest"] = digest,
|
|
||||||
["content-type"] = "application/activity+json"
|
|
||||||
};
|
|
||||||
var signingString = string.Join("\n", headers.Split(' ').Select(h => $"{h}: {values[h]}"));
|
|
||||||
var signature = Convert.ToBase64String(_key.SignData(Encoding.UTF8.GetBytes(signingString), HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1));
|
|
||||||
|
|
||||||
var context = new DefaultHttpContext();
|
|
||||||
context.Request.Method = "POST";
|
|
||||||
context.Request.Host = new HostString(Host);
|
|
||||||
context.Request.Path = "/peasants/bob/mouth";
|
|
||||||
context.Features.Get<IHttpRequestFeature>().RawTarget = "/peasants/bob/mouth";
|
|
||||||
context.Request.Headers["Date"] = date;
|
|
||||||
context.Request.Headers["Digest"] = digest;
|
|
||||||
context.Request.Headers["Content-Type"] = "application/activity+json";
|
|
||||||
context.Request.Headers["Signature"] = $"keyId=\"{KeyId}\",algorithm=\"rsa-sha256\",headers=\"{headers}\",signature=\"{signature}\"{extra}";
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
string Check(HttpContext context, byte[] body = default)
|
|
||||||
{
|
|
||||||
var parameters = HttpSignatures.Parse(context.Request.Headers["Signature"].ToString());
|
|
||||||
var problem = HttpSignatures.CheckRequest(context.Request, parameters, body ?? Body, Now);
|
|
||||||
if (problem != default)
|
|
||||||
return problem;
|
|
||||||
return HttpSignatures.Verify(PublicKey, HttpSignatures.SigningString(context.Request, parameters), parameters.Signature)
|
|
||||||
? default
|
|
||||||
: "does not verify";
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Accepts_a_mastodon_style_delivery() =>
|
|
||||||
Assert.Null(Check(MastodonRequest()));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_a_tampered_body() =>
|
|
||||||
Assert.Equal("the digest does not match the body", Check(MastodonRequest(), Encoding.UTF8.GetBytes("""{"type":"Delete"}""")));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_a_signature_for_another_inbox() =>
|
|
||||||
Assert.Equal("does not verify", Check(MastodonRequest(signedTarget: "/peasants/carol/mouth")));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_a_signature_older_than_an_hour() =>
|
|
||||||
Assert.Equal("the Date header is outside the allowed window", Check(MastodonRequest(signedAt: Now.AddMinutes(-61))));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Accepts_a_clock_slightly_ahead() =>
|
|
||||||
Assert.Null(Check(MastodonRequest(signedAt: Now.AddMinutes(10))));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_a_clock_far_ahead() =>
|
|
||||||
Assert.Equal("the Date header is outside the allowed window", Check(MastodonRequest(signedAt: Now.AddMinutes(20))));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_a_signature_without_the_request_target() =>
|
|
||||||
Assert.Equal("(request-target) is not signed", Check(MastodonRequest(headers: "host date digest")));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_a_signature_without_the_host() =>
|
|
||||||
Assert.Equal("host is not signed", Check(MastodonRequest(headers: "(request-target) date digest")));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_a_body_whose_digest_is_not_signed() =>
|
|
||||||
Assert.Equal("the digest is not signed", Check(MastodonRequest(headers: "(request-target) host date")));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_an_expired_signature() =>
|
|
||||||
Assert.Equal("the signature has expired",
|
|
||||||
Check(MastodonRequest(extra: $",expires=\"{Now.AddMinutes(-20).ToUnixTimeSeconds()}\"")));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Signs_with_the_raw_request_target()
|
|
||||||
{
|
|
||||||
var context = MastodonRequest(signedTarget: "/peasants/b%6Fb/mouth");
|
|
||||||
context.Features.Get<IHttpRequestFeature>().RawTarget = "/peasants/b%6Fb/mouth";
|
|
||||||
|
|
||||||
Assert.Null(Check(context));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Verifies_its_own_outbound_signature()
|
|
||||||
{
|
|
||||||
var (privateKey, publicKey) = Keys.NewKeyPair();
|
|
||||||
var signer = new LocalActor { UserName = "bob", BaseAddress = "https://privapub.test", PrivateKeyPem = privateKey };
|
|
||||||
using var outbound = new HttpRequestMessage(HttpMethod.Post, "https://mastodon.example/users/alice/inbox");
|
|
||||||
HttpSignatures.Sign(outbound, signer, Body);
|
|
||||||
|
|
||||||
var context = new DefaultHttpContext();
|
|
||||||
context.Request.Method = "POST";
|
|
||||||
context.Request.Host = new HostString("mastodon.example");
|
|
||||||
context.Request.Path = "/users/alice/inbox";
|
|
||||||
context.Features.Get<IHttpRequestFeature>().RawTarget = "/users/alice/inbox";
|
|
||||||
foreach (var header in outbound.Headers)
|
|
||||||
context.Request.Headers[header.Key] = string.Join(", ", header.Value);
|
|
||||||
var parameters = HttpSignatures.Parse(context.Request.Headers["Signature"].ToString());
|
|
||||||
|
|
||||||
Assert.Equal("https://privapub.test/peasants/bob#main-key", parameters.KeyId);
|
|
||||||
Assert.Null(HttpSignatures.CheckRequest(context.Request, parameters, Body));
|
|
||||||
Assert.True(HttpSignatures.Verify(publicKey, HttpSignatures.SigningString(context.Request, parameters), parameters.Signature));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Post;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class InboundRoutingTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
static string Origin(RemoteActor actor) => new Uri(actor.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
|
|
||||||
static string NewId(RemoteActor actor, string kind) => $"{Origin(actor)}/{kind}/{Guid.NewGuid():N}";
|
|
||||||
|
|
||||||
async Task<Post> LocalPost(string text)
|
|
||||||
{
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
await _harness.Posts.InsertPost(root, new InsertPostForm { AvatarId = alice.Id, Text = text }, TestContext.Current.CancellationToken);
|
|
||||||
return await DB.Default.Find<Post>().Match(p => p.GroupUserId == alice.Id).ExecuteFirstAsync(TestContext.Current.CancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_downvote_counts_and_its_undo_takes_it_back()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var post = await LocalPost("vote on me");
|
|
||||||
var lemmy = new RemoteActor(_harness.Peer, "voter");
|
|
||||||
var dislike = new JsonObject { ["id"] = NewId(lemmy, "activities/dislike"), ["type"] = "Dislike", ["actor"] = lemmy.Id, ["object"] = post.ObjectURI };
|
|
||||||
|
|
||||||
await _harness.Deliver(lemmy, "/human-centipede", dislike);
|
|
||||||
Assert.Equal(1, (await DB.Default.Find<Post>().OneAsync(post.ID, token)).DownvotesCount);
|
|
||||||
|
|
||||||
await _harness.Deliver(lemmy, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(lemmy, "activities/undo"), ["type"] = "Undo", ["actor"] = lemmy.Id, ["object"] = dislike.DeepClone()
|
|
||||||
});
|
|
||||||
Assert.Equal(0, (await DB.Default.Find<Post>().OneAsync(post.ID, token)).DownvotesCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_delete_that_arrives_first_keeps_the_post_from_coming_back()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
var noteId = NewId(mallory, "notes");
|
|
||||||
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(mallory, "activities/delete"), ["type"] = "Delete", ["actor"] = mallory.Id,
|
|
||||||
["object"] = new JsonObject { ["id"] = noteId, ["type"] = "Tombstone" }
|
|
||||||
});
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(mallory, "activities/create"), ["type"] = "Create", ["actor"] = mallory.Id,
|
|
||||||
["object"] = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = noteId, ["type"] = "Note", ["attributedTo"] = mallory.Id, ["content"] = "<p>late</p>",
|
|
||||||
["to"] = new JsonArray(Addressing.Public), ["cc"] = new JsonArray(alice.Uri),
|
|
||||||
["tag"] = new JsonArray(new JsonObject { ["type"] = "Mention", ["href"] = alice.Uri, ["name"] = "@alice" })
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.ObjectURI == noteId).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_lemmy_private_message_arrives_as_a_direct_message()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var lemmy = new RemoteActor(_harness.Peer, "pm");
|
|
||||||
var messageId = NewId(lemmy, "private_message");
|
|
||||||
|
|
||||||
await _harness.Deliver(lemmy, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(lemmy, "activities/create"), ["type"] = "Create", ["actor"] = lemmy.Id, ["to"] = new JsonArray(alice.Uri),
|
|
||||||
["object"] = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = messageId, ["type"] = "ChatMessage", ["attributedTo"] = lemmy.Id, ["to"] = new JsonArray(alice.Uri),
|
|
||||||
["content"] = "<p>psst</p>", ["mediaType"] = "text/html", ["published"] = DateTime.UtcNow.ToString("O")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var message = await DB.Default.Find<Post>().Match(p => p.ObjectURI == messageId).ExecuteFirstAsync(token);
|
|
||||||
Assert.NotNull(message);
|
|
||||||
Assert.Equal(PostVisibility.Direct, message.Visibility);
|
|
||||||
Assert.NotNull(message.ConversationId);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task An_unreachable_key_asks_the_sender_to_retry_instead_of_refusing()
|
|
||||||
{
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var offline = new RemoteActor(_harness.Peer, "offline", origin: "http://127.0.0.1:9");
|
|
||||||
|
|
||||||
var result = await _harness.Deliver(offline, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(offline, "follows"), ["type"] = "Follow", ["actor"] = offline.Id, ["object"] = alice.Uri
|
|
||||||
});
|
|
||||||
|
|
||||||
Assert.Equal(503, result.StatusCode);
|
|
||||||
Assert.Equal(300, result.RetryAfterSeconds);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_join_of_a_local_post_is_answered_with_ignore()
|
|
||||||
{
|
|
||||||
var post = await LocalPost("not an event");
|
|
||||||
var mobilizon = new RemoteActor(_harness.Peer, "joiner");
|
|
||||||
|
|
||||||
await _harness.Deliver(mobilizon, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(mobilizon, "join"), ["type"] = "Join", ["actor"] = mobilizon.Id, ["object"] = post.ObjectURI
|
|
||||||
});
|
|
||||||
|
|
||||||
var answer = Assert.Single(await _harness.Outgoing(mobilizon.Id + "/inbox"));
|
|
||||||
Assert.Equal("Ignore", answer["type"]!.GetValue<string>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,352 +0,0 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
|
||||||
|
|
||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Domain.Timelines;
|
|
||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Federation.Inbox.Handlers;
|
|
||||||
using PrivaPub.Federation.Inbox;
|
|
||||||
using PrivaPub.Federation.Moderation;
|
|
||||||
using PrivaPub.Domain.Statuses;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Federation.Outbox;
|
|
||||||
using PrivaPub.Infrastructure.Jobs;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.Group;
|
|
||||||
using PrivaPub.Models.Jobs;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Models.User;
|
|
||||||
using PrivaPub.Models;
|
|
||||||
using PrivaPub.StaticServices;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
using GroupEntity = PrivaPub.Models.Group.Group;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class InboxScenarioTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
const string Host = "privapub.test";
|
|
||||||
const string Base = "https://" + Host;
|
|
||||||
|
|
||||||
Peer _peer;
|
|
||||||
LocalActorService _local;
|
|
||||||
InboxReceiver _receiver;
|
|
||||||
InboxProcessor _processor;
|
|
||||||
DomainBlocks _blocks;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_peer = await Peer.Start();
|
|
||||||
var cache = new MemoryCache(new MemoryCacheOptions());
|
|
||||||
_local = new LocalActorService(new DbEntities(), new StaticOptions<AppConfiguration>(new AppConfiguration { BackendBaseAddress = Base }));
|
|
||||||
var remote = new RemoteActorService(Peer.Http(cache), _local, cache, new DbEntities());
|
|
||||||
var queue = new JobQueue();
|
|
||||||
var delivery = new DeliveryService(new DbEntities(), queue);
|
|
||||||
var db = new DbEntities();
|
|
||||||
_blocks = new DomainBlocks(NullLogger<DomainBlocks>.Instance);
|
|
||||||
_receiver = new InboxReceiver(_local, remote, queue, _blocks, NullLogger<InboxReceiver>.Instance);
|
|
||||||
_processor = new InboxProcessor(remote, new IActivityHandler[]
|
|
||||||
{
|
|
||||||
new FollowHandler(db, _local, remote, delivery),
|
|
||||||
new UndoHandler(db, _local),
|
|
||||||
new CreateHandler(db, _local, remote, delivery, _blocks, new Fanout(db), new RemotePosts(db, _local, remote, _blocks, queue, new ObjectRecords(queue)), new GroupDistributor(delivery), new ObjectRecords(queue), new PollService(db, _local, delivery, queue)),
|
|
||||||
new DeleteHandler(db, _local, remote, delivery, new GroupDistributor(delivery)),
|
|
||||||
new UpdateHandler(db, _local, remote, new GroupDistributor(delivery), new ObjectRecords(queue))
|
|
||||||
}, NullLogger<InboxProcessor>.Instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_peer != default)
|
|
||||||
await _peer.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
async Task<LocalActor> LocalAvatar(string name)
|
|
||||||
{
|
|
||||||
var (privateKey, publicKey) = Keys.NewKeyPair();
|
|
||||||
var avatar = new Avatar { UserName = $"{name}{Guid.NewGuid():N}"[..20], PrivateKey = privateKey, PublicKey = publicKey };
|
|
||||||
await DB.Default.SaveAsync(avatar, TestContext.Current.CancellationToken);
|
|
||||||
return _local.FromAvatar(avatar);
|
|
||||||
}
|
|
||||||
|
|
||||||
static JsonObject DirectCreate(RemoteActor author, string to, string context = default, string objectOrigin = default, string attributedTo = default)
|
|
||||||
{
|
|
||||||
var id = $"{objectOrigin ?? Origin(author.Id)}/notes/{Guid.NewGuid():N}";
|
|
||||||
var note = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = id,
|
|
||||||
["type"] = "Note",
|
|
||||||
["attributedTo"] = attributedTo ?? author.Id,
|
|
||||||
["content"] = "<p>psst</p>",
|
|
||||||
["to"] = new JsonArray(to),
|
|
||||||
["cc"] = new JsonArray()
|
|
||||||
};
|
|
||||||
if (context != default)
|
|
||||||
note["context"] = context;
|
|
||||||
return new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(author.Id)}/activities/{Guid.NewGuid():N}",
|
|
||||||
["type"] = "Create",
|
|
||||||
["actor"] = author.Id,
|
|
||||||
["to"] = new JsonArray(to),
|
|
||||||
["object"] = note
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
async Task<InboxResult> Deliver(RemoteActor sender, string path, JsonNode activity)
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var result = await _receiver.Receive(sender.Post(Host, path, activity), default, token);
|
|
||||||
var dedupe = "inbox|" + (activity is JsonObject ? activity["id"]?.GetValue<string>() : default);
|
|
||||||
var job = await DB.Default.Find<Job>().Match(j => j.DedupeKey == dedupe).ExecuteFirstAsync(token);
|
|
||||||
if (job != default)
|
|
||||||
Assert.Equal(JobResult.Done, (await _processor.Handle(job, token)).Result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static string Origin(string uri) => new Uri(uri).GetLeftPart(UriPartial.Authority);
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_context_cannot_pull_a_stranger_into_an_existing_conversation()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var bob = new RemoteActor(_peer, "bob");
|
|
||||||
var mallory = new RemoteActor(_peer, "mallory");
|
|
||||||
var context = $"{_peer.A}/contexts/{Guid.NewGuid():N}";
|
|
||||||
|
|
||||||
var first = await Deliver(bob, $"/peasants/{alice.UserName}/mouth", DirectCreate(bob, alice.Uri, context));
|
|
||||||
var injected = await Deliver(mallory, $"/peasants/{alice.UserName}/mouth", DirectCreate(mallory, alice.Uri, context));
|
|
||||||
|
|
||||||
Assert.Equal(202, first.StatusCode);
|
|
||||||
Assert.Equal(202, injected.StatusCode);
|
|
||||||
var bobDm = await DB.Default.Find<Post>().Match(p => p.ActorURI == bob.Id && p.Visibility == PostVisibility.Direct).ExecuteSingleAsync(token);
|
|
||||||
var malloryDm = await DB.Default.Find<Post>().Match(p => p.ActorURI == mallory.Id).ExecuteSingleAsync(token);
|
|
||||||
Assert.NotEqual(bobDm.ConversationId, malloryDm.ConversationId);
|
|
||||||
var bobConversation = await DB.Default.Find<DmGroup>().OneAsync(bobDm.ConversationId, token);
|
|
||||||
Assert.DoesNotContain(bobConversation.Members, m => m.AvatarId == mallory.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Replies_between_the_same_people_land_in_the_same_conversation()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var bob = new RemoteActor(_peer, "bob");
|
|
||||||
|
|
||||||
await Deliver(bob, $"/peasants/{alice.UserName}/mouth", DirectCreate(bob, alice.Uri));
|
|
||||||
await Deliver(bob, $"/peasants/{alice.UserName}/mouth", DirectCreate(bob, alice.Uri));
|
|
||||||
|
|
||||||
var dms = await DB.Default.Find<Post>().Match(p => p.ActorURI == bob.Id && p.Visibility == PostVisibility.Direct).ExecuteAsync(token);
|
|
||||||
Assert.Equal(2, dms.Count);
|
|
||||||
Assert.Single(dms.Select(d => d.ConversationId).Distinct());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task An_activity_id_on_another_origin_is_refused()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var mallory = new RemoteActor(_peer, "mallory");
|
|
||||||
var create = DirectCreate(mallory, alice.Uri);
|
|
||||||
create["id"] = $"{_peer.B}/activities/{Guid.NewGuid():N}";
|
|
||||||
|
|
||||||
var result = await Deliver(mallory, $"/peasants/{alice.UserName}/mouth", create);
|
|
||||||
|
|
||||||
Assert.Equal(400, result.StatusCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_note_put_in_someone_elses_mouth_is_refused()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var mallory = new RemoteActor(_peer, "mallory");
|
|
||||||
var victim = new RemoteActor(_peer, "victim");
|
|
||||||
|
|
||||||
var result = await Deliver(mallory, $"/peasants/{alice.UserName}/mouth", DirectCreate(mallory, alice.Uri, attributedTo: victim.Id));
|
|
||||||
|
|
||||||
Assert.Equal(400, result.StatusCode);
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.ActorURI == victim.Id).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_cross_origin_object_is_fetched_from_its_origin_before_it_is_believed()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var mallory = new RemoteActor(_peer, "mallory");
|
|
||||||
|
|
||||||
var result = await Deliver(mallory, $"/peasants/{alice.UserName}/mouth", DirectCreate(mallory, alice.Uri, objectOrigin: _peer.B));
|
|
||||||
|
|
||||||
Assert.Equal(202, result.StatusCode);
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.ActorURI == mallory.Id).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JsonObject PublicCreate(RemoteActor author, string inReplyTo = default, params string[] cc)
|
|
||||||
{
|
|
||||||
var id = $"{Origin(author.Id)}/notes/{Guid.NewGuid():N}";
|
|
||||||
var note = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = id,
|
|
||||||
["type"] = "Note",
|
|
||||||
["attributedTo"] = author.Id,
|
|
||||||
["content"] = "<p>hello</p>",
|
|
||||||
["to"] = new JsonArray(Addressing.Public),
|
|
||||||
["cc"] = new JsonArray(cc.Prepend(author.Id + "/followers").Select(c => (JsonNode)c).ToArray())
|
|
||||||
};
|
|
||||||
if (inReplyTo != default)
|
|
||||||
note["inReplyTo"] = inReplyTo;
|
|
||||||
return new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(author.Id)}/activities/{Guid.NewGuid():N}",
|
|
||||||
["type"] = "Create",
|
|
||||||
["actor"] = author.Id,
|
|
||||||
["object"] = note
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_public_reply_to_a_local_post_is_kept_and_counted()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var parent = new Post { GroupUserId = alice.Id, AuthorAccountId = alice.Id, ActorURI = alice.Uri, Text = "hi" };
|
|
||||||
parent.ID = (string)parent.GenerateNewID();
|
|
||||||
parent.ObjectURI = alice.PostUri(parent.ID);
|
|
||||||
await DB.Default.SaveAsync(parent, token);
|
|
||||||
var bob = new RemoteActor(_peer, "bob");
|
|
||||||
|
|
||||||
await Deliver(bob, "/human-centipede", PublicCreate(bob, parent.ObjectURI));
|
|
||||||
|
|
||||||
var reply = await DB.Default.Find<Post>().Match(p => p.ActorURI == bob.Id).ExecuteSingleAsync(token);
|
|
||||||
Assert.Equal(PostVisibility.Public, reply.Visibility);
|
|
||||||
Assert.Equal(parent.ID, reply.AnsweringToPostId);
|
|
||||||
Assert.Equal(alice.Id, reply.InReplyToAccountId);
|
|
||||||
Assert.Equal(1, (await DB.Default.Find<Post>().OneAsync(parent.ID, token)).RepliesCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_public_post_nobody_here_asked_for_is_dropped()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var bob = new RemoteActor(_peer, "bob");
|
|
||||||
|
|
||||||
await Deliver(bob, "/human-centipede", PublicCreate(bob));
|
|
||||||
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.ActorURI == bob.Id).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_mention_is_kept_and_linked_to_the_local_persona()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var bob = new RemoteActor(_peer, "bob");
|
|
||||||
var create = PublicCreate(bob, default, alice.Uri);
|
|
||||||
create["object"]!["tag"] = new JsonArray(new JsonObject { ["type"] = "Mention", ["href"] = alice.Uri, ["name"] = "@" + alice.Handle });
|
|
||||||
|
|
||||||
await Deliver(bob, "/human-centipede", create);
|
|
||||||
|
|
||||||
var post = await DB.Default.Find<Post>().Match(p => p.ActorURI == bob.Id).ExecuteSingleAsync(token);
|
|
||||||
var mention = Assert.Single(post.Mentions);
|
|
||||||
Assert.True(mention.IsLocal);
|
|
||||||
Assert.Equal(alice.Id, mention.AccountId);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_suspended_domain_is_dropped_before_its_key_is_fetched()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var bob = new RemoteActor(_peer, "bob", _peer.B);
|
|
||||||
await DB.Default.SaveAsync(new DomainBlock { Domain = "localhost", Severity = DomainBlockSeverity.Suspend }, token);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _blocks.Reload(token);
|
|
||||||
var before = _peer.Requests.Count;
|
|
||||||
|
|
||||||
var result = await Deliver(bob, $"/peasants/{alice.UserName}/mouth", DirectCreate(bob, alice.Uri));
|
|
||||||
|
|
||||||
Assert.Equal(202, result.StatusCode);
|
|
||||||
Assert.Equal(before, _peer.Requests.Count);
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.ActorURI == bob.Id).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
await DB.Default.DeleteAsync<DomainBlock>(b => b.Domain == "localhost");
|
|
||||||
await _blocks.Reload(token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_block_covers_subdomains_but_not_lookalikes()
|
|
||||||
{
|
|
||||||
var blocks = new DomainBlocks(NullLogger<DomainBlocks>.Instance);
|
|
||||||
typeof(DomainBlocks).GetField("_blocks", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)!
|
|
||||||
.SetValue(blocks, new Dictionary<string, DomainBlock> { ["evil.example"] = new() { Domain = "evil.example", Severity = DomainBlockSeverity.Silence } });
|
|
||||||
typeof(DomainBlocks).GetField("_loadedAt", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)!
|
|
||||||
.SetValue(blocks, DateTime.UtcNow);
|
|
||||||
|
|
||||||
Assert.NotNull(blocks.Find("evil.example"));
|
|
||||||
Assert.NotNull(blocks.Find("A.Evil.Example."));
|
|
||||||
Assert.Null(blocks.Find("notevil.example"));
|
|
||||||
Assert.False(blocks.IsSuspended("evil.example"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_bad_signature_is_a_401()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var mallory = new RemoteActor(_peer, "mallory");
|
|
||||||
var request = mallory.Post(Host, $"/peasants/{alice.UserName}/mouth", DirectCreate(mallory, alice.Uri));
|
|
||||||
request.Headers["Signature"] = request.Headers["Signature"].ToString().Replace("signature=\"", "signature=\"AAAA");
|
|
||||||
|
|
||||||
Assert.Equal(401, (await _receiver.Receive(request, alice, token)).StatusCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Junk_is_a_400_never_a_500()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var alice = await LocalAvatar("alice");
|
|
||||||
var mallory = new RemoteActor(_peer, "mallory");
|
|
||||||
|
|
||||||
foreach (var junk in new JsonNode[] { new JsonArray(1, 2), JsonValue.Create("x"), new JsonObject { ["type"] = "Create" } })
|
|
||||||
Assert.Equal(400, (await Deliver(mallory, $"/peasants/{alice.UserName}/mouth", junk)).StatusCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_circle_only_takes_follow_requests()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (privateKey, publicKey) = Keys.NewKeyPair();
|
|
||||||
var circle = new GroupEntity { UserName = $"circle{Guid.NewGuid():N}"[..20], PrivateKey = privateKey, PublicKey = publicKey };
|
|
||||||
await DB.Default.SaveAsync(circle, token);
|
|
||||||
var bob = new RemoteActor(_peer, "bob");
|
|
||||||
var actor = _local.FromGroup(circle);
|
|
||||||
var follow = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{bob.Id}/follows/{Guid.NewGuid():N}",
|
|
||||||
["type"] = "Follow",
|
|
||||||
["actor"] = bob.Id,
|
|
||||||
["object"] = actor.Uri
|
|
||||||
};
|
|
||||||
|
|
||||||
Assert.True(actor.IsCircle);
|
|
||||||
Assert.True(actor.ManuallyApprovesFollowers);
|
|
||||||
Assert.False(actor.Discoverable);
|
|
||||||
Assert.Equal(202, (await Deliver(bob, "/human-centipede", follow)).StatusCode);
|
|
||||||
var request = await DB.Default.Find<Follower>().Match(f => f.LocalActorId == circle.ID).ExecuteSingleAsync(token);
|
|
||||||
Assert.False(request.IsAccepted);
|
|
||||||
Assert.DoesNotContain(circle.Members, m => m.AvatarId == bob.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.ClientModels.Post;
|
|
||||||
using PrivaPub.ClientModels.Social;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Models.Social;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class InteractionTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
async Task<(string Root, Post Post)> LocalPost(string visibility = default)
|
|
||||||
{
|
|
||||||
var (root, alice) = await _harness.Persona("alice");
|
|
||||||
var view = (ViewPost)(await _harness.Posts.InsertPost(root, new InsertPostForm { AvatarId = alice.Id, Text = "like me", Visibility = visibility },
|
|
||||||
TestContext.Current.CancellationToken)).Data;
|
|
||||||
return (root, await DB.Default.Find<Post>().OneAsync(view.Id));
|
|
||||||
}
|
|
||||||
|
|
||||||
static string Origin(RemoteActor actor) => new Uri(actor.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_like_counts_once_notifies_and_can_be_undone()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, post) = await LocalPost();
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
var like = new JsonObject { ["id"] = $"{Origin(carol)}/likes/{Guid.NewGuid():N}", ["type"] = "Like", ["actor"] = carol.Id, ["object"] = post.ObjectURI };
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", like);
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", new JsonObject { ["id"] = $"{Origin(carol)}/likes/{Guid.NewGuid():N}", ["type"] = "Like", ["actor"] = carol.Id, ["object"] = post.ObjectURI });
|
|
||||||
|
|
||||||
Assert.Equal(1, (await DB.Default.Find<Post>().OneAsync(post.ID, token)).FavouritesCount);
|
|
||||||
Assert.Equal(NotificationType.Favourite, (await DB.Default.Find<Notification>().Match(n => n.AvatarId == post.GroupUserId).ExecuteSingleAsync(token)).Type);
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(carol)}/undos/{Guid.NewGuid():N}", ["type"] = "Undo", ["actor"] = carol.Id, ["object"] = like
|
|
||||||
});
|
|
||||||
Assert.Equal(0, (await DB.Default.Find<Post>().OneAsync(post.ID, token)).FavouritesCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_stranger_cannot_like_a_followers_only_post()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, post) = await LocalPost("followersonly");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(mallory)}/likes/{Guid.NewGuid():N}", ["type"] = "Like", ["actor"] = mallory.Id, ["object"] = post.ObjectURI
|
|
||||||
});
|
|
||||||
|
|
||||||
Assert.Equal(0, (await DB.Default.Find<Post>().OneAsync(post.ID, token)).FavouritesCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_boost_of_a_local_post_counts_notifies_and_can_be_undone()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, post) = await LocalPost();
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
var announce = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(carol)}/announces/{Guid.NewGuid():N}", ["type"] = "Announce", ["actor"] = carol.Id, ["object"] = post.ObjectURI,
|
|
||||||
["to"] = new JsonArray(Addressing.Public), ["cc"] = new JsonArray(carol.Id + "/followers")
|
|
||||||
};
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", announce);
|
|
||||||
|
|
||||||
Assert.Equal(1, (await DB.Default.Find<Post>().OneAsync(post.ID, token)).ReblogsCount);
|
|
||||||
Assert.Equal(NotificationType.Reblog, (await DB.Default.Find<Notification>().Match(n => n.AvatarId == post.GroupUserId).ExecuteSingleAsync(token)).Type);
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(carol)}/undos/{Guid.NewGuid():N}", ["type"] = "Undo", ["actor"] = carol.Id, ["object"] = announce["id"]!.GetValue<string>()
|
|
||||||
});
|
|
||||||
Assert.Equal(0, (await DB.Default.Find<Post>().OneAsync(post.ID, token)).ReblogsCount);
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.ObjectURI == announce["id"]!.GetValue<string>()).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_followed_account_boosting_a_remote_post_puts_it_in_home()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
|
||||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
|
||||||
var dave = new RemoteActor(_harness.Peer, "dave");
|
|
||||||
var stranger = new RemoteActor(_harness.Peer, "stranger");
|
|
||||||
await _harness.Follows.Follow(bobRoot, new FollowForm { AvatarId = bob.Id, Target = carol.Id }, token);
|
|
||||||
await DB.Default.Update<Following>().Match(f => f.AvatarId == bob.Id).Modify(f => f.State, FollowState.Accepted).ExecuteAsync(token);
|
|
||||||
var noteId = $"{Origin(dave)}/notes/{Guid.NewGuid():N}";
|
|
||||||
_harness.Peer.Serve(new Uri(noteId).AbsolutePath, new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = noteId, ["type"] = "Note", ["attributedTo"] = dave.Id, ["content"] = "<p>worth sharing</p>", ["to"] = new JsonArray(Addressing.Public)
|
|
||||||
}.ToJsonString());
|
|
||||||
|
|
||||||
await _harness.Deliver(stranger, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(stranger)}/announces/{Guid.NewGuid():N}", ["type"] = "Announce", ["actor"] = stranger.Id, ["object"] = noteId,
|
|
||||||
["to"] = new JsonArray(Addressing.Public)
|
|
||||||
});
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.ObjectURI == noteId).ExecuteAnyAsync(token));
|
|
||||||
|
|
||||||
await _harness.Deliver(carol, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{Origin(carol)}/announces/{Guid.NewGuid():N}", ["type"] = "Announce", ["actor"] = carol.Id, ["object"] = noteId,
|
|
||||||
["to"] = new JsonArray(Addressing.Public)
|
|
||||||
});
|
|
||||||
|
|
||||||
var home = (List<ViewPost>)(await _harness.Timelines.Home(bobRoot, bob.Id, default, 20, token)).Data;
|
|
||||||
var boosted = Assert.Single(home);
|
|
||||||
Assert.Equal("<p>worth sharing</p>", boosted.ReblogOf.ContentHtml);
|
|
||||||
Assert.Equal(carol.Id, boosted.AuthorActorURI);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
public class NoteParserTests
|
|
||||||
{
|
|
||||||
const string MastodonNote = """
|
|
||||||
{
|
|
||||||
"id": "https://m.example/users/alice/statuses/1",
|
|
||||||
"type": "Note",
|
|
||||||
"summary": "spoilers",
|
|
||||||
"inReplyTo": "https://privapub.test/peasants/bob/posts/abc",
|
|
||||||
"published": "2026-09-30T10:00:00Z",
|
|
||||||
"url": "https://m.example/@alice/1",
|
|
||||||
"attributedTo": "https://m.example/users/alice",
|
|
||||||
"to": ["https://www.w3.org/ns/activitystreams#Public"],
|
|
||||||
"cc": ["https://m.example/users/alice/followers", "https://privapub.test/peasants/bob"],
|
|
||||||
"sensitive": true,
|
|
||||||
"conversation": "tag:m.example,2026-09-30:objectId=1:objectType=Conversation",
|
|
||||||
"context": "https://m.example/contexts/1",
|
|
||||||
"content": "<p><span class=\"h-card\"><a href=\"https://privapub.test/peasants/bob\" class=\"u-url mention\">@<span>bob</span></a></span> hi <a href=\"https://m.example/tags/Fedi\" class=\"mention hashtag\" rel=\"tag\">#<span>Fedi</span></a><script>x</script></p>",
|
|
||||||
"contentMap": { "en": "<p>hi</p>" },
|
|
||||||
"attachment": [{
|
|
||||||
"type": "Document", "mediaType": "image/png", "url": "https://files.m.example/a.png",
|
|
||||||
"name": "a cat", "blurhash": "UBL_:rOpGG-oBUNG,qRj2so|=eE1w^n4S5NH", "focalPoint": [0.5, -2.0], "width": 640, "height": 480
|
|
||||||
}],
|
|
||||||
"tag": [
|
|
||||||
{ "type": "Mention", "href": "https://privapub.test/peasants/bob", "name": "@bob@privapub.test" },
|
|
||||||
{ "type": "Hashtag", "href": "https://m.example/tags/fedi", "name": "#Fedi" },
|
|
||||||
{ "type": "Emoji", "name": ":blob:", "icon": { "type": "Image", "url": "https://files.m.example/blob.png" } }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
""";
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Reads_a_mastodon_note()
|
|
||||||
{
|
|
||||||
var note = NoteParser.Parse(JsonNode.Parse(MastodonNote));
|
|
||||||
|
|
||||||
Assert.Equal("https://m.example/users/alice", note.AttributedTo);
|
|
||||||
Assert.Equal("spoilers", note.SpoilerText);
|
|
||||||
Assert.True(note.Sensitive);
|
|
||||||
Assert.Equal("en", note.Language);
|
|
||||||
Assert.Equal("https://m.example/@alice/1", note.Url);
|
|
||||||
Assert.Equal("https://m.example/contexts/1", note.Context);
|
|
||||||
Assert.DoesNotContain("<script>", note.ContentHtml);
|
|
||||||
Assert.Contains("u-url mention", note.ContentHtml);
|
|
||||||
Assert.Equal("https://privapub.test/peasants/bob", Assert.Single(note.Mentions).ActorURI);
|
|
||||||
Assert.Equal("fedi", Assert.Single(note.Tags));
|
|
||||||
var media = Assert.Single(note.Attachments);
|
|
||||||
Assert.Equal("a cat", media.Description);
|
|
||||||
Assert.Equal(new[] { 0.5f, -1f }, media.Focus);
|
|
||||||
Assert.Equal(new DateTime(2026, 9, 30, 10, 0, 0, DateTimeKind.Utc), note.Published);
|
|
||||||
Assert.Null(note.Updated);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Reads_a_lemmy_page_with_a_title()
|
|
||||||
{
|
|
||||||
var note = NoteParser.Parse(JsonNode.Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://l.example/post/7", "type": "Page", "name": "A title",
|
|
||||||
"attributedTo": "https://l.example/u/carol", "audience": "https://l.example/c/cats",
|
|
||||||
"content": "<p>body</p>", "to": ["https://l.example/c/cats", "https://www.w3.org/ns/activitystreams#Public"],
|
|
||||||
"published": "2026-09-30T10:00:00.123456+00:00"
|
|
||||||
}
|
|
||||||
"""));
|
|
||||||
|
|
||||||
Assert.Equal("A title", note.Title);
|
|
||||||
Assert.Equal("https://l.example/c/cats", note.Audience);
|
|
||||||
Assert.False(note.Sensitive);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Falls_back_to_misskey_content_and_takes_the_person_from_a_peertube_attribution()
|
|
||||||
{
|
|
||||||
var note = NoteParser.Parse(JsonNode.Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://k.example/notes/9", "type": "Note",
|
|
||||||
"attributedTo": [{ "type": "Group", "id": "https://k.example/c/chan" }, { "type": "Person", "id": "https://k.example/users/9" }],
|
|
||||||
"_misskey_content": "hello <b>there</b>\nnext", "_misskey_quote": "https://k.example/notes/8"
|
|
||||||
}
|
|
||||||
"""));
|
|
||||||
|
|
||||||
Assert.Equal("https://k.example/users/9", note.AttributedTo);
|
|
||||||
Assert.Equal("hello <b>there</b><br>next", note.ContentHtml);
|
|
||||||
Assert.Equal("https://k.example/notes/8", note.QuoteUri);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("Article", false, false)]
|
|
||||||
[InlineData("Event", false, false)]
|
|
||||||
[InlineData("Video", false, false)]
|
|
||||||
[InlineData("Page", false, false)]
|
|
||||||
[InlineData("Note", false, true)]
|
|
||||||
[InlineData("Question", false, true)]
|
|
||||||
[InlineData("Article", true, true)]
|
|
||||||
public void A_summary_warns_only_on_notes_or_when_marked_sensitive(string type, bool sensitive, bool warns)
|
|
||||||
{
|
|
||||||
var note = NoteParser.Parse(JsonNode.Parse($$"""
|
|
||||||
{
|
|
||||||
"id": "https://w.example/?p=12", "type": "{{type}}", "name": "Twelve", "summary": "Saturday, 10:00 at the library",
|
|
||||||
"sensitive": {{(sensitive ? "true" : "false")}}, "attributedTo": "https://w.example/author", "content": "<p>body</p>"
|
|
||||||
}
|
|
||||||
"""));
|
|
||||||
|
|
||||||
Assert.Equal(warns, note.Sensitive);
|
|
||||||
Assert.Equal(warns ? "Saturday, 10:00 at the library" : null, note.SpoilerText);
|
|
||||||
Assert.Equal(warns ? null : "Saturday, 10:00 at the library", note.Excerpt);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("""{ "id": "https://x.example/1", "type": "Person" }""")]
|
|
||||||
[InlineData("""{ "id": "not a uri", "type": "Note" }""")]
|
|
||||||
[InlineData("""[1, 2]""")]
|
|
||||||
public void Refuses_what_is_not_a_note(string json) =>
|
|
||||||
Assert.Null(NoteParser.Parse(JsonNode.Parse(json)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AddressingTests
|
|
||||||
{
|
|
||||||
const string Followers = "https://m.example/users/alice/followers";
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(new[] { Addressing.Public }, new[] { Followers }, PostVisibility.Public)]
|
|
||||||
[InlineData(new[] { "as:Public" }, new string[0], PostVisibility.Public)]
|
|
||||||
[InlineData(new[] { Followers }, new[] { Addressing.Public }, PostVisibility.Unlisted)]
|
|
||||||
[InlineData(new[] { Followers }, new[] { "https://privapub.test/peasants/bob" }, PostVisibility.FollowersOnly)]
|
|
||||||
[InlineData(new[] { "https://privapub.test/peasants/bob" }, new string[0], PostVisibility.Direct)]
|
|
||||||
[InlineData(new[] { "https://m.example/users/mallory/followers" }, new string[0], PostVisibility.Direct)]
|
|
||||||
public void Classifies_like_mastodon(string[] to, string[] cc, PostVisibility expected) =>
|
|
||||||
Assert.Equal(expected, Addressing.Classify(to, cc, Followers));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
using PrivaPub.Api.Mastodon.Mappers;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
public class ObjectShapesTests
|
|
||||||
{
|
|
||||||
static NoteDocument Parse(string json) => NoteParser.Parse(JsonNode.Parse(json));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Keeps_a_peertube_video_with_its_files_poster_captions_and_markdown_description()
|
|
||||||
{
|
|
||||||
var note = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://tube.example/videos/watch/1", "type": "Video", "name": "A *talk*", "duration": "PT6299S",
|
|
||||||
"mediaType": "text/markdown", "content": "**Bold** words", "sensitive": false, "views": 14771, "state": 1,
|
|
||||||
"isLiveBroadcast": false, "commentsPolicy": 2, "downloadEnabled": true,
|
|
||||||
"licence": { "identifier": "5", "name": "Attribution - Share Alike" }, "category": { "identifier": "2", "name": "Films" },
|
|
||||||
"attributedTo": [{ "type": "Person", "id": "https://tube.example/accounts/ann" }, { "type": "Group", "id": "https://tube.example/video-channels/films" }],
|
|
||||||
"icon": [
|
|
||||||
{ "type": "Image", "url": "https://tube.example/thumb-280.jpg", "mediaType": "image/jpeg", "width": 280, "height": 157 },
|
|
||||||
{ "type": "Image", "url": "https://tube.example/thumb-1920.jpg", "mediaType": "image/jpeg", "width": 1920, "height": 1080 },
|
|
||||||
{ "type": "Image", "url": "https://tube.example/thumb-850.jpg", "mediaType": "image/jpeg", "width": 850, "height": 480 }
|
|
||||||
],
|
|
||||||
"subtitleLanguage": [{ "identifier": "en", "url": [{ "mediaType": "text/vtt", "href": "https://tube.example/en.vtt" }] }],
|
|
||||||
"url": [
|
|
||||||
{ "type": "Link", "mediaType": "text/html", "href": "https://tube.example/w/abc" },
|
|
||||||
{ "type": "Link", "mediaType": "video/mp4", "href": "https://tube.example/720.mp4", "height": 720, "width": 1280, "fps": 24, "size": 942586378,
|
|
||||||
"attachment": [{ "type": "PropertyValue", "name": "ffprobe_codec_type", "value": "audio" }, { "type": "PropertyValue", "name": "ffprobe_codec_type", "value": "video" }] },
|
|
||||||
{ "type": "Link", "mediaType": "application/x-mpegURL", "href": "https://tube.example/master.m3u8" },
|
|
||||||
{ "type": "Link", "mediaType": "application/x-bittorrent;x-scheme-handler/magnet", "href": "magnet:?xt=urn:btih:abc" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
Assert.Equal("https://tube.example/w/abc", note.Url);
|
|
||||||
Assert.Equal("A *talk*", note.Title);
|
|
||||||
Assert.Contains("<strong>Bold</strong>", note.ContentHtml);
|
|
||||||
Assert.Equal("https://tube.example/thumb-850.jpg", note.CoverURL);
|
|
||||||
Assert.Equal(6299, note.Video.DurationSeconds);
|
|
||||||
var file = Assert.Single(note.Video.Variants);
|
|
||||||
Assert.Equal(new[] { "audio", "video" }, file.Streams);
|
|
||||||
Assert.Equal(942586378, file.Size);
|
|
||||||
Assert.Equal("https://tube.example/master.m3u8", note.Video.PlaylistURL);
|
|
||||||
Assert.Equal(2, note.Video.CommentsPolicy);
|
|
||||||
Assert.Equal("Attribution - Share Alike", note.Video.Licence);
|
|
||||||
Assert.Equal("https://tube.example/video-channels/films", note.Video.ChannelURI);
|
|
||||||
Assert.Equal("https://tube.example/en.vtt", Assert.Single(note.Video.Captions).Url);
|
|
||||||
Assert.Equal("https://tube.example/accounts/ann", note.AttributedTo);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Keeps_a_mobilizon_event_with_its_time_place_and_online_link()
|
|
||||||
{
|
|
||||||
var note = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://events.example/events/9", "type": "Event", "name": "Repair café",
|
|
||||||
"summary": "<p>Saturday at the library</p>", "content": "<p>Bring broken things.</p>",
|
|
||||||
"startTime": "2026-10-03T10:00:00+02:00", "endTime": "2026-10-03T13:00:00+02:00", "timezone": "Europe/Rome",
|
|
||||||
"joinMode": "free", "participantCount": 12, "maximumAttendeeCapacity": 40, "ical:status": "CONFIRMED",
|
|
||||||
"location": { "type": "Place", "name": "Biblioteca", "latitude": 45.07, "longitude": 7.68,
|
|
||||||
"address": { "type": "PostalAddress", "streetAddress": "Via Roma 1", "addressLocality": "Torino", "addressCountry": "IT" } },
|
|
||||||
"attachment": [{ "type": "Link", "name": "Website", "href": "https://meet.example/repair" }],
|
|
||||||
"attributedTo": "https://events.example/@club"
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
Assert.Null(note.SpoilerText);
|
|
||||||
Assert.False(note.Sensitive);
|
|
||||||
Assert.Equal("Saturday at the library", note.Excerpt);
|
|
||||||
Assert.Equal(new DateTime(2026, 10, 3, 8, 0, 0, DateTimeKind.Utc), note.Event.Start);
|
|
||||||
Assert.Equal("Via Roma 1, Torino, IT", Assert.Single(note.Event.Places).Address);
|
|
||||||
Assert.Equal("https://meet.example/repair", note.Event.OnlineURL);
|
|
||||||
Assert.Equal(40, note.Event.Capacity);
|
|
||||||
Assert.Equal("CONFIRMED", note.Event.Status);
|
|
||||||
Assert.Equal("2026-10-03 10:00 – 13:00 (Europe/Rome) · Biblioteca", MastodonMapper.EventLine(note.Event));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Keeps_a_lemmy_link_post_as_a_link_with_its_thumbnail()
|
|
||||||
{
|
|
||||||
var note = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://lemmy.example/post/5", "type": "Page", "name": "A good read", "attributedTo": "https://lemmy.example/u/bo",
|
|
||||||
"attachment": [{ "type": "Link", "href": "https://news.example/story", "mediaType": "text/html" }],
|
|
||||||
"image": { "type": "Image", "url": "https://lemmy.example/pictrs/thumb.jpg" },
|
|
||||||
"language": { "identifier": "en", "name": "English" }
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
Assert.Equal("https://news.example/story", note.Link.Href);
|
|
||||||
Assert.Equal("https://lemmy.example/pictrs/thumb.jpg", note.Link.ImageURL);
|
|
||||||
Assert.False(note.Link.FromPublisher);
|
|
||||||
Assert.Empty(note.Attachments);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Takes_a_publisher_supplied_preview_from_a_link_attachment()
|
|
||||||
{
|
|
||||||
var note = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://m.example/statuses/1", "type": "Note", "attributedTo": "https://m.example/users/a", "content": "<p>look</p>",
|
|
||||||
"attachment": [{ "type": "Link", "href": "https://news.example/a",
|
|
||||||
"preview": { "type": "Article", "name": "Headline & more", "summary": "<p>What happened</p>", "image": { "type": "Image", "url": "https://news.example/a.jpg" } } }]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
Assert.Equal("Headline & more", note.Link.Title);
|
|
||||||
Assert.Equal("What happened", note.Link.Description);
|
|
||||||
Assert.Equal("https://news.example/a.jpg", note.Link.ImageURL);
|
|
||||||
Assert.True(note.Link.FromPublisher);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Reads_media_in_every_shape_and_infers_what_is_missing()
|
|
||||||
{
|
|
||||||
var note = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://bsky.brid.gy/convert/ap/at://did:plc:x/post/1", "type": "Note", "attributedTo": "https://bsky.brid.gy/ap/did:plc:x",
|
|
||||||
"content": "<p>pics</p>",
|
|
||||||
"@context": ["https://www.w3.org/ns/activitystreams", { "@language": "de" }],
|
|
||||||
"attachment": [
|
|
||||||
{ "type": "Image", "url": "https://cdn.example/a.jpeg", "summary": "alt from summary" },
|
|
||||||
{ "type": "Document", "url": [{ "type": "Link", "href": "https://cdn.example/clip", "mediaType": "video/mp4" }],
|
|
||||||
"icon": { "type": "Image", "url": "https://cdn.example/clip.jpg" }, "duration": "PT12.4S", "sensitive": true },
|
|
||||||
{ "type": "Image", "url": "https://cdn.example/nameless" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
Assert.Equal("de", note.Language);
|
|
||||||
Assert.Equal("image/jpeg", note.Attachments[0].ContentType);
|
|
||||||
Assert.Equal("alt from summary", note.Attachments[0].Description);
|
|
||||||
Assert.Equal("https://cdn.example/clip", note.Attachments[1].RemoteURL);
|
|
||||||
Assert.Equal("video/mp4", note.Attachments[1].ContentType);
|
|
||||||
Assert.Equal("https://cdn.example/clip.jpg", note.Attachments[1].RemotePreviewURL);
|
|
||||||
Assert.Equal(12.4, note.Attachments[1].DurationSeconds);
|
|
||||||
Assert.True(note.Attachments[1].Sensitive);
|
|
||||||
Assert.Equal("image/*", note.Attachments[2].ContentType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Keeps_a_funkwhale_track_and_a_loops_poster()
|
|
||||||
{
|
|
||||||
var track = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://music.example/federation/music/uploads/1", "type": "Audio", "name": "Song", "attributedTo": "https://music.example/@band",
|
|
||||||
"summary": "#rock #live", "duration": 241, "position": 3, "album": "https://music.example/albums/2", "license": "https://creativecommons.org/licenses/by/4.0/",
|
|
||||||
"url": [{ "type": "Link", "mediaType": "text/html", "href": "https://music.example/library/tracks/1" },
|
|
||||||
{ "type": "Link", "mediaType": "audio/mpeg", "href": "https://music.example/listen/1.mp3", "bitrate": 320000, "size": 9640000 }]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
var loop = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://loops.example/v/1", "type": "Note", "attributedTo": "https://loops.example/@dancer", "content": "",
|
|
||||||
"preview": { "type": "Image", "url": { "href": "https://loops.example/poster.jpg", "mediaType": "image/jpeg" } },
|
|
||||||
"attachment": [{ "type": "Document", "mediaType": "video/mp4", "url": "https://loops.example/v/1.mp4", "width": 720, "height": 1280 }]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
Assert.Equal("#rock #live", track.Excerpt);
|
|
||||||
Assert.Null(track.SpoilerText);
|
|
||||||
Assert.Equal(241, track.Audio.DurationSeconds);
|
|
||||||
Assert.Equal(3, track.Audio.Position);
|
|
||||||
Assert.Equal("https://music.example/listen/1.mp3", Assert.Single(track.Audio.Variants).Url);
|
|
||||||
Assert.Equal("https://loops.example/poster.jpg", loop.CoverURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Keeps_custom_emoji_and_drops_ones_that_could_not_render()
|
|
||||||
{
|
|
||||||
var note = Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://k.example/notes/1", "type": "Note", "attributedTo": "https://k.example/users/1", "content": ":blobcat: hi :bad:",
|
|
||||||
"tag": [
|
|
||||||
{ "type": "Emoji", "name": ":blobcat:", "updated": "2026-01-01T00:00:00Z", "icon": { "type": "Image", "mediaType": "image/png", "url": "https://k.example/emoji/blobcat.png" } },
|
|
||||||
{ "type": "Emoji", "name": ":blobcat:", "icon": { "type": "Image", "url": "https://k.example/emoji/duplicate.png" } },
|
|
||||||
{ "type": "Emoji", "name": ":bad name:", "icon": { "type": "Image", "url": "https://k.example/emoji/x.png" } },
|
|
||||||
{ "type": "Emoji", "name": ":nourl:", "icon": { "type": "Image", "url": "data:image/png;base64,AAAA" } }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
|
|
||||||
var emoji = Assert.Single(note.Emojis);
|
|
||||||
Assert.Equal("blobcat", emoji.Shortcode);
|
|
||||||
Assert.Equal("https://k.example/emoji/blobcat.png", emoji.URL);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Reads_polls_from_mastodon_misskey_and_closed_ones()
|
|
||||||
{
|
|
||||||
var mastodon = Parse("""
|
|
||||||
{ "id": "https://m.example/q/1", "type": "Question", "attributedTo": "https://m.example/u", "content": "?", "endTime": "2026-10-02T00:00:00Z", "votersCount": 7,
|
|
||||||
"oneOf": [{ "type": "Note", "name": "a", "replies": { "type": "Collection", "totalItems": 4 } }, { "type": "Note", "name": "b", "replies": { "type": "Collection", "totalItems": 3 } }] }
|
|
||||||
""");
|
|
||||||
var misskey = Parse("""
|
|
||||||
{ "id": "https://k.example/q/1", "type": "Question", "attributedTo": "https://k.example/u", "_misskey_content": "?",
|
|
||||||
"anyOf": [{ "type": "Note", "name": "x", "_misskey_votes": 2 }, { "type": "Note", "name": "y", "_misskey_votes": 5 }] }
|
|
||||||
""");
|
|
||||||
var closed = Parse("""
|
|
||||||
{ "id": "https://g.example/q/1", "type": "Question", "attributedTo": "https://g.example/u", "content": "?", "closed": "2026-09-30T12:00:00Z",
|
|
||||||
"oneOf": [{ "type": "Note", "name": "p" }, { "type": "Note", "name": "q" }] }
|
|
||||||
""");
|
|
||||||
|
|
||||||
Assert.False(mastodon.Poll.Multiple);
|
|
||||||
Assert.Equal(new[] { 4, 3 }, mastodon.Poll.Options.Select(o => o.Votes));
|
|
||||||
Assert.Equal(7, mastodon.Poll.VotersCount);
|
|
||||||
Assert.True(misskey.Poll.Multiple);
|
|
||||||
Assert.Equal(new[] { 2, 5 }, misskey.Poll.Options.Select(o => o.Votes));
|
|
||||||
Assert.Null(misskey.Poll.VotersCount);
|
|
||||||
Assert.Equal(new DateTime(2026, 9, 30, 12, 0, 0, DateTimeKind.Utc), closed.Poll.ClosedAt);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Normalises_hashtags_like_mastodon() =>
|
|
||||||
Assert.Equal("fedi".Normalize(System.Text.NormalizationForm.FormKC).ToLowerInvariant(), Assert.Single(Parse("""
|
|
||||||
{ "id": "https://x.example/1", "type": "Note", "attributedTo": "https://x.example/u", "content": "",
|
|
||||||
"tag": [{ "type": "Hashtag", "name": "#FEDI" }] }
|
|
||||||
""").Tags));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Domain.Statuses;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Jobs;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Models.Social;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class PollTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
static string Origin(RemoteActor actor) => new Uri(actor.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
|
|
||||||
static string NewId(RemoteActor actor, string kind) => $"{Origin(actor)}/{kind}/{Guid.NewGuid():N}";
|
|
||||||
|
|
||||||
async Task Follows(RemoteActor follower, string target) =>
|
|
||||||
await _harness.Deliver(follower, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(follower, "follows"), ["type"] = "Follow", ["actor"] = follower.Id, ["object"] = target
|
|
||||||
});
|
|
||||||
|
|
||||||
JsonObject Vote(RemoteActor voter, string question, string owner, string choice) => new()
|
|
||||||
{
|
|
||||||
["id"] = NewId(voter, "activities"), ["type"] = "Create", ["actor"] = voter.Id, ["to"] = new JsonArray(owner),
|
|
||||||
["object"] = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(voter, "votes"), ["type"] = "Note", ["name"] = choice, ["attributedTo"] = voter.Id,
|
|
||||||
["inReplyTo"] = question, ["to"] = new JsonArray(owner)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_local_poll_goes_out_as_a_question_and_counts_each_remote_voter_once()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
await Follows(mallory, alice.Uri);
|
|
||||||
|
|
||||||
var outcome = await _harness.Statuses.Publish(alice, new StatusDraft { Text = "which?", Poll = new PollDraft(new[] { "tea", "coffee" }, 3600, false, false) }, token);
|
|
||||||
Assert.True(outcome.Ok);
|
|
||||||
var question = (await _harness.Outgoing(mallory.Id + "/inbox")).Single(a => a["type"]!.GetValue<string>() == "Create")["object"]!;
|
|
||||||
Assert.Equal("Question", question["type"]!.GetValue<string>());
|
|
||||||
Assert.Equal(new[] { "tea", "coffee" }, question["oneOf"]!.AsArray().Select(o => o!["name"]!.GetValue<string>()));
|
|
||||||
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", Vote(mallory, outcome.Post.ObjectURI, alice.Uri, "coffee"));
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", Vote(mallory, outcome.Post.ObjectURI, alice.Uri, "tea"));
|
|
||||||
|
|
||||||
var poll = (await DB.Default.Find<Post>().OneAsync(outcome.Post.ID, token)).Poll;
|
|
||||||
Assert.Equal(new[] { 0, 1 }, poll.Options.Select(o => o.Votes));
|
|
||||||
Assert.Equal(1, poll.VotersCount);
|
|
||||||
Assert.False(await DB.Default.Find<Post>().Match(p => p.InReplyToURI == outcome.Post.ObjectURI).ExecuteAnyAsync(token));
|
|
||||||
Assert.True(await DB.Default.Find<Job>().Match(j => j.Kind == JobKind.PollRefresh && j.Payload == outcome.Post.ID).ExecuteAnyAsync(token));
|
|
||||||
Assert.True(await DB.Default.Find<Job>().Match(j => j.Kind == JobKind.PollClose && j.Payload == outcome.Post.ID).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_persona_votes_on_a_remote_poll_and_a_count_refresh_is_not_an_edit()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
var questionId = NewId(mallory, "questions");
|
|
||||||
JsonObject Question(int first, int second) => new()
|
|
||||||
{
|
|
||||||
["id"] = questionId, ["type"] = "Question", ["attributedTo"] = mallory.Id, ["content"] = "<p>pick</p>",
|
|
||||||
["to"] = new JsonArray(Addressing.Public), ["cc"] = new JsonArray(alice.Uri),
|
|
||||||
["tag"] = new JsonArray(new JsonObject { ["type"] = "Mention", ["href"] = alice.Uri, ["name"] = "@alice" }),
|
|
||||||
["endTime"] = DateTime.UtcNow.AddDays(1).ToString("O"),
|
|
||||||
["anyOf"] = new JsonArray(
|
|
||||||
new JsonObject { ["type"] = "Note", ["name"] = "red", ["replies"] = new JsonObject { ["type"] = "Collection", ["totalItems"] = first } },
|
|
||||||
new JsonObject { ["type"] = "Note", ["name"] = "blue", ["replies"] = new JsonObject { ["type"] = "Collection", ["totalItems"] = second } })
|
|
||||||
};
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(mallory, "activities"), ["type"] = "Create", ["actor"] = mallory.Id, ["object"] = Question(3, 1)
|
|
||||||
});
|
|
||||||
var post = await DB.Default.Find<Post>().Match(p => p.ObjectURI == questionId).ExecuteFirstAsync(token);
|
|
||||||
Assert.True(post.Poll.Multiple);
|
|
||||||
|
|
||||||
Assert.True((await _harness.Polls.Vote(alice, post, new[] { 0, 1 }, token)).Ok);
|
|
||||||
Assert.False((await _harness.Polls.Vote(alice, post, new[] { 0 }, token)).Ok);
|
|
||||||
|
|
||||||
var votes = (await _harness.Outgoing(mallory.Id + "/inbox")).Where(a => a["type"]!.GetValue<string>() == "Create").Select(a => a["object"]!).ToList();
|
|
||||||
Assert.Equal(new[] { "red", "blue" }, votes.Select(v => v["name"]!.GetValue<string>()).Order().Reverse());
|
|
||||||
Assert.All(votes, v => Assert.Equal(questionId, v["inReplyTo"]!.GetValue<string>()));
|
|
||||||
Assert.All(votes, v => Assert.Null(v["published"]));
|
|
||||||
Assert.Equal(new[] { 0, 1 }, (await _harness.Polls.OwnVotes(post.ID, alice.Id, token)).Order());
|
|
||||||
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = NewId(mallory, "activities"), ["type"] = "Update", ["actor"] = mallory.Id, ["object"] = Question(9, 5)
|
|
||||||
});
|
|
||||||
var refreshed = await DB.Default.Find<Post>().OneAsync(post.ID, token);
|
|
||||||
Assert.Equal(new[] { 9, 5 }, refreshed.Poll.Options.Select(o => o.Votes));
|
|
||||||
Assert.Empty(refreshed.Revisions);
|
|
||||||
Assert.Null(refreshed.EditedAt);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Closing_a_poll_tells_its_voters_and_its_author()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var (_, bob) = await _harness.Persona("bob");
|
|
||||||
var outcome = await _harness.Statuses.Publish(alice, new StatusDraft { Text = "quick", Poll = new PollDraft(new[] { "yes", "no" }, 300, false, false) }, token);
|
|
||||||
Assert.True((await _harness.Polls.Vote(bob, outcome.Post, new[] { 0 }, token)).Ok);
|
|
||||||
Assert.False((await _harness.Polls.Vote(alice, outcome.Post, new[] { 0 }, token)).Ok);
|
|
||||||
|
|
||||||
var job = await DB.Default.Find<Job>().Match(j => j.Kind == JobKind.PollClose && j.Payload == outcome.Post.ID).ExecuteFirstAsync(token);
|
|
||||||
await new PollCloseJob(_harness.Db, _harness.Local, _harness.Outbox).Handle(job, token);
|
|
||||||
|
|
||||||
Assert.NotNull((await DB.Default.Find<Post>().OneAsync(outcome.Post.ID, token)).Poll.ClosedAt);
|
|
||||||
var told = await DB.Default.Find<Notification>().Match(n => n.Type == NotificationType.Poll && n.PostId == outcome.Post.ID).ExecuteAsync(token);
|
|
||||||
Assert.Equal(new[] { alice.Id, bob.Id }.Order(), told.Select(n => n.AvatarId).Order());
|
|
||||||
Assert.False((await _harness.Polls.Vote(bob, await DB.Default.Find<Post>().OneAsync(outcome.Post.ID, token), new[] { 1 }, token)).Ok);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.Jobs;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class ProvenanceTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Harness _harness;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_harness = await Harness.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_harness != default)
|
|
||||||
await _harness.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_delivered_post_keeps_its_raw_object_how_it_came_and_every_edit()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (_, alice) = await _harness.Persona("alice");
|
|
||||||
var mallory = new RemoteActor(_harness.Peer, "mallory");
|
|
||||||
var origin = new Uri(mallory.Id).GetLeftPart(UriPartial.Authority);
|
|
||||||
var note = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{origin}/notes/{Guid.NewGuid():N}",
|
|
||||||
["type"] = "Note",
|
|
||||||
["attributedTo"] = mallory.Id,
|
|
||||||
["content"] = "<p>hi</p>",
|
|
||||||
["_misskey_quote"] = $"{origin}/notes/elsewhere",
|
|
||||||
["to"] = new JsonArray(Addressing.Public),
|
|
||||||
["cc"] = new JsonArray(alice.Uri),
|
|
||||||
["tag"] = new JsonArray(new JsonObject { ["type"] = "Mention", ["href"] = alice.Uri, ["name"] = "@alice" })
|
|
||||||
};
|
|
||||||
var create = new JsonObject { ["id"] = $"{origin}/activities/{Guid.NewGuid():N}", ["type"] = "Create", ["actor"] = mallory.Id, ["object"] = note.DeepClone() };
|
|
||||||
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", create);
|
|
||||||
var edited = note.DeepClone().AsObject();
|
|
||||||
edited["content"] = "<p>hi again</p>";
|
|
||||||
edited["updated"] = DateTime.UtcNow.ToString("O");
|
|
||||||
await _harness.Deliver(mallory, "/human-centipede", new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = $"{origin}/activities/{Guid.NewGuid():N}", ["type"] = "Update", ["actor"] = mallory.Id, ["object"] = edited
|
|
||||||
});
|
|
||||||
|
|
||||||
var record = await DB.Default.Find<ObjectRecord>().Match(r => r.ObjectURI == note["id"]!.GetValue<string>()).ExecuteFirstAsync(token);
|
|
||||||
Assert.NotNull(record);
|
|
||||||
Assert.Equal(ObjectPath.Delivered, record.Path);
|
|
||||||
Assert.False(record.Refetched);
|
|
||||||
Assert.Equal("shared", record.Inbox);
|
|
||||||
Assert.Equal(mallory.KeyId, record.KeyId);
|
|
||||||
Assert.Equal(create["id"]!.GetValue<string>(), record.ActivityId);
|
|
||||||
Assert.Contains("digest", record.SignedHeaders);
|
|
||||||
Assert.Equal("<p>hi</p>", JsonNode.Parse(record.Raw)!["content"]!.GetValue<string>());
|
|
||||||
Assert.Contains("legacy-quote", ObjectFeatures.Detect(JsonNode.Parse(record.Raw)!.AsObject()));
|
|
||||||
Assert.Equal("<p>hi again</p>", JsonNode.Parse(Assert.Single(record.Revisions).Raw)!["content"]!.GetValue<string>());
|
|
||||||
Assert.True(await DB.Default.Find<Job>().Match(j => j.Kind == JobKind.DescribeInstance && j.Payload == record.Host).ExecuteAnyAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void An_object_larger_than_the_cap_keeps_only_its_hash()
|
|
||||||
{
|
|
||||||
var big = new JsonObject { ["content"] = new string('x', ObjectRecords.MaxRawBytes + 1) };
|
|
||||||
|
|
||||||
var (text, hash, bytes, truncated) = ObjectRecords.Capture(big);
|
|
||||||
|
|
||||||
Assert.Null(text);
|
|
||||||
Assert.True(truncated);
|
|
||||||
Assert.True(bytes > ObjectRecords.MaxRawBytes);
|
|
||||||
Assert.Equal(64, hash.Length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,244 +0,0 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Models;
|
|
||||||
using PrivaPub.StaticServices;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class RemoteActorServiceTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Peer _peer;
|
|
||||||
RemoteActorService _service;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_peer = await Peer.Start();
|
|
||||||
var cache = new MemoryCache(new MemoryCacheOptions());
|
|
||||||
var local = new LocalActorService(new DbEntities(),
|
|
||||||
new StaticOptions<AppConfiguration>(new AppConfiguration { BackendBaseAddress = "https://privapub.test" }));
|
|
||||||
_service = new RemoteActorService(Peer.Http(cache), local, cache, new DbEntities());
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_peer != default)
|
|
||||||
await _peer.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
static string Actor(string id, string keyId = default, string owner = default, string pem = default, string type = "Person") =>
|
|
||||||
new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = id,
|
|
||||||
["type"] = type,
|
|
||||||
["preferredUsername"] = id[(id.LastIndexOf('/') + 1)..],
|
|
||||||
["inbox"] = id + "/inbox",
|
|
||||||
["publicKey"] = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = keyId ?? id + "#main-key",
|
|
||||||
["owner"] = owner ?? id,
|
|
||||||
["publicKeyPem"] = pem ?? Keys.NewKeyPair().PublicKeyPem
|
|
||||||
}
|
|
||||||
}.ToJsonString();
|
|
||||||
|
|
||||||
string Unique(string name) => $"/users/{name}{Guid.NewGuid():N}";
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Accepts_an_actor_whose_document_names_its_own_address()
|
|
||||||
{
|
|
||||||
var path = Unique("alice");
|
|
||||||
_peer.Serve(path, Actor("{A}" + path));
|
|
||||||
|
|
||||||
var actor = await _service.GetActorByKeyId($"{_peer.A}{path}#main-key", refresh: false, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.NotNull(actor);
|
|
||||||
Assert.Equal(_peer.A + path, actor.ActorURI);
|
|
||||||
Assert.Equal($"{_peer.A}{path}#main-key", actor.PublicKeyId);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_a_document_that_claims_another_origin()
|
|
||||||
{
|
|
||||||
var victim = Unique("bob");
|
|
||||||
var mallory = Unique("mallory");
|
|
||||||
_peer.Serve(mallory, Actor("{B}" + victim));
|
|
||||||
|
|
||||||
var actor = await _service.GetActor(_peer.A + mallory, refresh: false, TestContext.Current.CancellationToken);
|
|
||||||
var byKey = await _service.GetActorByKeyId($"{_peer.B}{victim}#main-key", refresh: false, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.Null(actor);
|
|
||||||
Assert.Null(byKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_a_key_owned_by_someone_else()
|
|
||||||
{
|
|
||||||
var eve = Unique("eve");
|
|
||||||
_peer.Serve(eve, Actor("{A}" + eve, owner: "{A}/users/alice"));
|
|
||||||
|
|
||||||
Assert.Null(await _service.GetActorByKeyId($"{_peer.A}{eve}#main-key", refresh: false, TestContext.Current.CancellationToken));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_a_key_document_whose_owner_is_on_another_origin()
|
|
||||||
{
|
|
||||||
var alice = Unique("alice");
|
|
||||||
var key = $"/keys/{Guid.NewGuid():N}";
|
|
||||||
_peer.Serve(alice, Actor("{B}" + alice));
|
|
||||||
_peer.Serve(key, new JsonObject { ["id"] = "{A}" + key, ["owner"] = "{B}" + alice, ["publicKeyPem"] = Keys.NewKeyPair().PublicKeyPem }.ToJsonString());
|
|
||||||
|
|
||||||
Assert.Null(await _service.GetActorByKeyId(_peer.A + key, refresh: false, TestContext.Current.CancellationToken));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_a_key_the_actor_does_not_list()
|
|
||||||
{
|
|
||||||
var alice = Unique("alice");
|
|
||||||
_peer.Serve(alice, Actor("{A}" + alice));
|
|
||||||
|
|
||||||
Assert.Null(await _service.GetActorByKeyId($"{_peer.A}{alice}#other-key", refresh: false, TestContext.Current.CancellationToken));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Follows_a_same_origin_alias_to_the_actor_it_names()
|
|
||||||
{
|
|
||||||
var alice = Unique("alice");
|
|
||||||
var alias = $"/@alias{Guid.NewGuid():N}";
|
|
||||||
_peer.Serve(alice, Actor("{A}" + alice));
|
|
||||||
_peer.Serve(alias, Actor("{A}" + alice));
|
|
||||||
|
|
||||||
var actor = await _service.GetActor(_peer.A + alias, refresh: false, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.NotNull(actor);
|
|
||||||
Assert.Equal(_peer.A + alice, actor.ActorURI);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Resolves_a_gotosocial_style_key_address()
|
|
||||||
{
|
|
||||||
var gts = Unique("gts");
|
|
||||||
var keyPath = gts + "/main-key";
|
|
||||||
var pem = Keys.NewKeyPair().PublicKeyPem;
|
|
||||||
_peer.Serve(gts, Actor("{A}" + gts, keyId: "{A}" + keyPath, pem: pem));
|
|
||||||
_peer.Serve(keyPath, Actor("{A}" + gts, keyId: "{A}" + keyPath, pem: pem));
|
|
||||||
|
|
||||||
var actor = await _service.GetActorByKeyId(_peer.A + keyPath, refresh: false, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.NotNull(actor);
|
|
||||||
Assert.Equal(_peer.A + gts, actor.ActorURI);
|
|
||||||
Assert.Equal(pem, actor.PublicKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_rotated_key_replaces_the_stored_one_but_only_once_per_interval()
|
|
||||||
{
|
|
||||||
var alice = Unique("alice");
|
|
||||||
var keyId = $"{_peer.A}{alice}#main-key";
|
|
||||||
var first = Keys.NewKeyPair().PublicKeyPem;
|
|
||||||
var second = Keys.NewKeyPair().PublicKeyPem;
|
|
||||||
var third = Keys.NewKeyPair().PublicKeyPem;
|
|
||||||
_peer.Serve(alice, Actor("{A}" + alice, pem: first));
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
|
|
||||||
Assert.Equal(first, (await _service.GetActorByKeyId(keyId, refresh: false, token)).PublicKey);
|
|
||||||
_peer.Serve(alice, Actor("{A}" + alice, pem: second));
|
|
||||||
Assert.Equal(first, (await _service.GetActorByKeyId(keyId, refresh: true, token)).PublicKey);
|
|
||||||
|
|
||||||
var fresh = new RemoteActorService(Peer.Http(), new LocalActorService(new DbEntities(),
|
|
||||||
new StaticOptions<AppConfiguration>(new AppConfiguration { BackendBaseAddress = "https://privapub.test" })),
|
|
||||||
new MemoryCache(new MemoryCacheOptions()), new DbEntities());
|
|
||||||
Assert.Equal(second, (await fresh.GetActorByKeyId(keyId, refresh: true, token)).PublicKey);
|
|
||||||
_peer.Serve(alice, Actor("{A}" + alice, pem: third));
|
|
||||||
Assert.Equal(second, (await fresh.GetActorByKeyId(keyId, refresh: true, token)).PublicKey);
|
|
||||||
Assert.Single(await new DbEntities().ForeignAvatars.Match(a => a.ActorURI == _peer.A + alice).ExecuteAsync(token));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Signs_every_fetch()
|
|
||||||
{
|
|
||||||
var alice = Unique("alice");
|
|
||||||
_peer.Serve(alice, Actor("{A}" + alice));
|
|
||||||
|
|
||||||
await _service.GetActor(_peer.A + alice, refresh: false, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
var request = Assert.Single(_peer.Requests, r => r.Path == alice);
|
|
||||||
Assert.Contains("keyId=\"https://privapub.test/peasants/privapub#main-key\"", request.Signature);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ActorDocumentTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public void Reads_a_mastodon_actor()
|
|
||||||
{
|
|
||||||
var document = ActorDocument.Parse(JsonDocument.Parse("""
|
|
||||||
{
|
|
||||||
"@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"],
|
|
||||||
"id": "https://mastodon.example/users/alice",
|
|
||||||
"type": "Person",
|
|
||||||
"preferredUsername": "alice",
|
|
||||||
"name": "Alice",
|
|
||||||
"inbox": "https://mastodon.example/users/alice/inbox",
|
|
||||||
"outbox": "https://mastodon.example/users/alice/outbox",
|
|
||||||
"url": "https://mastodon.example/@alice",
|
|
||||||
"discoverable": false,
|
|
||||||
"endpoints": { "sharedInbox": "https://mastodon.example/inbox" },
|
|
||||||
"icon": { "type": "Image", "url": "https://files.mastodon.example/a.png" },
|
|
||||||
"publicKey": {
|
|
||||||
"id": "https://mastodon.example/users/alice#main-key",
|
|
||||||
"owner": "https://mastodon.example/users/alice",
|
|
||||||
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIB\n-----END PUBLIC KEY-----\n"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
""").RootElement);
|
|
||||||
|
|
||||||
Assert.Equal("alice", document.PreferredUsername);
|
|
||||||
Assert.Equal("https://mastodon.example/inbox", document.SharedInbox);
|
|
||||||
Assert.Equal("https://files.mastodon.example/a.png", document.Icon);
|
|
||||||
Assert.False(document.Discoverable);
|
|
||||||
Assert.NotNull(document.Key("https://mastodon.example/users/alice#main-key"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Keeps_only_keys_owned_by_the_actor_on_its_origin()
|
|
||||||
{
|
|
||||||
var document = ActorDocument.Parse(JsonDocument.Parse("""
|
|
||||||
{
|
|
||||||
"id": "https://a.example/users/alice",
|
|
||||||
"type": "Person",
|
|
||||||
"publicKey": [
|
|
||||||
{ "id": "https://a.example/users/alice#main-key", "owner": "https://a.example/users/alice", "publicKeyPem": "x" },
|
|
||||||
{ "id": "https://b.example/keys/1", "owner": "https://a.example/users/alice", "publicKeyPem": "y" },
|
|
||||||
{ "id": "https://a.example/users/alice#other", "owner": "https://a.example/users/bob", "publicKeyPem": "z" },
|
|
||||||
{ "id": "https://a.example/users/alice#unowned", "publicKeyPem": "w" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
""").RootElement);
|
|
||||||
|
|
||||||
Assert.Equal("https://a.example/users/alice#main-key", Assert.Single(document.Keys).Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Refuses_an_inbox_on_another_origin()
|
|
||||||
{
|
|
||||||
var document = ActorDocument.Parse(JsonDocument.Parse("""
|
|
||||||
{ "id": "https://a.example/users/alice", "type": "Person", "inbox": "https://b.example/inbox" }
|
|
||||||
""").RootElement);
|
|
||||||
|
|
||||||
Assert.Null(document.Inbox);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("Note")]
|
|
||||||
[InlineData("Tombstone")]
|
|
||||||
[InlineData("Collection")]
|
|
||||||
public void Refuses_non_actor_types(string type) =>
|
|
||||||
Assert.Null(ActorDocument.Parse(JsonDocument.Parse($$"""{ "id": "https://a.example/x", "type": "{{type}}" }""").RootElement));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Federation.Rendering;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Federation
|
|
||||||
{
|
|
||||||
public class RendererTests
|
|
||||||
{
|
|
||||||
static readonly LocalActor Alice = new()
|
|
||||||
{
|
|
||||||
Id = "a1",
|
|
||||||
Kind = LocalActorKind.Person,
|
|
||||||
UserName = "alice",
|
|
||||||
Name = "Alice",
|
|
||||||
Summary = "I **like** <b>cats</b>",
|
|
||||||
PublicKeyPem = Keys.NewKeyPair().PublicKeyPem,
|
|
||||||
Published = new DateTime(2026, 9, 30, 17, 45, 12, DateTimeKind.Utc),
|
|
||||||
Fields = new Dictionary<string, string> { ["site"] = "https://alice.example", ["mood"] = "<i>ok</i>" },
|
|
||||||
BaseAddress = "https://privapub.test"
|
|
||||||
};
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void An_actor_looks_like_a_mastodon_actor_with_our_route_names()
|
|
||||||
{
|
|
||||||
var actor = ActivityPubRenderer.Actor(Alice);
|
|
||||||
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice", actor["id"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/@alice", actor["url"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice/mouth", actor["inbox"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice/anus", actor["outbox"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice/groupies", actor["followers"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice/stalking", actor["following"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/human-centipede", actor["endpoints"]!["sharedInbox"]!.GetValue<string>());
|
|
||||||
Assert.Equal("2026-09-30T00:00:00Z", actor["published"]!.GetValue<string>());
|
|
||||||
Assert.Equal("alice@privapub.test", actor["webfinger"]!.GetValue<string>());
|
|
||||||
Assert.False(actor["indexable"]!.GetValue<bool>());
|
|
||||||
Assert.Equal("<p>I <strong>like</strong> <b>cats</b></p>", actor["summary"]!.GetValue<string>());
|
|
||||||
var fields = actor["attachment"]!.AsArray();
|
|
||||||
Assert.Contains("rel=\"nofollow noopener noreferrer me\"", fields[0]!["value"]!.GetValue<string>());
|
|
||||||
Assert.Equal("<i>ok</i>", fields[1]!["value"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice#main-key", actor["publicKey"]!["id"]!.GetValue<string>());
|
|
||||||
Assert.Equal(actor["id"]!.GetValue<string>(), actor["publicKey"]!["owner"]!.GetValue<string>());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_titled_post_with_a_warning_keeps_the_title_visible_on_mastodon()
|
|
||||||
{
|
|
||||||
var post = new Post
|
|
||||||
{
|
|
||||||
ID = "p1",
|
|
||||||
Title = "On <cats>",
|
|
||||||
ContentHtml = "<p>body</p>",
|
|
||||||
HasContentWarning = true,
|
|
||||||
Language = "en",
|
|
||||||
Mentions = new() { new PostMention { ActorURI = "https://m.example/users/bob", Handle = "@bob@m.example" } },
|
|
||||||
Tags = new() { "cats" },
|
|
||||||
CreationDate = new DateTime(2026, 9, 30, 17, 45, 12, 345, DateTimeKind.Utc)
|
|
||||||
};
|
|
||||||
|
|
||||||
var note = ActivityPubRenderer.Note(post, Alice, default, "https://m.example/users/bob/statuses/1");
|
|
||||||
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice/scribbles/p1", note["id"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/@alice/p1", note["url"]!.GetValue<string>());
|
|
||||||
Assert.Equal("<p><strong>On <cats></strong></p><p>body</p>", note["content"]!.GetValue<string>());
|
|
||||||
Assert.Equal("On <cats>", note["summary"]!.GetValue<string>());
|
|
||||||
Assert.True(note["sensitive"]!.GetValue<bool>());
|
|
||||||
Assert.Equal("2026-09-30T17:45:12.345Z", note["published"]!.GetValue<string>());
|
|
||||||
Assert.Equal(new[] { ActivityPubRenderer.Public }, note["to"]!.AsArray().Select(n => n!.GetValue<string>()));
|
|
||||||
Assert.Equal(new[] { Alice.Followers, "https://m.example/users/bob" }, note["cc"]!.AsArray().Select(n => n!.GetValue<string>()));
|
|
||||||
var tags = note["tag"]!.AsArray();
|
|
||||||
Assert.Equal("@bob@m.example", tags[0]!["name"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://privapub.test/tags/cats", tags[1]!["href"]!.GetValue<string>());
|
|
||||||
Assert.Equal("https://m.example/users/bob/statuses/1", note["inReplyTo"]!.GetValue<string>());
|
|
||||||
Assert.NotNull(note["contentMap"]!["en"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_warning_without_a_title_or_spoiler_gets_a_generic_summary()
|
|
||||||
{
|
|
||||||
var note = ActivityPubRenderer.Note(new Post { ID = "p2", ContentHtml = "<p>x</p>", HasContentWarning = true }, Alice, default, default);
|
|
||||||
|
|
||||||
Assert.Equal(ActivityPubRenderer.ContentWarning, note["summary"]!.GetValue<string>());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_direct_note_is_addressed_to_its_recipients_only()
|
|
||||||
{
|
|
||||||
var post = new Post { ID = "p3", ContentHtml = "<p>psst</p>", Visibility = PostVisibility.Direct };
|
|
||||||
|
|
||||||
var note = ActivityPubRenderer.DirectNote(post, Alice, new[] { ("https://m.example/users/bob", "bob@m.example") },
|
|
||||||
Alice.ConversationUri("c1"));
|
|
||||||
|
|
||||||
Assert.Equal(new[] { "https://m.example/users/bob" }, note["to"]!.AsArray().Select(n => n!.GetValue<string>()));
|
|
||||||
Assert.Empty(note["cc"]!.AsArray());
|
|
||||||
Assert.Equal("https://privapub.test/peasants/alice/whispers/c1", note["context"]!.GetValue<string>());
|
|
||||||
Assert.StartsWith("<p><span class=\"h-card\"", note["content"]!.GetValue<string>());
|
|
||||||
Assert.Equal("Mention", note["tag"]![0]!["type"]!.GetValue<string>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Moderation;
|
|
||||||
using PrivaPub.Infrastructure.Http;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Infrastructure
|
|
||||||
{
|
|
||||||
public sealed class FederationHttpTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
WebApplication _peer;
|
|
||||||
string _base;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
var builder = WebApplication.CreateSlimBuilder();
|
|
||||||
builder.WebHost.UseUrls("http://127.0.0.1:0");
|
|
||||||
_peer = builder.Build();
|
|
||||||
_peer.MapGet("/actor", () => Results.Text("{\"id\":\"x\"}", "application/activity+json"));
|
|
||||||
_peer.MapGet("/html", () => Results.Text("<html></html>", "text/html"));
|
|
||||||
_peer.MapGet("/big", () => Results.Text("{\"a\":\"" + new string('a', FederationHttp.MaxResponseBytes) + "\"}", "application/activity+json"));
|
|
||||||
_peer.MapGet("/hop/{n:int}", (int n) => Results.Redirect(n == 0 ? "/actor" : $"/hop/{n - 1}"));
|
|
||||||
_peer.MapGet("/gone", () => Results.StatusCode(410));
|
|
||||||
await _peer.StartAsync();
|
|
||||||
_base = _peer.Urls.First();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync() => await _peer.DisposeAsync();
|
|
||||||
|
|
||||||
static FederationHttp Client(bool allowTestNetwork = true)
|
|
||||||
{
|
|
||||||
var options = new FederationOptions { AllowPrivateNetworks = allowTestNetwork, AllowPlainHttp = allowTestNetwork };
|
|
||||||
var services = new ServiceCollection();
|
|
||||||
services.AddHttpClient(FederationHttp.ClientName)
|
|
||||||
.ConfigurePrimaryHttpMessageHandler(() => SafeHttpHandlerFactory.Create(options));
|
|
||||||
var provider = services.BuildServiceProvider();
|
|
||||||
return new FederationHttp(provider.GetRequiredService<IHttpClientFactory>(), new MemoryCache(new MemoryCacheOptions()),
|
|
||||||
new StaticOptionsMonitor(options), new StaticBlocks(), NullLogger<FederationHttp>.Instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Reads_a_json_document()
|
|
||||||
{
|
|
||||||
using var fetched = await Client().GetJson($"{_base}/actor", "application/activity+json", default, TestContext.Current.CancellationToken);
|
|
||||||
Assert.NotNull(fetched);
|
|
||||||
Assert.Equal("x", fetched.Root.GetProperty("id").GetString());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Follows_up_to_three_redirects_and_reports_the_final_url()
|
|
||||||
{
|
|
||||||
using var fetched = await Client().GetJson($"{_base}/hop/2", "application/activity+json", default, TestContext.Current.CancellationToken);
|
|
||||||
Assert.NotNull(fetched);
|
|
||||||
Assert.Equal($"{_base}/actor", fetched.FinalUri.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_a_fourth_redirect() =>
|
|
||||||
Assert.Null(await Client().GetJson($"{_base}/hop/3", "application/activity+json", default, TestContext.Current.CancellationToken));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_html() =>
|
|
||||||
Assert.Null(await Client().GetJson($"{_base}/html", "application/activity+json", default, TestContext.Current.CancellationToken));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_a_body_over_the_limit() =>
|
|
||||||
Assert.Null(await Client().GetJson($"{_base}/big", "application/activity+json", default, TestContext.Current.CancellationToken));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_an_error_status() =>
|
|
||||||
Assert.Null(await Client().GetJson($"{_base}/gone", "application/activity+json", default, TestContext.Current.CancellationToken));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Refuses_a_private_network_in_production_mode() =>
|
|
||||||
Assert.Null(await Client(allowTestNetwork: false).GetJson($"{_base}/actor", "application/activity+json", default, TestContext.Current.CancellationToken));
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("https://mastodon.social/users/Gargron", true)]
|
|
||||||
[InlineData("http://mastodon.social/users/Gargron", false)]
|
|
||||||
[InlineData("https://user:pass@mastodon.social/", false)]
|
|
||||||
[InlineData("https://localhost/", false)]
|
|
||||||
[InlineData("https://printer.local/", false)]
|
|
||||||
[InlineData("https://metadata.google.internal/", false)]
|
|
||||||
[InlineData("https://127.0.0.1/", false)]
|
|
||||||
[InlineData("https://[::1]/", false)]
|
|
||||||
[InlineData("ftp://example.org/", false)]
|
|
||||||
public void IsAllowed_takes_https_dns_names_only(string url, bool allowed) =>
|
|
||||||
Assert.Equal(allowed, Client(allowTestNetwork: false).IsAllowed(new Uri(url)));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void IsAllowed_refuses_a_suspended_domain_and_its_subdomains()
|
|
||||||
{
|
|
||||||
var http = new FederationHttp(new ServiceCollection().AddHttpClient().BuildServiceProvider().GetRequiredService<IHttpClientFactory>(),
|
|
||||||
new MemoryCache(new MemoryCacheOptions()), new StaticOptionsMonitor(new FederationOptions()), new StaticBlocks("evil.example"),
|
|
||||||
NullLogger<FederationHttp>.Instance);
|
|
||||||
|
|
||||||
Assert.False(http.IsAllowed(new Uri("https://evil.example/users/x")));
|
|
||||||
Assert.False(http.IsAllowed(new Uri("https://cdn.evil.example/a.png")));
|
|
||||||
Assert.True(http.IsAllowed(new Uri("https://notevil.example/users/x")));
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class StaticBlocks : IDomainBlocks
|
|
||||||
{
|
|
||||||
readonly string[] _suspended;
|
|
||||||
public StaticBlocks(params string[] suspended) => _suspended = suspended;
|
|
||||||
public DomainBlock Find(string host) => _suspended.Any(s => host == s || host.EndsWith("." + s))
|
|
||||||
? new DomainBlock { Domain = host, Severity = DomainBlockSeverity.Suspend }
|
|
||||||
: default;
|
|
||||||
public bool IsSuspended(string host) => Find(host) != default;
|
|
||||||
public Task Reload(CancellationToken token) => Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class StaticOptionsMonitor : IOptionsMonitor<FederationOptions>
|
|
||||||
{
|
|
||||||
public StaticOptionsMonitor(FederationOptions value) => CurrentValue = value;
|
|
||||||
public FederationOptions CurrentValue { get; }
|
|
||||||
public FederationOptions Get(string name) => CurrentValue;
|
|
||||||
public IDisposable OnChange(Action<FederationOptions, string> listener) => default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
using MongoDB.Driver;
|
|
||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Infrastructure.Data;
|
|
||||||
using PrivaPub.Infrastructure.Data.Migrations;
|
|
||||||
using PrivaPub.Models;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.User;
|
|
||||||
using PrivaPub.StaticServices;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Infrastructure
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public class IndexTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public async Task Duplicates_are_removed_and_the_unique_indexes_then_hold()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
await DB.Default.Index<ForeignAvatar>().DropAllAsync(token);
|
|
||||||
await DB.Default.Index<Follower>().DropAllAsync(token);
|
|
||||||
var actorUri = $"https://r.example/users/{Guid.NewGuid():N}";
|
|
||||||
var localId = Guid.NewGuid().ToString("N")[..24];
|
|
||||||
await DB.Default.SaveAsync(new[]
|
|
||||||
{
|
|
||||||
new ForeignAvatar { ActorURI = actorUri, Name = "old", UpdatedAt = DateTime.UtcNow.AddDays(-2) },
|
|
||||||
new ForeignAvatar { ActorURI = actorUri, Name = "new", UpdatedAt = DateTime.UtcNow }
|
|
||||||
}, token);
|
|
||||||
await DB.Default.SaveAsync(new[]
|
|
||||||
{
|
|
||||||
new Follower { LocalActorId = localId, ActorURI = actorUri, IsAccepted = false },
|
|
||||||
new Follower { LocalActorId = localId, ActorURI = actorUri, IsAccepted = true }
|
|
||||||
}, token);
|
|
||||||
|
|
||||||
await new _001_deduplicate_before_unique_indexes().UpgradeAsync();
|
|
||||||
await Indexes.Create(token);
|
|
||||||
|
|
||||||
Assert.Equal("new", (await DB.Default.Find<ForeignAvatar>().Match(a => a.ActorURI == actorUri).ExecuteSingleAsync(token)).Name);
|
|
||||||
Assert.True((await DB.Default.Find<Follower>().Match(f => f.LocalActorId == localId).ExecuteSingleAsync(token)).IsAccepted);
|
|
||||||
var duplicate = await Assert.ThrowsAsync<MongoWriteException>(async () =>
|
|
||||||
await DB.Default.SaveAsync(new ForeignAvatar { ActorURI = actorUri }, token));
|
|
||||||
Assert.Equal(ServerErrorCategory.DuplicateKey, duplicate.WriteError.Category);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_username_is_reserved_once_across_personas_and_groups()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var local = new LocalActorService(new DbEntities(), new StaticOptions<AppConfiguration>(new AppConfiguration { BackendBaseAddress = "https://privapub.test" }));
|
|
||||||
var name = $"n{Guid.NewGuid():N}"[..20];
|
|
||||||
|
|
||||||
Assert.True(await local.TryReserveUserName(name, LocalActorKind.Person, "a", token));
|
|
||||||
Assert.False(await local.TryReserveUserName(name.ToUpperInvariant(), LocalActorKind.Group, "b", token));
|
|
||||||
Assert.True(await local.IsUserNameTaken(name, token));
|
|
||||||
Assert.False(await local.TryReserveUserName("admin", LocalActorKind.Person, "c", token));
|
|
||||||
Assert.False(await local.TryReserveUserName(LocalActorService.InstanceUserName, LocalActorKind.Person, "c", token));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
using System.Net;
|
|
||||||
|
|
||||||
using PrivaPub.Infrastructure.Http;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Infrastructure
|
|
||||||
{
|
|
||||||
public class IpRangeGuardTests
|
|
||||||
{
|
|
||||||
[Theory]
|
|
||||||
[InlineData("1.1.1.1")]
|
|
||||||
[InlineData("8.8.8.8")]
|
|
||||||
[InlineData("93.184.215.14")]
|
|
||||||
[InlineData("172.15.255.255")]
|
|
||||||
[InlineData("172.32.0.1")]
|
|
||||||
[InlineData("100.63.255.255")]
|
|
||||||
[InlineData("100.128.0.0")]
|
|
||||||
[InlineData("2a01:4f8::1")]
|
|
||||||
[InlineData("2606:4700:4700::1111")]
|
|
||||||
[InlineData("::ffff:1.1.1.1")]
|
|
||||||
public void Public_addresses_are_allowed(string address) =>
|
|
||||||
Assert.True(IpRangeGuard.IsPublic(IPAddress.Parse(address)));
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("0.0.0.0")]
|
|
||||||
[InlineData("10.1.2.3")]
|
|
||||||
[InlineData("100.64.0.1")]
|
|
||||||
[InlineData("100.127.255.255")]
|
|
||||||
[InlineData("127.0.0.1")]
|
|
||||||
[InlineData("127.255.255.254")]
|
|
||||||
[InlineData("169.254.169.254")]
|
|
||||||
[InlineData("172.16.0.1")]
|
|
||||||
[InlineData("172.31.255.255")]
|
|
||||||
[InlineData("192.0.0.170")]
|
|
||||||
[InlineData("192.0.2.1")]
|
|
||||||
[InlineData("192.88.99.1")]
|
|
||||||
[InlineData("192.168.1.1")]
|
|
||||||
[InlineData("198.18.0.1")]
|
|
||||||
[InlineData("198.51.100.7")]
|
|
||||||
[InlineData("203.0.113.9")]
|
|
||||||
[InlineData("224.0.0.251")]
|
|
||||||
[InlineData("239.255.255.250")]
|
|
||||||
[InlineData("240.0.0.1")]
|
|
||||||
[InlineData("255.255.255.255")]
|
|
||||||
[InlineData("::")]
|
|
||||||
[InlineData("::1")]
|
|
||||||
[InlineData("::127.0.0.1")]
|
|
||||||
[InlineData("::ffff:127.0.0.1")]
|
|
||||||
[InlineData("::ffff:10.0.0.1")]
|
|
||||||
[InlineData("::ffff:169.254.169.254")]
|
|
||||||
[InlineData("64:ff9b::7f00:1")]
|
|
||||||
[InlineData("64:ff9b::808:808")]
|
|
||||||
[InlineData("64:ff9b:1::1")]
|
|
||||||
[InlineData("100::1")]
|
|
||||||
[InlineData("2001::1")]
|
|
||||||
[InlineData("2001:0:4136:e378:8000:63bf:3fff:fdd2")]
|
|
||||||
[InlineData("2001:db8::1")]
|
|
||||||
[InlineData("2001:10::1")]
|
|
||||||
[InlineData("2002:7f00:1::1")]
|
|
||||||
[InlineData("2002:c0a8:101::1")]
|
|
||||||
[InlineData("3fff::1")]
|
|
||||||
[InlineData("fc00::1")]
|
|
||||||
[InlineData("fd12:3456:789a::1")]
|
|
||||||
[InlineData("fe80::1")]
|
|
||||||
[InlineData("fec0::1")]
|
|
||||||
[InlineData("ff02::1")]
|
|
||||||
public void Private_and_special_addresses_are_refused(string address) =>
|
|
||||||
Assert.False(IpRangeGuard.IsPublic(IPAddress.Parse(address)));
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Connect_refuses_a_name_that_resolves_to_loopback()
|
|
||||||
{
|
|
||||||
await Assert.ThrowsAsync<BlockedDestinationException>(async () =>
|
|
||||||
await SafeHttpHandlerFactory.Connect(new DnsEndPoint("localhost", 443), allowPrivateNetworks: false, TestContext.Current.CancellationToken));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("127.0.0.1")]
|
|
||||||
[InlineData("[::1]")]
|
|
||||||
[InlineData("169.254.169.254")]
|
|
||||||
public async Task Connect_refuses_a_private_literal(string host)
|
|
||||||
{
|
|
||||||
await Assert.ThrowsAsync<BlockedDestinationException>(async () =>
|
|
||||||
await SafeHttpHandlerFactory.Connect(new DnsEndPoint(host, 443), allowPrivateNetworks: false, TestContext.Current.CancellationToken));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
|
||||||
|
|
||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Federation.Outbox;
|
|
||||||
using PrivaPub.Infrastructure.Jobs;
|
|
||||||
using PrivaPub.Models;
|
|
||||||
using PrivaPub.Models.Jobs;
|
|
||||||
using PrivaPub.Models.User;
|
|
||||||
using PrivaPub.StaticServices;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Infrastructure
|
|
||||||
{
|
|
||||||
public class BackoffTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public void Grows_like_mastodons()
|
|
||||||
{
|
|
||||||
Assert.InRange(Backoff.After(1).TotalSeconds, 16, 16 + 9 * 2);
|
|
||||||
Assert.InRange(Backoff.After(10).TotalSeconds, 10015, 10015 + 9 * 11);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Quarantines_a_host_only_past_the_threshold()
|
|
||||||
{
|
|
||||||
Assert.Equal(TimeSpan.Zero, Backoff.HostQuarantine(9, 10));
|
|
||||||
Assert.Equal(TimeSpan.FromHours(1), Backoff.HostQuarantine(10, 10));
|
|
||||||
Assert.Equal(TimeSpan.FromHours(4), Backoff.HostQuarantine(12, 10));
|
|
||||||
Assert.Equal(TimeSpan.FromDays(7), Backoff.HostQuarantine(40, 10));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public sealed class JobQueueTests : IAsyncLifetime
|
|
||||||
{
|
|
||||||
Peer _peer;
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
_peer = await Peer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (_peer != default)
|
|
||||||
await _peer.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
static Job NewJob(string host = default, string dedupe = default) => new()
|
|
||||||
{
|
|
||||||
Kind = (JobKind)99,
|
|
||||||
Host = host,
|
|
||||||
DedupeKey = dedupe,
|
|
||||||
Payload = "{}"
|
|
||||||
};
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_dedupe_key_is_queued_once()
|
|
||||||
{
|
|
||||||
var queue = new JobQueue();
|
|
||||||
var key = Guid.NewGuid().ToString("N");
|
|
||||||
|
|
||||||
var inserted = await queue.EnqueueMany(new[] { NewJob(dedupe: key), NewJob(dedupe: key) }, TestContext.Current.CancellationToken);
|
|
||||||
|
|
||||||
Assert.Equal(1, inserted);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_busy_host_is_skipped_and_a_failed_job_backs_off()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var queue = new JobQueue();
|
|
||||||
var kind = (JobKind)(100 + Random.Shared.Next(1000));
|
|
||||||
var busy = $"busy{Guid.NewGuid():N}.example";
|
|
||||||
var free = $"free{Guid.NewGuid():N}.example";
|
|
||||||
await queue.EnqueueMany(new[] { new Job { Kind = kind, Host = busy }, new Job { Kind = kind, Host = free } }, token);
|
|
||||||
|
|
||||||
var leased = await queue.Lease(kind, new[] { busy }, token);
|
|
||||||
Assert.Equal(free, leased.Host);
|
|
||||||
Assert.Equal(1, leased.Attempts);
|
|
||||||
|
|
||||||
await queue.Finish(leased, JobOutcome.Retry("boom"), maxAttempts: 3, token);
|
|
||||||
var after = await DB.Default.Find<Job>().OneAsync(leased.ID, token);
|
|
||||||
Assert.Equal(JobState.Pending, after.State);
|
|
||||||
Assert.True(after.RunAt > DateTime.UtcNow.AddSeconds(10));
|
|
||||||
|
|
||||||
leased.Attempts = 3;
|
|
||||||
await queue.Finish(leased, JobOutcome.Retry("boom"), maxAttempts: 3, token);
|
|
||||||
Assert.Equal(JobState.Dead, (await DB.Default.Find<Job>().OneAsync(leased.ID, token)).State);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task An_expired_lease_returns_to_the_queue()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var job = new Job { Kind = (JobKind)98, State = JobState.Running, LeasedUntil = DateTime.UtcNow.AddMinutes(-1) };
|
|
||||||
await DB.Default.SaveAsync(job, token);
|
|
||||||
|
|
||||||
await new JobQueue().Reap(token);
|
|
||||||
|
|
||||||
Assert.Equal(JobState.Pending, (await DB.Default.Find<Job>().OneAsync(job.ID, token)).State);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task A_dead_host_does_not_hold_up_deliveries_to_live_ones()
|
|
||||||
{
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var (privateKey, publicKey) = Keys.NewKeyPair();
|
|
||||||
var avatar = new Avatar { UserName = $"sender{Guid.NewGuid():N}"[..20], PrivateKey = privateKey, PublicKey = publicKey };
|
|
||||||
await DB.Default.SaveAsync(avatar, token);
|
|
||||||
var local = new LocalActorService(new DbEntities(), new StaticOptions<AppConfiguration>(new AppConfiguration { BackendBaseAddress = "https://privapub.test" }));
|
|
||||||
var sender = local.FromAvatar(avatar);
|
|
||||||
var queue = new JobQueue();
|
|
||||||
var delivery = new DeliveryService(new DbEntities(), queue);
|
|
||||||
_peer.Answer("/dead/inbox", 503, TimeSpan.FromMilliseconds(300));
|
|
||||||
_peer.Answer("/live/inbox", 202);
|
|
||||||
|
|
||||||
var deadInboxes = Enumerable.Range(0, 60).Select(i => $"{_peer.B}/dead/inbox?{i}");
|
|
||||||
await delivery.Enqueue(sender, deadInboxes, new JsonObject { ["id"] = $"https://privapub.test/a/{Guid.NewGuid():N}", ["type"] = "Create" }, token);
|
|
||||||
await delivery.Enqueue(sender, new[] { $"{_peer.A}/live/inbox" }, new JsonObject { ["id"] = $"https://privapub.test/a/{Guid.NewGuid():N}", ["type"] = "Create" }, token);
|
|
||||||
|
|
||||||
var handler = new DeliveryJobHandler(local, Peer.Http(), new HostCircuitBreaker(new MemoryCache(new MemoryCacheOptions())), NullLogger<DeliveryJobHandler>.Instance);
|
|
||||||
using var worker = new JobWorker(queue, new IJobHandler[] { handler }, NullLogger<JobWorker>.Instance);
|
|
||||||
await worker.StartAsync(token);
|
|
||||||
var deadline = DateTime.UtcNow.AddSeconds(5);
|
|
||||||
while (DateTime.UtcNow < deadline && !_peer.Requests.Any(r => r.Path == "/live/inbox"))
|
|
||||||
await Task.Delay(50, token);
|
|
||||||
var live = Assert.Single(_peer.Requests, r => r.Path == "/live/inbox");
|
|
||||||
Assert.True(_peer.Requests.Count(r => r.Path == "/dead/inbox") < 30);
|
|
||||||
while (DateTime.UtcNow < deadline && !await DB.Default.Find<RemoteInstance>().Match(i => i.Host == "localhost").ExecuteAnyAsync(token))
|
|
||||||
await Task.Delay(50, token);
|
|
||||||
await worker.StopAsync(token);
|
|
||||||
|
|
||||||
Assert.Contains($"keyId=\"{sender.KeyId}\"", live.Signature);
|
|
||||||
var instance = await DB.Default.Find<RemoteInstance>().Match(i => i.Host == "localhost").ExecuteFirstAsync(token);
|
|
||||||
Assert.True(instance.ConsecutiveFailures > 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Infrastructure.Data.Migrations;
|
|
||||||
using PrivaPub.Models.Post;
|
|
||||||
using PrivaPub.Tests.Support;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Infrastructure
|
|
||||||
{
|
|
||||||
[Trait("Category", "Integration")]
|
|
||||||
public class MigrationTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public async Task Stored_remote_content_is_sanitized_and_local_content_rendered()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var remote = new Post { IsFederatedCopy = true, Text = "<p>hi<script>alert(1)</script></p>", ObjectURI = $"https://r.example/{Guid.NewGuid():N}" };
|
|
||||||
var local = new Post { Text = "**bold** <b>raw</b>", ObjectURI = $"https://privapub.test/{Guid.NewGuid():N}" };
|
|
||||||
await DB.Default.SaveAsync(new[] { remote, local }, token);
|
|
||||||
|
|
||||||
await new _002_sanitize_stored_content().UpgradeAsync();
|
|
||||||
|
|
||||||
var migratedRemote = await DB.Default.Find<Post>().OneAsync(remote.ID, token);
|
|
||||||
var migratedLocal = await DB.Default.Find<Post>().OneAsync(local.ID, token);
|
|
||||||
Assert.Equal("<p>hi</p>", migratedRemote.Text);
|
|
||||||
Assert.Equal("<p>hi</p>", migratedRemote.ContentHtml);
|
|
||||||
Assert.Equal(ContentFormat.Html, migratedRemote.ContentFormat);
|
|
||||||
Assert.Equal("**bold** <b>raw</b>", migratedLocal.Text);
|
|
||||||
Assert.Equal("<p><strong>bold</strong> <b>raw</b></p>", migratedLocal.ContentHtml);
|
|
||||||
Assert.Equal(ContentFormat.Markdown, migratedLocal.ContentFormat);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task Direct_posts_move_into_posts_with_their_conversation()
|
|
||||||
{
|
|
||||||
Assert.SkipUnless(MongoFixture.Enabled, MongoFixture.Skip);
|
|
||||||
var token = TestContext.Current.CancellationToken;
|
|
||||||
var dm = new DmPost { GroupId = "conversation1", Text = "psst", ObjectURI = $"https://privapub.test/{Guid.NewGuid():N}", GroupUserId = "a1" };
|
|
||||||
await DB.Default.SaveAsync(dm, token);
|
|
||||||
|
|
||||||
await new _005_direct_posts_join_posts().UpgradeAsync();
|
|
||||||
|
|
||||||
var post = await DB.Default.Find<Post>().OneAsync(dm.ID, token);
|
|
||||||
Assert.Equal(PostVisibility.Direct, post.Visibility);
|
|
||||||
Assert.Equal("conversation1", post.ConversationId);
|
|
||||||
Assert.Equal("a1", post.AuthorAccountId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
using MongoDB.Bson;
|
|
||||||
|
|
||||||
using PrivaPub.Infrastructure.Ids;
|
|
||||||
using PrivaPub.Models.User;
|
|
||||||
|
|
||||||
using GroupEntity = PrivaPub.Models.Group.Group;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Infrastructure
|
|
||||||
{
|
|
||||||
public class PrivacyIdsTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public void Persona_ids_carry_only_the_day_and_share_nothing_else()
|
|
||||||
{
|
|
||||||
var avatar = new Avatar();
|
|
||||||
var first = (string)avatar.GenerateNewID();
|
|
||||||
var second = (string)new Avatar { PublishedOn = avatar.PublishedOn }.GenerateNewID();
|
|
||||||
var group = new GroupEntity();
|
|
||||||
|
|
||||||
Assert.True(ObjectId.TryParse(first, out var a));
|
|
||||||
Assert.True(ObjectId.TryParse(second, out var b));
|
|
||||||
Assert.Equal(avatar.PublishedOn, a.CreationTime);
|
|
||||||
Assert.InRange(a.CreationTime, DateTime.UtcNow.Date.AddDays(-13), DateTime.UtcNow.Date);
|
|
||||||
Assert.Equal(a.CreationTime, b.CreationTime);
|
|
||||||
Assert.NotEqual(first[8..14], second[8..14]);
|
|
||||||
Assert.Equal(group.PublishedOn, ObjectId.Parse((string)group.GenerateNewID()).CreationTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_remote_post_id_sorts_by_its_published_time()
|
|
||||||
{
|
|
||||||
var older = PrivacyIds.At(new DateTime(2025, 1, 1, 0, 0, 0, DateTimeKind.Utc));
|
|
||||||
var newer = PrivacyIds.At(new DateTime(2025, 1, 2, 0, 0, 0, DateTimeKind.Utc));
|
|
||||||
|
|
||||||
Assert.True(string.CompareOrdinal(older, newer) < 0);
|
|
||||||
Assert.Equal(new DateTime(2025, 1, 1, 0, 0, 0, DateTimeKind.Utc), ObjectId.Parse(older).CreationTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_post_arriving_live_sorts_after_everything_already_stored()
|
|
||||||
{
|
|
||||||
var local = ObjectId.GenerateNewId().ToString();
|
|
||||||
var reply = PrivacyIds.Arrived(DateTime.UtcNow.AddSeconds(-30));
|
|
||||||
var skewed = PrivacyIds.Arrived(DateTime.UtcNow.AddYears(50));
|
|
||||||
|
|
||||||
Assert.True(string.CompareOrdinal(local, reply) < 0);
|
|
||||||
Assert.True(string.CompareOrdinal(reply, skewed) < 0);
|
|
||||||
Assert.True(ObjectId.Parse(skewed).CreationTime < DateTime.UtcNow.AddMinutes(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_backfilled_post_keeps_its_published_time() =>
|
|
||||||
Assert.Equal(new DateTime(2025, 1, 1, 0, 0, 0, DateTimeKind.Utc), ObjectId.Parse(PrivacyIds.Arrived(new DateTime(2025, 1, 1, 0, 0, 0, DateTimeKind.Utc))).CreationTime);
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_persona_publishes_a_day_within_two_weeks_before_its_creation()
|
|
||||||
{
|
|
||||||
var created = new DateTime(2026, 10, 1, 15, 30, 0, DateTimeKind.Utc);
|
|
||||||
var days = Enumerable.Range(0, 200).Select(_ => PrivacyIds.PublishedDay(created)).ToList();
|
|
||||||
|
|
||||||
Assert.All(days, d => Assert.Equal(TimeSpan.Zero, d.TimeOfDay));
|
|
||||||
Assert.All(days, d => Assert.InRange(d, created.Date.AddDays(-13), created.Date));
|
|
||||||
Assert.True(days.Distinct().Count() > 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_published_time_in_the_future_is_clamped() =>
|
|
||||||
Assert.True(ObjectId.Parse(PrivacyIds.At(DateTime.UtcNow.AddYears(50))).CreationTime < DateTime.UtcNow.AddDays(2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
|
||||||
<Nullable>disable</Nullable>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
|
|
||||||
<PackageReference Include="xunit.v3" Version="3.2.2" />
|
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Using Include="Xunit" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\PrivaPub\PrivaPub.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Update="Fixtures\**\*" CopyToOutputDirectory="PreserveNewest" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
|
||||||
|
|
||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Domain.Content;
|
|
||||||
using PrivaPub.Domain.Media;
|
|
||||||
using PrivaPub.Domain.Relationships;
|
|
||||||
using PrivaPub.Domain.Social;
|
|
||||||
using PrivaPub.Domain.Statuses;
|
|
||||||
using PrivaPub.Domain.Timelines;
|
|
||||||
using PrivaPub.Federation.Actors;
|
|
||||||
using PrivaPub.Federation.Inbox;
|
|
||||||
using PrivaPub.Federation.Inbox.Handlers;
|
|
||||||
using PrivaPub.Federation.Outbox;
|
|
||||||
using PrivaPub.Infrastructure.Jobs;
|
|
||||||
using PrivaPub.Models;
|
|
||||||
using PrivaPub.Federation.Objects;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
using PrivaPub.Models.Jobs;
|
|
||||||
using PrivaPub.Models.User;
|
|
||||||
using PrivaPub.Resources;
|
|
||||||
using PrivaPub.Services;
|
|
||||||
using PrivaPub.StaticServices;
|
|
||||||
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Support
|
|
||||||
{
|
|
||||||
public sealed class Harness : IAsyncDisposable
|
|
||||||
{
|
|
||||||
public const string Host = "privapub.test";
|
|
||||||
public const string Base = "https://" + Host;
|
|
||||||
|
|
||||||
Harness(Peer peer)
|
|
||||||
{
|
|
||||||
Peer = peer;
|
|
||||||
var cache = new MemoryCache(new MemoryCacheOptions());
|
|
||||||
Local = new LocalActorService(Db, new StaticOptions<AppConfiguration>(new AppConfiguration { BackendBaseAddress = Base }));
|
|
||||||
Remote = new RemoteActorService(Peer.Http(cache), Local, cache, Db);
|
|
||||||
Delivery = new DeliveryService(Db, Queue);
|
|
||||||
Fanout = new Fanout(Db);
|
|
||||||
Groups = new GroupDistributor(Delivery);
|
|
||||||
Records = new ObjectRecords(Queue);
|
|
||||||
Polls = new PollService(Db, Local, Delivery, Queue);
|
|
||||||
RemotePosts = new RemotePosts(Db, Local, Remote, new NoBlocks(), Queue, Records);
|
|
||||||
Receiver = new InboxReceiver(Local, Remote, Queue, new NoBlocks(), NullLogger<InboxReceiver>.Instance);
|
|
||||||
Processor = new InboxProcessor(Remote, new IActivityHandler[]
|
|
||||||
{
|
|
||||||
new FollowHandler(Db, Local, Remote, Delivery),
|
|
||||||
new AcceptHandler(Db, Local),
|
|
||||||
new RejectHandler(Db, Local),
|
|
||||||
new UndoHandler(Db, Local),
|
|
||||||
new LikeHandler(Db),
|
|
||||||
new DislikeHandler(Db),
|
|
||||||
new JoinHandler(Db, Local, Delivery),
|
|
||||||
new AnnounceHandler(Db, Local, RemotePosts, Fanout, Remote),
|
|
||||||
new CreateHandler(Db, Local, Remote, Delivery, new NoBlocks(), Fanout, RemotePosts, Groups, Records, Polls),
|
|
||||||
new DeleteHandler(Db, Local, Remote, Delivery, Groups),
|
|
||||||
new UpdateHandler(Db, Local, Remote, Groups, Records),
|
|
||||||
new FlagHandler(Db, Local)
|
|
||||||
}, NullLogger<InboxProcessor>.Instance);
|
|
||||||
Follows = new FollowService(Db, Local, Remote, Delivery, new KeyLocalizer<GenericRes>(), NullLogger<FollowService>.Instance);
|
|
||||||
Content = new ContentRenderer(Local, Remote);
|
|
||||||
Outbox = new OutboxPublisher(Db, Local, Delivery);
|
|
||||||
Media = new MediaService(new StaticOptions<MediaOptions>(new MediaOptions { Root = Path.Combine(Path.GetTempPath(), $"privapub-media-{Guid.NewGuid():N}") }),
|
|
||||||
Local, default, NullLogger<MediaService>.Instance);
|
|
||||||
Statuses = new StatusService(Db, Local, Remote, Delivery, Content, Outbox, Fanout, Media, Groups, Polls);
|
|
||||||
Posts = new PostsService(Db, Local, Statuses, new KeyLocalizer<GenericRes>(), NullLogger<PostsService>.Instance);
|
|
||||||
Timelines = new TimelineService(Db, new KeyLocalizer<GenericRes>());
|
|
||||||
Relationships = new RelationshipService(Db, Follows, Delivery);
|
|
||||||
Reports = new ReportService(Db, Local, Delivery);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Peer Peer { get; }
|
|
||||||
public DbEntities Db { get; } = new();
|
|
||||||
public JobQueue Queue { get; } = new();
|
|
||||||
public LocalActorService Local { get; }
|
|
||||||
public RemoteActorService Remote { get; }
|
|
||||||
public DeliveryService Delivery { get; }
|
|
||||||
public InboxReceiver Receiver { get; }
|
|
||||||
public InboxProcessor Processor { get; }
|
|
||||||
public FollowService Follows { get; }
|
|
||||||
public ContentRenderer Content { get; }
|
|
||||||
public OutboxPublisher Outbox { get; }
|
|
||||||
public PostsService Posts { get; }
|
|
||||||
public StatusService Statuses { get; }
|
|
||||||
public MediaService Media { get; }
|
|
||||||
public GroupDistributor Groups { get; }
|
|
||||||
public Fanout Fanout { get; }
|
|
||||||
public RemotePosts RemotePosts { get; }
|
|
||||||
public ObjectRecords Records { get; }
|
|
||||||
public PollService Polls { get; }
|
|
||||||
public TimelineService Timelines { get; }
|
|
||||||
public RelationshipService Relationships { get; }
|
|
||||||
public ReportService Reports { get; }
|
|
||||||
|
|
||||||
public async Task FollowedBy(LocalActor local, RemoteActor follower) =>
|
|
||||||
await DB.Default.SaveAsync(new Follower
|
|
||||||
{
|
|
||||||
LocalActorId = local.Id,
|
|
||||||
LocalActorKind = local.Kind,
|
|
||||||
ActorURI = follower.Id,
|
|
||||||
InboxURL = follower.Id + "/inbox",
|
|
||||||
SharedInboxURL = follower.SharedInbox
|
|
||||||
});
|
|
||||||
|
|
||||||
public static async Task<Harness> Start() => new(await Peer.Start());
|
|
||||||
|
|
||||||
public async Task<(string RootId, LocalActor Avatar)> Persona(string name, string rootId = default)
|
|
||||||
{
|
|
||||||
rootId ??= Guid.NewGuid().ToString("N")[..24];
|
|
||||||
var (privateKey, publicKey) = Keys.NewKeyPair();
|
|
||||||
var avatar = new Avatar { UserName = $"{name}{Guid.NewGuid():N}"[..20], Name = name, PrivateKey = privateKey, PublicKey = publicKey };
|
|
||||||
await DB.Default.SaveAsync(avatar);
|
|
||||||
await DB.Default.SaveAsync(new RootToAvatar { RootId = rootId, AvatarId = avatar.ID });
|
|
||||||
return (rootId, Local.FromAvatar(avatar));
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<InboxResult> Deliver(RemoteActor sender, string path, JsonNode activity)
|
|
||||||
{
|
|
||||||
var result = await Receiver.Receive(sender.Post(Host, path, activity), default, CancellationToken.None);
|
|
||||||
var dedupe = "inbox|" + (activity is JsonObject ? activity["id"]?.GetValue<string>() : default);
|
|
||||||
var job = await DB.Default.Find<Job>().Match(j => j.DedupeKey == dedupe).ExecuteFirstAsync();
|
|
||||||
if (job != default)
|
|
||||||
Assert.Equal(JobResult.Done, (await Processor.Handle(job, CancellationToken.None)).Result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<JsonObject>> Outgoing(string inbox) =>
|
|
||||||
(await DB.Default.Find<Job>().Match(j => j.Kind == JobKind.Deliver).ExecuteAsync())
|
|
||||||
.Select(j => JsonSerializer.Deserialize<DeliveryPayload>(j.Payload))
|
|
||||||
.Where(p => p.Inbox == inbox)
|
|
||||||
.Select(p => JsonNode.Parse(p.Body)!.AsObject())
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync() => await Peer.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class KeyLocalizer<T> : IStringLocalizer<T>
|
|
||||||
{
|
|
||||||
public LocalizedString this[string name] => new(name, name);
|
|
||||||
public LocalizedString this[string name, params object[] arguments] => new(name, string.Format(name, arguments));
|
|
||||||
public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) => Enumerable.Empty<LocalizedString>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
using MongoDB.Bson;
|
|
||||||
using MongoDB.Bson.Serialization;
|
|
||||||
using MongoDB.Bson.Serialization.Serializers;
|
|
||||||
using MongoDB.Driver;
|
|
||||||
using MongoDB.Entities;
|
|
||||||
|
|
||||||
using PrivaPub.Infrastructure.Data;
|
|
||||||
|
|
||||||
[assembly: AssemblyFixture(typeof(PrivaPub.Tests.Support.MongoFixture))]
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Support
|
|
||||||
{
|
|
||||||
public sealed class MongoFixture : IAsyncLifetime
|
|
||||||
{
|
|
||||||
public const string Skip = "set PRIVAPUB_TEST_MONGOD=1 (and optionally PRIVAPUB_TEST_MONGO) to run the tests that need a mongod";
|
|
||||||
|
|
||||||
public static bool Enabled => Environment.GetEnvironmentVariable("PRIVAPUB_TEST_MONGOD") == "1";
|
|
||||||
|
|
||||||
public string Database { get; } = $"PrivaPubTests_{Guid.NewGuid():N}";
|
|
||||||
|
|
||||||
public async ValueTask InitializeAsync()
|
|
||||||
{
|
|
||||||
if (!Enabled)
|
|
||||||
return;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
BsonSerializer.RegisterSerializer(new GuidSerializer(GuidRepresentation.Standard));
|
|
||||||
}
|
|
||||||
catch (BsonSerializationException)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
var connection = Environment.GetEnvironmentVariable("PRIVAPUB_TEST_MONGO") ?? "mongodb://127.0.0.1:27017";
|
|
||||||
await DB.InitAsync(Database, MongoClientSettings.FromConnectionString(connection));
|
|
||||||
EntityMaps.Warm();
|
|
||||||
await Indexes.Create();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
if (Enabled)
|
|
||||||
await DB.Default.Database().Client.DropDatabaseAsync(Database);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Moderation;
|
|
||||||
using PrivaPub.Infrastructure.Http;
|
|
||||||
using PrivaPub.Models.Federation;
|
|
||||||
|
|
||||||
using System.Collections.Concurrent;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Support
|
|
||||||
{
|
|
||||||
public sealed class Peer : IAsyncDisposable
|
|
||||||
{
|
|
||||||
readonly WebApplication _app;
|
|
||||||
readonly ConcurrentDictionary<string, string> _documents = new();
|
|
||||||
readonly ConcurrentDictionary<string, (int Status, TimeSpan Delay)> _answers = new();
|
|
||||||
readonly ConcurrentDictionary<string, (byte[] Bytes, string ContentType)> _files = new();
|
|
||||||
|
|
||||||
public int Port { get; }
|
|
||||||
public string A => $"http://127.0.0.1:{Port}";
|
|
||||||
public string B => $"http://localhost:{Port}";
|
|
||||||
public ConcurrentQueue<HttpRequestRecord> Requests { get; } = new();
|
|
||||||
|
|
||||||
Peer(WebApplication app, int port)
|
|
||||||
{
|
|
||||||
_app = app;
|
|
||||||
Port = port;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static async Task<Peer> Start()
|
|
||||||
{
|
|
||||||
var builder = WebApplication.CreateSlimBuilder();
|
|
||||||
builder.WebHost.UseUrls("http://127.0.0.1:0");
|
|
||||||
var app = builder.Build();
|
|
||||||
Peer peer = default;
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
|
||||||
peer.Requests.Enqueue(new(context.Request.Method, context.Request.Path, context.Request.Headers["Signature"].ToString()));
|
|
||||||
var key = context.Request.Path.Value;
|
|
||||||
if (peer._files.TryGetValue(key, out var file))
|
|
||||||
{
|
|
||||||
context.Response.ContentType = file.ContentType;
|
|
||||||
await context.Response.Body.WriteAsync(file.Bytes);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (peer._answers.TryGetValue(key, out var answer))
|
|
||||||
{
|
|
||||||
if (answer.Delay > TimeSpan.Zero)
|
|
||||||
await Task.Delay(answer.Delay);
|
|
||||||
context.Response.StatusCode = answer.Status;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!peer._documents.TryGetValue(key, out var document))
|
|
||||||
{
|
|
||||||
context.Response.StatusCode = StatusCodes.Status404NotFound;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
context.Response.ContentType = "application/activity+json";
|
|
||||||
await context.Response.WriteAsync(document.Replace("{A}", peer.A).Replace("{B}", peer.B));
|
|
||||||
});
|
|
||||||
await app.StartAsync();
|
|
||||||
peer = new Peer(app, new Uri(app.Urls.First()).Port);
|
|
||||||
return peer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Serve(string path, string json) => _documents[path] = json;
|
|
||||||
|
|
||||||
public void ServeFile(string path, byte[] bytes, string contentType) => _files[path] = (bytes, contentType);
|
|
||||||
|
|
||||||
public void Answer(string path, int status, TimeSpan delay = default) => _answers[path] = (status, delay);
|
|
||||||
|
|
||||||
public static FederationHttp Http(IMemoryCache cache = default, IDomainBlocks blocks = default)
|
|
||||||
{
|
|
||||||
var options = new FederationOptions { AllowPrivateNetworks = true, AllowPlainHttp = true };
|
|
||||||
var services = new ServiceCollection();
|
|
||||||
services.AddHttpClient(FederationHttp.ClientName)
|
|
||||||
.ConfigurePrimaryHttpMessageHandler(() => SafeHttpHandlerFactory.Create(options));
|
|
||||||
return new FederationHttp(services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>(),
|
|
||||||
cache ?? new MemoryCache(new MemoryCacheOptions()), new StaticOptions<FederationOptions>(options),
|
|
||||||
blocks ?? new NoBlocks(), NullLogger<FederationHttp>.Instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async ValueTask DisposeAsync() => await _app.DisposeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class NoBlocks : IDomainBlocks
|
|
||||||
{
|
|
||||||
public DomainBlock Find(string host) => default;
|
|
||||||
public bool IsSuspended(string host) => false;
|
|
||||||
public Task Reload(CancellationToken token) => Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed record HttpRequestRecord(string Method, string Path, string Signature);
|
|
||||||
|
|
||||||
public sealed class StaticOptions<T> : IOptionsMonitor<T>
|
|
||||||
{
|
|
||||||
public StaticOptions(T value) => CurrentValue = value;
|
|
||||||
public T CurrentValue { get; }
|
|
||||||
public T Get(string name) => CurrentValue;
|
|
||||||
public IDisposable OnChange(Action<T, string> listener) => default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
|
||||||
|
|
||||||
using PrivaPub.Federation.Signing;
|
|
||||||
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace PrivaPub.Tests.Support
|
|
||||||
{
|
|
||||||
public sealed class RemoteActor
|
|
||||||
{
|
|
||||||
readonly RSA _key = RSA.Create(2048);
|
|
||||||
|
|
||||||
public RemoteActor(Peer peer, string name, string origin = default, string type = "Person")
|
|
||||||
{
|
|
||||||
Name = $"{name}{Guid.NewGuid():N}"[..20];
|
|
||||||
Id = $"{origin ?? peer.A}/users/{Name}";
|
|
||||||
Type = type;
|
|
||||||
peer.Serve($"/users/{Name}", Document().ToJsonString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Type { get; }
|
|
||||||
|
|
||||||
public string Name { get; }
|
|
||||||
public string Id { get; }
|
|
||||||
public string KeyId => Id + "#main-key";
|
|
||||||
public string SharedInbox => Id.Split("/users/")[0] + "/inbox";
|
|
||||||
|
|
||||||
public JsonObject Document() => new()
|
|
||||||
{
|
|
||||||
["id"] = Id,
|
|
||||||
["type"] = Type,
|
|
||||||
["preferredUsername"] = Name,
|
|
||||||
["inbox"] = Id + "/inbox",
|
|
||||||
["followers"] = Id + "/followers",
|
|
||||||
["publicKey"] = new JsonObject
|
|
||||||
{
|
|
||||||
["id"] = KeyId,
|
|
||||||
["owner"] = Id,
|
|
||||||
["publicKeyPem"] = _key.ExportSubjectPublicKeyInfoPem()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public HttpRequest Get(string host, string path)
|
|
||||||
{
|
|
||||||
var date = DateTimeOffset.UtcNow.ToString("r", CultureInfo.InvariantCulture);
|
|
||||||
var signingString = $"(request-target): get {path}\nhost: {host}\ndate: {date}";
|
|
||||||
var signature = Convert.ToBase64String(_key.SignData(Encoding.UTF8.GetBytes(signingString), HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1));
|
|
||||||
var context = new DefaultHttpContext();
|
|
||||||
context.Request.Method = "GET";
|
|
||||||
context.Request.Host = new HostString(host);
|
|
||||||
context.Request.Path = path;
|
|
||||||
context.Features.Get<IHttpRequestFeature>().RawTarget = path;
|
|
||||||
context.Request.Headers["Date"] = date;
|
|
||||||
context.Request.Headers["Signature"] = $"keyId=\"{KeyId}\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date\",signature=\"{signature}\"";
|
|
||||||
return context.Request;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpRequest Post(string host, string path, JsonNode activity)
|
|
||||||
{
|
|
||||||
var body = Encoding.UTF8.GetBytes(activity.ToJsonString());
|
|
||||||
var date = DateTimeOffset.UtcNow.ToString("r", CultureInfo.InvariantCulture);
|
|
||||||
var digest = HttpSignatures.Digest(body);
|
|
||||||
var signingString = $"(request-target): post {path}\nhost: {host}\ndate: {date}\ndigest: {digest}";
|
|
||||||
var signature = Convert.ToBase64String(_key.SignData(Encoding.UTF8.GetBytes(signingString), HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1));
|
|
||||||
|
|
||||||
var context = new DefaultHttpContext();
|
|
||||||
context.Request.Method = "POST";
|
|
||||||
context.Request.Host = new HostString(host);
|
|
||||||
context.Request.Path = path;
|
|
||||||
context.Features.Get<IHttpRequestFeature>().RawTarget = path;
|
|
||||||
context.Request.Headers["Date"] = date;
|
|
||||||
context.Request.Headers["Digest"] = digest;
|
|
||||||
context.Request.Headers["Content-Type"] = "application/activity+json";
|
|
||||||
context.Request.Headers["Signature"] = $"keyId=\"{KeyId}\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date digest\",signature=\"{signature}\"";
|
|
||||||
context.Request.Body = new MemoryStream(body);
|
|
||||||
context.Request.ContentLength = body.Length;
|
|
||||||
return context.Request;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrivaPub", "PrivaPub\PrivaP
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrivaPub.ClientModels", "PrivaPub.ClientModels\PrivaPub.ClientModels.csproj", "{5E63C68C-0E60-4418-A53A-FF4EF0007080}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrivaPub.ClientModels", "PrivaPub.ClientModels\PrivaPub.ClientModels.csproj", "{5E63C68C-0E60-4418-A53A-FF4EF0007080}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrivaPub.Tests", "PrivaPub.Tests\PrivaPub.Tests.csproj", "{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -43,18 +41,6 @@ Global
|
|||||||
{5E63C68C-0E60-4418-A53A-FF4EF0007080}.Release|x64.Build.0 = Release|Any CPU
|
{5E63C68C-0E60-4418-A53A-FF4EF0007080}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{5E63C68C-0E60-4418-A53A-FF4EF0007080}.Release|x86.ActiveCfg = Release|Any CPU
|
{5E63C68C-0E60-4418-A53A-FF4EF0007080}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{5E63C68C-0E60-4418-A53A-FF4EF0007080}.Release|x86.Build.0 = Release|Any CPU
|
{5E63C68C-0E60-4418-A53A-FF4EF0007080}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{BA20AFE4-A348-4BDF-A2F4-36E0710D61A2}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -23,10 +23,7 @@ namespace PrivaPub.Api.Mastodon.Auth
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await Task.Delay(Interval, stoppingToken);
|
await Task.Delay(Interval, stoppingToken);
|
||||||
using var scope = _services.CreateScope();
|
var (tokens, authorizations) = await Prune(DateTimeOffset.UtcNow - Threshold, stoppingToken);
|
||||||
var threshold = DateTimeOffset.UtcNow - Threshold;
|
|
||||||
var tokens = await scope.ServiceProvider.GetRequiredService<IOpenIddictTokenManager>().PruneAsync(threshold, stoppingToken);
|
|
||||||
var authorizations = await scope.ServiceProvider.GetRequiredService<IOpenIddictAuthorizationManager>().PruneAsync(threshold, stoppingToken);
|
|
||||||
if (tokens + authorizations > 0)
|
if (tokens + authorizations > 0)
|
||||||
_logger.LogInformation("{Service} removed {Tokens} tokens and {Authorizations} authorizations", nameof(OAuthPruner), tokens, authorizations);
|
_logger.LogInformation("{Service} removed {Tokens} tokens and {Authorizations} authorizations", nameof(OAuthPruner), tokens, authorizations);
|
||||||
}
|
}
|
||||||
@@ -40,5 +37,14 @@ namespace PrivaPub.Api.Mastodon.Auth
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//one pass: tokens and authorizations created before the threshold that are no longer valid
|
||||||
|
public async Task<(long Tokens, long Authorizations)> Prune(DateTimeOffset threshold, CancellationToken token)
|
||||||
|
{
|
||||||
|
using var scope = _services.CreateScope();
|
||||||
|
var tokens = await scope.ServiceProvider.GetRequiredService<IOpenIddictTokenManager>().PruneAsync(threshold, token);
|
||||||
|
var authorizations = await scope.ServiceProvider.GetRequiredService<IOpenIddictAuthorizationManager>().PruneAsync(threshold, token);
|
||||||
|
return (tokens, authorizations);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,14 @@ namespace PrivaPub.Api.Mastodon.Auth
|
|||||||
.SetTokenEndpointUris("/oauth/token")
|
.SetTokenEndpointUris("/oauth/token")
|
||||||
.SetRevocationEndpointUris("/oauth/revoke")
|
.SetRevocationEndpointUris("/oauth/revoke")
|
||||||
.SetConfigurationEndpointUris("/.well-known/openid-configuration", "/.well-known/oauth-authorization-server");
|
.SetConfigurationEndpointUris("/.well-known/openid-configuration", "/.well-known/oauth-authorization-server");
|
||||||
options.AllowAuthorizationCodeFlow().AllowClientCredentialsFlow();
|
options.AllowAuthorizationCodeFlow().AllowClientCredentialsFlow().AllowTokenExchangeFlow();
|
||||||
|
//the only subject token accepted is the root JWT, for PersonaExchange; OpenIddict's own tokens are not exchanged
|
||||||
|
options.Configure(server =>
|
||||||
|
{
|
||||||
|
server.SubjectTokenTypes.Clear();
|
||||||
|
server.SubjectTokenTypes.Add(PersonaExchange.SubjectTokenType);
|
||||||
|
});
|
||||||
|
options.AddEventHandler(RootJwtSubjectToken.Descriptor);
|
||||||
options.RegisterScopes(MastodonScopes.All);
|
options.RegisterScopes(MastodonScopes.All);
|
||||||
options.UseReferenceAccessTokens();
|
options.UseReferenceAccessTokens();
|
||||||
options.SetAccessTokenLifetime(null);
|
options.SetAccessTokenLifetime(null);
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
|
||||||
|
using OpenIddict.Abstractions;
|
||||||
|
using OpenIddict.Server;
|
||||||
|
|
||||||
|
using PrivaPub.Services;
|
||||||
|
using PrivaPub.StaticServices;
|
||||||
|
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
using static OpenIddict.Abstractions.OpenIddictConstants;
|
||||||
|
using static OpenIddict.Server.OpenIddictServerEvents;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Auth
|
||||||
|
{
|
||||||
|
// One sign-in for the first-party client (decePubClient): it signs in on /clientapi, then exchanges that root JWT for one
|
||||||
|
// persona's Mastodon token (RFC 8693, grant_type urn:ietf:params:oauth:grant-type:token-exchange, subject_token_type
|
||||||
|
// urn:ietf:params:oauth:token-type:jwt, avatar_id). Only the seeded first-party application holds the grant permission,
|
||||||
|
// and the issued token is the same kind the authorization code flow issues: subject the avatar, never the root.
|
||||||
|
public static class PersonaExchange
|
||||||
|
{
|
||||||
|
public const string SubjectTokenType = "urn:ietf:params:oauth:token-type:jwt";
|
||||||
|
public const string AvatarParameter = "avatar_id";
|
||||||
|
//the root the subject token belongs to; it lives on the subject token's principal only, which is never stored or issued
|
||||||
|
public const string RootClaim = "privapub_root";
|
||||||
|
|
||||||
|
public static string FirstPartyClientId(IConfiguration configuration) =>
|
||||||
|
configuration["ClientApi:FirstPartyClientId"] is { Length: > 0 } clientId ? clientId : "decepub";
|
||||||
|
|
||||||
|
//the first-party application: public (a browser keeps no secret), token exchange only, no redirect
|
||||||
|
public static async Task EnsureFirstPartyClient(IServiceProvider services, CancellationToken token)
|
||||||
|
{
|
||||||
|
using var scope = services.CreateScope();
|
||||||
|
var applications = scope.ServiceProvider.GetRequiredService<IOpenIddictApplicationManager>();
|
||||||
|
var clientId = FirstPartyClientId(scope.ServiceProvider.GetRequiredService<IConfiguration>());
|
||||||
|
var descriptor = new OpenIddictApplicationDescriptor
|
||||||
|
{
|
||||||
|
ClientId = clientId,
|
||||||
|
ClientType = ClientTypes.Public,
|
||||||
|
ConsentType = ConsentTypes.Implicit,
|
||||||
|
DisplayName = "decePubClient",
|
||||||
|
Permissions =
|
||||||
|
{
|
||||||
|
Permissions.Endpoints.Token,
|
||||||
|
Permissions.Endpoints.Revocation,
|
||||||
|
Permissions.GrantTypes.TokenExchange
|
||||||
|
}
|
||||||
|
};
|
||||||
|
foreach (var scopeName in new[] { "read", "write", "follow" })
|
||||||
|
descriptor.Permissions.Add(Permissions.Prefixes.Scope + scopeName);
|
||||||
|
|
||||||
|
var existing = await applications.FindByClientIdAsync(clientId, token);
|
||||||
|
if (existing == default)
|
||||||
|
{
|
||||||
|
await applications.CreateAsync(descriptor, token);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await applications.PopulateAsync(existing, descriptor, token);
|
||||||
|
await applications.UpdateAsync(existing, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validates a root JWT given as a token exchange subject token, before OpenIddict tries it as one of its own tokens.
|
||||||
|
// The principal it builds names the root under PersonaExchange.RootClaim for TokenController, which signs in a fresh
|
||||||
|
// identity for the avatar.
|
||||||
|
public sealed class RootJwtSubjectToken : IOpenIddictServerHandler<ValidateTokenContext>
|
||||||
|
{
|
||||||
|
public static OpenIddictServerHandlerDescriptor Descriptor { get; } = OpenIddictServerHandlerDescriptor.CreateBuilder<ValidateTokenContext>()
|
||||||
|
.UseScopedHandler<RootJwtSubjectToken>()
|
||||||
|
.SetOrder(OpenIddictServerHandlers.Protection.ValidateIdentityModelToken.Descriptor.Order - 500)
|
||||||
|
.SetType(OpenIddictServerHandlerType.Custom)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
readonly IConfiguration _configuration;
|
||||||
|
readonly DbEntities _dbEntities;
|
||||||
|
|
||||||
|
public RootJwtSubjectToken(IConfiguration configuration, DbEntities dbEntities)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
_dbEntities = dbEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async ValueTask HandleAsync(ValidateTokenContext context)
|
||||||
|
{
|
||||||
|
if (context.ValidTokenTypes.Count != 1 || !context.ValidTokenTypes.Contains(PersonaExchange.SubjectTokenType))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var root = await RootJwt.Root(context.Token, _configuration, _dbEntities, context.Transaction.CancellationToken);
|
||||||
|
if (root == default)
|
||||||
|
{
|
||||||
|
context.Reject(Errors.InvalidGrant, "The session token is not valid.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var identity = new ClaimsIdentity(TokenValidationParameters.DefaultAuthenticationType, Claims.Name, Claims.Role);
|
||||||
|
identity.SetClaim(PersonaExchange.RootClaim, root.ID);
|
||||||
|
var principal = new ClaimsPrincipal(identity)
|
||||||
|
.SetTokenType(PersonaExchange.SubjectTokenType)
|
||||||
|
.SetCreationDate(DateTimeOffset.UtcNow);
|
||||||
|
if (context.ValidPresenters.Count > 0)
|
||||||
|
principal.SetPresenters(context.ValidPresenters);
|
||||||
|
context.Principal = principal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using Microsoft.AspNetCore;
|
using Microsoft.AspNetCore;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
@@ -48,9 +48,33 @@ namespace PrivaPub.Api.Mastodon.Auth
|
|||||||
return SignIn(new ClaimsPrincipal(identity), OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
|
return SignIn(new ClaimsPrincipal(identity), OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.IsTokenExchangeGrantType())
|
||||||
|
return await Persona(request, token);
|
||||||
|
|
||||||
return Refuse(Errors.UnsupportedGrantType, "The grant type is not supported.");
|
return Refuse(Errors.UnsupportedGrantType, "The grant type is not supported.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//PersonaExchange: the root JWT, validated by RootJwtSubjectToken, for a token of one of the root's personas
|
||||||
|
async Task<IActionResult> Persona(OpenIddictRequest request, CancellationToken token)
|
||||||
|
{
|
||||||
|
var subject = (await HttpContext.AuthenticateAsync(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme)).Principal;
|
||||||
|
var rootId = subject?.GetClaim(PersonaExchange.RootClaim);
|
||||||
|
var avatarId = (string)request[PersonaExchange.AvatarParameter];
|
||||||
|
if (string.IsNullOrEmpty(rootId) || string.IsNullOrEmpty(avatarId))
|
||||||
|
return Refuse(Errors.InvalidGrant, "The persona can no longer be used.");
|
||||||
|
var owns = await _dbEntities.RootToAvatars.Match(r => r.RootId == rootId && r.AvatarId == avatarId).ExecuteAnyAsync(token);
|
||||||
|
var avatar = owns ? await _dbEntities.Avatars.MatchID(avatarId).ExecuteFirstAsync(token) : default;
|
||||||
|
if (avatar == default || !await Usable(avatarId, token))
|
||||||
|
return Refuse(Errors.InvalidGrant, "The persona can no longer be used.");
|
||||||
|
|
||||||
|
var identity = new ClaimsIdentity(TokenValidationParameters.DefaultAuthenticationType, Claims.Name, Claims.Role);
|
||||||
|
identity.SetClaim(Claims.Subject, avatar.ID);
|
||||||
|
identity.SetClaim(Claims.Name, avatar.UserName);
|
||||||
|
identity.SetScopes(MastodonScopes.Parse(request.Scope).Intersect(new[] { "read", "write", "follow" }));
|
||||||
|
identity.SetDestinations(_ => new[] { Destinations.AccessToken });
|
||||||
|
return SignIn(new ClaimsPrincipal(identity), OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
|
||||||
|
}
|
||||||
|
|
||||||
async Task<bool> Usable(string avatarId, CancellationToken token)
|
async Task<bool> Usable(string avatarId, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(avatarId))
|
if (string.IsNullOrEmpty(avatarId))
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Microsoft.AspNetCore.RateLimiting;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
using MongoDB.Entities;
|
using MongoDB.Entities;
|
||||||
@@ -16,6 +17,7 @@ using PrivaPub.Models.Post;
|
|||||||
using PrivaPub.Models.Social;
|
using PrivaPub.Models.Social;
|
||||||
using PrivaPub.Models.User;
|
using PrivaPub.Models.User;
|
||||||
using PrivaPub.StaticServices;
|
using PrivaPub.StaticServices;
|
||||||
|
using PrivaPub.Infrastructure;
|
||||||
|
|
||||||
using PostEntity = PrivaPub.Models.Post.Post;
|
using PostEntity = PrivaPub.Models.Post.Post;
|
||||||
|
|
||||||
@@ -30,10 +32,12 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
readonly IFollowService _follows;
|
readonly IFollowService _follows;
|
||||||
readonly IOutboxPublisher _outbox;
|
readonly IOutboxPublisher _outbox;
|
||||||
readonly IRelationshipService _relationships;
|
readonly IRelationshipService _relationships;
|
||||||
|
readonly IFeedFollows _feeds;
|
||||||
|
|
||||||
public AccountsController(MastodonMapper mapper, DbEntities dbEntities, ILocalActorService localActors, IRemoteActorService remoteActors,
|
public AccountsController(MastodonMapper mapper, DbEntities dbEntities, ILocalActorService localActors, IRemoteActorService remoteActors,
|
||||||
IFollowService follows, IOutboxPublisher outbox, IRelationshipService relationships)
|
IFollowService follows, IOutboxPublisher outbox, IRelationshipService relationships, IFeedFollows feeds)
|
||||||
{
|
{
|
||||||
|
_feeds = feeds;
|
||||||
_relationships = relationships;
|
_relationships = relationships;
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_dbEntities = dbEntities;
|
_dbEntities = dbEntities;
|
||||||
@@ -46,18 +50,33 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
[HttpGet("/api/v1/accounts/verify_credentials"), Scope("read:accounts")]
|
[HttpGet("/api/v1/accounts/verify_credentials"), Scope("read:accounts")]
|
||||||
public async Task<IActionResult> VerifyCredentials(CancellationToken token) => Json(await _mapper.Local(Me, withSource: true, token));
|
public async Task<IActionResult> VerifyCredentials(CancellationToken token) => Json(await _mapper.Local(Me, withSource: true, token));
|
||||||
|
|
||||||
[HttpPatch("/api/v1/accounts/update_credentials"), Scope("write:accounts"), RequestSizeLimit(20 * 1024 * 1024),
|
[HttpPatch("/api/v1/accounts/update_credentials"), Scope("write:accounts"), EnableRateLimiting(RateLimiting.Uploads), RequestSizeLimit(20 * 1024 * 1024),
|
||||||
RequestFormLimits(MultipartBodyLengthLimit = 20 * 1024 * 1024)]
|
RequestFormLimits(MultipartBodyLengthLimit = 20 * 1024 * 1024)]
|
||||||
public async Task<IActionResult> UpdateCredentials([FromServices] IMediaService media, CancellationToken token)
|
public async Task<IActionResult> UpdateCredentials([FromServices] IMediaService media, CancellationToken token)
|
||||||
{
|
{
|
||||||
var avatar = await _dbEntities.Avatars.MatchID(Me.Id).ExecuteFirstAsync(token);
|
var avatar = await _dbEntities.Avatars.MatchID(Me.Id).ExecuteFirstAsync(token);
|
||||||
|
// a new picture is a row of its own; the one it replaces goes to the trash once the profile is saved
|
||||||
|
var replaced = new List<Models.Media.MediaAttachment>();
|
||||||
if (Request.HasFormContentType)
|
if (Request.HasFormContentType)
|
||||||
{
|
{
|
||||||
var form = await Request.ReadFormAsync(token);
|
var form = await Request.ReadFormAsync(token);
|
||||||
if (form.Files["avatar"] is { } picture && await media.ProfileImage(picture, 400, 400, token) is { } pictureUrl)
|
foreach (var (field, kind, width, height) in new[] { ("avatar", "avatar", 400, 400), ("header", "header", 1500, 500) })
|
||||||
avatar.PictureURL = pictureUrl;
|
{
|
||||||
if (form.Files["header"] is { } header && await media.ProfileImage(header, 1500, 500, token) is { } headerUrl)
|
if (form.Files[field] is not { } file)
|
||||||
avatar.ThumbnailURL = headerUrl;
|
continue;
|
||||||
|
var outcome = await media.ProfileImage(avatar.ID, kind, file, width, height, token);
|
||||||
|
if (!outcome.Ok)
|
||||||
|
{
|
||||||
|
foreach (var made in replaced)
|
||||||
|
await media.Trash(m => m.ID == made.ID, "profile not saved", token);
|
||||||
|
return Error(outcome.Status, outcome.Error);
|
||||||
|
}
|
||||||
|
replaced.Add(outcome.Attachment);
|
||||||
|
if (kind == "avatar")
|
||||||
|
avatar.PictureURL = media.Url(outcome.Attachment.FilePath);
|
||||||
|
else
|
||||||
|
avatar.ThumbnailURL = media.Url(outcome.Attachment.FilePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Params.Has("display_name"))
|
if (Params.Has("display_name"))
|
||||||
avatar.Name = Params.Get("display_name")?.Trim();
|
avatar.Name = Params.Get("display_name")?.Trim();
|
||||||
@@ -71,14 +90,15 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
avatar.Settings.IsDiscoverable = discoverable;
|
avatar.Settings.IsDiscoverable = discoverable;
|
||||||
if (Params.Bool("indexable") is { } indexable)
|
if (Params.Bool("indexable") is { } indexable)
|
||||||
avatar.Settings.IsIndexable = indexable;
|
avatar.Settings.IsIndexable = indexable;
|
||||||
if (Params.Bool("hide_collections") is { } hide)
|
// hide_collections stays true: who follows whom is never listed here, only counted (FEDERATION.md)
|
||||||
avatar.Settings.HideCollections = hide;
|
|
||||||
if (Params.Get("source[privacy]") is { } privacy && privacy is "public" or "unlisted" or "private")
|
if (Params.Get("source[privacy]") is { } privacy && privacy is "public" or "unlisted" or "private")
|
||||||
avatar.Settings.DefaultVisibility = privacy;
|
avatar.Settings.DefaultVisibility = privacy;
|
||||||
if (Params.Bool("source[sensitive]") is { } sensitive)
|
if (Params.Bool("source[sensitive]") is { } sensitive)
|
||||||
avatar.Settings.DefaultSensitive = sensitive;
|
avatar.Settings.DefaultSensitive = sensitive;
|
||||||
if (Params.Has("source[language]"))
|
if (Params.Has("source[language]"))
|
||||||
avatar.Settings.DefaultLanguage = Params.Get("source[language]");
|
avatar.Settings.DefaultLanguage = Params.Get("source[language]");
|
||||||
|
if (Params.Get("source[quote_policy]") is { } quotePolicy && QuotePolicies.IsKnown(quotePolicy))
|
||||||
|
avatar.Settings.QuotePolicy = quotePolicy;
|
||||||
var fields = new Dictionary<string, string>();
|
var fields = new Dictionary<string, string>();
|
||||||
for (var i = 0; i < 4; i++)
|
for (var i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
@@ -97,12 +117,36 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
avatar.Fields = fields;
|
avatar.Fields = fields;
|
||||||
avatar.UpdatedAt = DateTime.UtcNow;
|
avatar.UpdatedAt = DateTime.UtcNow;
|
||||||
await DB.Default.SaveAsync(avatar, token);
|
await DB.Default.SaveAsync(avatar, token);
|
||||||
|
foreach (var made in replaced)
|
||||||
|
await media.Trash(m => m.ProfileOfAvatarId == avatar.ID && m.Kind == made.Kind && m.ID != made.ID, "replaced", token);
|
||||||
|
|
||||||
var actor = _localActors.FromAvatar(avatar);
|
var actor = _localActors.FromAvatar(avatar);
|
||||||
await _outbox.PublishProfile(actor, token);
|
await _outbox.PublishProfile(actor, token);
|
||||||
return Json(await _mapper.Local(actor, withSource: true, token));
|
return Json(await _mapper.Local(actor, withSource: true, token));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mastodon's: the picture goes (to the trash), the profile shows the default again, and followers are told
|
||||||
|
[HttpDelete("/api/v1/profile/avatar"), Scope("write:accounts")]
|
||||||
|
public Task<IActionResult> DeleteAvatar([FromServices] IMediaService media, CancellationToken token) => DeletePicture(media, "avatar", token);
|
||||||
|
|
||||||
|
[HttpDelete("/api/v1/profile/header"), Scope("write:accounts")]
|
||||||
|
public Task<IActionResult> DeleteHeader([FromServices] IMediaService media, CancellationToken token) => DeletePicture(media, "header", token);
|
||||||
|
|
||||||
|
async Task<IActionResult> DeletePicture(IMediaService media, string kind, CancellationToken token)
|
||||||
|
{
|
||||||
|
var avatar = await _dbEntities.Avatars.MatchID(Me.Id).ExecuteFirstAsync(token);
|
||||||
|
if (kind == "avatar")
|
||||||
|
avatar.PictureURL = default;
|
||||||
|
else
|
||||||
|
avatar.ThumbnailURL = default;
|
||||||
|
avatar.UpdatedAt = DateTime.UtcNow;
|
||||||
|
await DB.Default.SaveAsync(avatar, token);
|
||||||
|
await media.Trash(m => m.ProfileOfAvatarId == avatar.ID && m.Kind == kind, "removed", token);
|
||||||
|
var actor = _localActors.FromAvatar(avatar);
|
||||||
|
await _outbox.PublishProfile(actor, token);
|
||||||
|
return Json(await _mapper.Local(actor, withSource: true, token));
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("/api/v1/accounts/lookup"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
[HttpGet("/api/v1/accounts/lookup"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||||
public async Task<IActionResult> Lookup(CancellationToken token)
|
public async Task<IActionResult> Lookup(CancellationToken token)
|
||||||
{
|
{
|
||||||
@@ -114,11 +158,11 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
if (parts.Length == 1 || parts[1].Equals(localDomain, StringComparison.OrdinalIgnoreCase))
|
if (parts.Length == 1 || parts[1].Equals(localDomain, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var local = await _localActors.FindByUserName(parts[0], token);
|
var local = await _localActors.FindByUserName(parts[0], token);
|
||||||
return local is { IsFederated: true, IsCircle: false, Kind: not LocalActorKind.Application } ? Json(await _mapper.Local(local, false, token)) : NotFoundError();
|
return local is { IsFederated: true, IsCircle: false, IsServerActor: false } ? Json(await _mapper.Local(local, false, token)) : NotFoundError();
|
||||||
}
|
}
|
||||||
var userName = parts[0];
|
var userName = parts[0];
|
||||||
var domain = parts[1].ToLowerInvariant();
|
var domain = parts[1].ToLowerInvariant();
|
||||||
var foreign = await _dbEntities.ForeignAvatars.Match(f => f.UserName == userName && f.Domain == domain).ExecuteFirstAsync(token);
|
var foreign = await _dbEntities.ForeignAvatars.Match(f => f.UserName == userName && f.Domain == domain && !f.DeletionAt.HasValue).ExecuteFirstAsync(token);
|
||||||
return foreign == default ? NotFoundError() : Json(_mapper.Foreign(foreign));
|
return foreign == default ? NotFoundError() : Json(_mapper.Foreign(foreign));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +177,20 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
|
|
||||||
[HttpGet("/api/v1/accounts/search"), Scope("read:accounts")]
|
[HttpGet("/api/v1/accounts/search"), Scope("read:accounts")]
|
||||||
public async Task<IActionResult> Search([FromServices] AccountSearch search, CancellationToken token) =>
|
public async Task<IActionResult> Search([FromServices] AccountSearch search, CancellationToken token) =>
|
||||||
Json(await search.Find(Params.Get("q"), Params.Bool("resolve") == true && MyId != default, Limit(), token));
|
Json(Params.Bool("following") == true && MyId != default
|
||||||
|
? await search.Followed(MyId, Params.Get("q"), Limit(), token)
|
||||||
|
: await search.Find(Params.Get("q"), Params.Bool("resolve") == true && MyId != default, Limit(), token));
|
||||||
|
|
||||||
|
// Mastodon 4.3: several accounts at once (at most 40), those that exist, in no promised order
|
||||||
|
[HttpGet("/api/v1/accounts"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||||
|
public async Task<IActionResult> Many(CancellationToken token)
|
||||||
|
{
|
||||||
|
var accounts = new List<object>();
|
||||||
|
foreach (var id in Params.List("id").Distinct().Take(40))
|
||||||
|
if (await _mapper.Account(id, token) is { } account)
|
||||||
|
accounts.Add(account);
|
||||||
|
return Json(accounts);
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("/api/v1/accounts/{id}"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
[HttpGet("/api/v1/accounts/{id}"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||||
public async Task<IActionResult> Get(string id, CancellationToken token)
|
public async Task<IActionResult> Get(string id, CancellationToken token)
|
||||||
@@ -151,17 +208,25 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
if (Params.Bool("pinned") == true)
|
if (Params.Bool("pinned") == true)
|
||||||
{
|
{
|
||||||
if (local == default)
|
if (local == default)
|
||||||
return Json(Array.Empty<Status>());
|
{
|
||||||
|
var featured = (await DB.Default.Find<RemoteFeatured>().Match(f => f.ActorURI == remote.ActorURI).Sort(f => f.Position, Order.Ascending)
|
||||||
|
.Limit(Federation.Actors.FeaturedPosts.MaxFeatured).ExecuteAsync(token)).Select(f => f.PostId).ToList();
|
||||||
|
var featuredPosts = await _dbEntities.Posts.Match(p => featured.Contains(p.ID) && !p.DeletedAt.HasValue).Match(VisibilityPolicy.IsPublic).ExecuteAsync(token);
|
||||||
|
return Json(await _mapper.Statuses(featured.Select(id => featuredPosts.FirstOrDefault(p => p.ID == id)).Where(p => p != default).ToList(), MyId, token));
|
||||||
|
}
|
||||||
var pinIds = (await DB.Default.Find<Pin>().Match(p => p.AvatarId == local.Id).Sort(p => p.ID, Order.Descending).ExecuteAsync(token)).Select(p => p.PostId).ToList();
|
var pinIds = (await DB.Default.Find<Pin>().Match(p => p.AvatarId == local.Id).Sort(p => p.ID, Order.Descending).ExecuteAsync(token)).Select(p => p.PostId).ToList();
|
||||||
var pinnedPosts = await _dbEntities.Posts.Match(p => pinIds.Contains(p.ID) && !p.DeletedAt.HasValue).Match(VisibilityPolicy.IsPublic).ExecuteAsync(token);
|
var pinnedPosts = await _dbEntities.Posts.Match(p => pinIds.Contains(p.ID)).Match(VisibilityPolicy.IsPublic).ExecuteAsync(token);
|
||||||
return Json(await _mapper.Statuses(pinIds.Select(id => pinnedPosts.FirstOrDefault(p => p.ID == id)).Where(p => p != default).ToList(), MyId, token));
|
return Json(await _mapper.Statuses(pinIds.Select(id => pinnedPosts.FirstOrDefault(p => p.ID == id)).Where(p => p != default).ToList(), MyId, token));
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = local != default
|
var query = local is { Kind: LocalActorKind.Group }
|
||||||
? _dbEntities.Posts.Match(p => p.GroupUserId == local.Id && !p.IsFederatedCopy && !p.DeletedAt.HasValue)
|
? _dbEntities.Posts.Match(p => p.GroupId == local.Id).Match(VisibilityPolicy.IsShown)
|
||||||
: _dbEntities.Posts.Match(p => p.ActorURI == remote.ActorURI && p.IsFederatedCopy && !p.DeletedAt.HasValue);
|
: local != default
|
||||||
var viewerFollows = MyId != default && local != default
|
? _dbEntities.Posts.Match(p => p.GroupUserId == local.Id && !p.IsFederatedCopy).Match(VisibilityPolicy.IsShown)
|
||||||
&& await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.TargetAccountId == local.Id && f.State == FollowState.Accepted).ExecuteAnyAsync(token);
|
: _dbEntities.Posts.Match(p => p.ActorURI == remote.ActorURI && p.IsFederatedCopy).Match(VisibilityPolicy.IsShown);
|
||||||
|
var viewerFollows = MyId != default && (local != default
|
||||||
|
? await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.TargetAccountId == local.Id && f.State == FollowState.Accepted).ExecuteAnyAsync(token)
|
||||||
|
: await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.TargetActorURI == remote.ActorURI && f.State == FollowState.Accepted).ExecuteAnyAsync(token));
|
||||||
if (MyId != id)
|
if (MyId != id)
|
||||||
query.Match(viewerFollows
|
query.Match(viewerFollows
|
||||||
? p => p.Visibility == PostVisibility.Public || p.Visibility == PostVisibility.Unlisted || p.Visibility == PostVisibility.FollowersOnly
|
? p => p.Visibility == PostVisibility.Public || p.Visibility == PostVisibility.Unlisted || p.Visibility == PostVisibility.FollowersOnly
|
||||||
@@ -169,7 +234,10 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
else
|
else
|
||||||
query.Match(p => p.Visibility != PostVisibility.LocalGeo);
|
query.Match(p => p.Visibility != PostVisibility.LocalGeo);
|
||||||
if (Params.Bool("exclude_replies") == true)
|
if (Params.Bool("exclude_replies") == true)
|
||||||
query.Match(p => p.InReplyToURI == null);
|
{
|
||||||
|
var self = local?.Id ?? remote.ID;
|
||||||
|
query.Match(p => p.InReplyToURI == null || p.InReplyToAccountId == self);
|
||||||
|
}
|
||||||
if (Params.Bool("exclude_reblogs") == true)
|
if (Params.Bool("exclude_reblogs") == true)
|
||||||
query.Match(p => p.ReblogOfPostId == null);
|
query.Match(p => p.ReblogOfPostId == null);
|
||||||
if (Params.Bool("only_media") == true)
|
if (Params.Bool("only_media") == true)
|
||||||
@@ -189,29 +257,49 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
var (local, _) = await Find(id, token);
|
var (local, _) = await Find(id, token);
|
||||||
if (local == default || local.Id != MyId)
|
if (local == default || local.Id != MyId)
|
||||||
return Json(Array.Empty<Account>());
|
return Json(Array.Empty<Account>());
|
||||||
var followers = await _dbEntities.Followers.Match(f => f.LocalActorId == local.Id && f.LocalActorKind == local.Kind && f.IsAccepted)
|
var followers = await Page.From(Params, Limit(40, 80))
|
||||||
.Sort(f => f.ID, Order.Descending).Limit(Limit(40, 80)).ExecuteAsync(token);
|
.Fetch(_dbEntities.Followers.Match(f => f.LocalActorId == local.Id && f.LocalActorKind == local.Kind && f.IsAccepted), f => f.ID, token);
|
||||||
|
Link($"/api/v1/accounts/{id}/followers", followers.LastOrDefault()?.ID, followers.FirstOrDefault()?.ID);
|
||||||
return Json(await AccountsFor(followers.Select(f => f.ActorURI), token));
|
return Json(await AccountsFor(followers.Select(f => f.ActorURI), token));
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("/api/v1/accounts/{id}/following"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
[HttpGet("/api/v1/accounts/{id}/following"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||||
public async Task<IActionResult> Following(string id, CancellationToken token)
|
public async Task<IActionResult> Following(string id, CancellationToken token)
|
||||||
{
|
{
|
||||||
var (local, _) = await Find(id, token);
|
var (local, remote) = await Find(id, token);
|
||||||
|
// a feed's following is what it is: its communities, as its server lists them
|
||||||
|
if (remote is { AvatarType: AvatarType.Feed })
|
||||||
|
return Json(await AccountsFor(remote.FeedCommunities.Take(Limit(40, 80)), token));
|
||||||
if (local == default || local.Id != MyId)
|
if (local == default || local.Id != MyId)
|
||||||
return Json(Array.Empty<Account>());
|
return Json(Array.Empty<Account>());
|
||||||
var following = await _dbEntities.Followings.Match(f => f.AvatarId == local.Id && f.State == FollowState.Accepted)
|
var following = await Page.From(Params, Limit(40, 80))
|
||||||
.Sort(f => f.ID, Order.Descending).Limit(Limit(40, 80)).ExecuteAsync(token);
|
.Fetch(_dbEntities.Followings.Match(f => f.AvatarId == local.Id && f.State == FollowState.Accepted), f => f.ID, token);
|
||||||
|
Link($"/api/v1/accounts/{id}/following", following.LastOrDefault()?.ID, following.FirstOrDefault()?.ID);
|
||||||
var accounts = await _mapper.Accounts(following.Select(f => f.TargetAccountId), token);
|
var accounts = await _mapper.Accounts(following.Select(f => f.TargetAccountId), token);
|
||||||
return Json(following.Select(f => accounts.GetValueOrDefault(f.TargetAccountId)).Where(a => a != default).ToList());
|
return Json(following.Select(f => accounts.GetValueOrDefault(f.TargetAccountId)).Where(a => a != default).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PrivaPub's own: the feeds the persona reads (a feed's timeline is /api/v1/timelines/feed/:id)
|
||||||
|
[HttpGet("/api/v1/feeds"), Scope("read:follows")]
|
||||||
|
public async Task<IActionResult> Feeds(CancellationToken token)
|
||||||
|
{
|
||||||
|
var read = await DB.Default.Find<FeedSubscription>().Match(s => s.AvatarId == MyId).Sort(s => s.ID, MongoDB.Entities.Order.Descending).ExecuteAsync(token);
|
||||||
|
var accounts = await _mapper.Accounts(read.Select(s => s.FeedAccountId), token);
|
||||||
|
return Json(read.Select(s => accounts.GetValueOrDefault(s.FeedAccountId)).Where(a => a != default).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost("/api/v1/accounts/{id}/follow"), Scope("write:follows")]
|
[HttpPost("/api/v1/accounts/{id}/follow"), Scope("write:follows")]
|
||||||
public async Task<IActionResult> Follow(string id, CancellationToken token)
|
public async Task<IActionResult> Follow(string id, CancellationToken token)
|
||||||
{
|
{
|
||||||
var (local, remote) = await Find(id, token);
|
var (local, remote) = await Find(id, token);
|
||||||
if (local == default && remote == default)
|
if (local == default && remote == default)
|
||||||
return NotFoundError();
|
return NotFoundError();
|
||||||
|
// a feed is read through the server, whose reader follows its communities; the persona follows nothing
|
||||||
|
if (remote is { AvatarType: AvatarType.Feed })
|
||||||
|
{
|
||||||
|
await _feeds.Subscribe(Me, remote, true, token);
|
||||||
|
return Json(await Relationship(id, token));
|
||||||
|
}
|
||||||
var following = await _follows.FollowAs(Me, local?.Uri ?? remote.ActorURI, Params.Bool("reblogs") != false, token);
|
var following = await _follows.FollowAs(Me, local?.Uri ?? remote.ActorURI, Params.Bool("reblogs") != false, token);
|
||||||
return following == default ? Error(StatusCodes.Status403Forbidden, "This action is not allowed") : Json(await Relationship(id, token));
|
return following == default ? Error(StatusCodes.Status403Forbidden, "This action is not allowed") : Json(await Relationship(id, token));
|
||||||
}
|
}
|
||||||
@@ -222,7 +310,10 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
var (local, remote) = await Find(id, token);
|
var (local, remote) = await Find(id, token);
|
||||||
if (local == default && remote == default)
|
if (local == default && remote == default)
|
||||||
return NotFoundError();
|
return NotFoundError();
|
||||||
await _follows.UnfollowAs(Me, local?.Uri ?? remote.ActorURI, token);
|
if (remote is { AvatarType: AvatarType.Feed })
|
||||||
|
await _feeds.Subscribe(Me, remote, false, token);
|
||||||
|
else
|
||||||
|
await _follows.UnfollowAs(Me, local?.Uri ?? remote.ActorURI, token);
|
||||||
return Json(await Relationship(id, token));
|
return Json(await Relationship(id, token));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,9 +324,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
var uri = local?.Uri ?? remote?.ActorURI;
|
var uri = local?.Uri ?? remote?.ActorURI;
|
||||||
if (uri == default)
|
if (uri == default)
|
||||||
return NotFoundError();
|
return NotFoundError();
|
||||||
await DB.Default.DeleteAsync<Follower>(f => f.LocalActorId == Me.Id && f.ActorURI == uri);
|
await _relationships.RemoveFollower(Me, uri, id, token);
|
||||||
if (local != default)
|
|
||||||
await DB.Default.DeleteAsync<Following>(f => f.AvatarId == local.Id && f.TargetActorURI == Me.Uri);
|
|
||||||
return Json(await Relationship(id, token));
|
return Json(await Relationship(id, token));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,9 +424,6 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
[HttpGet("/api/v1/accounts/{id}/featured_tags"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
[HttpGet("/api/v1/accounts/{id}/featured_tags"), Scope("read:accounts", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||||
public IActionResult FeaturedTags(string id) => Json(Array.Empty<object>());
|
public IActionResult FeaturedTags(string id) => Json(Array.Empty<object>());
|
||||||
|
|
||||||
[HttpGet("/api/v1/accounts/{id}/lists"), Scope("read:lists")]
|
|
||||||
public IActionResult Lists(string id) => Json(Array.Empty<object>());
|
|
||||||
|
|
||||||
[HttpGet("/api/v1/accounts/familiar_followers"), Scope("read:follows")]
|
[HttpGet("/api/v1/accounts/familiar_followers"), Scope("read:follows")]
|
||||||
public IActionResult FamiliarFollowers() => Json(Params.List("id").Select(id => new { id, accounts = Array.Empty<Account>() }).ToList());
|
public IActionResult FamiliarFollowers() => Json(Params.List("id").Select(id => new { id, accounts = Array.Empty<Account>() }).ToList());
|
||||||
|
|
||||||
@@ -375,11 +461,15 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
var (local, remote) = await Find(id, token);
|
var (local, remote) = await Find(id, token);
|
||||||
var uri = local?.Uri ?? remote?.ActorURI;
|
var uri = local?.Uri ?? remote?.ActorURI;
|
||||||
var following = uri == default ? default : await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.TargetActorURI == uri).ExecuteFirstAsync(token);
|
var following = uri == default ? default : await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.TargetActorURI == uri).ExecuteFirstAsync(token);
|
||||||
|
var reading = remote is { AvatarType: AvatarType.Feed } && await _feeds.IsSubscribed(MyId, remote.ActorURI, token);
|
||||||
var followedBy = uri == default ? default : await _dbEntities.Followers.Match(f => f.LocalActorId == MyId && f.ActorURI == uri).ExecuteFirstAsync(token);
|
var followedBy = uri == default ? default : await _dbEntities.Followers.Match(f => f.LocalActorId == MyId && f.ActorURI == uri).ExecuteFirstAsync(token);
|
||||||
var blocking = uri != default && await DB.Default.Find<Block>().Match(b => b.AvatarId == MyId && b.TargetActorURI == uri).ExecuteAnyAsync(token);
|
var blocking = uri != default && await DB.Default.Find<Block>().Match(b => b.AvatarId == MyId && b.TargetActorURI == uri).ExecuteAnyAsync(token);
|
||||||
var mute = uri == default ? default : await DB.Default.Find<Mute>().Match(m => m.AvatarId == MyId && m.TargetActorURI == uri).ExecuteFirstAsync(token);
|
var mute = uri == default ? default : await DB.Default.Find<Mute>().Match(m => m.AvatarId == MyId && m.TargetActorURI == uri).ExecuteFirstAsync(token);
|
||||||
var blockedBy = local != default && await DB.Default.Find<Block>().Match(b => b.AvatarId == local.Id && b.TargetActorURI == Me.Uri).ExecuteAnyAsync(token);
|
var blockedBy = local != default
|
||||||
var domainBlocked = remote != default && await DB.Default.Find<AccountDomainBlock>().Match(b => b.AvatarId == MyId && b.Domain == remote.Domain).ExecuteAnyAsync(token);
|
? await DB.Default.Find<Block>().Match(b => b.AvatarId == local.Id && b.TargetActorURI == Me.Uri).ExecuteAnyAsync(token)
|
||||||
|
: remote != default && await DB.Default.Find<BlockedBy>().Match(b => b.AvatarId == MyId && b.ActorURI == remote.ActorURI).ExecuteAnyAsync(token);
|
||||||
|
var domainBlocked = remote != default && (await DB.Default.Find<AccountDomainBlock>().Match(b => b.AvatarId == MyId).ExecuteAsync(token))
|
||||||
|
.Any(b => Hidden.Blocks(b.Domain, remote.ActorURI, remote.Domain));
|
||||||
return new Relationship
|
return new Relationship
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
@@ -388,7 +478,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
Muting = mute != default && (mute.ExpiresAt == default || mute.ExpiresAt > DateTime.UtcNow),
|
Muting = mute != default && (mute.ExpiresAt == default || mute.ExpiresAt > DateTime.UtcNow),
|
||||||
MutingNotifications = mute?.HideNotifications == true,
|
MutingNotifications = mute?.HideNotifications == true,
|
||||||
DomainBlocking = domainBlocked,
|
DomainBlocking = domainBlocked,
|
||||||
Following = following?.State == FollowState.Accepted,
|
Following = following?.State == FollowState.Accepted || reading,
|
||||||
Requested = following?.State == FollowState.Requested,
|
Requested = following?.State == FollowState.Requested,
|
||||||
ShowingReblogs = following?.ShowReblogs ?? false,
|
ShowingReblogs = following?.ShowReblogs ?? false,
|
||||||
FollowedBy = followedBy?.IsAccepted == true,
|
FollowedBy = followedBy?.IsAccepted == true,
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using MongoDB.Entities;
|
||||||
|
|
||||||
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Domain.Social;
|
||||||
|
using PrivaPub.Models.Social;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
|
{
|
||||||
|
// Mastodon's announcements: the administrators' (Domain/Social/Announcements.cs), each persona's dismissals and
|
||||||
|
// reactions its own. Anonymous readers get the list without `read` or `me`.
|
||||||
|
public class AnnouncementsController : MastodonController
|
||||||
|
{
|
||||||
|
readonly IAnnouncements _announcements;
|
||||||
|
|
||||||
|
public AnnouncementsController(IAnnouncements announcements)
|
||||||
|
{
|
||||||
|
_announcements = announcements;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/announcements"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||||
|
public async Task<IActionResult> List(CancellationToken token) =>
|
||||||
|
Json(await Map(await _announcements.Shown(token), MyId, token));
|
||||||
|
|
||||||
|
[HttpPost("/api/v1/announcements/{id}/dismiss"), Scope("write:accounts")]
|
||||||
|
public async Task<IActionResult> Dismiss(string id, CancellationToken token) =>
|
||||||
|
await _announcements.Dismiss(id, MyId, token) ? Json(new { }) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpPut("/api/v1/announcements/{id}/reactions/{name}"), Scope("write:favourites")]
|
||||||
|
public Task<IActionResult> React(string id, string name, CancellationToken token) => Reaction(id, name, add: true, token);
|
||||||
|
|
||||||
|
[HttpDelete("/api/v1/announcements/{id}/reactions/{name}"), Scope("write:favourites")]
|
||||||
|
public Task<IActionResult> Unreact(string id, string name, CancellationToken token) => Reaction(id, name, add: false, token);
|
||||||
|
|
||||||
|
async Task<IActionResult> Reaction(string id, string name, bool add, CancellationToken token)
|
||||||
|
{
|
||||||
|
var (status, error) = await _announcements.React(id, MyId, name, add, token);
|
||||||
|
return error == default ? Json(new { }) : Error(status, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Mastodon's Announcement entities, as the viewer (a persona, or nobody) sees them.</summary>
|
||||||
|
public static async Task<List<Dictionary<string, object>>> Map(IReadOnlyList<Announcement> announcements, string viewerId, CancellationToken token)
|
||||||
|
{
|
||||||
|
var ids = announcements.Select(a => a.ID).ToList();
|
||||||
|
if (ids.Count == 0)
|
||||||
|
return new List<Dictionary<string, object>>();
|
||||||
|
var reactions = await DB.Default.Find<AnnouncementReaction>().Match(r => ids.Contains(r.AnnouncementId)).ExecuteAsync(token);
|
||||||
|
var read = viewerId == default
|
||||||
|
? new HashSet<string>()
|
||||||
|
: (await DB.Default.Find<AnnouncementRead>().Match(r => r.AvatarId == viewerId && ids.Contains(r.AnnouncementId)).ExecuteAsync(token))
|
||||||
|
.Select(r => r.AnnouncementId).ToHashSet();
|
||||||
|
return announcements.Select(a =>
|
||||||
|
{
|
||||||
|
var entity = new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
["id"] = a.ID,
|
||||||
|
["content"] = a.Html ?? string.Empty,
|
||||||
|
["starts_at"] = a.StartsAt == default ? default : MastodonJson.Time(a.StartsAt.Value),
|
||||||
|
["ends_at"] = a.EndsAt == default ? default : MastodonJson.Time(a.EndsAt.Value),
|
||||||
|
["all_day"] = a.AllDay,
|
||||||
|
["published_at"] = MastodonJson.Time(a.PublishedAt ?? a.CreatedAt),
|
||||||
|
["updated_at"] = MastodonJson.Time(a.UpdatedAt),
|
||||||
|
["mentions"] = Array.Empty<object>(),
|
||||||
|
["statuses"] = Array.Empty<object>(),
|
||||||
|
["tags"] = Array.Empty<object>(),
|
||||||
|
["emojis"] = Array.Empty<object>(),
|
||||||
|
["reactions"] = reactions.Where(r => r.AnnouncementId == a.ID)
|
||||||
|
.GroupBy(r => r.Name)
|
||||||
|
.OrderBy(g => g.Min(r => r.CreatedAt))
|
||||||
|
.Select(g => Reaction(g.Key, g.Count(), viewerId == default ? default : g.Any(r => r.AvatarId == viewerId)))
|
||||||
|
.ToList()
|
||||||
|
};
|
||||||
|
if (viewerId != default)
|
||||||
|
entity["read"] = read.Contains(a.ID);
|
||||||
|
return entity;
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// a unicode emoji's reaction: no url (custom emoji come later); `me` only for a persona
|
||||||
|
static Dictionary<string, object> Reaction(string name, int count, bool? me)
|
||||||
|
{
|
||||||
|
var reaction = new Dictionary<string, object> { ["name"] = name, ["count"] = count };
|
||||||
|
if (me is { } mine)
|
||||||
|
reaction["me"] = mine;
|
||||||
|
return reaction;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The `announcement.reaction` event's payload: the emoji, how many chose it now, and on which.</summary>
|
||||||
|
public static async Task<Dictionary<string, object>> ReactionEvent(string announcementId, string name, CancellationToken token) => new()
|
||||||
|
{
|
||||||
|
["name"] = name,
|
||||||
|
["count"] = await DB.Default.CountAsync<AnnouncementReaction>(r => r.AnnouncementId == announcementId && r.Name == name, token),
|
||||||
|
["announcement_id"] = announcementId
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Domain.Statistics;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
|
{
|
||||||
|
// The CDNs in front of the servers this server knows, each named by its own domain (owner decision 2026-10-04): how many
|
||||||
|
// servers are behind it, how it is recognised, and week by week who joined and who left.
|
||||||
|
public class CdnsController : MastodonController
|
||||||
|
{
|
||||||
|
const int MaxWeeks = 260;
|
||||||
|
|
||||||
|
readonly IServerPlaces _places;
|
||||||
|
|
||||||
|
public CdnsController(IServerPlaces places) => _places = places;
|
||||||
|
|
||||||
|
[HttpGet("/api/privapub/v1/cdns"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||||
|
public async Task<IActionResult> List(CancellationToken token) => Json((await _places.Cdns(token)).Select(Summary).ToList());
|
||||||
|
|
||||||
|
[HttpGet("/api/privapub/v1/cdns/{key}"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||||
|
public async Task<IActionResult> Detail(string key, CancellationToken token)
|
||||||
|
{
|
||||||
|
var history = await _places.Cdn(key, Math.Clamp(Params.Int("weeks") ?? 52, 1, MaxWeeks), token);
|
||||||
|
if (history == default)
|
||||||
|
return NotFoundError();
|
||||||
|
var detail = new CdnDetail
|
||||||
|
{
|
||||||
|
Hosts = history.Hosts,
|
||||||
|
HostsTruncated = history.Group.Servers > history.Hosts.Count,
|
||||||
|
Weeks = history.Weeks.Select(w => new CdnWeekEntry { Week = w.Week, Servers = w.Servers, Joined = w.Joined, Left = w.Left }).ToList()
|
||||||
|
};
|
||||||
|
Fill(detail, history.Group);
|
||||||
|
return Json(detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CdnSummary Summary(CdnGroup group)
|
||||||
|
{
|
||||||
|
var summary = new CdnSummary();
|
||||||
|
Fill(summary, group);
|
||||||
|
return summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Fill(CdnSummary summary, CdnGroup group)
|
||||||
|
{
|
||||||
|
summary.Key = group.Key;
|
||||||
|
summary.Name = group.Name;
|
||||||
|
summary.Domain = group.Domain;
|
||||||
|
summary.Servers = group.Servers;
|
||||||
|
summary.Ranges = group.Ranges;
|
||||||
|
summary.RangesUpdatedAt = group.RangesUpdatedAt is { } at ? MastodonJson.Time(at) : default;
|
||||||
|
summary.DetectedBy = group.DetectedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CdnSummary
|
||||||
|
{
|
||||||
|
public string Key { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Domain { get; set; }
|
||||||
|
public int Servers { get; set; }
|
||||||
|
public int Ranges { get; set; }
|
||||||
|
public string RangesUpdatedAt { get; set; }
|
||||||
|
public List<string> DetectedBy { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CdnDetail : CdnSummary
|
||||||
|
{
|
||||||
|
public List<string> Hosts { get; set; } = new();
|
||||||
|
public bool HostsTruncated { get; set; }
|
||||||
|
public List<CdnWeekEntry> Weeks { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CdnWeekEntry
|
||||||
|
{
|
||||||
|
public string Week { get; set; }
|
||||||
|
public int Servers { get; set; }
|
||||||
|
public List<string> Joined { get; set; } = new();
|
||||||
|
public List<string> Left { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,362 @@
|
|||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using MongoDB.Bson;
|
||||||
|
using MongoDB.Entities;
|
||||||
|
|
||||||
|
using PrivaPub.Api.Mastodon.Entities;
|
||||||
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Domain.Social;
|
||||||
|
using PrivaPub.Models.Social;
|
||||||
|
using PrivaPub.StaticServices;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
|
{
|
||||||
|
// Mastodon's filters (owner decision 2026-10-04, back from the cut list): v2 filters with their keywords and statuses,
|
||||||
|
// and the v1 API, whose filter is one keyword of a v2 filter. Statuses carry what they match in `filtered`; clients
|
||||||
|
// apply the context and the action. Nothing here leaves the server.
|
||||||
|
public class FiltersController : MastodonController
|
||||||
|
{
|
||||||
|
const int MaxFilters = 100;
|
||||||
|
const int MaxEntries = 100;
|
||||||
|
const int MaxKeywordLength = 100;
|
||||||
|
static readonly Regex Attribute = new(@"^keywords_attributes\[(\d*)\]\[(\w+)\]$", RegexOptions.Compiled);
|
||||||
|
|
||||||
|
readonly DbEntities _dbEntities;
|
||||||
|
|
||||||
|
public FiltersController(DbEntities dbEntities)
|
||||||
|
{
|
||||||
|
_dbEntities = dbEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
static string NewId() => ObjectId.GenerateNewId().ToString();
|
||||||
|
|
||||||
|
Task<PersonaFilter> Mine(string id, CancellationToken token) =>
|
||||||
|
DB.Default.Find<PersonaFilter>().Match(f => f.ID == id && f.AvatarId == MyId).ExecuteFirstAsync(token);
|
||||||
|
|
||||||
|
Task<PersonaFilter> WithKeyword(string keywordId, CancellationToken token) =>
|
||||||
|
DB.Default.Find<PersonaFilter>().Match(f => f.AvatarId == MyId && f.Keywords.Any(k => k.Id == keywordId)).ExecuteFirstAsync(token);
|
||||||
|
|
||||||
|
Task<PersonaFilter> WithStatus(string statusFilterId, CancellationToken token) =>
|
||||||
|
DB.Default.Find<PersonaFilter>().Match(f => f.AvatarId == MyId && f.Statuses.Any(s => s.Id == statusFilterId)).ExecuteFirstAsync(token);
|
||||||
|
|
||||||
|
static JsonResult Invalid(string message) => Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: " + message);
|
||||||
|
|
||||||
|
// title, context[], filter_action, expires_in: what a create or an update sets; an error message when one is wrong
|
||||||
|
string Apply(PersonaFilter filter, bool creating)
|
||||||
|
{
|
||||||
|
var title = Params.Get("title")?.Trim();
|
||||||
|
if (title != default || creating)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(title) || title.Length > 200)
|
||||||
|
return "Title can't be blank";
|
||||||
|
filter.Title = title;
|
||||||
|
}
|
||||||
|
if (Params.Has("context") || creating)
|
||||||
|
{
|
||||||
|
var context = Params.List("context").Distinct().ToList();
|
||||||
|
if (context.Count == 0 || context.Any(c => !FilterContexts.IsValid(c)))
|
||||||
|
return "Context can't be blank";
|
||||||
|
filter.Context = context;
|
||||||
|
}
|
||||||
|
if (Params.Get("filter_action") is { } action)
|
||||||
|
{
|
||||||
|
if (!FilterActions.IsValid(action))
|
||||||
|
return "Filter action is not included in the list";
|
||||||
|
filter.Action = action;
|
||||||
|
}
|
||||||
|
if (Params.Has("expires_in"))
|
||||||
|
filter.ExpiresAt = Params.Int("expires_in") is > 0 and var seconds ? DateTime.UtcNow.AddSeconds(seconds) : default;
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
|
// keywords_attributes, as Rails takes them: a JSON array of objects, or form fields [][keyword], [][whole_word], [][id],
|
||||||
|
// [][_destroy], or numbered [0][keyword]
|
||||||
|
List<Dictionary<string, string>> KeywordAttributes()
|
||||||
|
{
|
||||||
|
if (Params.Json is { ValueKind: System.Text.Json.JsonValueKind.Object } body
|
||||||
|
&& body.TryGetProperty("keywords_attributes", out var array) && array.ValueKind == System.Text.Json.JsonValueKind.Array)
|
||||||
|
return array.EnumerateArray().Where(o => o.ValueKind == System.Text.Json.JsonValueKind.Object)
|
||||||
|
.Select(o => o.EnumerateObject().ToDictionary(p => p.Name, p => p.Value.ValueKind switch
|
||||||
|
{
|
||||||
|
System.Text.Json.JsonValueKind.String => p.Value.GetString(),
|
||||||
|
System.Text.Json.JsonValueKind.True => "true",
|
||||||
|
System.Text.Json.JsonValueKind.False => "false",
|
||||||
|
_ => p.Value.ToString()
|
||||||
|
}))
|
||||||
|
.ToList();
|
||||||
|
var numbered = new SortedDictionary<int, Dictionary<string, string>>();
|
||||||
|
var listed = new Dictionary<string, IReadOnlyList<string>>();
|
||||||
|
foreach (var name in Params.Names)
|
||||||
|
{
|
||||||
|
var match = Attribute.Match(name);
|
||||||
|
if (!match.Success)
|
||||||
|
continue;
|
||||||
|
if (match.Groups[1].Value.Length == 0)
|
||||||
|
listed[match.Groups[2].Value] = Params.List(name);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var index = int.Parse(match.Groups[1].Value);
|
||||||
|
if (!numbered.TryGetValue(index, out var item))
|
||||||
|
numbered[index] = item = new Dictionary<string, string>();
|
||||||
|
item[match.Groups[2].Value] = Params.Get(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var items = numbered.Values.ToList();
|
||||||
|
var count = listed.Count == 0 ? 0 : listed.Values.Max(v => v.Count);
|
||||||
|
for (var i = 0; i < count; i++)
|
||||||
|
items.Add(listed.Where(kv => i < kv.Value.Count).ToDictionary(kv => kv.Key, kv => kv.Value[i]));
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool IsTrue(string value) => value?.ToLowerInvariant() is "true" or "1" or "on" or "yes";
|
||||||
|
|
||||||
|
// adds, changes or removes keywords; an error message when one is wrong
|
||||||
|
static string ApplyKeywords(PersonaFilter filter, List<Dictionary<string, string>> items)
|
||||||
|
{
|
||||||
|
foreach (var item in items)
|
||||||
|
{
|
||||||
|
var id = item.GetValueOrDefault("id");
|
||||||
|
var existing = id == default ? default : filter.Keywords.FirstOrDefault(k => k.Id == id);
|
||||||
|
if (existing != default && IsTrue(item.GetValueOrDefault("_destroy")))
|
||||||
|
{
|
||||||
|
filter.Keywords.Remove(existing);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var keyword = item.GetValueOrDefault("keyword")?.Trim();
|
||||||
|
if (existing == default && string.IsNullOrEmpty(keyword))
|
||||||
|
return "Keyword can't be blank";
|
||||||
|
if (keyword?.Length > MaxKeywordLength)
|
||||||
|
return "Keyword is too long";
|
||||||
|
var target = existing ?? new FilterKeyword { Id = NewId() };
|
||||||
|
if (!string.IsNullOrEmpty(keyword))
|
||||||
|
target.Keyword = keyword;
|
||||||
|
if (item.ContainsKey("whole_word"))
|
||||||
|
target.WholeWord = IsTrue(item["whole_word"]);
|
||||||
|
else if (existing == default)
|
||||||
|
target.WholeWord = true;
|
||||||
|
if (existing == default)
|
||||||
|
filter.Keywords.Add(target);
|
||||||
|
}
|
||||||
|
return filter.Keywords.Count > MaxEntries ? "Too many keywords" : default;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- v2
|
||||||
|
|
||||||
|
[HttpGet("/api/v2/filters"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> All(CancellationToken token) =>
|
||||||
|
Json((await DB.Default.Find<PersonaFilter>().Match(f => f.AvatarId == MyId).Sort(f => f.ID, Order.Ascending).ExecuteAsync(token))
|
||||||
|
.Select(Filters.View).ToList());
|
||||||
|
|
||||||
|
[HttpGet("/api/v2/filters/{id}"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> One(string id, CancellationToken token) =>
|
||||||
|
await Mine(id, token) is { } filter ? Json(Filters.View(filter)) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpPost("/api/v2/filters"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> Create(CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await DB.Default.CountAsync<PersonaFilter>(f => f.AvatarId == MyId, token) >= MaxFilters)
|
||||||
|
return Invalid("Too many filters");
|
||||||
|
var filter = new PersonaFilter { AvatarId = MyId };
|
||||||
|
if ((Apply(filter, creating: true) ?? ApplyKeywords(filter, KeywordAttributes())) is { } problem)
|
||||||
|
return Invalid(problem);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(Filters.View(filter));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("/api/v2/filters/{id}"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> Update(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
if ((Apply(filter, creating: false) ?? ApplyKeywords(filter, KeywordAttributes())) is { } problem)
|
||||||
|
return Invalid(problem);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(Filters.View(filter));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("/api/v2/filters/{id}"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> Delete(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
await DB.Default.DeleteAsync<PersonaFilter>(filter.ID);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v2/filters/{id}/keywords"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> Keywords(string id, CancellationToken token) =>
|
||||||
|
await Mine(id, token) is { } filter ? Json(filter.Keywords.Select(Filters.Keyword).ToList()) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpPost("/api/v2/filters/{id}/keywords"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> AddKeyword(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
var item = new Dictionary<string, string> { ["keyword"] = Params.Get("keyword") };
|
||||||
|
if (Params.Has("whole_word"))
|
||||||
|
item["whole_word"] = Params.Get("whole_word");
|
||||||
|
if (ApplyKeywords(filter, new List<Dictionary<string, string>> { item }) is { } problem)
|
||||||
|
return Invalid(problem);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(Filters.Keyword(filter.Keywords[^1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v2/filters/keywords/{id}"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> Keyword(string id, CancellationToken token) =>
|
||||||
|
await WithKeyword(id, token) is { } filter ? Json(Filters.Keyword(filter.Keywords.First(k => k.Id == id))) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpPut("/api/v2/filters/keywords/{id}"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> UpdateKeyword(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await WithKeyword(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
var item = new Dictionary<string, string> { ["id"] = id, ["keyword"] = Params.Get("keyword") };
|
||||||
|
if (Params.Has("whole_word"))
|
||||||
|
item["whole_word"] = Params.Get("whole_word");
|
||||||
|
if (ApplyKeywords(filter, new List<Dictionary<string, string>> { item }) is { } problem)
|
||||||
|
return Invalid(problem);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(Filters.Keyword(filter.Keywords.First(k => k.Id == id)));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("/api/v2/filters/keywords/{id}"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> DeleteKeyword(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await WithKeyword(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
filter.Keywords.RemoveAll(k => k.Id == id);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v2/filters/{id}/statuses"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> Statuses(string id, CancellationToken token) =>
|
||||||
|
await Mine(id, token) is { } filter ? Json(filter.Statuses.Select(Filters.Status).ToList()) : NotFoundError();
|
||||||
|
|
||||||
|
// a status the persona can see, once per filter
|
||||||
|
[HttpPost("/api/v2/filters/{id}/statuses"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> AddStatus(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
var statusId = Params.Get("status_id");
|
||||||
|
var post = string.IsNullOrEmpty(statusId) ? default : await _dbEntities.Posts.Match(p => p.ID == statusId).ExecuteFirstAsync(token);
|
||||||
|
if (post == default || !await Domain.Privacy.VisibilityPolicy.CanSee(post, MyId, token))
|
||||||
|
return NotFoundError();
|
||||||
|
if (filter.Statuses.FirstOrDefault(s => s.PostId == statusId) is { } present)
|
||||||
|
return Json(Filters.Status(present));
|
||||||
|
if (filter.Statuses.Count >= MaxEntries)
|
||||||
|
return Invalid("Too many statuses");
|
||||||
|
var added = new FilterStatus { Id = NewId(), PostId = statusId };
|
||||||
|
filter.Statuses.Add(added);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(Filters.Status(added));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v2/filters/statuses/{id}"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> Status(string id, CancellationToken token) =>
|
||||||
|
await WithStatus(id, token) is { } filter ? Json(Filters.Status(filter.Statuses.First(s => s.Id == id))) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpDelete("/api/v2/filters/statuses/{id}"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> DeleteStatus(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await WithStatus(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
filter.Statuses.RemoveAll(s => s.Id == id);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- v1: each keyword is a filter of its own, with its parent's context, action and expiry
|
||||||
|
|
||||||
|
static FilterV1Entity V1(PersonaFilter filter, FilterKeyword keyword) => new()
|
||||||
|
{
|
||||||
|
Id = keyword.Id,
|
||||||
|
Phrase = keyword.Keyword,
|
||||||
|
Context = filter.Context,
|
||||||
|
WholeWord = keyword.WholeWord,
|
||||||
|
ExpiresAt = filter.ExpiresAt.HasValue ? MastodonJson.Time(filter.ExpiresAt.Value) : default,
|
||||||
|
Irreversible = filter.Action == FilterActions.Hide
|
||||||
|
};
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/filters"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> AllV1(CancellationToken token) =>
|
||||||
|
Json((await DB.Default.Find<PersonaFilter>().Match(f => f.AvatarId == MyId).Sort(f => f.ID, Order.Ascending).ExecuteAsync(token))
|
||||||
|
.SelectMany(f => f.Keywords.Select(k => V1(f, k))).ToList());
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/filters/{id}"), Scope("read:filters")]
|
||||||
|
public async Task<IActionResult> OneV1(string id, CancellationToken token) =>
|
||||||
|
await WithKeyword(id, token) is { } filter ? Json(V1(filter, filter.Keywords.First(k => k.Id == id))) : NotFoundError();
|
||||||
|
|
||||||
|
// phrase, context[], irreversible, whole_word, expires_in
|
||||||
|
string ApplyV1(PersonaFilter filter, FilterKeyword keyword, bool creating)
|
||||||
|
{
|
||||||
|
var phrase = Params.Get("phrase")?.Trim();
|
||||||
|
if (phrase != default || creating)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(phrase))
|
||||||
|
return "Phrase can't be blank";
|
||||||
|
if (phrase.Length > MaxKeywordLength)
|
||||||
|
return "Phrase is too long";
|
||||||
|
keyword.Keyword = phrase;
|
||||||
|
if (creating)
|
||||||
|
filter.Title = phrase;
|
||||||
|
}
|
||||||
|
if (Params.Has("context") || creating)
|
||||||
|
{
|
||||||
|
var context = Params.List("context").Distinct().ToList();
|
||||||
|
if (context.Count == 0 || context.Any(c => !FilterContexts.IsValid(c)))
|
||||||
|
return "Context can't be blank";
|
||||||
|
filter.Context = context;
|
||||||
|
}
|
||||||
|
if (Params.Bool("whole_word") is { } wholeWord)
|
||||||
|
keyword.WholeWord = wholeWord;
|
||||||
|
if (Params.Bool("irreversible") is { } irreversible)
|
||||||
|
filter.Action = irreversible ? FilterActions.Hide : FilterActions.Warn;
|
||||||
|
if (Params.Has("expires_in"))
|
||||||
|
filter.ExpiresAt = Params.Int("expires_in") is > 0 and var seconds ? DateTime.UtcNow.AddSeconds(seconds) : default;
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("/api/v1/filters"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> CreateV1(CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await DB.Default.CountAsync<PersonaFilter>(f => f.AvatarId == MyId, token) >= MaxFilters)
|
||||||
|
return Invalid("Too many filters");
|
||||||
|
var keyword = new FilterKeyword { Id = NewId(), WholeWord = true };
|
||||||
|
var filter = new PersonaFilter { AvatarId = MyId, Keywords = new List<FilterKeyword> { keyword } };
|
||||||
|
if (ApplyV1(filter, keyword, creating: true) is { } problem)
|
||||||
|
return Invalid(problem);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(V1(filter, keyword));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("/api/v1/filters/{id}"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> UpdateV1(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await WithKeyword(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
var keyword = filter.Keywords.First(k => k.Id == id);
|
||||||
|
if (ApplyV1(filter, keyword, creating: false) is { } problem)
|
||||||
|
return Invalid(problem);
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(V1(filter, keyword));
|
||||||
|
}
|
||||||
|
|
||||||
|
// the keyword goes, and its filter with it when nothing else is left in it
|
||||||
|
[HttpDelete("/api/v1/filters/{id}"), Scope("write:filters")]
|
||||||
|
public async Task<IActionResult> DeleteV1(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await WithKeyword(id, token) is not { } filter)
|
||||||
|
return NotFoundError();
|
||||||
|
filter.Keywords.RemoveAll(k => k.Id == id);
|
||||||
|
if (filter.Keywords.Count == 0 && filter.Statuses.Count == 0)
|
||||||
|
await DB.Default.DeleteAsync<PersonaFilter>(filter.ID);
|
||||||
|
else
|
||||||
|
await DB.Default.SaveAsync(filter, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,107 +1,277 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
using MongoDB.Entities;
|
using MongoDB.Entities;
|
||||||
|
|
||||||
using PrivaPub.Api.Mastodon.Infrastructure;
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Api.Mastodon.Mappers;
|
||||||
|
using PrivaPub.Domain.Content;
|
||||||
|
using PrivaPub.Domain.Instance;
|
||||||
using PrivaPub.Domain.Privacy;
|
using PrivaPub.Domain.Privacy;
|
||||||
using PrivaPub.Federation.Actors;
|
using PrivaPub.Federation.Actors;
|
||||||
|
using PrivaPub.Infrastructure;
|
||||||
|
using PrivaPub.Models;
|
||||||
|
using PrivaPub.Models.Federation;
|
||||||
using PrivaPub.Models.User;
|
using PrivaPub.Models.User;
|
||||||
|
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
using PostEntity = PrivaPub.Models.Post.Post;
|
using PostEntity = PrivaPub.Models.Post.Post;
|
||||||
|
|
||||||
namespace PrivaPub.Api.Mastodon.Controllers
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
{
|
{
|
||||||
|
// The instance API: what the server says of itself comes from its settings (IInstanceSettings, edited on the
|
||||||
|
// administrator's page; until then exactly what it said before), its numbers from Counted, its limits from where they
|
||||||
|
// are enforced.
|
||||||
public class InstanceController : MastodonController
|
public class InstanceController : MastodonController
|
||||||
{
|
{
|
||||||
public const string Version = "4.2.0 (compatible; PrivaPub)";
|
public const string Version = "4.2.0 (compatible; PrivaPub)";
|
||||||
const string Description = "A small ActivityPub server where one private login keeps several unlinkable public personas.";
|
const int ActivityWeeks = 12;
|
||||||
|
static readonly TimeSpan ActivityLifetime = TimeSpan.FromHours(1);
|
||||||
|
static volatile CachedActivity _activity;
|
||||||
|
|
||||||
|
sealed record CachedActivity(DateTime At, object Weeks);
|
||||||
|
|
||||||
readonly ILocalActorService _localActors;
|
readonly ILocalActorService _localActors;
|
||||||
|
readonly IOptionsMonitor<RegistrationOptions> _registrations;
|
||||||
|
readonly IInstanceSettings _settings;
|
||||||
|
readonly MastodonMapper _mapper;
|
||||||
|
|
||||||
public InstanceController(ILocalActorService localActors)
|
public InstanceController(ILocalActorService localActors, IOptionsMonitor<RegistrationOptions> registrations, IInstanceSettings settings,
|
||||||
|
MastodonMapper mapper)
|
||||||
{
|
{
|
||||||
_localActors = localActors;
|
_localActors = localActors;
|
||||||
|
_registrations = registrations;
|
||||||
|
_settings = settings;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Open => _registrations.CurrentValue.IsOpen;
|
||||||
|
|
||||||
|
ServerSettings Settings => _settings.Current;
|
||||||
|
|
||||||
|
string Thumbnail => Settings.ThumbnailUrl ?? $"{_localActors.BaseAddress}{ServerSettings.DefaultThumbnailPath}";
|
||||||
|
|
||||||
|
static object Rules(ServerSettings settings) =>
|
||||||
|
settings.ListedRules().Select(r => new { id = r.Id, text = r.Text ?? string.Empty, hint = r.Hint ?? string.Empty }).ToList();
|
||||||
|
|
||||||
|
// the persona the administrator named as the server's contact, while it exists and its login may act
|
||||||
|
async Task<object> ContactAccount(ServerSettings settings, CancellationToken token)
|
||||||
|
{
|
||||||
|
var id = settings.ContactAccountId;
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
return default;
|
||||||
|
var avatar = await DB.Default.Find<Avatar>().Match(a => a.ID == id && !a.DeletionAt.HasValue).ExecuteFirstAsync(token);
|
||||||
|
if (avatar == default || (await Counted.BarredPersonas(token)).Contains(id))
|
||||||
|
return default;
|
||||||
|
return await _mapper.Local(_localActors.FromAvatar(avatar), false, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
// the languages this server is set up for (AppConfiguration:SupportedLanguages), "en" when none are named
|
||||||
|
public static IReadOnlyList<string> LanguageCodes(IServiceProvider services)
|
||||||
|
{
|
||||||
|
var configured = services.GetRequiredService<Microsoft.Extensions.Options.IOptionsMonitor<Models.AppConfiguration>>().CurrentValue.SupportedLanguages;
|
||||||
|
var codes = (configured ?? new List<string>()).Where(c => !string.IsNullOrWhiteSpace(c)).Select(c => c.Split('-')[0].ToLowerInvariant()).Distinct().ToList();
|
||||||
|
return codes.Count == 0 ? new[] { "en" } : codes;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Domain => new Uri(_localActors.BaseAddress).Authority;
|
string Domain => new Uri(_localActors.BaseAddress).Authority;
|
||||||
|
|
||||||
static object Statuses => new { max_characters = 5000, max_media_attachments = 4, characters_reserved_per_url = 23 };
|
// where clients open their streams (StreamingController): this server, as ws or wss
|
||||||
|
string Streaming => new UriBuilder(_localActors.BaseAddress) { Scheme = _localActors.BaseAddress.StartsWith("https", StringComparison.OrdinalIgnoreCase) ? "wss" : "ws" }
|
||||||
|
.Uri.GetLeftPart(UriPartial.Authority);
|
||||||
|
|
||||||
static object MediaAttachments => new
|
// every limit is what the server enforces, read from where it is enforced
|
||||||
|
static object Statuses => new { max_characters = PrivaPub.Domain.Statuses.StatusService.MaxCharacters, max_media_attachments = 4, characters_reserved_per_url = 23 };
|
||||||
|
|
||||||
|
object MediaAttachments
|
||||||
{
|
{
|
||||||
supported_mime_types = new[] { "image/jpeg", "image/png", "image/gif", "image/webp", "video/mp4", "video/webm", "audio/mpeg", "audio/ogg" },
|
get
|
||||||
image_size_limit = 16 * 1024 * 1024,
|
{
|
||||||
image_matrix_limit = 16_777_216,
|
var media = HttpContext.RequestServices.GetRequiredService<IOptionsMonitor<PrivaPub.Domain.Media.MediaOptions>>().CurrentValue;
|
||||||
video_size_limit = 99 * 1024 * 1024,
|
return new
|
||||||
video_frame_rate_limit = 60,
|
{
|
||||||
video_matrix_limit = 2_304_000
|
supported_mime_types = PrivaPub.Domain.Media.MediaService.SupportedTypes,
|
||||||
};
|
image_size_limit = media.MaxImageBytes,
|
||||||
|
image_matrix_limit = media.MaxPixels,
|
||||||
|
video_size_limit = media.MaxVideoBytes,
|
||||||
|
video_frame_rate_limit = (int)media.MaxFrameRate,
|
||||||
|
video_matrix_limit = media.MaxVideoPixels
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static object Polls => new { max_options = 4, max_characters_per_option = 50, min_expiration = 300, max_expiration = 2_629_746 };
|
static object Polls => new
|
||||||
|
{
|
||||||
|
max_options = PrivaPub.Domain.Statuses.PollService.MaxOptions,
|
||||||
|
max_characters_per_option = PrivaPub.Domain.Statuses.PollService.MaxOptionLength,
|
||||||
|
min_expiration = PrivaPub.Domain.Statuses.PollService.MinExpiration,
|
||||||
|
max_expiration = PrivaPub.Domain.Statuses.PollService.MaxExpiration
|
||||||
|
};
|
||||||
|
|
||||||
[HttpGet("/api/v1/instance"), AllowAnonymous]
|
[HttpGet("/api/v1/instance"), AllowAnonymous]
|
||||||
public async Task<IActionResult> V1(CancellationToken token)
|
public async Task<IActionResult> V1(CancellationToken token)
|
||||||
{
|
{
|
||||||
var users = await DB.Default.CountAsync<Avatar>(a => !a.DeletionAt.HasValue, token);
|
var settings = Settings;
|
||||||
var statuses = await DB.Default.CountAsync<PostEntity>(f => f.Where(p => !p.IsFederatedCopy) & f.Where(VisibilityPolicy.IsPublic), token);
|
var users = await Counted.Users(token);
|
||||||
var domains = (await DB.Default.Find<ForeignAvatar, string>().Project(a => a.Domain).ExecuteAsync(token)).Distinct().Count();
|
var statuses = await Counted.LocalPosts(token);
|
||||||
|
var domains = await KnownServers(token);
|
||||||
return Json(new
|
return Json(new
|
||||||
{
|
{
|
||||||
uri = Domain,
|
uri = Domain,
|
||||||
title = "PrivaPub",
|
title = settings.Title,
|
||||||
short_description = Description,
|
short_description = settings.ShortDescription ?? string.Empty,
|
||||||
description = Description,
|
description = settings.ShortDescription ?? string.Empty,
|
||||||
email = string.Empty,
|
email = settings.ContactEmail ?? string.Empty,
|
||||||
version = Version,
|
version = Version,
|
||||||
urls = new { streaming_api = $"wss://{Domain}" },
|
urls = new { streaming_api = Streaming },
|
||||||
stats = new { user_count = users, status_count = statuses, domain_count = domains },
|
stats = new { user_count = users, status_count = statuses, domain_count = domains },
|
||||||
thumbnail = $"{_localActors.BaseAddress}/media/missing-header.png",
|
thumbnail = Thumbnail,
|
||||||
languages = new[] { "en" },
|
languages = LanguageCodes(HttpContext.RequestServices),
|
||||||
registrations = false,
|
registrations = Open,
|
||||||
approval_required = false,
|
approval_required = false,
|
||||||
invites_enabled = false,
|
invites_enabled = true,//a group invitation always creates an account
|
||||||
configuration = new { accounts = new { max_featured_tags = 0 }, statuses = Statuses, media_attachments = MediaAttachments, polls = Polls },
|
configuration = new { accounts = new { max_featured_tags = 0 }, statuses = Statuses, media_attachments = MediaAttachments, polls = Polls },
|
||||||
contact_account = default(object),
|
contact_account = await ContactAccount(settings, token),
|
||||||
rules = Array.Empty<object>()
|
rules = Rules(settings)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the servers we have exchanged activities with, as the statistics count them. Which ones is not published
|
||||||
|
// (/instance/peers stays empty, as on a Mastodon with its peers API off): on a small server it would say who its
|
||||||
|
// personas talk to.
|
||||||
|
static async Task<long> KnownServers(CancellationToken token) =>
|
||||||
|
await DB.Default.CountAsync<Models.Jobs.RemoteInstance>(i => i.Seen == "touched", token);
|
||||||
|
|
||||||
[HttpGet("/api/v2/instance"), AllowAnonymous]
|
[HttpGet("/api/v2/instance"), AllowAnonymous]
|
||||||
public IActionResult V2() => Json(new
|
public async Task<IActionResult> V2(CancellationToken token) => Json(new
|
||||||
{
|
{
|
||||||
domain = Domain,
|
domain = Domain,
|
||||||
title = "PrivaPub",
|
title = Settings.Title,
|
||||||
version = Version,
|
version = Version,
|
||||||
|
api_versions = new { mastodon = 7 },
|
||||||
source_url = "https://git.thepra.dev/thepra/SocialPub",
|
source_url = "https://git.thepra.dev/thepra/SocialPub",
|
||||||
description = Description,
|
description = Settings.ShortDescription ?? string.Empty,
|
||||||
usage = new { users = new { active_month = 0 } },
|
usage = new { users = new { active_month = await Counted.ActiveUsers(30, token) } },
|
||||||
thumbnail = new { url = $"{_localActors.BaseAddress}/media/missing-header.png" },
|
thumbnail = new { url = Thumbnail },
|
||||||
languages = new[] { "en" },
|
languages = LanguageCodes(HttpContext.RequestServices),
|
||||||
configuration = new
|
configuration = new
|
||||||
{
|
{
|
||||||
urls = new { streaming = $"wss://{Domain}" },
|
urls = new { streaming = Streaming },
|
||||||
accounts = new { max_featured_tags = 0, max_pinned_statuses = 0 },
|
accounts = new { max_featured_tags = 0, max_pinned_statuses = StatusesController.MaxPins },
|
||||||
statuses = Statuses,
|
statuses = Statuses,
|
||||||
media_attachments = MediaAttachments,
|
media_attachments = MediaAttachments,
|
||||||
polls = Polls,
|
polls = Polls,
|
||||||
translation = new { enabled = false }
|
translation = new { enabled = false }
|
||||||
},
|
},
|
||||||
registrations = new { enabled = false, approval_required = false, message = default(string) },
|
registrations = new { enabled = Open, approval_required = false, message = Open ? default : RegistrationOptions.ClosedMessage },
|
||||||
contact = new { email = string.Empty, account = default(object) },
|
contact = new { email = Settings.ContactEmail ?? string.Empty, account = await ContactAccount(Settings, token) },
|
||||||
rules = Array.Empty<object>()
|
rules = Rules(Settings)
|
||||||
});
|
});
|
||||||
|
|
||||||
[HttpGet("/api/v1/instance/peers"), AllowAnonymous]
|
[HttpGet("/api/v1/instance/peers"), AllowAnonymous]
|
||||||
public IActionResult Peers() => Json(Array.Empty<string>());
|
public IActionResult Peers() => Json(Array.Empty<string>());
|
||||||
|
|
||||||
|
// Mastodon's weekly activity, only when the administrator publishes it (off by default): twelve weeks, this one first,
|
||||||
|
// counted as Counted counts (local posts, logins made); sign-ins are not kept, so `logins` is 0. Worked out at most
|
||||||
|
// once an hour.
|
||||||
[HttpGet("/api/v1/instance/activity"), AllowAnonymous]
|
[HttpGet("/api/v1/instance/activity"), AllowAnonymous]
|
||||||
public IActionResult Activity() => Json(Array.Empty<object>());
|
public async Task<IActionResult> Activity(CancellationToken token)
|
||||||
|
{
|
||||||
|
if (!Settings.PublishActivity)
|
||||||
|
return Json(Array.Empty<object>());
|
||||||
|
if (_activity is { } cached && DateTime.UtcNow - cached.At < ActivityLifetime)
|
||||||
|
return Json(cached.Weeks);
|
||||||
|
var weeks = (await Counted.Weekly(ActivityWeeks, token)).Select(w => new
|
||||||
|
{
|
||||||
|
week = new DateTimeOffset(w.Week, TimeSpan.Zero).ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture),
|
||||||
|
statuses = w.Posts.ToString(CultureInfo.InvariantCulture),
|
||||||
|
logins = "0",
|
||||||
|
registrations = w.Registrations.ToString(CultureInfo.InvariantCulture)
|
||||||
|
}).ToList();
|
||||||
|
_activity = new CachedActivity(DateTime.UtcNow, weeks);
|
||||||
|
return Json(weeks);
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("/api/v1/instance/rules"), AllowAnonymous]
|
[HttpGet("/api/v1/instance/rules"), AllowAnonymous]
|
||||||
public IActionResult Rules() => Json(Array.Empty<object>());
|
public IActionResult InstanceRules() => Json(Rules(Settings));
|
||||||
|
|
||||||
[HttpGet("/api/v1/instance/extended_description"), AllowAnonymous]
|
[HttpGet("/api/v1/instance/extended_description"), AllowAnonymous]
|
||||||
public IActionResult ExtendedDescription() => Json(new { updated_at = MastodonJson.Day(DateTime.UtcNow), content = $"<p>{Description}</p>" });
|
public IActionResult ExtendedDescription()
|
||||||
|
{
|
||||||
|
var settings = Settings;
|
||||||
|
return Json(new
|
||||||
|
{
|
||||||
|
updated_at = settings.DescriptionUpdatedAt is { } updated ? MastodonJson.Time(updated) : MastodonJson.Day(DateTime.UtcNow),
|
||||||
|
content = ContentRenderer.Document(settings.Description)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/instance/privacy_policy"), AllowAnonymous]
|
||||||
|
public IActionResult PrivacyPolicy()
|
||||||
|
{
|
||||||
|
var settings = Settings;
|
||||||
|
return Json(new
|
||||||
|
{
|
||||||
|
updated_at = MastodonJson.Time(settings.PrivacyPolicyUpdatedAt ?? ServerSettings.DefaultPrivacyPolicyUpdatedAt),
|
||||||
|
content = ContentRenderer.Document(settings.PrivacyPolicy)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mastodon 4.4's terms of service: the one version the server keeps, 404 while it has none
|
||||||
|
[HttpGet("/api/v1/instance/terms_of_service"), AllowAnonymous]
|
||||||
|
public IActionResult TermsOfService() => Terms(default);
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/instance/terms_of_service/{date}"), AllowAnonymous]
|
||||||
|
public IActionResult TermsOfServiceOn(string date) =>
|
||||||
|
DateTime.TryParseExact(date, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out var on)
|
||||||
|
? Terms(on.Date)
|
||||||
|
: NotFoundError();
|
||||||
|
|
||||||
|
IActionResult Terms(DateTime? on)
|
||||||
|
{
|
||||||
|
var settings = Settings;
|
||||||
|
if (string.IsNullOrWhiteSpace(settings.TermsOfService))
|
||||||
|
return NotFoundError();
|
||||||
|
var effective = (settings.TermsEffectiveAt ?? settings.UpdatedAt ?? DateTime.UtcNow).Date;
|
||||||
|
if (on != default && on.Value != effective)
|
||||||
|
return NotFoundError();
|
||||||
|
return Json(new
|
||||||
|
{
|
||||||
|
effective_date = effective.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture),
|
||||||
|
effective = effective <= DateTime.UtcNow.Date,
|
||||||
|
content = ContentRenderer.Document(settings.TermsOfService),
|
||||||
|
succeeded_by = default(string)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// the server's blocks the administrator chose to publish (off for each by default: publishing one tells the blocked
|
||||||
|
// server, and everyone else, that it is blocked), its name partly hidden when asked, as Mastodon hides it
|
||||||
|
[HttpGet("/api/v1/instance/domain_blocks"), AllowAnonymous]
|
||||||
|
public async Task<IActionResult> DomainBlocks(CancellationToken token) =>
|
||||||
|
Json((await DB.Default.Find<DomainBlock>().Match(b => b.Published).Sort(b => b.Domain, Order.Ascending).ExecuteAsync(token))
|
||||||
|
.Select(b => new
|
||||||
|
{
|
||||||
|
domain = b.Obfuscate ? Obfuscated(b.Domain) : b.Domain,
|
||||||
|
digest = Convert.ToHexStringLower(SHA256.HashData(Encoding.UTF8.GetBytes(b.Domain ?? string.Empty))),
|
||||||
|
severity = b.Severity switch { DomainBlockSeverity.Suspend => "suspend", DomainBlockSeverity.Silence => "silence", _ => "noop" },
|
||||||
|
comment = b.PublicComment
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Mastodon's DomainBlock#public_domain: a quarter of the name kept at each end, every other character but the dots a *
|
||||||
|
public static string Obfuscated(string domain)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(domain))
|
||||||
|
return domain;
|
||||||
|
var visible = domain.Length / 4;
|
||||||
|
var hidden = domain.ToCharArray();
|
||||||
|
for (var i = 0; i < hidden.Length; i++)
|
||||||
|
if (i > visible && i < domain.Length - visible && hidden[i] != '.')
|
||||||
|
hidden[i] = '*';
|
||||||
|
return new string(hidden);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using MongoDB.Entities;
|
||||||
|
|
||||||
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Api.Mastodon.Mappers;
|
||||||
|
using PrivaPub.Domain.Privacy;
|
||||||
|
using PrivaPub.Models.Social;
|
||||||
|
using PrivaPub.StaticServices;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
|
{
|
||||||
|
// Mastodon's lists (owner decision 2026-10-04, back from the cut list): a persona groups accounts it follows, reads them
|
||||||
|
// as a timeline, and may keep an exclusive list's members out of its home. Nothing here leaves the server.
|
||||||
|
public class ListsController : MastodonController
|
||||||
|
{
|
||||||
|
const int MaxLists = 50;
|
||||||
|
const int MaxMembers = 500;
|
||||||
|
|
||||||
|
readonly DbEntities _dbEntities;
|
||||||
|
readonly MastodonMapper _mapper;
|
||||||
|
|
||||||
|
public ListsController(DbEntities dbEntities, MastodonMapper mapper)
|
||||||
|
{
|
||||||
|
_dbEntities = dbEntities;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
static object View(PersonaList list) => new { id = list.ID, title = list.Title, replies_policy = list.RepliesPolicy, exclusive = list.Exclusive };
|
||||||
|
|
||||||
|
Task<PersonaList> Mine(string id, CancellationToken token) =>
|
||||||
|
DB.Default.Find<PersonaList>().Match(l => l.ID == id && l.AvatarId == MyId).ExecuteFirstAsync(token);
|
||||||
|
|
||||||
|
// a list holds only accounts the persona still follows: whatever ended the follow (an unfollow, a Reject, a Block, the
|
||||||
|
// account's deletion), its membership goes with it, pruned here on the next read
|
||||||
|
async Task<List<string>> Members(PersonaList list, CancellationToken token)
|
||||||
|
{
|
||||||
|
var members = (await DB.Default.Find<PersonaListMember>().Match(m => m.ListId == list.ID).ExecuteAsync(token)).Select(m => m.AccountId).ToList();
|
||||||
|
if (members.Count == 0)
|
||||||
|
return members;
|
||||||
|
var followed = (await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.State == FollowState.Accepted && members.Contains(f.TargetAccountId))
|
||||||
|
.ExecuteAsync(token)).Select(f => f.TargetAccountId).ToHashSet();
|
||||||
|
var gone = members.Where(m => !followed.Contains(m)).ToList();
|
||||||
|
if (gone.Count > 0)
|
||||||
|
await DB.Default.DeleteAsync<PersonaListMember>(m => m.ListId == list.ID && gone.Contains(m.AccountId));
|
||||||
|
return members.Where(followed.Contains).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/lists"), Scope("read:lists")]
|
||||||
|
public async Task<IActionResult> All(CancellationToken token) =>
|
||||||
|
Json((await DB.Default.Find<PersonaList>().Match(l => l.AvatarId == MyId).Sort(l => l.Title, MongoDB.Entities.Order.Ascending)
|
||||||
|
.ExecuteAsync(token)).Select(View).ToList());
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/lists/{id}"), Scope("read:lists")]
|
||||||
|
public async Task<IActionResult> One(string id, CancellationToken token) =>
|
||||||
|
await Mine(id, token) is { } list ? Json(View(list)) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpPost("/api/v1/lists"), Scope("write:lists")]
|
||||||
|
public async Task<IActionResult> Create(CancellationToken token)
|
||||||
|
{
|
||||||
|
var title = Params.Get("title")?.Trim();
|
||||||
|
var policy = Params.Get("replies_policy") ?? ListRepliesPolicy.List;
|
||||||
|
if (string.IsNullOrEmpty(title) || title.Length > 200)
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Title can't be blank");
|
||||||
|
if (!ListRepliesPolicy.IsValid(policy))
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Replies policy is not included in the list");
|
||||||
|
if (await DB.Default.CountAsync<PersonaList>(l => l.AvatarId == MyId, token) >= MaxLists)
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Too many lists");
|
||||||
|
var list = new PersonaList { AvatarId = MyId, Title = title, RepliesPolicy = policy, Exclusive = Params.Bool("exclusive") == true };
|
||||||
|
await DB.Default.SaveAsync(list, token);
|
||||||
|
return Json(View(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("/api/v1/lists/{id}"), Scope("write:lists")]
|
||||||
|
public async Task<IActionResult> Update(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } list)
|
||||||
|
return NotFoundError();
|
||||||
|
var title = Params.Get("title")?.Trim();
|
||||||
|
var policy = Params.Get("replies_policy");
|
||||||
|
if (title != default)
|
||||||
|
{
|
||||||
|
if (title.Length == 0 || title.Length > 200)
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Title can't be blank");
|
||||||
|
list.Title = title;
|
||||||
|
}
|
||||||
|
if (policy != default)
|
||||||
|
{
|
||||||
|
if (!ListRepliesPolicy.IsValid(policy))
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Replies policy is not included in the list");
|
||||||
|
list.RepliesPolicy = policy;
|
||||||
|
}
|
||||||
|
if (Params.Bool("exclusive") is { } exclusive)
|
||||||
|
list.Exclusive = exclusive;
|
||||||
|
await DB.Default.SaveAsync(list, token);
|
||||||
|
return Json(View(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("/api/v1/lists/{id}"), Scope("write:lists")]
|
||||||
|
public async Task<IActionResult> Delete(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } list)
|
||||||
|
return NotFoundError();
|
||||||
|
await DB.Default.DeleteAsync<PersonaListMember>(m => m.ListId == list.ID);
|
||||||
|
await DB.Default.DeleteAsync<PersonaList>(list.ID);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/lists/{id}/accounts"), Scope("read:lists")]
|
||||||
|
public async Task<IActionResult> Accounts(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } list)
|
||||||
|
return NotFoundError();
|
||||||
|
await Members(list, token);
|
||||||
|
var members = await Page.From(Params, Limit(40, 80)).Fetch(DB.Default.Find<PersonaListMember>().Match(m => m.ListId == list.ID), m => m.ID, token);
|
||||||
|
var accounts = await _mapper.Accounts(members.Select(m => m.AccountId), token);
|
||||||
|
Link($"/api/v1/lists/{id}/accounts", members.LastOrDefault()?.ID, members.FirstOrDefault()?.ID);
|
||||||
|
return Json(members.Where(m => accounts.ContainsKey(m.AccountId)).Select(m => accounts[m.AccountId]).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// only accounts the persona follows may join its list, as on Mastodon
|
||||||
|
[HttpPost("/api/v1/lists/{id}/accounts"), Scope("write:lists")]
|
||||||
|
public async Task<IActionResult> Add(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } list)
|
||||||
|
return NotFoundError();
|
||||||
|
var ids = Params.List("account_ids").Distinct().ToList();
|
||||||
|
if (ids.Count == 0)
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Account ids can't be blank");
|
||||||
|
var followed = (await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.State == FollowState.Accepted && ids.Contains(f.TargetAccountId))
|
||||||
|
.ExecuteAsync(token)).Select(f => f.TargetAccountId).ToHashSet();
|
||||||
|
if (ids.Any(a => !followed.Contains(a)))
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: You must follow this account to add it to a list");
|
||||||
|
var present = (await DB.Default.Find<PersonaListMember>().Match(m => m.ListId == list.ID && ids.Contains(m.AccountId)).ExecuteAsync(token))
|
||||||
|
.Select(m => m.AccountId).ToHashSet();
|
||||||
|
if (await DB.Default.CountAsync<PersonaListMember>(m => m.ListId == list.ID, token) + ids.Count(a => !present.Contains(a)) > MaxMembers)
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Too many accounts in the list");
|
||||||
|
foreach (var account in ids.Where(a => !present.Contains(a)))
|
||||||
|
await DB.Default.SaveAsync(new PersonaListMember { ListId = list.ID, AvatarId = MyId, AccountId = account }, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("/api/v1/lists/{id}/accounts"), Scope("write:lists")]
|
||||||
|
public async Task<IActionResult> Remove(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } list)
|
||||||
|
return NotFoundError();
|
||||||
|
var ids = Params.List("account_ids");
|
||||||
|
await DB.Default.DeleteAsync<PersonaListMember>(m => m.ListId == list.ID && ids.Contains(m.AccountId));
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/accounts/{id}/lists"), Scope("read:lists")]
|
||||||
|
public async Task<IActionResult> Containing(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
var listIds = (await DB.Default.Find<PersonaListMember>().Match(m => m.AvatarId == MyId && m.AccountId == id).ExecuteAsync(token))
|
||||||
|
.Select(m => m.ListId).ToList();
|
||||||
|
return Json((await DB.Default.Find<PersonaList>().Match(l => l.AvatarId == MyId && listIds.Contains(l.ID)).ExecuteAsync(token))
|
||||||
|
.Select(View).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// the list's timeline: the persona's home entries by its members. Replies are kept as Mastodon keeps them: a member's
|
||||||
|
// replies to itself and to the persona always, to others as the policy says (anyone followed, the list's members, no one)
|
||||||
|
[HttpGet("/api/v1/timelines/list/{id}"), Scope("read:lists")]
|
||||||
|
public async Task<IActionResult> Timeline(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } list)
|
||||||
|
return NotFoundError();
|
||||||
|
var members = await Members(list, token);
|
||||||
|
var entries = await Page.From(Params, Limit()).Fetch(
|
||||||
|
_dbEntities.TimelineEntries.Match(e => e.AvatarId == MyId && members.Contains(e.AuthorAccountId)), e => e.PostId, token);
|
||||||
|
var ids = entries.Select(e => e.PostId).ToList();
|
||||||
|
var posts = (await _dbEntities.Posts.Match(p => ids.Contains(p.ID)).Match(VisibilityPolicy.IsShown).ExecuteAsync(token)).ToDictionary(p => p.ID);
|
||||||
|
var answered = list.RepliesPolicy switch
|
||||||
|
{
|
||||||
|
ListRepliesPolicy.Followed => (await _dbEntities.Followings.Match(f => f.AvatarId == MyId && f.State == FollowState.Accepted).ExecuteAsync(token))
|
||||||
|
.Select(f => f.TargetAccountId).Append(MyId).ToHashSet(),
|
||||||
|
ListRepliesPolicy.List => members.Append(MyId).ToHashSet(),
|
||||||
|
_ => new HashSet<string> { MyId }
|
||||||
|
};
|
||||||
|
var shown = ids.Where(posts.ContainsKey).Select(i => posts[i])
|
||||||
|
.Where(p => p.ReblogOfPostId != default || string.IsNullOrEmpty(p.AnsweringToPostId) && string.IsNullOrEmpty(p.InReplyToURI)
|
||||||
|
|| p.InReplyToAccountId != default && (p.InReplyToAccountId == p.AuthorAccountId || answered.Contains(p.InReplyToAccountId)))
|
||||||
|
.ToList();
|
||||||
|
Link($"/api/v1/timelines/list/{id}", entries.LastOrDefault()?.PostId, entries.FirstOrDefault()?.PostId);
|
||||||
|
return Json(await _mapper.Statuses(shown, MyId, token));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using Microsoft.AspNetCore.RateLimiting;
|
||||||
|
using PrivaPub.Infrastructure.Statistics;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@@ -6,6 +8,8 @@ using MongoDB.Entities;
|
|||||||
using PrivaPub.Api.Mastodon.Infrastructure;
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
using PrivaPub.Domain.Media;
|
using PrivaPub.Domain.Media;
|
||||||
using PrivaPub.Models.Media;
|
using PrivaPub.Models.Media;
|
||||||
|
using PrivaPub.Infrastructure;
|
||||||
|
using PrivaPub.Infrastructure.Jobs;
|
||||||
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
@@ -17,64 +21,146 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
|
|
||||||
readonly IMediaService _media;
|
readonly IMediaService _media;
|
||||||
readonly IMediaProxy _proxy;
|
readonly IMediaProxy _proxy;
|
||||||
|
readonly IJobQueue _jobs;
|
||||||
|
|
||||||
public MediaController(IMediaService media, IMediaProxy proxy)
|
readonly IInteractionLedger _ledger;
|
||||||
|
|
||||||
|
public MediaController(IMediaService media, IMediaProxy proxy, IJobQueue jobs, IInteractionLedger ledger = default)
|
||||||
{
|
{
|
||||||
_media = media;
|
_media = media;
|
||||||
_proxy = proxy;
|
_proxy = proxy;
|
||||||
|
_jobs = jobs;
|
||||||
|
_ledger = ledger;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("/api/v1/media"), HttpPost("/api/v2/media"), Scope("write:media"), RequestSizeLimit(UploadLimit),
|
[HttpPost("/api/v1/media"), HttpPost("/api/v2/media"), Scope("write:media"), EnableRateLimiting(RateLimiting.Uploads), RequestSizeLimit(UploadLimit),
|
||||||
RequestFormLimits(MultipartBodyLengthLimit = UploadLimit)]
|
RequestFormLimits(MultipartBodyLengthLimit = UploadLimit)]
|
||||||
public async Task<IActionResult> Upload(CancellationToken token)
|
public async Task<IActionResult> Upload(CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!Request.HasFormContentType)
|
if (!Request.HasFormContentType)
|
||||||
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: File can't be blank");
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: File can't be blank");
|
||||||
var form = await Request.ReadFormAsync(token);
|
var form = await Request.ReadFormAsync(token);
|
||||||
var outcome = await _media.Upload(Me, form.Files["file"], form["description"], form["focus"], token);
|
// v2 may answer before audio or video is processed (202, its url null until then), as Mastodon does; v1 waits
|
||||||
return outcome.Ok ? Json(View(outcome.Attachment)) : Error(outcome.Status, outcome.Error);
|
var later = Request.Path.StartsWithSegments("/api/v2/media");
|
||||||
|
var outcome = await _media.Upload(Me, form.Files["file"], form["description"], form["focus"], later, token);
|
||||||
|
if (!outcome.Ok)
|
||||||
|
return Error(outcome.Status, outcome.Error);
|
||||||
|
if (outcome.Attachment.ProcessingState != "pending")
|
||||||
|
return Json(View(outcome.Attachment));
|
||||||
|
await _jobs.EnqueueMany(new[] { ProcessMediaJob.JobFor(outcome.Attachment, new Uri(Me.BaseAddress).Host) }, token);
|
||||||
|
return new JsonResult(View(outcome.Attachment)) { StatusCode = StatusCodes.Status202Accepted };
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("/api/v1/media/{id}"), Scope("write:media")]
|
[HttpGet("/api/v1/media/{id}"), Scope("write:media")]
|
||||||
public async Task<IActionResult> Get(string id, CancellationToken token)
|
public async Task<IActionResult> Get(string id, CancellationToken token)
|
||||||
{
|
{
|
||||||
var attachment = await DB.Default.Find<MediaAttachment>().Match(m => m.ID == id && m.OwnerAvatarId == MyId).ExecuteFirstAsync(token);
|
var attachment = await DB.Default.Find<MediaAttachment>().Match(m => m.ID == id && m.OwnerAvatarId == MyId && m.TrashedAt == null && m.ProfileOfAvatarId == null).ExecuteFirstAsync(token);
|
||||||
return attachment == default ? NotFoundError() : Json(View(attachment));
|
return attachment?.ProcessingState switch
|
||||||
|
{
|
||||||
|
null when attachment == default => NotFoundError(),
|
||||||
|
"pending" => new JsonResult(View(attachment)) { StatusCode = StatusCodes.Status206PartialContent },
|
||||||
|
"failed" => Error(StatusCodes.Status422UnprocessableEntity, attachment.ProcessingError ?? "Validation failed: The file could not be processed"),
|
||||||
|
_ => Json(View(attachment))
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mastodon 4.4: a persona's own upload, while nothing holds it (not posted, not scheduled, not a profile picture), goes to
|
||||||
|
// the trash as the janitor would take it
|
||||||
|
[HttpDelete("/api/v1/media/{id}"), Scope("write:media")]
|
||||||
|
public async Task<IActionResult> Delete(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
var attachment = await DB.Default.Find<MediaAttachment>().Match(m => m.ID == id && m.OwnerAvatarId == MyId && m.TrashedAt == null && m.ProfileOfAvatarId == null).ExecuteFirstAsync(token);
|
||||||
|
if (attachment == default)
|
||||||
|
return NotFoundError();
|
||||||
|
if (attachment.PostId != null || attachment.ScheduledStatusId != null)
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Media attachment is currently used by a status");
|
||||||
|
await _media.Trash(m => m.ID == attachment.ID && m.PostId == null && m.ScheduledStatusId == null, "deleted by its owner", token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
// as on Mastodon, only media not posted yet: a posted one's description and focus change by editing its post (media_attributes)
|
||||||
[HttpPut("/api/v1/media/{id}"), Scope("write:media")]
|
[HttpPut("/api/v1/media/{id}"), Scope("write:media")]
|
||||||
public async Task<IActionResult> Update(string id, CancellationToken token)
|
public async Task<IActionResult> Update(string id, CancellationToken token)
|
||||||
{
|
{
|
||||||
var attachment = await DB.Default.Find<MediaAttachment>().Match(m => m.ID == id && m.OwnerAvatarId == MyId).ExecuteFirstAsync(token);
|
var attachment = await DB.Default.Find<MediaAttachment>().Match(m => m.ID == id && m.OwnerAvatarId == MyId && m.TrashedAt == null && m.ProfileOfAvatarId == null && m.PostId == null).ExecuteFirstAsync(token);
|
||||||
if (attachment == default)
|
if (attachment == default)
|
||||||
return NotFoundError();
|
return NotFoundError();
|
||||||
if (Params.Has("description"))
|
if (Params.Has("description"))
|
||||||
attachment.Description = Params.Get("description")?.Trim() is { Length: > 0 } description ? description[..Math.Min(description.Length, 1500)] : default;
|
attachment.Description = Params.Get("description")?.Trim() is { Length: > 0 } description ? description[..Math.Min(description.Length, 1500)] : default;
|
||||||
if (Params.Get("focus")?.Split(',') is [var x, var y]
|
if (FocalPoint.Parse(Params.Get("focus")) is { } focus)
|
||||||
&& float.TryParse(x, NumberStyles.Float, CultureInfo.InvariantCulture, out var fx) && float.TryParse(y, NumberStyles.Float, CultureInfo.InvariantCulture, out var fy))
|
attachment.Focus = focus;
|
||||||
attachment.Focus = new[] { Math.Clamp(fx, -1, 1), Math.Clamp(fy, -1, 1) };
|
|
||||||
await DB.Default.SaveAsync(attachment, token);
|
await DB.Default.SaveAsync(attachment, token);
|
||||||
return Json(View(attachment));
|
return Json(View(attachment));
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("/media/proxy/{signature}/{encoded}"), AllowAnonymous, ApiExplorerSettings(IgnoreApi = true)]
|
[HttpGet("/media/proxy/{signature}/{encoded}"), AllowAnonymous, EnableRateLimiting(RateLimiting.Proxy), ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public async Task<IActionResult> Proxy(string signature, string encoded, CancellationToken token)
|
public async Task<IActionResult> Proxy(string signature, string encoded, CancellationToken token)
|
||||||
{
|
{
|
||||||
var (path, contentType) = await _proxy.Fetch(signature, encoded, token);
|
var url = _proxy.Verified(signature, encoded);
|
||||||
if (path == default)
|
if (url == default || _proxy.Refuses(url))
|
||||||
return NotFound();
|
return NotFound();
|
||||||
Response.Headers["X-Content-Type-Options"] = "nosniff";
|
Response.Headers["X-Content-Type-Options"] = "nosniff";
|
||||||
Response.Headers["Content-Security-Policy"] = "default-src 'none'; sandbox";
|
Response.Headers["Content-Security-Policy"] = "default-src 'none'; sandbox";
|
||||||
Response.Headers["Cache-Control"] = "public, max-age=604800";
|
if (_proxy.Cached(url) is { Path: not null } cached && Serve(cached.Path, cached.ContentType) is { } hit)
|
||||||
return PhysicalFile(path, contentType);
|
{
|
||||||
|
_ledger?.Count(Interactions.HostOf(url), "media:hit");
|
||||||
|
return hit;
|
||||||
|
}
|
||||||
|
if (Request.Headers.Range.Count == 0)
|
||||||
|
{
|
||||||
|
var (outcome, path, contentType) = await _proxy.Download(url, token);
|
||||||
|
if (outcome == ProxyOutcome.Cached && Serve(path, contentType) is { } fetched)
|
||||||
|
return fetched;
|
||||||
|
if (outcome == ProxyOutcome.Failed)
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
return await Stream(url, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
object View(MediaAttachment attachment) => new
|
// a cached file, opened before it is answered: trimmed meanwhile, what is open still reads; cached by browsers only
|
||||||
|
// once there is something to cache
|
||||||
|
IActionResult Serve(string path, string contentType)
|
||||||
|
{
|
||||||
|
FileStream file;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, 64 * 1024, useAsync: true);
|
||||||
|
}
|
||||||
|
catch (IOException)
|
||||||
|
{
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
Response.Headers["Cache-Control"] = "public, max-age=604800";
|
||||||
|
return File(file, contentType, enableRangeProcessing: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task<IActionResult> Stream(string url, CancellationToken token)
|
||||||
|
{
|
||||||
|
var range = System.Net.Http.Headers.RangeHeaderValue.TryParse(Request.Headers.Range.ToString(), out var asked) ? asked : default;
|
||||||
|
using var upstream = await _proxy.Open(url, range, token);
|
||||||
|
if (upstream == default)
|
||||||
|
return NotFound();
|
||||||
|
if (upstream.IsSuccessStatusCode)
|
||||||
|
Response.Headers["Cache-Control"] = "public, max-age=604800";
|
||||||
|
Response.StatusCode = (int)upstream.StatusCode;
|
||||||
|
Response.ContentType = upstream.Content.Headers.ContentType?.ToString() ?? "application/octet-stream";
|
||||||
|
if (upstream.Content.Headers.ContentLength is { } length)
|
||||||
|
Response.ContentLength = length;
|
||||||
|
if (upstream.Content.Headers.ContentRange is { } contentRange)
|
||||||
|
Response.Headers.ContentRange = contentRange.ToString();
|
||||||
|
Response.Headers.AcceptRanges = "bytes";
|
||||||
|
await upstream.Content.CopyToAsync(Response.Body, token);
|
||||||
|
return new EmptyResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
object View(MediaAttachment attachment) => View(_media, attachment);
|
||||||
|
|
||||||
|
internal static object View(IMediaService media, MediaAttachment attachment) => new
|
||||||
{
|
{
|
||||||
id = attachment.ID,
|
id = attachment.ID,
|
||||||
type = attachment.Kind,
|
type = attachment.Kind,
|
||||||
url = _media.Url(attachment.FilePath),
|
url = media.Url(attachment.FilePath),
|
||||||
preview_url = _media.Url(attachment.PreviewPath ?? attachment.FilePath),
|
preview_url = media.Url(attachment.PreviewPath ?? attachment.FilePath),
|
||||||
remote_url = default(string),
|
remote_url = default(string),
|
||||||
text_url = default(string),
|
text_url = default(string),
|
||||||
meta = new
|
meta = new
|
||||||
|
|||||||
@@ -0,0 +1,178 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using MongoDB.Driver;
|
||||||
|
using MongoDB.Entities;
|
||||||
|
|
||||||
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Api.Mastodon.Mappers;
|
||||||
|
using PrivaPub.Domain.Social;
|
||||||
|
using PrivaPub.Models.Social;
|
||||||
|
using PrivaPub.StaticServices;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
|
{
|
||||||
|
// Mastodon's notification policy and requests (4.3): what the persona's notifications from strangers, new accounts,
|
||||||
|
// unasked private mentions and silenced accounts become, and the requests that gather the filtered ones, one per
|
||||||
|
// account, let in or dismissed
|
||||||
|
public class NotificationRequestsController : MastodonController
|
||||||
|
{
|
||||||
|
readonly MastodonMapper _mapper;
|
||||||
|
readonly DbEntities _dbEntities;
|
||||||
|
|
||||||
|
public NotificationRequestsController(MastodonMapper mapper, DbEntities dbEntities)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_dbEntities = dbEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
static string Name(NotificationAction action) => action switch
|
||||||
|
{
|
||||||
|
NotificationAction.Filter => "filter",
|
||||||
|
NotificationAction.Drop => "drop",
|
||||||
|
_ => "accept"
|
||||||
|
};
|
||||||
|
|
||||||
|
static NotificationAction? Parse(string value) => value?.ToLowerInvariant() switch
|
||||||
|
{
|
||||||
|
"accept" => NotificationAction.Accept,
|
||||||
|
"filter" => NotificationAction.Filter,
|
||||||
|
"drop" => NotificationAction.Drop,
|
||||||
|
_ => null
|
||||||
|
};
|
||||||
|
|
||||||
|
async Task<object> Summary(CancellationToken token) => new
|
||||||
|
{
|
||||||
|
pending_requests_count = await DB.Default.CountAsync<NotificationRequest>(r => r.AvatarId == MyId, token),
|
||||||
|
pending_notifications_count = await DB.Default.CountAsync<Notification>(n => n.AvatarId == MyId && n.Filtered, token)
|
||||||
|
};
|
||||||
|
|
||||||
|
async Task<object> V2(NotificationPolicy policy, CancellationToken token) => new
|
||||||
|
{
|
||||||
|
for_not_following = Name(policy.ForNotFollowing),
|
||||||
|
for_not_followers = Name(policy.ForNotFollowers),
|
||||||
|
for_new_accounts = Name(policy.ForNewAccounts),
|
||||||
|
for_private_mentions = Name(policy.ForPrivateMentions),
|
||||||
|
for_limited_accounts = Name(policy.ForLimitedAccounts),
|
||||||
|
summary = await Summary(token)
|
||||||
|
};
|
||||||
|
|
||||||
|
// the first version spoke of filtering only: dropped is filtered for it
|
||||||
|
async Task<object> V1(NotificationPolicy policy, CancellationToken token) => new
|
||||||
|
{
|
||||||
|
filter_not_following = policy.ForNotFollowing != NotificationAction.Accept,
|
||||||
|
filter_not_followers = policy.ForNotFollowers != NotificationAction.Accept,
|
||||||
|
filter_new_accounts = policy.ForNewAccounts != NotificationAction.Accept,
|
||||||
|
filter_private_mentions = policy.ForPrivateMentions != NotificationAction.Accept,
|
||||||
|
summary = await Summary(token)
|
||||||
|
};
|
||||||
|
|
||||||
|
[HttpGet("/api/v2/notifications/policy"), Scope("read:notifications")]
|
||||||
|
public async Task<IActionResult> Policy(CancellationToken token) => Json(await V2(await NotificationPolicies.Of(MyId, token), token));
|
||||||
|
|
||||||
|
[HttpPatch("/api/v2/notifications/policy"), Scope("write:notifications")]
|
||||||
|
public async Task<IActionResult> SetPolicy(CancellationToken token)
|
||||||
|
{
|
||||||
|
var policy = await NotificationPolicies.Of(MyId, token);
|
||||||
|
policy.ForNotFollowing = Parse(Params.Get("for_not_following")) ?? policy.ForNotFollowing;
|
||||||
|
policy.ForNotFollowers = Parse(Params.Get("for_not_followers")) ?? policy.ForNotFollowers;
|
||||||
|
policy.ForNewAccounts = Parse(Params.Get("for_new_accounts")) ?? policy.ForNewAccounts;
|
||||||
|
policy.ForPrivateMentions = Parse(Params.Get("for_private_mentions")) ?? policy.ForPrivateMentions;
|
||||||
|
policy.ForLimitedAccounts = Parse(Params.Get("for_limited_accounts")) ?? policy.ForLimitedAccounts;
|
||||||
|
await NotificationPolicies.Save(policy, token);
|
||||||
|
return Json(await V2(policy, token));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/notifications/policy"), Scope("read:notifications")]
|
||||||
|
public async Task<IActionResult> PolicyV1(CancellationToken token) => Json(await V1(await NotificationPolicies.Of(MyId, token), token));
|
||||||
|
|
||||||
|
[HttpPut("/api/v1/notifications/policy"), HttpPatch("/api/v1/notifications/policy"), Scope("write:notifications")]
|
||||||
|
public async Task<IActionResult> SetPolicyV1(CancellationToken token)
|
||||||
|
{
|
||||||
|
var policy = await NotificationPolicies.Of(MyId, token);
|
||||||
|
static NotificationAction Filter(bool? filter, NotificationAction current) =>
|
||||||
|
filter switch { true => current == NotificationAction.Drop ? NotificationAction.Drop : NotificationAction.Filter, false => NotificationAction.Accept, _ => current };
|
||||||
|
policy.ForNotFollowing = Filter(Params.Bool("filter_not_following"), policy.ForNotFollowing);
|
||||||
|
policy.ForNotFollowers = Filter(Params.Bool("filter_not_followers"), policy.ForNotFollowers);
|
||||||
|
policy.ForNewAccounts = Filter(Params.Bool("filter_new_accounts"), policy.ForNewAccounts);
|
||||||
|
policy.ForPrivateMentions = Filter(Params.Bool("filter_private_mentions"), policy.ForPrivateMentions);
|
||||||
|
await NotificationPolicies.Save(policy, token);
|
||||||
|
return Json(await V1(policy, token));
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task<object> Map(NotificationRequest request, CancellationToken token)
|
||||||
|
{
|
||||||
|
var account = await _mapper.Account(request.FromAccountId, token);
|
||||||
|
if (account == default)
|
||||||
|
return default;
|
||||||
|
var post = string.IsNullOrEmpty(request.LastPostId) ? default
|
||||||
|
: await _dbEntities.Posts.Match(p => p.ID == request.LastPostId && !p.DeletedAt.HasValue).ExecuteFirstAsync(token);
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
id = request.ID,
|
||||||
|
created_at = MastodonJson.Time(request.CreatedAt),
|
||||||
|
updated_at = MastodonJson.Time(request.UpdatedAt),
|
||||||
|
notifications_count = request.NotificationsCount.ToString(System.Globalization.CultureInfo.InvariantCulture),
|
||||||
|
account,
|
||||||
|
last_status = post == default ? default : await _mapper.Status(post, MyId, token)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/notifications/requests"), Scope("read:notifications")]
|
||||||
|
public async Task<IActionResult> Requests(CancellationToken token)
|
||||||
|
{
|
||||||
|
var requests = await Page.From(Params, Limit(40, 80)).Fetch(DB.Default.Find<NotificationRequest>().Match(r => r.AvatarId == MyId), r => r.ID, token);
|
||||||
|
Link("/api/v1/notifications/requests", requests.LastOrDefault()?.ID, requests.FirstOrDefault()?.ID);
|
||||||
|
var mapped = new List<object>();
|
||||||
|
foreach (var request in requests)
|
||||||
|
if (await Map(request, token) is { } one)
|
||||||
|
mapped.Add(one);
|
||||||
|
return Json(mapped);
|
||||||
|
}
|
||||||
|
|
||||||
|
Task<NotificationRequest> Mine(string id, CancellationToken token) =>
|
||||||
|
DB.Default.Find<NotificationRequest>().Match(r => r.ID == id && r.AvatarId == MyId).ExecuteFirstAsync(token);
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/notifications/requests/merged"), Scope("read:notifications")]
|
||||||
|
public IActionResult Merged() => Json(new { merged = true });
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/notifications/requests/{id}"), Scope("read:notifications")]
|
||||||
|
public async Task<IActionResult> Request(string id, CancellationToken token) =>
|
||||||
|
await Mine(id, token) is { } request && await Map(request, token) is { } mapped ? Json(mapped) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpPost("/api/v1/notifications/requests/{id}/accept"), Scope("write:notifications")]
|
||||||
|
public async Task<IActionResult> Accept(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } request)
|
||||||
|
return NotFoundError();
|
||||||
|
await NotificationPolicies.Accept(request, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("/api/v1/notifications/requests/{id}/dismiss"), Scope("write:notifications")]
|
||||||
|
public async Task<IActionResult> Dismiss(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } request)
|
||||||
|
return NotFoundError();
|
||||||
|
await NotificationPolicies.Dismiss(request, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("/api/v1/notifications/requests/accept"), Scope("write:notifications")]
|
||||||
|
public async Task<IActionResult> AcceptMany(CancellationToken token)
|
||||||
|
{
|
||||||
|
foreach (var id in Params.List("id").Take(100))
|
||||||
|
if (await Mine(id, token) is { } request)
|
||||||
|
await NotificationPolicies.Accept(request, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("/api/v1/notifications/requests/dismiss"), Scope("write:notifications")]
|
||||||
|
public async Task<IActionResult> DismissMany(CancellationToken token)
|
||||||
|
{
|
||||||
|
foreach (var id in Params.List("id").Take(100))
|
||||||
|
if (await Mine(id, token) is { } request)
|
||||||
|
await NotificationPolicies.Dismiss(request, token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
using MongoDB.Entities;
|
using MongoDB.Entities;
|
||||||
|
|
||||||
using PrivaPub.Api.Mastodon.Infrastructure;
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
using PrivaPub.Domain.Privacy;
|
using PrivaPub.Domain.Privacy;
|
||||||
|
using PrivaPub.Domain.Statistics;
|
||||||
|
using PrivaPub.Federation.Actors;
|
||||||
using PrivaPub.Federation.Objects;
|
using PrivaPub.Federation.Objects;
|
||||||
|
using PrivaPub.Infrastructure;
|
||||||
|
using PrivaPub.Infrastructure.Geo;
|
||||||
using PrivaPub.Models.Federation;
|
using PrivaPub.Models.Federation;
|
||||||
using PrivaPub.Models.Jobs;
|
using PrivaPub.Models.Jobs;
|
||||||
using PrivaPub.Models.Post;
|
using PrivaPub.Models.Post;
|
||||||
@@ -19,16 +24,32 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
{
|
{
|
||||||
public class ProvenanceController : MastodonController
|
public class ProvenanceController : MastodonController
|
||||||
{
|
{
|
||||||
readonly DbEntities _dbEntities;
|
const int MaxHosts = 40;
|
||||||
|
|
||||||
public ProvenanceController(DbEntities dbEntities) => _dbEntities = dbEntities;
|
readonly DbEntities _dbEntities;
|
||||||
|
const int MaxWeeks = 260;
|
||||||
|
|
||||||
|
readonly ISelfLocation _self;
|
||||||
|
readonly IServerPlaces _places;
|
||||||
|
readonly ILocalActorService _localActors;
|
||||||
|
readonly IOptionsMonitor<RegistrationOptions> _registrations;
|
||||||
|
|
||||||
|
public ProvenanceController(DbEntities dbEntities, ISelfLocation self, IServerPlaces places, ILocalActorService localActors,
|
||||||
|
IOptionsMonitor<RegistrationOptions> registrations)
|
||||||
|
{
|
||||||
|
_dbEntities = dbEntities;
|
||||||
|
_self = self;
|
||||||
|
_places = places;
|
||||||
|
_localActors = localActors;
|
||||||
|
_registrations = registrations;
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("/api/privapub/v1/statuses/{id}/provenance"), Scope("read:statuses", requiresUser: false), AllowAnonymous]
|
[HttpGet("/api/privapub/v1/statuses/{id}/provenance"), Scope("read:statuses", requiresUser: false), AllowAnonymous]
|
||||||
public async Task<IActionResult> Status(string id, CancellationToken token)
|
public async Task<IActionResult> Status(string id, CancellationToken token)
|
||||||
{
|
{
|
||||||
var post = await _dbEntities.Posts.Match(p => p.ID == id && !p.DeletedAt.HasValue).ExecuteFirstAsync(token);
|
var post = await _dbEntities.Posts.Match(p => p.ID == id).Match(VisibilityPolicy.IsShown).ExecuteFirstAsync(token);
|
||||||
if (post?.ReblogOfPostId != default)
|
if (post?.ReblogOfPostId != default)
|
||||||
post = await _dbEntities.Posts.Match(p => p.ID == post.ReblogOfPostId && !p.DeletedAt.HasValue).ExecuteFirstAsync(token);
|
post = await _dbEntities.Posts.Match(p => p.ID == post.ReblogOfPostId).Match(VisibilityPolicy.IsShown).ExecuteFirstAsync(token);
|
||||||
if (post == default || post.Visibility == PostVisibility.LocalGeo || !await VisibilityPolicy.CanSee(post, MyId, token))
|
if (post == default || post.Visibility == PostVisibility.LocalGeo || !await VisibilityPolicy.CanSee(post, MyId, token))
|
||||||
return NotFoundError();
|
return NotFoundError();
|
||||||
if (!post.IsFederatedCopy)
|
if (!post.IsFederatedCopy)
|
||||||
@@ -38,18 +59,104 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
?? await DB.Default.Find<ObjectRecord>().Match(r => r.ObjectURI == post.ObjectURI).ExecuteFirstAsync(token);
|
?? await DB.Default.Find<ObjectRecord>().Match(r => r.ObjectURI == post.ObjectURI).ExecuteFirstAsync(token);
|
||||||
var host = record?.Host ?? (Uri.TryCreate(post.ObjectURI, UriKind.Absolute, out var uri) ? uri.Host.ToLowerInvariant() : default);
|
var host = record?.Host ?? (Uri.TryCreate(post.ObjectURI, UriKind.Absolute, out var uri) ? uri.Host.ToLowerInvariant() : default);
|
||||||
var instance = host == default ? default : await DB.Default.Find<RemoteInstance>().Match(i => i.Host == host).ExecuteFirstAsync(token);
|
var instance = host == default ? default : await DB.Default.Find<RemoteInstance>().Match(i => i.Host == host).ExecuteFirstAsync(token);
|
||||||
return Json(Describe(post, record, instance));
|
var beforeCdn = instance?.Geo?.Cdn == default ? default : (await _places.BeforeCdn(new[] { instance.Host }, token)).GetValueOrDefault(instance.Host);
|
||||||
|
return Json(Describe(post, record, instance, beforeCdn));
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("/api/privapub/v1/instances/{host}"), Scope("read", requiresUser: false), AllowAnonymous]
|
[HttpGet("/api/privapub/v1/instances/{host}"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||||
public async Task<IActionResult> Instance(string host, CancellationToken token)
|
public async Task<IActionResult> Instance(string host, CancellationToken token)
|
||||||
{
|
{
|
||||||
host = host?.Trim().ToLowerInvariant();
|
var described = await Describe(new[] { host }, token);
|
||||||
var instance = await DB.Default.Find<RemoteInstance>().Match(i => i.Host == host).ExecuteFirstAsync(token);
|
return described.Count == 0 ? NotFoundError() : Json(described[0]);
|
||||||
return instance == default ? NotFoundError() : Json(Describe(instance));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Provenance Describe(PostEntity post, ObjectRecord record, RemoteInstance instance)
|
//up to MaxHosts at once (host[]=...), in the order asked; hosts this server does not know are left out
|
||||||
|
[HttpGet("/api/privapub/v1/instances"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||||
|
public async Task<IActionResult> Instances(CancellationToken token) => Json(await Describe(Params.List("host"), token));
|
||||||
|
|
||||||
|
//the server's weekly snapshots, newest first (weeks=, at most MaxWeeks): its place as shown publicly, its CDN, its size
|
||||||
|
[HttpGet("/api/privapub/v1/instances/{host}/history"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||||
|
public async Task<IActionResult> History(string host, CancellationToken token)
|
||||||
|
{
|
||||||
|
host = host?.Trim().ToLowerInvariant();
|
||||||
|
if (string.IsNullOrEmpty(host) || host.Length > 253 || !await DB.Default.Find<RemoteInstance>().Match(i => i.Host == host).ExecuteAnyAsync(token))
|
||||||
|
return NotFoundError();
|
||||||
|
var weeks = Math.Clamp(Params.Int("weeks") ?? 52, 1, MaxWeeks);
|
||||||
|
return Json((await _places.History(host, weeks, token)).Select(s => new InstanceWeek
|
||||||
|
{
|
||||||
|
Week = s.Week,
|
||||||
|
TakenAt = MastodonJson.Time(s.TakenAt),
|
||||||
|
Reachable = s.Reachable,
|
||||||
|
Software = s.Software,
|
||||||
|
Version = s.SoftwareVersion,
|
||||||
|
UsersTotal = s.UsersTotal,
|
||||||
|
UsersActiveMonth = s.UsersActiveMonth,
|
||||||
|
LocalPosts = s.LocalPosts,
|
||||||
|
OpenRegistrations = s.OpenRegistrations,
|
||||||
|
Geo = Located(PublicGeo.Project(new InstanceGeo
|
||||||
|
{
|
||||||
|
Country = s.Country, City = s.City, Latitude = s.Latitude, Longitude = s.Longitude, Asn = s.Asn,
|
||||||
|
Cdn = s.Cdn, CdnDomain = s.CdnDomain, CdnSource = s.CdnSource, Ipv6 = s.Ipv6
|
||||||
|
}), new InstanceGeo { Cdn = s.Cdn, CdnDomain = s.CdnDomain ?? CdnCatalog.ByKey(s.Cdn)?.Key, CdnSource = s.CdnSource })
|
||||||
|
}).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task<List<InstanceDescription>> Describe(IEnumerable<string> hosts, CancellationToken token)
|
||||||
|
{
|
||||||
|
var wanted = hosts.Select(h => h?.Trim().ToLowerInvariant()).Where(h => !string.IsNullOrEmpty(h) && h.Length <= 253)
|
||||||
|
.Distinct().Take(MaxHosts).ToList();
|
||||||
|
var selfHost = Uri.TryCreate(_localActors.BaseAddress, UriKind.Absolute, out var self) ? self.Host.ToLowerInvariant() : default;
|
||||||
|
var remote = await DB.Default.Find<RemoteInstance>().Match(i => wanted.Contains(i.Host)).ExecuteAsync(token);
|
||||||
|
var beforeCdn = await _places.BeforeCdn(remote.Where(i => i.Geo?.Cdn != default).Select(i => i.Host), token);
|
||||||
|
var described = new List<InstanceDescription>();
|
||||||
|
foreach (var host in wanted)
|
||||||
|
{
|
||||||
|
if (host == selfHost)
|
||||||
|
described.Add(await DescribeSelf(host, token));
|
||||||
|
else if (remote.FirstOrDefault(i => i.Host == host) is { } instance)
|
||||||
|
described.Add(Describe(instance, beforeCdn.GetValueOrDefault(host)));
|
||||||
|
}
|
||||||
|
return described;
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task<InstanceDescription> DescribeSelf(string host, CancellationToken token)
|
||||||
|
{
|
||||||
|
var geo = await _self.Get(token);
|
||||||
|
return new InstanceDescription
|
||||||
|
{
|
||||||
|
Host = host,
|
||||||
|
Software = "privapub",
|
||||||
|
Version = BuildInfo.Ref,
|
||||||
|
NodeName = HttpContext.RequestServices.GetRequiredService<Domain.Instance.IInstanceSettings>().Current.Title,
|
||||||
|
Protocols = new() { "activitypub" },
|
||||||
|
OpenRegistrations = _registrations.CurrentValue.IsOpen,
|
||||||
|
DescribedAt = MastodonJson.Time(DateTime.UtcNow),
|
||||||
|
Geo = Located(PublicGeo.Project(geo), geo)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//the public projection of a server's place (PublicGeo); for a CDN-fronted one, the CDN's domain, how it was found and
|
||||||
|
//where the server was before it
|
||||||
|
static InstanceLocation Located(PublicLocation location, InstanceGeo geo, PlaceBeforeCdn beforeCdn = default) => location == default ? default : new InstanceLocation
|
||||||
|
{
|
||||||
|
Precision = location.Cdn != default ? "cdn" : location.Latitude != default ? "city" : "country",
|
||||||
|
Country = location.Country,
|
||||||
|
City = location.City,
|
||||||
|
Latitude = location.Latitude,
|
||||||
|
Longitude = location.Longitude,
|
||||||
|
Network = location.Network,
|
||||||
|
Cdn = location.Cdn,
|
||||||
|
CdnDomain = location.Cdn != default ? ServerPlaces.KeyOf(geo) : default,
|
||||||
|
CdnSource = location.Cdn != default ? geo?.CdnSource : default,
|
||||||
|
BeforeCdn = location.Cdn == default || beforeCdn == default ? default : new InstancePlace
|
||||||
|
{
|
||||||
|
Week = beforeCdn.Week, Country = beforeCdn.Country, City = beforeCdn.City, Latitude = beforeCdn.Latitude, Longitude = beforeCdn.Longitude
|
||||||
|
},
|
||||||
|
Source = geo?.Source,
|
||||||
|
LocatedAt = geo?.LocatedAt is { } at ? MastodonJson.Time(at) : default
|
||||||
|
};
|
||||||
|
|
||||||
|
Provenance Describe(PostEntity post, ObjectRecord record, RemoteInstance instance, PlaceBeforeCdn beforeCdn)
|
||||||
{
|
{
|
||||||
var raw = record?.Raw == default ? default : JsonNode.Parse(record.Raw) as JsonObject;
|
var raw = record?.Raw == default ? default : JsonNode.Parse(record.Raw) as JsonObject;
|
||||||
return new Provenance
|
return new Provenance
|
||||||
@@ -64,15 +171,16 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
Id = record.ActivityId, Type = record.ActivityType, Actor = record.ActivityActorURI
|
Id = record.ActivityId, Type = record.ActivityType, Actor = record.ActivityActorURI
|
||||||
},
|
},
|
||||||
Inbox = record?.Inbox,
|
Inbox = record?.Inbox,
|
||||||
Signature = record?.KeyId == default ? default : new ProvenanceSignature
|
FetchedBy = record?.Path == ObjectPath.Fetched ? "instance-actor" : default,
|
||||||
|
Signature = record?.KeyId == default || record.Path == ObjectPath.Fetched ? default : new ProvenanceSignature
|
||||||
{
|
{
|
||||||
Scheme = record.SignatureScheme, KeyId = record.KeyId, Algorithm = record.Algorithm, Headers = record.SignedHeaders
|
Scheme = record.SignatureScheme, KeyId = record.KeyId, Algorithm = record.Algorithm, Headers = record.SignedHeaders
|
||||||
},
|
},
|
||||||
ReceivedAt = record == default ? default : MastodonJson.Time(record.ReceivedAt),
|
ReceivedAt = record == default ? default : MastodonJson.Time(record.ReceivedAt),
|
||||||
Published = record?.Published is { } published ? MastodonJson.Time(published) : default,
|
Published = record?.Published is { } published ? MastodonJson.Time(published) : default,
|
||||||
Updated = record?.Updated is { } updated ? MastodonJson.Time(updated) : default,
|
Updated = record?.Updated is { } updated ? MastodonJson.Time(updated) : default,
|
||||||
Extensions = ObjectFeatures.Detect(raw),
|
Extensions = record?.Extensions ?? ObjectFeatures.Detect(raw),
|
||||||
ContextNamespaces = ObjectFeatures.Namespaces(raw, record?.ActivityContext),
|
ContextNamespaces = record?.ContextNamespaces ?? ObjectFeatures.Namespaces(raw, record?.ActivityContext),
|
||||||
Raw = raw,
|
Raw = raw,
|
||||||
RawBytes = record?.RawBytes ?? 0,
|
RawBytes = record?.RawBytes ?? 0,
|
||||||
RawHash = record?.RawHash,
|
RawHash = record?.RawHash,
|
||||||
@@ -85,11 +193,11 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
RawHash = r.RawHash,
|
RawHash = r.RawHash,
|
||||||
Raw = r.Raw == default ? default : JsonNode.Parse(r.Raw)
|
Raw = r.Raw == default ? default : JsonNode.Parse(r.Raw)
|
||||||
}).ToList() ?? new(),
|
}).ToList() ?? new(),
|
||||||
Instance = instance == default ? default : Describe(instance)
|
Instance = instance == default ? default : Describe(instance, beforeCdn)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static InstanceDescription Describe(RemoteInstance instance) => new()
|
static InstanceDescription Describe(RemoteInstance instance, PlaceBeforeCdn beforeCdn) => new()
|
||||||
{
|
{
|
||||||
Host = instance.Host,
|
Host = instance.Host,
|
||||||
Software = instance.Software,
|
Software = instance.Software,
|
||||||
@@ -106,7 +214,8 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
UnavailableUntil = instance.UnavailableUntil is { } until ? MastodonJson.Time(until) : default,
|
UnavailableUntil = instance.UnavailableUntil is { } until ? MastodonJson.Time(until) : default,
|
||||||
LastSuccessAt = instance.LastSuccessAt is { } success ? MastodonJson.Time(success) : default,
|
LastSuccessAt = instance.LastSuccessAt is { } success ? MastodonJson.Time(success) : default,
|
||||||
LastFailureAt = instance.LastFailureAt is { } failure ? MastodonJson.Time(failure) : default
|
LastFailureAt = instance.LastFailureAt is { } failure ? MastodonJson.Time(failure) : default
|
||||||
}
|
},
|
||||||
|
Geo = Located(PublicGeo.Project(instance.Geo), instance.Geo, beforeCdn)
|
||||||
};
|
};
|
||||||
|
|
||||||
public class Provenance
|
public class Provenance
|
||||||
@@ -118,6 +227,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
public bool Refetched { get; set; }
|
public bool Refetched { get; set; }
|
||||||
public ProvenanceActivity Activity { get; set; }
|
public ProvenanceActivity Activity { get; set; }
|
||||||
public string Inbox { get; set; }
|
public string Inbox { get; set; }
|
||||||
|
public string FetchedBy { get; set; }
|
||||||
public ProvenanceSignature Signature { get; set; }
|
public ProvenanceSignature Signature { get; set; }
|
||||||
public string ReceivedAt { get; set; }
|
public string ReceivedAt { get; set; }
|
||||||
public string Published { get; set; }
|
public string Published { get; set; }
|
||||||
@@ -168,6 +278,48 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
public string DescriptionError { get; set; }
|
public string DescriptionError { get; set; }
|
||||||
public JsonNode NodeInfo { get; set; }
|
public JsonNode NodeInfo { get; set; }
|
||||||
public InstanceDelivery Delivery { get; set; }
|
public InstanceDelivery Delivery { get; set; }
|
||||||
|
public InstanceLocation Geo { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//precision: "city" (coordinates to 0.1°, city and network), "country" (located only to a country) or "cdn" (the
|
||||||
|
//CDN's name only)
|
||||||
|
public class InstanceLocation
|
||||||
|
{
|
||||||
|
public string Precision { get; set; }
|
||||||
|
public string Country { get; set; }
|
||||||
|
public string City { get; set; }
|
||||||
|
public double? Latitude { get; set; }
|
||||||
|
public double? Longitude { get; set; }
|
||||||
|
public string Network { get; set; }
|
||||||
|
public string Cdn { get; set; }
|
||||||
|
public string CdnDomain { get; set; }
|
||||||
|
public string CdnSource { get; set; }//"ranges", "headers" or "asn"
|
||||||
|
public InstancePlace BeforeCdn { get; set; }//where a CDN-fronted server was located before the CDN, by its snapshots
|
||||||
|
public string Source { get; set; }
|
||||||
|
public string LocatedAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InstancePlace
|
||||||
|
{
|
||||||
|
public string Week { get; set; }
|
||||||
|
public string Country { get; set; }
|
||||||
|
public string City { get; set; }
|
||||||
|
public double? Latitude { get; set; }
|
||||||
|
public double? Longitude { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InstanceWeek
|
||||||
|
{
|
||||||
|
public string Week { get; set; }
|
||||||
|
public string TakenAt { get; set; }
|
||||||
|
public bool Reachable { get; set; }
|
||||||
|
public string Software { get; set; }
|
||||||
|
public string Version { get; set; }
|
||||||
|
public long? UsersTotal { get; set; }
|
||||||
|
public long? UsersActiveMonth { get; set; }
|
||||||
|
public long? LocalPosts { get; set; }
|
||||||
|
public bool? OpenRegistrations { get; set; }
|
||||||
|
public InstanceLocation Geo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InstanceDelivery
|
public class InstanceDelivery
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using MongoDB.Entities;
|
||||||
|
|
||||||
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Api.Mastodon.Mappers;
|
||||||
|
using PrivaPub.Domain.Privacy;
|
||||||
|
using PrivaPub.Domain.Social;
|
||||||
|
using PrivaPub.Models.Post;
|
||||||
|
using PrivaPub.Models.Social;
|
||||||
|
using PrivaPub.StaticServices;
|
||||||
|
|
||||||
|
using PostEntity = PrivaPub.Models.Post.Post;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
|
{
|
||||||
|
public class ReactionsController : MastodonController
|
||||||
|
{
|
||||||
|
readonly DbEntities _dbEntities;
|
||||||
|
readonly MastodonMapper _mapper;
|
||||||
|
readonly IReactions _reactions;
|
||||||
|
|
||||||
|
public ReactionsController(DbEntities dbEntities, MastodonMapper mapper, IReactions reactions)
|
||||||
|
{
|
||||||
|
_dbEntities = dbEntities;
|
||||||
|
_mapper = mapper;
|
||||||
|
_reactions = reactions;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/pleroma/statuses/{id}/reactions"), Scope("read:statuses", requiresUser: false), AllowAnonymous]
|
||||||
|
public async Task<IActionResult> List(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
var post = await Visible(id, token);
|
||||||
|
if (post == default)
|
||||||
|
return NotFoundError();
|
||||||
|
var reactions = await DB.Default.Find<Reaction>().Match(r => r.PostId == post.ID).ExecuteAsync(token);
|
||||||
|
var accounts = await _mapper.Accounts(reactions.Select(r => r.AccountId), token);
|
||||||
|
return Json(reactions.GroupBy(r => r.Emoji).Select(group => new
|
||||||
|
{
|
||||||
|
name = group.Key,
|
||||||
|
count = group.Count(),
|
||||||
|
me = MyId != default && group.Any(r => r.AccountId == MyId),
|
||||||
|
url = _mapper.ProxiedUrl(group.First().EmojiURL),
|
||||||
|
accounts = group.Select(r => accounts.GetValueOrDefault(r.AccountId)).Where(a => a != default).ToList()
|
||||||
|
}).OrderByDescending(r => r.count).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("/api/v1/pleroma/statuses/{id}/reactions/{emoji}"), Scope("write:favourites")]
|
||||||
|
public async Task<IActionResult> React(string id, string emoji, CancellationToken token)
|
||||||
|
{
|
||||||
|
var post = await Visible(id, token);
|
||||||
|
if (post == default)
|
||||||
|
return NotFoundError();
|
||||||
|
if (!await _reactions.React(Me, post, Uri.UnescapeDataString(emoji), token))
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: That emoji cannot be used here");
|
||||||
|
return Json(await _mapper.Status(post, MyId, token));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("/api/v1/pleroma/statuses/{id}/reactions/{emoji}"), Scope("write:favourites")]
|
||||||
|
public async Task<IActionResult> Unreact(string id, string emoji, CancellationToken token)
|
||||||
|
{
|
||||||
|
var post = await Visible(id, token);
|
||||||
|
if (post == default)
|
||||||
|
return NotFoundError();
|
||||||
|
await _reactions.Unreact(Me, post, Uri.UnescapeDataString(emoji), token);
|
||||||
|
return Json(await _mapper.Status(post, MyId, token));
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task<PostEntity> Visible(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
var post = await _dbEntities.Posts.Match(p => p.ID == id && !p.DeletedAt.HasValue && p.ReblogOfPostId == null).ExecuteFirstAsync(token);
|
||||||
|
return post != default && post.Visibility != PostVisibility.LocalGeo && await VisibilityPolicy.CanSee(post, MyId, token) ? post : default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
public async Task<IActionResult> Create(CancellationToken token)
|
public async Task<IActionResult> Create(CancellationToken token)
|
||||||
{
|
{
|
||||||
var report = await _reports.File(Me, Params.Get("account_id"), Params.List("status_ids"), Params.Get("comment"), Params.Get("category"),
|
var report = await _reports.File(Me, Params.Get("account_id"), Params.List("status_ids"), Params.Get("comment"), Params.Get("category"),
|
||||||
Params.Bool("forward") == true, token);
|
Params.List("rule_ids"), Params.Bool("forward") == true, token);
|
||||||
if (report == default)
|
if (report == default)
|
||||||
return NotFoundError();
|
return NotFoundError();
|
||||||
return Json(new
|
return Json(new
|
||||||
@@ -34,7 +34,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
|||||||
forwarded = report.Forwarded,
|
forwarded = report.Forwarded,
|
||||||
created_at = MastodonJson.Time(report.CreatedAt),
|
created_at = MastodonJson.Time(report.CreatedAt),
|
||||||
status_ids = report.PostIds,
|
status_ids = report.PostIds,
|
||||||
rule_ids = Array.Empty<string>(),
|
rule_ids = report.RuleIds,
|
||||||
target_account = await _mapper.Account(report.TargetAccountId, token)
|
target_account = await _mapper.Account(report.TargetAccountId, token)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using MongoDB.Entities;
|
||||||
|
|
||||||
|
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||||
|
using PrivaPub.Domain.Media;
|
||||||
|
using PrivaPub.Domain.Statuses;
|
||||||
|
using PrivaPub.Infrastructure.Jobs;
|
||||||
|
using PrivaPub.Models.Media;
|
||||||
|
using PrivaPub.Models.Social;
|
||||||
|
|
||||||
|
namespace PrivaPub.Api.Mastodon.Controllers
|
||||||
|
{
|
||||||
|
// Mastodon's scheduled statuses (owner decision 2026-10-04, back from the cut list): the persona's posts waiting for
|
||||||
|
// their time, moved to another time or dropped. POST /api/v1/statuses with scheduled_at makes them.
|
||||||
|
public class ScheduledStatusesController : MastodonController
|
||||||
|
{
|
||||||
|
readonly IMediaService _media;
|
||||||
|
readonly IJobQueue _jobs;
|
||||||
|
|
||||||
|
public ScheduledStatusesController(IMediaService media, IJobQueue jobs)
|
||||||
|
{
|
||||||
|
_media = media;
|
||||||
|
_jobs = jobs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<object> View(ScheduledStatus scheduled, IMediaService media, CancellationToken token)
|
||||||
|
{
|
||||||
|
var p = scheduled.Params;
|
||||||
|
var ids = p.MediaIds;
|
||||||
|
var attachments = ids.Count == 0
|
||||||
|
? new List<MediaAttachment>()
|
||||||
|
: await DB.Default.Find<MediaAttachment>().Match(m => ids.Contains(m.ID)).ExecuteAsync(token);
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
id = scheduled.ID,
|
||||||
|
scheduled_at = MastodonJson.Time(scheduled.ScheduledAt),
|
||||||
|
@params = new
|
||||||
|
{
|
||||||
|
text = p.Text,
|
||||||
|
poll = p.Poll == default ? default : new { options = p.Poll.Options, expires_in = p.Poll.ExpiresIn, multiple = p.Poll.Multiple, hide_totals = p.Poll.HideTotals },
|
||||||
|
media_ids = ids.Count == 0 ? default : ids,
|
||||||
|
sensitive = p.Sensitive,
|
||||||
|
spoiler_text = p.SpoilerText,
|
||||||
|
visibility = p.Visibility,
|
||||||
|
in_reply_to_id = p.InReplyToId,
|
||||||
|
language = p.Language,
|
||||||
|
application_id = default(string),
|
||||||
|
scheduled_at = default(string),
|
||||||
|
idempotency = p.Idempotency,
|
||||||
|
with_rate_limit = false,
|
||||||
|
quoted_status_id = p.QuotedStatusId
|
||||||
|
},
|
||||||
|
media_attachments = ids.Select(id => attachments.FirstOrDefault(m => m.ID == id)).Where(m => m != default)
|
||||||
|
.Select(m => MediaController.View(media, m)).ToList()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Task<ScheduledStatus> Mine(string id, CancellationToken token) =>
|
||||||
|
DB.Default.Find<ScheduledStatus>().Match(s => s.ID == id && s.AvatarId == MyId).ExecuteFirstAsync(token);
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/scheduled_statuses"), Scope("read:statuses")]
|
||||||
|
public async Task<IActionResult> All(CancellationToken token)
|
||||||
|
{
|
||||||
|
var page = await Page.From(Params, Limit(20, 40)).Fetch(DB.Default.Find<ScheduledStatus>().Match(s => s.AvatarId == MyId), s => s.ID, token);
|
||||||
|
Link("/api/v1/scheduled_statuses", page.LastOrDefault()?.ID, page.FirstOrDefault()?.ID);
|
||||||
|
var views = new List<object>();
|
||||||
|
foreach (var scheduled in page)
|
||||||
|
views.Add(await View(scheduled, _media, token));
|
||||||
|
return Json(views);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("/api/v1/scheduled_statuses/{id}"), Scope("read:statuses")]
|
||||||
|
public async Task<IActionResult> One(string id, CancellationToken token) =>
|
||||||
|
await Mine(id, token) is { } scheduled ? Json(await View(scheduled, _media, token)) : NotFoundError();
|
||||||
|
|
||||||
|
[HttpPut("/api/v1/scheduled_statuses/{id}"), Scope("write:statuses")]
|
||||||
|
public async Task<IActionResult> Move(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } scheduled)
|
||||||
|
return NotFoundError();
|
||||||
|
if (!DateTime.TryParse(Params.Get("scheduled_at"), System.Globalization.CultureInfo.InvariantCulture,
|
||||||
|
System.Globalization.DateTimeStyles.AdjustToUniversal | System.Globalization.DateTimeStyles.AssumeUniversal, out var at))
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: Scheduled at is invalid");
|
||||||
|
if (await ScheduledStatuses.Refusal(MyId, at, scheduled.ID, token) is { } refusal)
|
||||||
|
return Error(StatusCodes.Status422UnprocessableEntity, "Validation failed: " + refusal);
|
||||||
|
scheduled.ScheduledAt = at;
|
||||||
|
await DB.Default.Update<ScheduledStatus>().MatchID(scheduled.ID).Modify(s => s.ScheduledAt, at).ExecuteAsync(token);
|
||||||
|
await _jobs.EnqueueMany(new[] { ScheduledStatuses.JobFor(scheduled, new Uri(Me.BaseAddress).Host) }, token);
|
||||||
|
return Json(await View(scheduled, _media, token));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("/api/v1/scheduled_statuses/{id}"), Scope("write:statuses")]
|
||||||
|
public async Task<IActionResult> Drop(string id, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (await Mine(id, token) is not { } scheduled)
|
||||||
|
return NotFoundError();
|
||||||
|
await DB.Default.DeleteAsync<ScheduledStatus>(scheduled.ID);
|
||||||
|
// its media were the scheduled post's alone, never posted
|
||||||
|
await _media.Trash(m => m.ScheduledStatusId == scheduled.ID, "scheduled post dropped", token);
|
||||||
|
return Json(new { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loaded 100 of 502 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user