mkizka / unsocial Goto Github PK
View Code? Open in Web Editor NEWSimple ActivityPub server for personal use, built with Next.js (App Router), Prisma, and Tailwind CSS.
Home Page: https://beta.unsocial.dev
License: MIT License
Simple ActivityPub server for personal use, built with Next.js (App Router), Prisma, and Tailwind CSS.
Home Page: https://beta.unsocial.dev
License: MIT License
new URLつらいのでやめる
ActivityPubにおいては@[email protected]で完全にユーザーを区別でき名前の変更もないため、名前の変更を考慮した/@[preferredUsername]@[host] と /users/[userId] の二つパスがあるのは特に意味がない
userKeyとして扱ってパースするなど処理に複雑さが出てきているのでやめる
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.tool-versions
node 20.12.2
compose.yaml
nginx 1-alpine
yukimochi/activity-relay v2.0.5
yukimochi/activity-relay v2.0.5
nginx 1-alpine
nginx 1-alpine
tootsuite/mastodon v4.2.8
tootsuite/mastodon v4.2.8
tootsuite/mastodon v4.2.8
nginx 1-alpine
misskey/misskey 2024.3.1
postgres 16-alpine
redis 7-alpine
mailhog/mailhog v1.0.1
jest/compose.yaml
postgres 16-alpine
Dockerfile
.github/workflows/_e2e-federation.yml
catchpoint/workflow-telemetry-action v2
actions/checkout v4
actions/cache v4
actions/setup-node v4
gh640/command-result-action v1
thollander/actions-comment-pull-request v2
.github/workflows/_mutation-test.yml
actions/checkout v4
actions/setup-node v4
gh640/command-result-action v1
thollander/actions-comment-pull-request v2
.github/workflows/_unit-test.yml
actions/checkout v4
actions/setup-node v4
.github/workflows/commit.yml
actions/create-github-app-token v1
actions/checkout v4
actions/setup-node v4
actions/create-github-app-token v1
actions/checkout v4
.github/workflows/pr.yml
actions/checkout v4
jdx/mise-action v2
.github/workflows/tag.yml
actions/checkout v4
docker/login-action v3
docker/setup-buildx-action v3
docker/metadata-action v5
docker/build-push-action v5
actions/checkout v4
actions/setup-node v4
actions/cache v4
package.json
@aws-sdk/client-s3 3.556.0
@heroicons/react 2.1.3
@prisma/client 5.13.0
@sentry/nextjs 7.112.1
async-mutex 0.5.0
bcryptjs 2.4.3
class-variance-authority 0.7.0
clsx 2.1.1
jotai 2.8.0
jsonld 8.3.2
next 14.3.0-canary.21
next-auth 4.24.7
next-nprogress-bar 2.3.11
react 19.0.0-canary-e3ebcd54b-20240405
react-dom 19.0.0-canary-e3ebcd54b-20240405
react-simple-image-viewer 1.2.2
sanitize-html 2.13.0
server-only 0.0.1
sharp 0.33.3
swiper 11.1.1
tailwind-merge 2.3.0
zod 3.23.4
zod-validation-error 3.2.0
@changesets/cli 2.27.1
@eslint/eslintrc 3.0.2
@mkizka/eslint-config 4.1.1
@playwright/test 1.43.1
@quramy/jest-prisma-core 1.8.0
@quramy/jest-prisma-node 1.8.0
@quramy/prisma-fabbrica 2.1.2
@storybook/addon-essentials 8.0.9
@storybook/addon-interactions 8.0.9
@storybook/jest 0.2.3
@storybook/nextjs 8.0.9
@storybook/react 8.0.9
@storybook/test-runner 0.17.0
@storybook/testing-library 0.2.2
@stryker-mutator/api 8.2.6
@stryker-mutator/core 8.2.6
@stryker-mutator/jest-runner 8.2.6
@total-typescript/ts-reset 0.5.1
@types/bcryptjs 2.4.6
@types/eslint__eslintrc 2.1.1
@types/jest 29.5.12
@types/jsonld 1.5.13
@types/node 20.12.7
@types/react 18.2.79
@types/react-dom 18.2.25
@types/sanitize-html 2.11.0
@typescript-eslint/eslint-plugin 7.7.1
@typescript-eslint/parser 7.7.1
autoprefixer 10.4.19
cli-markdown 3.2.3
dotenv-cli 7.4.1
eslint 8.57.0
eslint-config-next 14.2.2
eslint-plugin-storybook 0.8.0
eslint-plugin-tailwindcss 3.15.1
husky 9.0.11
jest 29.7.0
jest-diff 29.7.0
jest-mock-extended 3.0.6
knip 5.10.0
lint-staged 15.2.2
msw 2.2.14
npm-run-all2 6.1.2
postcss 8.4.38
prettier 3.2.5
prettier-plugin-pkg 0.18.1
prettier-plugin-sh 0.14.0
prisma 5.13.0
storybook 8.0.9
tailwindcss 3.4.3
tailwindcss-animate 1.0.7
ts-node 10.9.2
tsx 4.7.2
typescript 5.4.5
wait-on 7.2.0
node 20.x
pnpm 9.0.5
Dockerfile
node 20.12.2
例えばNoteなら
NoteCard, LikeButtonをStorybookでテストする
ServerNoteCardは単体テストがあるserviceロジックをimportして実行するだけにする
next/imageはリサイズした画像をキャッシュする?ためかメモリ使用率がすごく増えた
next/imageのリサイズだけ使ってキャッシュはさせないというのは出来なさそう
(CDN用にs-maxageを指定するとnext/imageがそれを使ってキャッシュしてしまう)
https://nextjs.org/docs/pages/api-reference/components/image#caching-behavior
リサイズは自分で実装して、キャッシュはCloudflareにさせるべき?
今してないので
https://unsocial.dev/@[email protected]
が404になる
参考
https://github.com/misskey-dev/misskey/blob/8a302a9af4e632f6d41616176f8307da37f28e93/packages/backend/src/core/activitypub/ApResolverService.ts#L102
https://github.com/misskey-dev/misskey/blob/8a302a9af4e632f6d41616176f8307da37f28e93/packages/backend/src/core/CreateSystemUserService.ts#L21
note.url と user.actorUrl と統一できてないので
swrの時はやってた
ServerActionに変えてからやめたけど、swrと違ってむしろやりやすそう
next/linkのバグ対策にもなるかも #512
ということが起きる
対策1 ... fetch(GET)を一定時間内で連続で呼んだ場合はキャッシュから返すようにする
対策2 ... findOrFetchUserの最初にlastFetchedAtを更新する(失敗しても更新されるようにする)
swrとか使う
トランザクション制御してないので
あったりなかったりするので
userIdという変数に@ xxxxとDBのid値どっちが入ってるか分からないので
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: None
Error type: An existing branch is blocking Renovate
Message: Renovate needs to create the branch "renovate/pin-dependencies" but is blocked from doing so because of an existing branch called "renovate". Please remove it so that Renovate can proceed.
note.tsなど1ファイルにメソッドを入れ過ぎているので
URLを扱う時は基本new URLするようにしてたけど、
hostを取る時などパースしたいときだけ使う
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.