Compare commits

...

33 commits

Author SHA1 Message Date
e98b8fc2eb
chore: stop formatting neko/index.js 2024-01-23 02:35:30 +09:00
e70a056f67
chore: upgrade pnpm 2024-01-23 02:21:19 +09:00
c035c368c7
refactor: stop importing stuff from firefish-js/built 2024-01-23 02:19:35 +09:00
f1e1f9e5b0
refactor: stop importing stuff from backend-rs/built 2024-01-23 02:16:52 +09:00
631a1d1d8e
dev: build backend-rs and firefish-js at first
these modules are imported by other modules
2024-01-23 01:37:50 +09:00
01e8ae37f8
refactor: rename backend/native-utils to backend-rs 2024-01-23 01:29:15 +09:00
20bfd954a3
container: dockerignore more files 2024-01-22 20:49:19 +09:00
d0eab90c9b
dev: use recursive wildcard in Makefile 2024-01-22 20:33:01 +09:00
866234854e
chore: update node version requirement 2024-01-22 09:28:56 +09:00
38e9e21d60
refactor: remove native-utils/migration 2024-01-22 08:54:24 +09:00
cbf8fd9f20
migration: delete original migrations from the 'migrations' table when reverting
Co-authored-by: naskya <m@naskya.net>
2024-01-22 07:23:29 +09:00
9cfe11e7a0
migration: wrap the revert SQL queries in BEGIN; and COMMIT;
Co-authored-by: sup39 <dev@sup39.dev>
2024-01-22 07:22:29 +09:00
52fea1ddcf
dev: add test for neko/revert.sql in Makefile 2024-01-22 04:14:31 +09:00
25a1bbea7b
dev: fix Makefile to run clippy if rust sources are updated 2024-01-22 04:00:35 +09:00
7ae491b0ee
docs: take into account that podman-compose exec prints the exit code at the end 2024-01-22 03:52:52 +09:00
100918e0b3
chore: remove chokidar from dependencies
overlooked in 261b8e6218
2024-01-22 02:37:36 +09:00
18312574ea
chore: upgrade dependencies 2024-01-22 02:19:22 +09:00
5dc3e5f347
chore: remove nsfwjs from dependencies
overlooked in 261b8e6218
2024-01-22 02:15:31 +09:00
b5a34b5bcb
dev: format the code in pre-commit 2024-01-22 02:11:22 +09:00
1beb3df99f
dev: set pre-commit as the default make recipe, make debug -> make run 2024-01-22 02:04:54 +09:00
79be37ea47
dev: run make recipes only when needed 2024-01-22 01:50:35 +09:00
7d5e062a21
dev: update neko/index.js only when rusty stuff are updated 2024-01-22 01:34:26 +09:00
e1b2b2a10d
dev: update lockfiles in make pre-commit 2024-01-22 01:29:49 +09:00
971da24c49
chore: update Cargo.lock 2024-01-22 01:19:36 +09:00
d1adaa5023
dev: execute clippy at the end of pre-commit so you don't miss the output 2024-01-22 01:02:40 +09:00
261b8e6218
refactor: remove NSFW media detection 2024-01-22 00:40:07 +09:00
65609b27c2
fix (native-utils): add js_name to the entities 2024-01-21 02:13:13 +09:00
78d48ed021
meta: add 20240120_update_will_take_a_long_time 2024-01-20 19:29:30 +09:00
afbddc7d37
dev (minor): format Makefile 2024-01-20 08:33:18 +09:00
0ac115874c
refactor: bring all internal functions into misc/native-utils.ts
Co-authored-by: sup39 <dev@sup39.dev>
2024-01-20 08:27:08 +09:00
93b7396990
refactor: make database models accesible to napi
Co-authored-by: sup39 <dev@sup39.dev>
2024-01-20 05:57:00 +09:00
3bc2b7bcfb
refactor (backend): drop timezone info from database
Co-authored-by: sup39 <dev@sup39.dev>
2024-01-20 04:26:13 +09:00
ea020e9f7c
refactor (client): organize CSS properties & improve RTL layout support
Co-authored-by: sup39 <dev@sup39.dev>
2024-01-20 03:04:08 +09:00
435 changed files with 2745 additions and 15421 deletions

View file

@ -10,7 +10,7 @@ node_modules
report.*.json
# Rust
packages/backend/native-utils/target
packages/backend-rs/target
# Cypress
cypress/screenshots
@ -40,8 +40,18 @@ packages/backend/assets/instance.css
# dockerignore custom
.git
.gitignore
Dockerfile
docker-compose.yml
docker-compose.example.yml
# Auto-generated files
/neko/volume
/dev
/docs
/neko
/scripts
biome.json
COPYING
LICENSE
Makefile
README.md
update.sh

View file

@ -15,14 +15,12 @@ RUN <<EOC
EOC
# Copy only the cargo dependency-related files first, to cache efficiently
COPY packages/backend/native-utils/Cargo.toml packages/backend/native-utils/Cargo.toml
COPY packages/backend/native-utils/Cargo.lock packages/backend/native-utils/Cargo.lock
COPY packages/backend/native-utils/src/lib.rs packages/backend/native-utils/src/
COPY packages/backend/native-utils/migration/Cargo.toml packages/backend/native-utils/migration/Cargo.toml
COPY packages/backend/native-utils/migration/src/lib.rs packages/backend/native-utils/migration/src/
COPY packages/backend-rs/Cargo.toml packages/backend-rs/Cargo.toml
COPY packages/backend-rs/Cargo.lock packages/backend-rs/Cargo.lock
COPY packages/backend-rs/src/lib.rs packages/backend-rs/src/
# Install cargo dependencies
RUN cargo fetch --locked --manifest-path /firefish/packages/backend/native-utils/Cargo.toml
RUN cargo fetch --locked --manifest-path /firefish/packages/backend-rs/Cargo.toml
# Copy only the dependency-related files first, to cache efficiently
COPY package.json pnpm*.yaml ./
@ -31,18 +29,18 @@ COPY packages/client/package.json packages/client/package.json
COPY packages/sw/package.json packages/sw/package.json
COPY packages/firefish-js/package.json packages/firefish-js/package.json
COPY packages/megalodon/package.json packages/megalodon/package.json
COPY packages/backend/native-utils/package.json packages/backend/native-utils/package.json
COPY packages/backend/native-utils/npm/linux-x64-musl/package.json packages/backend/native-utils/npm/linux-x64-musl/package.json
COPY packages/backend/native-utils/npm/linux-arm64-musl/package.json packages/backend/native-utils/npm/linux-arm64-musl/package.json
COPY packages/backend-rs/package.json packages/backend-rs/package.json
COPY packages/backend-rs/npm/linux-x64-musl/package.json packages/backend-rs/npm/linux-x64-musl/package.json
COPY packages/backend-rs/npm/linux-arm64-musl/package.json packages/backend-rs/npm/linux-arm64-musl/package.json
# Configure pnpm, and install dev mode dependencies for compilation
RUN corepack enable && corepack prepare pnpm@latest --activate && pnpm install --frozen-lockfile
# Copy in the rest of the native-utils rust files
COPY packages/backend/native-utils packages/backend/native-utils/
# Copy in the rest of the rust files
COPY packages/backend-rs packages/backend-rs/
# Compile native-utils
RUN pnpm run --filter native-utils build
# Compile backend-rs
RUN pnpm run --filter backend-rs build
# Copy in the rest of the files to compile
COPY . ./
@ -53,7 +51,8 @@ ENV VERSION=${VERSION}
RUN pnpm pkg set version="${VERSION}"
# Compile
RUN env NODE_ENV=production sh -c "pnpm run --filter '!native-utils' build && pnpm run gulp"
RUN env NODE_ENV=production sh -c "pnpm --filter 'firefish-js' run build"
RUN env NODE_ENV=production sh -c "pnpm --filter '!backend-rs' --filter '!firefish-js' -r --parallel run build && pnpm run gulp"
# Trim down the dependencies to only those for production
RUN pnpm install --prod --frozen-lockfile
@ -75,6 +74,7 @@ COPY --from=build /firefish/packages/megalodon /firefish/packages/megalodon
# Copy node modules
COPY --from=build /firefish/node_modules /firefish/node_modules
COPY --from=build /firefish/packages/backend/node_modules /firefish/packages/backend/node_modules
COPY --from=build /firefish/packages/backend-rs/node_modules /firefish/packages/backend-rs/node_modules
COPY --from=build /firefish/packages/sw/node_modules /firefish/packages/sw/node_modules
COPY --from=build /firefish/packages/client/node_modules /firefish/packages/client/node_modules
COPY --from=build /firefish/packages/firefish-js/node_modules /firefish/packages/firefish-js/node_modules
@ -83,7 +83,7 @@ COPY --from=build /firefish/packages/firefish-js/node_modules /firefish/packages
COPY --from=build /firefish/built /firefish/built
COPY --from=build /firefish/packages/backend/built /firefish/packages/backend/built
COPY --from=build /firefish/packages/backend/assets/instance.css /firefish/packages/backend/assets/instance.css
COPY --from=build /firefish/packages/backend/native-utils/built /firefish/packages/backend/native-utils/built
COPY --from=build /firefish/packages/backend-rs/built /firefish/packages/backend-rs/built
RUN corepack enable && corepack prepare pnpm@latest --activate
ARG VERSION

112
Makefile
View file

@ -1,13 +1,66 @@
.PHONY: build
build: build-image
T := dev/make_virtual_target
recursive_wildcard=$(foreach d, $(wildcard $(1:=/*)), $(call recursive_wildcard, $d, $2) $(filter $(subst *, %, $2), $d))
PACKAGE_JSONS := package.json
PACKAGE_JSONS += packages/backend/package.json
PACKAGE_JSONS += packages/backend-rs/package.json
PACKAGE_JSONS += packages/client/package.json
PACKAGE_JSONS += packages/firefish-js/package.json
PACKAGE_JSONS += packages/megalodon/package.json
PACKAGE_JSONS += packages/sw/package.json
RUST_DIR := packages/backend-rs
RUSTY_STUFF := $(call recursive_wildcard, $(RUST_DIR)/src, *)
RUSTY_STUFF += $(RUST_DIR)/Cargo.toml
MIGRATIONS := $(foreach dir, packages/backend/migration, $(wildcard $(dir)/*))
MIGRATIONS += $(foreach dir, packages/backend/migration-neko, $(wildcard $(dir)/*))
UPDATE_SCRIPTS := update.sh
UPDATE_SCRIPTS += $(foreach dir, neko/update, $(wildcard $(dir)/*))
POSTGRES_USER := firefish
POSTGRES_DB := firefish_db
POSTGRES_PASSWORD := password
POSTGRES_HOST_PORT := localhost:25432
.PHONY: pre-commit
pre-commit: shellcheck rust-lint regenerate-entities update-index-js
pre-commit: test format shellcheck update-lockfiles regenerate-entities neko/index.js rust-lint
.PHONY: debug
debug:
.PHONY: test
test: test-revert
.PHONY: test-revert
test-revert: $(T)/test-revert
$(T)/test-revert: neko/revert.sql $(MIGRATIONS)
cd dev && \
podman-compose exec db \
psql \
--echo-all \
--user=$(POSTGRES_USER) \
--dbname=$(POSTGRES_DB) \
--set='ON_ERROR_STOP=1' \
--command="$$(printf '%s\nROLLBACK;' "$$(cat ../neko/revert.sql | sed '$$ d')")"
touch $@
.PHONY: update-lockfiles
update-lockfiles: pnpm-lock.yaml $(RUST_DIR)/Cargo.lock
pnpm-lock.yaml: pnpm-workspace.yaml $(PACKAGE_JSONS)
pnpm install
$(RUST_DIR)/Cargo.lock: $(RUST_DIR)/Cargo.toml
cd $(RUST_DIR) && cargo update
.PHONY: run
run:
pnpm install
pnpm run build:debug
pnpm run migrate
@ -15,32 +68,53 @@ debug:
.PHONY: shellcheck
shellcheck:
shellcheck --external-sources update.sh
shellcheck --external-sources neko/update/*
shellcheck: $(T)/shellcheck
$(T)/shellcheck: $(UPDATE_SCRIPTS)
shellcheck --external-sources $^
touch $@
.PHONY: format
format:
pnpm run format
.PHONY: rust-lint
rust-lint:
cd packages/backend/native-utils && pnpm run lint
rust-lint: $(T)/rust-lint
$(T)/rust-lint: $(RUSTY_STUFF)
pnpm --filter='backend-rs' run lint
touch $@
.PHONY: regenerate-entities
regenerate-entities:
regenerate-entities: $(T)/regenerate-entities
$(T)/regenerate-entities: $(MIGRATIONS)
pnpm run migrate
cd packages/backend/native-utils && \
cd $(RUST_DIR) && \
sea-orm-cli generate entity \
--output-dir='src/model/entity' \
--database-url='postgres://firefish:password@localhost:25432/firefish_db'
--database-url='postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST_PORT)/$(POSTGRES_DB)' \
--date-time-crate='chrono' \
--model-extra-attributes='NAPI_EXTRA_ATTR_PLACEHOLDER' && \
for file in src/model/entity/*; do \
base=$$(basename -- "$${file}"); \
jsname=$$(printf '%s\n' "$${base%.*}" | perl -pe 's/(^|_)./uc($$&)/ge;s/_//g'); \
attribute=$$(printf 'napi_derive::napi(object, js_name = "%s")' "$${jsname}"); \
sed -i "s/NAPI_EXTRA_ATTR_PLACEHOLDER/$${attribute}/" "$${file}"; \
done
sed -i 's/#\[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum)\]/#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)]\n#[napi_derive::napi]/' \
$(RUST_DIR)/src/model/entity/sea_orm_active_enums.rs
touch $@
.PHONY: update-index-js
update-index-js:
pnpm --filter='native-utils' run build:debug
[ -f packages/backend/native-utils/built/index.js ]
pnpm run format
neko/index.js: $(RUSTY_STUFF)
pnpm --filter='backend-rs' run build:debug
[ -f $(RUST_DIR)/built/index.js ]
rm neko/index.js
cp packages/backend/native-utils/built/index.js neko/index.js
cp $(RUST_DIR)/built/index.js neko/index.js
.PHONY: build-image

4
dev/make_virtual_target/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View file

@ -11,6 +11,8 @@
- この Firefish はよく Firefish neko flavor と呼ばれていますが、これはこのバージョン番号に由来します。私自身は特にこの呼称を普及させたいわけではなかったのですが、[私のアカウント](https://post.naskya.net/@dev)の数割のフォロワーが英語圏の本家 Firefish の利用者であるため単に「この機能を追加しました!」などと投稿すると本家版の更新と誤解される恐れがありますし、「私の Firefish フォークにこの機能を追加しました!」などと投稿すると私が本家 Firefish の開発を離れて新たなハードフォークを作っているのだと誤解される恐れがあるため、投稿を機械翻訳で英訳されて読まれてもなるべく誤解されないための苦肉の策としてこの呼称を使い始めました。このソフトフォークはあくまで本家 Firefish の私による「味付け」です。
- 依存ライブラリをほとんど常に最新版にアップデート
- 本家版を更新する前にちゃんと動くか実験したいという意図もあります
- Rust によるデータベースのマイグレーションを廃止
- Rust に移植できる部分は少しずつ移植していきますが、Rust によるデータベースのマイグレーションは(少なくとも当面の間)行いません
## クライアントの変更点
@ -108,6 +110,8 @@
### 主要な変更点
- センシティブなメディアの自動検出機能を削除
- 誤検知が多く、使っているサーバーもあまり多くないと思ったため(困る場合には教えてください)
- 非ログインユーザーにもローカルタイムラインとグローバルタイムラインを公開できるように変更
- コントロールパネルから設定すると `https://server.example.com/timeline` で公開されます
- 全文検索のエンジンを [PGroonga](https://pgroonga.github.io/) に変更([tamaina さんの PGroonga パッチ](https://gist.github.com/tamaina/29e88e02d0dc5acfa2f50b3347d3d20d)を拡張)

View file

@ -12,7 +12,7 @@
- podman
- podman-compose
- make
- GNU Make
- nodejs
- pnpm
- shellcheck
@ -54,13 +54,13 @@ make
### 実行
```bash
make debug
make run
```
### コミット前に行う確認
### lockfile の更新やコードのフォーマットなど(コミット前に行ってください)
```bash
make pre-commit
make
```
### コミットメッセージ
@ -95,4 +95,4 @@ make pre-commit
## 注意事項
データベースのマイグレーションを伴う変更を加える場合にはマイグレーションのファイルを [`packages/backend/migration-neko`](https://code.naskya.net/naskya/firefish/source-by/main/packages/backend/migration-neko) の下に作成し、マイグレーションを打ち消す SQL クエリを [`neko/revert.sql`](https://code.naskya.net/naskya/firefish/source-by/main/neko/revert.sql) の**一番上に**追記してください。
データベースのマイグレーションを伴う変更を加える場合にはマイグレーションのファイルを [`packages/backend/migration-neko`](https://code.naskya.net/naskya/firefish/source-by/main/packages/backend/migration-neko) の下に作成し、マイグレーションを打ち消す SQL クエリを [`neko/revert.sql`](https://code.naskya.net/naskya/firefish/source-by/main/neko/revert.sql) の一番上にある `BEGIN;``DELETE` 文の直後に追記し、`DELETE` 文の括弧内の末尾に作成したマイグレーションのクラス名を追加してください。

View file

@ -1,5 +1,7 @@
# このフォークから本家版に移行する
移行には時間が掛かるので、必ずまとまった時間が取れるときに行ってください。
## サーバーに Firefish を直接インストールしている場合
1. サーバーを停止する
@ -103,6 +105,8 @@
./update.sh --install --native
```
`update.sh` の初回の実行には非常に時間が掛かります(サーバーの規模にもよりますが、数十分から 1 時間は掛かると思ってください)。処理がフリーズしているように見えることもありますが、**絶対に途中で強制終了しないでください。**
13. サーバーを起動して動作を確認する
```bash
@ -172,9 +176,11 @@ Docker を使う場合には以下の `podman`, `podman-compose`, `--podman` を
9. サーバーを起動して動作を確認する
```bash
podman-compose up --detach
podman-compose up
```
初回の起動には非常に時間が掛かります(サーバーの規模にもよりますが、数十分から 1 時間は掛かると思ってください)。初回は `-d (--detach)` のオプション無しで起動してログを確認することをおすすめします。**処理がフリーズしているように見えることもありますが、絶対に途中で強制終了しないでください。**
10. 元々 Firefish がインストールされていたディレクトリを削除する
```bash

View file

@ -1,5 +1,7 @@
# このフォークから本家版に移行する
移行には時間が掛かるので、必ずまとまった時間が取れるときに行ってください。
## サーバーに Firefish を直接インストールしている場合
1. サーバーのバックアップを取る
@ -30,21 +32,17 @@
db: firefish_db # これ
```
6. 次のコマンドでデータベースをいじる前に、そのコマンドが正常に動作するか確認する(`firefish_db` の部分は自分のデータベース名に変更する)
```bash
printf 'BEGIN;\n%s\nROLLBACK;' "$(cat neko/revert.sql)" | sudo -u postgres psql --echo-all --set='ON_ERROR_STOP=1' --dbname=firefish_db
```
最後の行が `ROLLBACK` で終わっていれば問題ありません。そうでない場合には[私にコマンドの実行ログを送ってください](https://code.naskya.net/naskya/firefish/source-by/main/docs/trouble_shooting.md#私にコマンドの実行ログを送る)。
7. このフォークで加えられたデータベースへの変更を実際に取り消す(`firefish_db` の部分は自分のデータベース名に変更する)
6. このフォークで加えられたデータベースへの変更を取り消す(`firefish_db` の部分は自分のデータベース名に変更する)
```bash
sudo -u postgres psql --file=neko/revert.sql --dbname=firefish_db
```
8. PGroonga をアンインストールする
これには非常に時間が掛かります(サーバーの規模によりますが、数十分から 1 時間の時間が掛かることが予想されます)が、**絶対に処理を強制終了しないでください**。
出力の最後の行が `COMMIT` になっていれば問題ありません。そうでない場合には[私にコマンドの実行ログを送ってください](https://code.naskya.net/naskya/firefish/source-by/main/docs/trouble_shooting.md#私にコマンドの実行ログを送る)。
7. PGroonga をアンインストールする
コマンドの例
@ -55,25 +53,25 @@
sudo apt update
```
9. Firefish がインストールされているディレクトリの親ディレクトリ (e.g., `/home/firefish`) に行く
8. Firefish がインストールされているディレクトリの親ディレクトリ (e.g., `/home/firefish`) に行く
```bash
cd ..
```
10. Firefish がインストールされているディレクトリ (e.g., `./firefish`) の名前を変える
9. Firefish がインストールされているディレクトリ (e.g., `./firefish`) の名前を変える
```bash
mv firefish firefish.old
```
11. Firefish がインストールされているディレクトリと同じ名前で本家版の Firefish を clone する
10. Firefish がインストールされているディレクトリと同じ名前で本家版の Firefish を clone する
```bash
git clone https://git.joinfirefish.org/firefish/firefish.git firefish
```
12. 必要なファイルをコピーする
11. 必要なファイルをコピーする
```bash
rm -rf firefish/files firefish/custom firefish/.config
@ -82,14 +80,14 @@
cp -r firefish.old/.config firefish
```
13. 新しい Firefish のディレクトリ (e.g., `./firefish`) に入り、`develop` ブランチに行く(実際には既に `develop` にいるはず)
12. 新しい Firefish のディレクトリ (e.g., `./firefish`) に入り、`develop` ブランチに行く(実際には既に `develop` にいるはず)
```bash
cd firefish
git checkout develop
```
14. Firefish をビルドする
13. Firefish をビルドする
```bash
corepack prepare pnpm@latest --activate
@ -98,13 +96,13 @@
pnpm run migrate
```
15. サーバーを起動して動作を確認する
14. サーバーを起動して動作を確認する
```bash
sudo systemctl start firefish
```
16. 元々 Firefish がインストールされていたディレクトリを削除する
15. 元々 Firefish がインストールされていたディレクトリを削除する
```bash
cd ..
@ -147,39 +145,35 @@ Docker を使う場合には以下の `podman`, `podman-compose`, `--podman` を
POSTGRES_DB=firefish_db # これがデータベース名
```
6. 次のコマンドでデータベースをいじる前に、そのコマンドが正常に動作するか確認する(`firefish` と `firefish_db` の部分は自分のユーザー名とデータベース名に変更する)
```bash
podman-compose exec db psql --user=firefish --dbname=firefish_db --echo-all --set='ON_ERROR_STOP=1' --command="$(printf 'BEGIN;\n%s\nROLLBACK;' "$(cat neko/revert.sql)")"
```
最後の行が `ROLLBACK` で終わっていれば問題ありません。そうでない場合には[私にコマンドの実行ログを送ってください](https://code.naskya.net/naskya/firefish/source-by/main/docs/trouble_shooting.md#私にコマンドの実行ログを送る)。
7. このフォークで加えられたデータベースへの変更を実際に取り消す(`mk1` の部分は自分のデータベース名に変更する)
6. このフォークで加えられたデータベースへの変更を取り消す(`firefish_db` の部分は自分のデータベース名に変更する)
```bash
podman-compose exec db psql --user=firefish --dbname=firefish_db --command="$(cat neko/revert.sql)"
```
8. Firefish がインストールされているディレクトリの親ディレクトリ (e.g., `/home/firefish`) に行く
これには非常に時間が掛かります(サーバーの規模によりますが、数十分から 1 時間の時間が掛かることが予想されます)が、**絶対に処理を強制終了しないでください**。
出力の最後の行が `ROLLBACK`(またはその後に `exit code: 0` と続いている)になっていれば問題ありません。そうでない場合には[私にコマンドの実行ログを送ってください](https://code.naskya.net/naskya/firefish/source-by/main/docs/trouble_shooting.md#私にコマンドの実行ログを送る)。
7. Firefish がインストールされているディレクトリの親ディレクトリ (e.g., `/home/firefish`) に行く
```bash
cd ..
```
9. Firefish がインストールされているディレクトリ (e.g., `./firefish`) の名前を変える
8. Firefish がインストールされているディレクトリ (e.g., `./firefish`) の名前を変える
```bash
mv firefish firefish.old
```
10. Firefish がインストールされているディレクトリと同じ名前で本家版の Firefish を clone する
9. Firefish がインストールされているディレクトリと同じ名前で本家版の Firefish を clone する
```bash
git clone https://git.joinfirefish.org/firefish/firefish.git firefish
```
11. 必要なファイルをコピーする
10. 必要なファイルをコピーする
```bash
rm -rf firefish/files firefish/custom firefish/.config
@ -188,13 +182,13 @@ Docker を使う場合には以下の `podman`, `podman-compose`, `--podman` を
cp -r firefish.old/.config firefish
```
12. 新しい Firefish のディレクトリ (e.g., `./firefish`) に入る
11. 新しい Firefish のディレクトリ (e.g., `./firefish`) に入る
```bash
cd firefish
```
13. サーバーを起動して動作を確認する
12. サーバーを起動して動作を確認する
```bash
podman-compose up --detach
@ -202,7 +196,7 @@ Docker を使う場合には以下の `podman`, `podman-compose`, `--podman` を
`docker-compose.yml` にカスタムが必要な場合には、各自で編集してください。
14. 元々 Firefish がインストールされていたディレクトリを削除する
13. 元々 Firefish がインストールされていたディレクトリを削除する
```bash
cd ..

View file

@ -4,307 +4,326 @@
/* auto-generated by NAPI-RS */
const { existsSync, readFileSync } = require("fs");
const { join } = require("path");
const { existsSync, readFileSync } = require('fs')
const { join } = require('path')
const { platform, arch } = process;
const { platform, arch } = process
let nativeBinding = null;
let localFileExisted = false;
let loadError = null;
let nativeBinding = null
let localFileExisted = false
let loadError = null
function isMusl() {
// For Node 10
if (!process.report || typeof process.report.getReport !== "function") {
try {
const lddPath = require("child_process")
.execSync("which ldd")
.toString()
.trim();
return readFileSync(lddPath, "utf8").includes("musl");
} catch (e) {
return true;
}
} else {
const { glibcVersionRuntime } = process.report.getReport().header;
return !glibcVersionRuntime;
}
// For Node 10
if (!process.report || typeof process.report.getReport !== 'function') {
try {
const lddPath = require('child_process').execSync('which ldd').toString().trim()
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {
return true
}
} else {
const { glibcVersionRuntime } = process.report.getReport().header
return !glibcVersionRuntime
}
}
switch (platform) {
case "android":
switch (arch) {
case "arm64":
localFileExisted = existsSync(
join(__dirname, "native-utils.android-arm64.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.android-arm64.node");
} else {
nativeBinding = require("native-utils-android-arm64");
}
} catch (e) {
loadError = e;
}
break;
case "arm":
localFileExisted = existsSync(
join(__dirname, "native-utils.android-arm-eabi.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.android-arm-eabi.node");
} else {
nativeBinding = require("native-utils-android-arm-eabi");
}
} catch (e) {
loadError = e;
}
break;
default:
throw new Error(`Unsupported architecture on Android ${arch}`);
}
break;
case "win32":
switch (arch) {
case "x64":
localFileExisted = existsSync(
join(__dirname, "native-utils.win32-x64-msvc.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.win32-x64-msvc.node");
} else {
nativeBinding = require("native-utils-win32-x64-msvc");
}
} catch (e) {
loadError = e;
}
break;
case "ia32":
localFileExisted = existsSync(
join(__dirname, "native-utils.win32-ia32-msvc.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.win32-ia32-msvc.node");
} else {
nativeBinding = require("native-utils-win32-ia32-msvc");
}
} catch (e) {
loadError = e;
}
break;
case "arm64":
localFileExisted = existsSync(
join(__dirname, "native-utils.win32-arm64-msvc.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.win32-arm64-msvc.node");
} else {
nativeBinding = require("native-utils-win32-arm64-msvc");
}
} catch (e) {
loadError = e;
}
break;
default:
throw new Error(`Unsupported architecture on Windows: ${arch}`);
}
break;
case "darwin":
localFileExisted = existsSync(
join(__dirname, "native-utils.darwin-universal.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.darwin-universal.node");
} else {
nativeBinding = require("native-utils-darwin-universal");
}
break;
} catch {}
switch (arch) {
case "x64":
localFileExisted = existsSync(
join(__dirname, "native-utils.darwin-x64.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.darwin-x64.node");
} else {
nativeBinding = require("native-utils-darwin-x64");
}
} catch (e) {
loadError = e;
}
break;
case "arm64":
localFileExisted = existsSync(
join(__dirname, "native-utils.darwin-arm64.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.darwin-arm64.node");
} else {
nativeBinding = require("native-utils-darwin-arm64");
}
} catch (e) {
loadError = e;
}
break;
default:
throw new Error(`Unsupported architecture on macOS: ${arch}`);
}
break;
case "freebsd":
if (arch !== "x64") {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
}
localFileExisted = existsSync(
join(__dirname, "native-utils.freebsd-x64.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.freebsd-x64.node");
} else {
nativeBinding = require("native-utils-freebsd-x64");
}
} catch (e) {
loadError = e;
}
break;
case "linux":
switch (arch) {
case "x64":
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, "native-utils.linux-x64-musl.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.linux-x64-musl.node");
} else {
nativeBinding = require("native-utils-linux-x64-musl");
}
} catch (e) {
loadError = e;
}
} else {
localFileExisted = existsSync(
join(__dirname, "native-utils.linux-x64-gnu.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.linux-x64-gnu.node");
} else {
nativeBinding = require("native-utils-linux-x64-gnu");
}
} catch (e) {
loadError = e;
}
}
break;
case "arm64":
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, "native-utils.linux-arm64-musl.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.linux-arm64-musl.node");
} else {
nativeBinding = require("native-utils-linux-arm64-musl");
}
} catch (e) {
loadError = e;
}
} else {
localFileExisted = existsSync(
join(__dirname, "native-utils.linux-arm64-gnu.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.linux-arm64-gnu.node");
} else {
nativeBinding = require("native-utils-linux-arm64-gnu");
}
} catch (e) {
loadError = e;
}
}
break;
case "arm":
localFileExisted = existsSync(
join(__dirname, "native-utils.linux-arm-gnueabihf.node"),
);
try {
if (localFileExisted) {
nativeBinding = require("./native-utils.linux-arm-gnueabihf.node");
} else {
nativeBinding = require("native-utils-linux-arm-gnueabihf");
}
} catch (e) {
loadError = e;
}
break;
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`);
}
break;
default:
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
case 'android':
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.android-arm64.node')
} else {
nativeBinding = require('backend-rs-android-arm64')
}
} catch (e) {
loadError = e
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm-eabi.node'))
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.android-arm-eabi.node')
} else {
nativeBinding = require('backend-rs-android-arm-eabi')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Android ${arch}`)
}
break
case 'win32':
switch (arch) {
case 'x64':
localFileExisted = existsSync(
join(__dirname, 'backend-rs.win32-x64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.win32-x64-msvc.node')
} else {
nativeBinding = require('backend-rs-win32-x64-msvc')
}
} catch (e) {
loadError = e
}
break
case 'ia32':
localFileExisted = existsSync(
join(__dirname, 'backend-rs.win32-ia32-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.win32-ia32-msvc.node')
} else {
nativeBinding = require('backend-rs-win32-ia32-msvc')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'backend-rs.win32-arm64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.win32-arm64-msvc.node')
} else {
nativeBinding = require('backend-rs-win32-arm64-msvc')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Windows: ${arch}`)
}
break
case 'darwin':
localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-universal.node'))
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.darwin-universal.node')
} else {
nativeBinding = require('backend-rs-darwin-universal')
}
break
} catch {}
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.darwin-x64.node')
} else {
nativeBinding = require('backend-rs-darwin-x64')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'backend-rs.darwin-arm64.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.darwin-arm64.node')
} else {
nativeBinding = require('backend-rs-darwin-arm64')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on macOS: ${arch}`)
}
break
case 'freebsd':
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'backend-rs.freebsd-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.freebsd-x64.node')
} else {
nativeBinding = require('backend-rs-freebsd-x64')
}
} catch (e) {
loadError = e
}
break
case 'linux':
switch (arch) {
case 'x64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-x64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-x64-musl.node')
} else {
nativeBinding = require('backend-rs-linux-x64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-x64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-x64-gnu.node')
} else {
nativeBinding = require('backend-rs-linux-x64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 'arm64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-arm64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-arm64-musl.node')
} else {
nativeBinding = require('backend-rs-linux-arm64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-arm64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-arm64-gnu.node')
} else {
nativeBinding = require('backend-rs-linux-arm64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 'arm':
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('backend-rs-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
}
break
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-riscv64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-riscv64-musl.node')
} else {
nativeBinding = require('backend-rs-linux-riscv64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-riscv64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-riscv64-gnu.node')
} else {
nativeBinding = require('backend-rs-linux-riscv64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 's390x':
localFileExisted = existsSync(
join(__dirname, 'backend-rs.linux-s390x-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./backend-rs.linux-s390x-gnu.node')
} else {
nativeBinding = require('backend-rs-linux-s390x-gnu')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`)
}
break
default:
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
}
if (!nativeBinding) {
if (loadError) {
throw loadError;
}
throw new Error(`Failed to load native binding`);
if (loadError) {
throw loadError
}
throw new Error(`Failed to load native binding`)
}
const {
EnvConfig,
readEnvironmentConfig,
readServerConfig,
stringToAcct,
acctToString,
getFullApAccount,
isSelfHost,
extractHost,
toPuny,
toPunyOptional,
convertToHiddenPost,
sqlLikeEscape,
safeForSql,
formatMilliseconds,
genString,
IdConvertType,
convertId,
nativeGetTimestamp,
nativeCreateId,
nativeInitIdGenerator,
} = nativeBinding;
const { EnvConfig, readEnvironmentConfig, readServerConfig, AntennaSrcEnum, MutedNoteReasonEnum, NoteVisibilityEnum, NotificationTypeEnum, PageVisibilityEnum, PollNotevisibilityEnum, RelayStatusEnum, UserEmojimodpermEnum, UserProfileFfvisibilityEnum, UserProfileMutingnotificationtypesEnum, stringToAcct, acctToString, getFullApAccount, isSelfHost, extractHost, toPuny, toPunyOptional, convertToHiddenPost, sqlLikeEscape, safeForSql, formatMilliseconds, nativeInitIdGenerator, nativeCreateId, nativeGetTimestamp, genString, IdConvertType, convertId } = nativeBinding
module.exports.EnvConfig = EnvConfig;
module.exports.readEnvironmentConfig = readEnvironmentConfig;
module.exports.readServerConfig = readServerConfig;
module.exports.stringToAcct = stringToAcct;
module.exports.acctToString = acctToString;
module.exports.getFullApAccount = getFullApAccount;
module.exports.isSelfHost = isSelfHost;
module.exports.extractHost = extractHost;
module.exports.toPuny = toPuny;
module.exports.toPunyOptional = toPunyOptional;
module.exports.convertToHiddenPost = convertToHiddenPost;
module.exports.sqlLikeEscape = sqlLikeEscape;
module.exports.safeForSql = safeForSql;
module.exports.formatMilliseconds = formatMilliseconds;
module.exports.genString = genString;
module.exports.IdConvertType = IdConvertType;
module.exports.convertId = convertId;
module.exports.nativeGetTimestamp = nativeGetTimestamp;
module.exports.nativeCreateId = nativeCreateId;
module.exports.nativeInitIdGenerator = nativeInitIdGenerator;
module.exports.EnvConfig = EnvConfig
module.exports.readEnvironmentConfig = readEnvironmentConfig
module.exports.readServerConfig = readServerConfig
module.exports.AntennaSrcEnum = AntennaSrcEnum
module.exports.MutedNoteReasonEnum = MutedNoteReasonEnum
module.exports.NoteVisibilityEnum = NoteVisibilityEnum
module.exports.NotificationTypeEnum = NotificationTypeEnum
module.exports.PageVisibilityEnum = PageVisibilityEnum
module.exports.PollNotevisibilityEnum = PollNotevisibilityEnum
module.exports.RelayStatusEnum = RelayStatusEnum
module.exports.UserEmojimodpermEnum = UserEmojimodpermEnum
module.exports.UserProfileFfvisibilityEnum = UserProfileFfvisibilityEnum
module.exports.UserProfileMutingnotificationtypesEnum = UserProfileMutingnotificationtypesEnum
module.exports.stringToAcct = stringToAcct
module.exports.acctToString = acctToString
module.exports.getFullApAccount = getFullApAccount
module.exports.isSelfHost = isSelfHost
module.exports.extractHost = extractHost
module.exports.toPuny = toPuny
module.exports.toPunyOptional = toPunyOptional
module.exports.convertToHiddenPost = convertToHiddenPost
module.exports.sqlLikeEscape = sqlLikeEscape
module.exports.safeForSql = safeForSql
module.exports.formatMilliseconds = formatMilliseconds
module.exports.nativeInitIdGenerator = nativeInitIdGenerator
module.exports.nativeCreateId = nativeCreateId
module.exports.nativeGetTimestamp = nativeGetTimestamp
module.exports.genString = genString
module.exports.IdConvertType = IdConvertType
module.exports.convertId = convertId

View file

@ -0,0 +1,25 @@
-------------------------------------------------
| For all users: |
| |
| This time, the upgrade will take a LONG time. |
| I expect it to take at least 10 minutes and |
| up to an hour. |
| |
| Please perform the upgrade when you have enough |
| time, and DO NOT TERMINATE THE PROCESS even if |
| it appears to be frozen. |
| |
| If you are using containers (Podman or Docker), |
| the initial startup will take a very long time. |
| It's possible you won't be able to access the |
| server for a few tens of minutes after starting |
| the container. I recommend you to start the |
| server without `-d (--detach)` option and check |
| the logs. |
| |
| PLEASE DO NOT STOP (podman-compose down) THE |
| CONTAINER even if it appears to be frozen. |
| |
| For the detailed explanation, see: |
| https://post.naskya.net/notes/9opfamuwh10xye7y |
-------------------------------------------------

View file

@ -1,3 +1,120 @@
BEGIN;
DELETE FROM "migrations" WHERE name IN (
'DropTimeZone1705691683091',
'AddReplyMuting1704851359889',
'EmojimodEnumRelabel1699658378432',
'Vervis1699302371683',
'Pgroonga1698420787202',
'TruncateChartTables1694921638251',
'EmojiModerator1692825433698',
'RemoveNativeUtilsMigration1705877093218'
);
-- remove-native-utils-migration
CREATE TABLE "seaql_migrations" (
version character varying NOT NULL,
applied_at bigint NOT NULL
);
INSERT INTO "seaql_migrations" (version, applied_at)
VALUES
('m20230531_180824_drop_reversi', 1705876632),
('m20230627_185451_index_note_url', 1705876632),
('m20230709_000510_move_antenna_to_cache', 1705876632),
('m20230806_170616_fix_antenna_stream_ids', 1705876632),
('m20230904_013244_is_indexable', 1705876632),
('m20231002_143323_remove_integrations', 1705876632)
;
-- remove-nsfw-detection
ALTER TABLE "user_profile" ADD "autoSensitive" boolean NOT NULL DEFAULT false;
ALTER TABLE "meta" ADD "enableSensitiveMediaDetectionForVideos" boolean NOT NULL DEFAULT false;
ALTER TABLE "meta" ADD "setSensitiveFlagAutomatically" boolean NOT NULL DEFAULT false;
CREATE TYPE "public"."meta_sensitivemediadetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh');
ALTER TABLE "meta" ADD "sensitiveMediaDetectionSensitivity" "public"."meta_sensitivemediadetectionsensitivity_enum" NOT NULL DEFAULT 'medium';
CREATE TYPE "public"."meta_sensitivemediadetection_enum" AS ENUM('none', 'all', 'local', 'remote');
ALTER TABLE "meta" ADD "sensitiveMediaDetection" "public"."meta_sensitivemediadetection_enum" NOT NULL DEFAULT 'none';
ALTER TABLE "drive_file" ADD "maybePorn" boolean NOT NULL DEFAULT false;
ALTER TABLE "drive_file" ADD "maybeSensitive" boolean NOT NULL DEFAULT false;
COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)';
-- drop-time-zone
ALTER TABLE "webhook" ALTER "latestSentAt" TYPE timestamp with time zone;
ALTER TABLE "webhook" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_security_key" ALTER "lastUsed" TYPE timestamp with time zone;
ALTER TABLE "user_pending" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_note_pining" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_list_joining" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_list" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_ip" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_group_joining" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_group_invite" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_group_invitation" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user_group" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "user" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "user" ALTER "lastFetchedAt" TYPE timestamp with time zone;
ALTER TABLE "user" ALTER "lastActiveDate" TYPE timestamp with time zone;
ALTER TABLE "user" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "used_username" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "sw_subscription" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "signin" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "reply_muting" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "renote_muting" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "registry_item" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "registry_item" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "registration_ticket" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "promo_read" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "promo_note" ALTER "expiresAt" TYPE timestamp with time zone;
ALTER TABLE "poll_vote" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "poll" ALTER "expiresAt" TYPE timestamp with time zone;
ALTER TABLE "password_reset_request" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "page_like" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "page" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "page" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "notification" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "note_watching" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "note_thread_muting" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "note_reaction" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "note_favorite" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "note_edit" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "note" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "note" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "muting" ALTER "expiresAt" TYPE timestamp with time zone;
ALTER TABLE "muting" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "moderation_log" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "messaging_message" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "instance" ALTER "latestRequestSentAt" TYPE timestamp with time zone;
ALTER TABLE "instance" ALTER "latestRequestReceivedAt" TYPE timestamp with time zone;
ALTER TABLE "instance" ALTER "lastCommunicatedAt" TYPE timestamp with time zone;
ALTER TABLE "instance" ALTER "infoUpdatedAt" TYPE timestamp with time zone;
ALTER TABLE "instance" ALTER "caughtAt" TYPE timestamp with time zone;
ALTER TABLE "gallery_post" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "gallery_post" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "gallery_like" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "follow_request" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "following" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "emoji" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "drive_folder" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "drive_file" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "clip" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "channel_note_pining" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "channel_following" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "channel" ALTER "lastNotedAt" TYPE timestamp with time zone;
ALTER TABLE "channel" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "blocking" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "auth_session" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "attestation_challenge" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "app" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "antenna" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "announcement_read" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "announcement" ALTER "updatedAt" TYPE timestamp with time zone;
ALTER TABLE "announcement" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "ad" ALTER "expiresAt" TYPE timestamp with time zone;
ALTER TABLE "ad" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "access_token" ALTER "lastUsedAt" TYPE timestamp with time zone;
ALTER TABLE "access_token" ALTER "createdAt" TYPE timestamp with time zone;
ALTER TABLE "abuse_user_report" ALTER "createdAt" TYPE timestamp with time zone;
-- reply-muting
DROP TABLE "reply_muting";
@ -13,3 +130,5 @@ DROP EXTENSION pgroonga CASCADE;
-- emoji-moderator
ALTER TABLE "user" DROP COLUMN "emojiModPerm";
DROP TYPE "public"."user_emojimodperm_enum";
COMMIT;

View file

@ -48,9 +48,9 @@ say "Done! We're almost there."
br
# prevent migration errors
if [ ! -f packages/backend/native-utils/built/index.js ]; then
if [ ! -f packages/backend-rs/built/index.js ]; then
sadsay 'Something went wrong... Gonnya try fixing that.'
run 'cp neko/index.js packages/backend/native-utils/built/index.js'
run 'cp neko/index.js packages/backend-rs/built/index.js'
br
else
say "It's going well so far!"

View file

@ -6,11 +6,14 @@
"type": "git",
"url": "https://code.naskya.net/naskya/firefish"
},
"packageManager": "pnpm@8.14.1",
"engines": {
"node": ">= 18.17.0"
},
"packageManager": "pnpm@8.14.2",
"private": true,
"scripts": {
"rebuild": "pnpm run clean && pnpm run build",
"build": "pnpm --filter firefish-js run build && pnpm --filter !firefish-js -r --parallel run build && pnpm run gulp",
"build": "pnpm --filter backend-rs run build && pnpm --filter firefish-js run build && pnpm --filter !firefish-js --filter !backend-rs -r --parallel run build && pnpm run gulp",
"start": "pnpm --filter backend run start",
"start:container": "pnpm run gulp && pnpm run migrate && pnpm run start",
"init": "pnpm run migrate",
@ -22,7 +25,7 @@
"dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start",
"lint": "pnpm -r --parallel run lint",
"debug": "pnpm run build:debug && pnpm run start",
"build:debug": "pnpm clean && pnpm --filter firefish-js run build:types && pnpm -r --parallel run build:debug && pnpm run gulp",
"build:debug": "pnpm clean && pnpm --filter backend-rs run build:debug && pnpm --filter firefish-js run build:debug && pnpm --filter firefish-js run build:types && pnpm --filter !firefish-js --filter !backend-rs -r --parallel run build:debug && pnpm run gulp",
"format": "pnpm -r --parallel run format",
"clean": "pnpm node ./scripts/clean-built.mjs",
"clean-cargo": "pnpm node ./scripts/clean-cargo.mjs",
@ -33,8 +36,7 @@
"dependencies": {
"@bull-board/api": "5.13.0",
"@bull-board/ui": "5.13.0",
"@napi-rs/cli": "2.17.0",
"@tensorflow/tfjs": "4.16.0",
"@napi-rs/cli": "2.18.0",
"gulp": "4.0.2",
"gulp-cssnano": "2.1.3",
"gulp-replace": "1.1.4",
@ -49,7 +51,7 @@
"@biomejs/cli-linux-x64": "1.5.2",
"@types/node": "20.11.5",
"execa": "8.0.1",
"pnpm": "8.14.1",
"pnpm": "8.14.2",
"typescript": "5.3.3"
}
}

View file

@ -3,7 +3,7 @@
This directory contains all of the packages Firefish uses.
- `backend`: Main backend code written in TypeScript for NodeJS
- `backend/native-utils`: Backend code written in Rust, bound to NodeJS by [NAPI-RS](https://napi.rs/)
- `backend-rs`: Backend code written in Rust, bound to NodeJS by [NAPI-RS](https://napi.rs/)
- `client`: Web interface written in Vue3 and TypeScript
- `sw`: Web [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) written in TypeScript
- `firefish-js`: TypeScript SDK for both backend and client, also published on [NPM](https://www.npmjs.com/package/firefish-js) for public use

View file

@ -80,9 +80,9 @@ dependencies = [
[[package]]
name = "anstream"
version = "0.6.8"
version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "628a8f9bd1e24b4e0db2b4bc2d000b001e7dd032d54afa60a68836aeec5aa54a"
checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5"
dependencies = [
"anstyle",
"anstyle-parse",
@ -196,6 +196,34 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "backend-rs"
version = "0.0.0"
dependencies = [
"async-trait",
"basen",
"cfg-if",
"chrono",
"cuid2",
"idna",
"jsonschema",
"napi",
"napi-build",
"napi-derive",
"once_cell",
"parse-display",
"pretty_assertions",
"rand",
"schemars",
"sea-orm",
"serde",
"serde_json",
"serde_yaml",
"thiserror",
"tokio",
"url",
]
[[package]]
name = "backtrace"
version = "0.3.69"
@ -443,33 +471,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "combine"
version = "4.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
dependencies = [
"bytes",
"futures-core",
"memchr",
"pin-project-lite",
"tokio",
"tokio-util",
]
[[package]]
name = "console"
version = "0.15.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb"
dependencies = [
"encode_unicode",
"lazy_static",
"libc",
"unicode-width",
"windows-sys 0.52.0",
]
[[package]]
name = "const-oid"
version = "0.9.6"
@ -649,12 +650,6 @@ dependencies = [
"serde",
]
[[package]]
name = "encode_unicode"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]]
name = "encoding_rs"
version = "0.8.33"
@ -769,7 +764,6 @@ checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
@ -820,17 +814,6 @@ version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
[[package]]
name = "futures-macro"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]]
name = "futures-sink"
version = "0.3.30"
@ -852,7 +835,6 @@ dependencies = [
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
@ -890,12 +872,6 @@ version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "glob"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "h2"
version = "0.3.24"
@ -1042,7 +1018,7 @@ dependencies = [
"httpdate",
"itoa",
"pin-project-lite",
"socket2 0.5.5",
"socket2",
"tokio",
"tower-service",
"tracing",
@ -1092,20 +1068,6 @@ dependencies = [
"hashbrown 0.14.3",
]
[[package]]
name = "indicatif"
version = "0.17.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25"
dependencies = [
"console",
"instant",
"number_prefix",
"portable-atomic",
"tokio",
"unicode-width",
]
[[package]]
name = "inherent"
version = "1.0.11"
@ -1117,15 +1079,6 @@ dependencies = [
"syn 2.0.48",
]
[[package]]
name = "instant"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
"cfg-if",
]
[[package]]
name = "ipnet"
version = "2.9.0"
@ -1268,15 +1221,6 @@ version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
name = "matchers"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
dependencies = [
"regex-automata 0.1.10",
]
[[package]]
name = "md-5"
version = "0.10.6"
@ -1293,25 +1237,6 @@ version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "migration"
version = "0.1.0"
dependencies = [
"basen",
"futures",
"indicatif",
"native-utils",
"redis",
"sea-orm",
"sea-orm-migration",
"serde",
"serde_json",
"serde_yaml",
"tokio",
"url",
"urlencoding",
]
[[package]]
name = "mime"
version = "0.3.17"
@ -1351,10 +1276,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fc1cb00cde484640da9f01a124edbb013576a6ae9843b23857c940936b76d91"
dependencies = [
"bitflags 2.4.2",
"chrono",
"ctor",
"napi-derive",
"napi-sys",
"once_cell",
"serde",
"serde_json",
"tokio",
]
@ -1402,34 +1330,6 @@ dependencies = [
"libloading",
]
[[package]]
name = "native-utils"
version = "0.0.0"
dependencies = [
"async-trait",
"basen",
"cfg-if",
"chrono",
"cuid2",
"idna",
"jsonschema",
"napi",
"napi-build",
"napi-derive",
"once_cell",
"parse-display",
"pretty_assertions",
"rand",
"schemars",
"sea-orm",
"serde",
"serde_json",
"serde_yaml",
"thiserror",
"tokio",
"url",
]
[[package]]
name = "nix"
version = "0.27.1"
@ -1561,12 +1461,6 @@ dependencies = [
"libc",
]
[[package]]
name = "number_prefix"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]]
name = "object"
version = "0.32.2"
@ -1582,12 +1476,6 @@ version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "openssl-probe"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "ordered-float"
version = "3.9.2"
@ -1730,12 +1618,6 @@ version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"
[[package]]
name = "portable-atomic"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
[[package]]
name = "powerfmt"
version = "0.2.0"
@ -1793,9 +1675,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.76"
version = "1.0.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
dependencies = [
"unicode-ident",
]
@ -1865,32 +1747,6 @@ dependencies = [
"getrandom",
]
[[package]]
name = "redis"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd"
dependencies = [
"async-trait",
"bytes",
"combine",
"futures-util",
"itoa",
"percent-encoding",
"pin-project-lite",
"rustls",
"rustls-native-certs",
"rustls-pemfile",
"rustls-webpki",
"ryu",
"sha1_smol",
"socket2 0.4.10",
"tokio",
"tokio-rustls",
"tokio-util",
"url",
]
[[package]]
name = "redox_syscall"
version = "0.4.1"
@ -1902,42 +1758,27 @@ dependencies = [
[[package]]
name = "regex"
version = "1.10.2"
version = "1.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.4.3",
"regex-automata",
"regex-syntax 0.8.2",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax 0.6.29",
]
[[package]]
name = "regex-automata"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.8.2",
]
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
version = "0.7.5"
@ -2098,24 +1939,11 @@ version = "0.21.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba"
dependencies = [
"log",
"ring",
"rustls-webpki",
"sct",
]
[[package]]
name = "rustls-native-certs"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
dependencies = [
"openssl-probe",
"rustls-pemfile",
"schannel",
"security-framework",
]
[[package]]
name = "rustls-pemfile"
version = "1.0.4"
@ -2141,15 +1969,6 @@ version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
[[package]]
name = "schannel"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534"
dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "schemars"
version = "0.8.16"
@ -2232,23 +2051,6 @@ dependencies = [
"uuid",
]
[[package]]
name = "sea-orm-cli"
version = "0.12.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "747f032e4abd58a6cacdb21275cc13448b4ff4b368f5f578ece465957ae7b417"
dependencies = [
"chrono",
"clap",
"dotenvy",
"glob",
"regex",
"sea-schema",
"tracing",
"tracing-subscriber",
"url",
]
[[package]]
name = "sea-orm-macros"
version = "0.12.11"
@ -2263,23 +2065,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "sea-orm-migration"
version = "0.12.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "412643baf225b37ae1313c0344c10bff6ec1fae72cdec1c7b591cc7c833134d2"
dependencies = [
"async-trait",
"clap",
"dotenvy",
"futures",
"sea-orm",
"sea-orm-cli",
"sea-schema",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "sea-query"
version = "0.30.7"
@ -2292,7 +2077,6 @@ dependencies = [
"inherent",
"ordered-float",
"rust_decimal",
"sea-query-derive",
"serde_json",
"time",
"uuid",
@ -2314,71 +2098,12 @@ dependencies = [
"uuid",
]
[[package]]
name = "sea-query-derive"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25a82fcb49253abcb45cdcb2adf92956060ec0928635eb21b4f7a6d8f25ab0bc"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 2.0.48",
"thiserror",
]
[[package]]
name = "sea-schema"
version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd9561232bd1b82ea748b581f15909d11de0db6563ddcf28c5d908aee8282f1"
dependencies = [
"futures",
"sea-query",
"sea-schema-derive",
]
[[package]]
name = "sea-schema-derive"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6f686050f76bffc4f635cda8aea6df5548666b830b52387e8bc7de11056d11e"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "seahash"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
[[package]]
name = "security-framework"
version = "2.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-foundation-sys",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "semver"
version = "1.0.21"
@ -2463,12 +2188,6 @@ dependencies = [
"digest",
]
[[package]]
name = "sha1_smol"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012"
[[package]]
name = "sha2"
version = "0.10.8"
@ -2490,15 +2209,6 @@ dependencies = [
"keccak",
]
[[package]]
name = "sharded-slab"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
dependencies = [
"lazy_static",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.1"
@ -2535,19 +2245,9 @@ dependencies = [
[[package]]
name = "smallvec"
version = "1.12.0"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e"
[[package]]
name = "socket2"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
dependencies = [
"libc",
"winapi",
]
checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
[[package]]
name = "socket2"
@ -2966,16 +2666,6 @@ dependencies = [
"syn 2.0.48",
]
[[package]]
name = "thread_local"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152"
dependencies = [
"cfg-if",
"once_cell",
]
[[package]]
name = "time"
version = "0.3.31"
@ -3034,7 +2724,7 @@ dependencies = [
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2 0.5.5",
"socket2",
"tokio-macros",
"windows-sys 0.48.0",
]
@ -3050,16 +2740,6 @@ dependencies = [
"syn 2.0.48",
]
[[package]]
name = "tokio-rustls"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
"rustls",
"tokio",
]
[[package]]
name = "tokio-stream"
version = "0.1.14"
@ -3140,21 +2820,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "tracing-subscriber"
version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b"
dependencies = [
"matchers",
"once_cell",
"regex",
"sharded-slab",
"thread_local",
"tracing",
"tracing-core",
]
[[package]]
name = "try-lock"
version = "0.2.5"
@ -3194,12 +2859,6 @@ version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
[[package]]
name = "unicode-width"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
[[package]]
name = "unicode_categories"
version = "0.1.1"
@ -3227,7 +2886,6 @@ dependencies = [
"form_urlencoded",
"idna",
"percent-encoding",
"serde",
]
[[package]]
@ -3244,9 +2902,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]]
name = "uuid"
version = "1.6.1"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560"
checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a"
dependencies = [
"serde",
]
@ -3366,28 +3024,6 @@ version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.52.0"

View file

@ -1,13 +1,10 @@
[package]
edition = "2021"
name = "native-utils"
name = "backend-rs"
version = "0.0.0"
[workspace]
members = ["migration"]
[features]
default = []
default = ["napi"]
napi = ["dep:napi-derive"]
[lib]
@ -33,7 +30,7 @@ tokio = { version = "1.35.1", features = ["full"] }
url = "2.5.0"
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.14.2", default-features = false, features = ["napi9", "tokio_rt"] }
napi = { version = "2.14.2", default-features = false, features = ["napi9", "tokio_rt", "chrono_date", "serde-json"] }
napi-derive = { version = "2.14.6", optional = true }
basen = "0.1.0"

View file

@ -0,0 +1,3 @@
# `backend-rs-android-arm-eabi`
This is the **armv7-linux-androideabi** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-android-arm-eabi",
"name": "backend-rs-android-arm-eabi",
"version": "0.0.0",
"os": [
"android"
@ -7,9 +7,9 @@
"cpu": [
"arm"
],
"main": "native-utils.android-arm-eabi.node",
"main": "backend-rs.android-arm-eabi.node",
"files": [
"native-utils.android-arm-eabi.node"
"backend-rs.android-arm-eabi.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-android-arm64`
This is the **aarch64-linux-android** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-android-arm64",
"name": "backend-rs-android-arm64",
"version": "0.0.0",
"os": [
"android"
@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "native-utils.android-arm64.node",
"main": "backend-rs.android-arm64.node",
"files": [
"native-utils.android-arm64.node"
"backend-rs.android-arm64.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-darwin-arm64`
This is the **aarch64-apple-darwin** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-darwin-arm64",
"name": "backend-rs-darwin-arm64",
"version": "0.0.0",
"os": [
"darwin"
@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "native-utils.darwin-arm64.node",
"main": "backend-rs.darwin-arm64.node",
"files": [
"native-utils.darwin-arm64.node"
"backend-rs.darwin-arm64.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-darwin-universal`
This is the **universal-apple-darwin** binary for `backend-rs`

View file

@ -0,0 +1,15 @@
{
"name": "backend-rs-darwin-universal",
"version": "0.0.0",
"os": [
"darwin"
],
"main": "backend-rs.darwin-universal.node",
"files": [
"backend-rs.darwin-universal.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -0,0 +1,3 @@
# `backend-rs-darwin-x64`
This is the **x86_64-apple-darwin** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-darwin-x64",
"name": "backend-rs-darwin-x64",
"version": "0.0.0",
"os": [
"darwin"
@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "native-utils.darwin-x64.node",
"main": "backend-rs.darwin-x64.node",
"files": [
"native-utils.darwin-x64.node"
"backend-rs.darwin-x64.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-freebsd-x64`
This is the **x86_64-unknown-freebsd** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-freebsd-x64",
"name": "backend-rs-freebsd-x64",
"version": "0.0.0",
"os": [
"freebsd"
@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "native-utils.freebsd-x64.node",
"main": "backend-rs.freebsd-x64.node",
"files": [
"native-utils.freebsd-x64.node"
"backend-rs.freebsd-x64.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-linux-arm-gnueabihf`
This is the **armv7-unknown-linux-gnueabihf** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-linux-arm-gnueabihf",
"name": "backend-rs-linux-arm-gnueabihf",
"version": "0.0.0",
"os": [
"linux"
@ -7,9 +7,9 @@
"cpu": [
"arm"
],
"main": "native-utils.linux-arm-gnueabihf.node",
"main": "backend-rs.linux-arm-gnueabihf.node",
"files": [
"native-utils.linux-arm-gnueabihf.node"
"backend-rs.linux-arm-gnueabihf.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-linux-arm64-gnu`
This is the **aarch64-unknown-linux-gnu** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-linux-arm64-gnu",
"name": "backend-rs-linux-arm64-gnu",
"version": "0.0.0",
"os": [
"linux"
@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "native-utils.linux-arm64-gnu.node",
"main": "backend-rs.linux-arm64-gnu.node",
"files": [
"native-utils.linux-arm64-gnu.node"
"backend-rs.linux-arm64-gnu.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-linux-arm64-musl`
This is the **aarch64-unknown-linux-musl** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-linux-arm64-musl",
"name": "backend-rs-linux-arm64-musl",
"version": "0.0.0",
"os": [
"linux"
@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "native-utils.linux-arm64-musl.node",
"main": "backend-rs.linux-arm64-musl.node",
"files": [
"native-utils.linux-arm64-musl.node"
"backend-rs.linux-arm64-musl.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-linux-x64-gnu`
This is the **x86_64-unknown-linux-gnu** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-linux-x64-gnu",
"name": "backend-rs-linux-x64-gnu",
"version": "0.0.0",
"os": [
"linux"
@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "native-utils.linux-x64-gnu.node",
"main": "backend-rs.linux-x64-gnu.node",
"files": [
"native-utils.linux-x64-gnu.node"
"backend-rs.linux-x64-gnu.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-linux-x64-musl`
This is the **x86_64-unknown-linux-musl** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-linux-x64-musl",
"name": "backend-rs-linux-x64-musl",
"version": "0.0.0",
"os": [
"linux"
@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "native-utils.linux-x64-musl.node",
"main": "backend-rs.linux-x64-musl.node",
"files": [
"native-utils.linux-x64-musl.node"
"backend-rs.linux-x64-musl.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-win32-arm64-msvc`
This is the **aarch64-pc-windows-msvc** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-win32-arm64-msvc",
"name": "backend-rs-win32-arm64-msvc",
"version": "0.0.0",
"os": [
"win32"
@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "native-utils.win32-arm64-msvc.node",
"main": "backend-rs.win32-arm64-msvc.node",
"files": [
"native-utils.win32-arm64-msvc.node"
"backend-rs.win32-arm64-msvc.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-win32-ia32-msvc`
This is the **i686-pc-windows-msvc** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-win32-ia32-msvc",
"name": "backend-rs-win32-ia32-msvc",
"version": "0.0.0",
"os": [
"win32"
@ -7,9 +7,9 @@
"cpu": [
"ia32"
],
"main": "native-utils.win32-ia32-msvc.node",
"main": "backend-rs.win32-ia32-msvc.node",
"files": [
"native-utils.win32-ia32-msvc.node"
"backend-rs.win32-ia32-msvc.node"
],
"license": "MIT",
"engines": {

View file

@ -0,0 +1,3 @@
# `backend-rs-win32-x64-msvc`
This is the **x86_64-pc-windows-msvc** binary for `backend-rs`

View file

@ -1,5 +1,5 @@
{
"name": "native-utils-win32-x64-msvc",
"name": "backend-rs-win32-x64-msvc",
"version": "0.0.0",
"os": [
"win32"
@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "native-utils.win32-x64-msvc.node",
"main": "backend-rs.win32-x64-msvc.node",
"files": [
"native-utils.win32-x64-msvc.node"
"backend-rs.win32-x64-msvc.node"
],
"license": "MIT",
"engines": {

View file

@ -1,10 +1,10 @@
{
"name": "native-utils",
"name": "backend-rs",
"version": "0.0.0",
"main": "built/index.js",
"types": "built/index.d.ts",
"napi": {
"name": "native-utils",
"name": "backend-rs",
"triples": {
"additional": [
"aarch64-apple-darwin",
@ -23,23 +23,16 @@
},
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "2.16.1",
"ava": "5.1.1"
"@napi-rs/cli": "2.18.0",
"ava": "6.0.1"
},
"ava": {
"timeout": "3m"
},
"engines": {
"node": ">= 10"
},
"scripts": {
"artifacts": "napi artifacts",
"build": "pnpm run build:napi && pnpm run build:migration",
"build:napi": "napi build --features napi --platform --release ./built/",
"build:migration": "pnpm run build:migration:cargo && pnpm run build:migration:copy",
"build:migration:cargo": "cargo build --locked --release --manifest-path ./migration/Cargo.toml",
"build:migration:copy": "cp -v ./target/release/migration ./built/migration",
"build:debug": "napi build --features napi --platform ./built/ && cargo build --locked --manifest-path ./migration/Cargo.toml && cp -v ./target/debug/migration ./built/migration",
"build": "napi build --features napi --platform --release ./built/",
"build:debug": "napi build --features napi --platform ./built/",
"prepublishOnly": "napi prepublish -t npm",
"universal": "napi universal",
"version": "napi version",

View file

@ -1,6 +1,6 @@
use sea_orm::error::DbErr;
use crate::impl_into_napi_error;
use crate::impl_napi_error_from;
#[derive(thiserror::Error, Debug, PartialEq, Eq)]
pub enum Error {
@ -10,4 +10,4 @@ pub enum Error {
OrmError(#[from] DbErr),
}
impl_into_napi_error!(Error);
impl_napi_error_from!(Error);

View file

@ -4,5 +4,5 @@ pub mod macros;
pub mod model;
pub mod util;
#[cfg(feature = "napi")]
// #[cfg(feature = "napi")]
pub mod mastodon_api;

View file

@ -0,0 +1,11 @@
#[macro_export]
macro_rules! impl_napi_error_from {
($a:ty) => {
#[cfg(feature = "napi")]
impl From<$a> for napi::Error {
fn from(reason: $a) -> napi::Error {
napi::Error::from_reason(reason.to_string())
}
}
};
}

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "abuse_user_report")]
#[napi_derive::napi(object, js_name = "AbuseUserReport")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "targetUserId")]
pub target_user_id: String,
#[sea_orm(column_name = "reporterId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "access_token")]
#[napi_derive::napi(object, js_name = "AccessToken")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
pub token: String,
pub hash: String,
#[sea_orm(column_name = "userId")]
@ -16,7 +17,7 @@ pub struct Model {
#[sea_orm(column_name = "appId")]
pub app_id: Option<String>,
#[sea_orm(column_name = "lastUsedAt")]
pub last_used_at: Option<DateTimeWithTimeZone>,
pub last_used_at: Option<DateTime>,
pub session: Option<String>,
pub name: Option<String>,
pub description: Option<String>,

View file

@ -4,13 +4,14 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "ad")]
#[napi_derive::napi(object, js_name = "Ad")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "expiresAt")]
pub expires_at: DateTimeWithTimeZone,
pub expires_at: DateTime,
pub place: String,
pub priority: String,
pub url: String,

View file

@ -4,17 +4,18 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "announcement")]
#[napi_derive::napi(object, js_name = "Announcement")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
pub text: String,
pub title: String,
#[sea_orm(column_name = "imageUrl")]
pub image_url: Option<String>,
#[sea_orm(column_name = "updatedAt")]
pub updated_at: Option<DateTimeWithTimeZone>,
pub updated_at: Option<DateTime>,
#[sea_orm(column_name = "showPopup")]
pub show_popup: bool,
#[sea_orm(column_name = "isGoodNews")]

View file

@ -4,6 +4,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "announcement_read")]
#[napi_derive::napi(object, js_name = "AnnouncementRead")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
@ -12,7 +13,7 @@ pub struct Model {
#[sea_orm(column_name = "announcementId")]
pub announcement_id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View file

@ -5,11 +5,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "antenna")]
#[napi_derive::napi(object, js_name = "Antenna")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
pub name: String,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "app")]
#[napi_derive::napi(object, js_name = "App")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: Option<String>,
pub secret: String,

View file

@ -4,6 +4,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "attestation_challenge")]
#[napi_derive::napi(object, js_name = "AttestationChallenge")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
@ -11,7 +12,7 @@ pub struct Model {
pub user_id: String,
pub challenge: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "registrationChallenge")]
pub registration_challenge: bool,
}

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "auth_session")]
#[napi_derive::napi(object, js_name = "AuthSession")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
pub token: String,
#[sea_orm(column_name = "userId")]
pub user_id: Option<String>,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "blocking")]
#[napi_derive::napi(object, js_name = "Blocking")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "blockeeId")]
pub blockee_id: String,
#[sea_orm(column_name = "blockerId")]

View file

@ -4,13 +4,14 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "channel")]
#[napi_derive::napi(object, js_name = "Channel")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "lastNotedAt")]
pub last_noted_at: Option<DateTimeWithTimeZone>,
pub last_noted_at: Option<DateTime>,
#[sea_orm(column_name = "userId")]
pub user_id: Option<String>,
pub name: String,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "channel_following")]
#[napi_derive::napi(object, js_name = "ChannelFollowing")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "followeeId")]
pub followee_id: String,
#[sea_orm(column_name = "followerId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "channel_note_pining")]
#[napi_derive::napi(object, js_name = "ChannelNotePining")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "channelId")]
pub channel_id: String,
#[sea_orm(column_name = "noteId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "clip")]
#[napi_derive::napi(object, js_name = "Clip")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
pub name: String,

View file

@ -4,6 +4,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "clip_note")]
#[napi_derive::napi(object, js_name = "ClipNote")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "drive_file")]
#[napi_derive::napi(object, js_name = "DriveFile")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: Option<String>,
#[sea_orm(column_name = "userHost")]
@ -48,10 +49,6 @@ pub struct Model {
pub request_headers: Option<Json>,
#[sea_orm(column_name = "requestIp")]
pub request_ip: Option<String>,
#[sea_orm(column_name = "maybeSensitive")]
pub maybe_sensitive: bool,
#[sea_orm(column_name = "maybePorn")]
pub maybe_porn: bool,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "drive_folder")]
#[napi_derive::napi(object, js_name = "DriveFolder")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
pub name: String,
#[sea_orm(column_name = "userId")]
pub user_id: Option<String>,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "emoji")]
#[napi_derive::napi(object, js_name = "Emoji")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "updatedAt")]
pub updated_at: Option<DateTimeWithTimeZone>,
pub updated_at: Option<DateTime>,
pub name: String,
pub host: Option<String>,
#[sea_orm(column_name = "originalUrl")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "follow_request")]
#[napi_derive::napi(object, js_name = "FollowRequest")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "followeeId")]
pub followee_id: String,
#[sea_orm(column_name = "followerId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "following")]
#[napi_derive::napi(object, js_name = "Following")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "followeeId")]
pub followee_id: String,
#[sea_orm(column_name = "followerId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "gallery_like")]
#[napi_derive::napi(object, js_name = "GalleryLike")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
#[sea_orm(column_name = "postId")]

View file

@ -4,13 +4,14 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "gallery_post")]
#[napi_derive::napi(object, js_name = "GalleryPost")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "updatedAt")]
pub updated_at: DateTimeWithTimeZone,
pub updated_at: DateTime,
pub title: String,
pub description: Option<String>,
#[sea_orm(column_name = "userId")]

View file

@ -4,6 +4,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "hashtag")]
#[napi_derive::napi(object, js_name = "Hashtag")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "instance")]
#[napi_derive::napi(object, js_name = "Instance")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "caughtAt")]
pub caught_at: DateTimeWithTimeZone,
pub caught_at: DateTime,
pub host: String,
#[sea_orm(column_name = "usersCount")]
pub users_count: i32,
@ -19,13 +20,13 @@ pub struct Model {
#[sea_orm(column_name = "followersCount")]
pub followers_count: i32,
#[sea_orm(column_name = "latestRequestSentAt")]
pub latest_request_sent_at: Option<DateTimeWithTimeZone>,
pub latest_request_sent_at: Option<DateTime>,
#[sea_orm(column_name = "latestStatus")]
pub latest_status: Option<i32>,
#[sea_orm(column_name = "latestRequestReceivedAt")]
pub latest_request_received_at: Option<DateTimeWithTimeZone>,
pub latest_request_received_at: Option<DateTime>,
#[sea_orm(column_name = "lastCommunicatedAt")]
pub last_communicated_at: DateTimeWithTimeZone,
pub last_communicated_at: DateTime,
#[sea_orm(column_name = "isNotResponding")]
pub is_not_responding: bool,
#[sea_orm(column_name = "softwareName")]
@ -41,7 +42,7 @@ pub struct Model {
#[sea_orm(column_name = "maintainerEmail")]
pub maintainer_email: Option<String>,
#[sea_orm(column_name = "infoUpdatedAt")]
pub info_updated_at: Option<DateTimeWithTimeZone>,
pub info_updated_at: Option<DateTime>,
#[sea_orm(column_name = "isSuspended")]
pub is_suspended: bool,
#[sea_orm(column_name = "iconUrl")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "messaging_message")]
#[napi_derive::napi(object, js_name = "MessagingMessage")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
#[sea_orm(column_name = "recipientId")]

View file

@ -1,11 +1,10 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.10
use super::sea_orm_active_enums::MetaSensitivemediadetectionEnum;
use super::sea_orm_active_enums::MetaSensitivemediadetectionsensitivityEnum;
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "meta")]
#[napi_derive::napi(object, js_name = "Meta")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
@ -137,16 +136,8 @@ pub struct Model {
pub default_light_theme: Option<String>,
#[sea_orm(column_name = "defaultDarkTheme")]
pub default_dark_theme: Option<String>,
#[sea_orm(column_name = "sensitiveMediaDetection")]
pub sensitive_media_detection: MetaSensitivemediadetectionEnum,
#[sea_orm(column_name = "sensitiveMediaDetectionSensitivity")]
pub sensitive_media_detection_sensitivity: MetaSensitivemediadetectionsensitivityEnum,
#[sea_orm(column_name = "setSensitiveFlagAutomatically")]
pub set_sensitive_flag_automatically: bool,
#[sea_orm(column_name = "enableIpLogging")]
pub enable_ip_logging: bool,
#[sea_orm(column_name = "enableSensitiveMediaDetectionForVideos")]
pub enable_sensitive_media_detection_for_videos: bool,
#[sea_orm(column_name = "enableActiveEmailValidation")]
pub enable_active_email_validation: bool,
#[sea_orm(column_name = "customMOTD")]

View file

@ -4,6 +4,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "migrations")]
#[napi_derive::napi(object, js_name = "Migrations")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "moderation_log")]
#[napi_derive::napi(object, js_name = "ModerationLog")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
pub r#type: String,

View file

@ -5,6 +5,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "muted_note")]
#[napi_derive::napi(object, js_name = "MutedNote")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -4,17 +4,18 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "muting")]
#[napi_derive::napi(object, js_name = "Muting")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "muteeId")]
pub mutee_id: String,
#[sea_orm(column_name = "muterId")]
pub muter_id: String,
#[sea_orm(column_name = "expiresAt")]
pub expires_at: Option<DateTimeWithTimeZone>,
pub expires_at: Option<DateTime>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View file

@ -5,11 +5,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "note")]
#[napi_derive::napi(object, js_name = "Note")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "replyId")]
pub reply_id: Option<String>,
#[sea_orm(column_name = "renoteId")]
@ -60,7 +61,7 @@ pub struct Model {
#[sea_orm(column_name = "threadId")]
pub thread_id: Option<String>,
#[sea_orm(column_name = "updatedAt")]
pub updated_at: Option<DateTimeWithTimeZone>,
pub updated_at: Option<DateTime>,
pub lang: Option<String>,
}

View file

@ -4,6 +4,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "note_edit")]
#[napi_derive::napi(object, js_name = "NoteEdit")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
@ -15,7 +16,7 @@ pub struct Model {
#[sea_orm(column_name = "fileIds")]
pub file_ids: Vec<String>,
#[sea_orm(column_name = "updatedAt")]
pub updated_at: DateTimeWithTimeZone,
pub updated_at: DateTime,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "note_favorite")]
#[napi_derive::napi(object, js_name = "NoteFavorite")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
#[sea_orm(column_name = "noteId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "note_reaction")]
#[napi_derive::napi(object, js_name = "NoteReaction")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
#[sea_orm(column_name = "noteId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "note_thread_muting")]
#[napi_derive::napi(object, js_name = "NoteThreadMuting")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
#[sea_orm(column_name = "threadId")]

View file

@ -4,6 +4,7 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "note_unread")]
#[napi_derive::napi(object, js_name = "NoteUnread")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "note_watching")]
#[napi_derive::napi(object, js_name = "NoteWatching")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
#[sea_orm(column_name = "noteId")]

View file

@ -5,11 +5,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "notification")]
#[napi_derive::napi(object, js_name = "Notification")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "notifieeId")]
pub notifiee_id: String,
#[sea_orm(column_name = "notifierId")]

View file

@ -5,13 +5,14 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "page")]
#[napi_derive::napi(object, js_name = "Page")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "updatedAt")]
pub updated_at: DateTimeWithTimeZone,
pub updated_at: DateTime,
pub title: String,
pub name: String,
pub summary: Option<String>,

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "page_like")]
#[napi_derive::napi(object, js_name = "PageLike")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
#[sea_orm(column_name = "userId")]
pub user_id: String,
#[sea_orm(column_name = "pageId")]

View file

@ -4,11 +4,12 @@ use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "password_reset_request")]
#[napi_derive::napi(object, js_name = "PasswordResetRequest")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
pub created_at: DateTime,
pub token: String,
#[sea_orm(column_name = "userId")]
pub user_id: String,

Some files were not shown because too many files have changed in this diff Show more