Merge branch 'develop' into iceshrimp_mastodon
This commit is contained in:
commit
1778952af8
8 changed files with 76 additions and 35 deletions
|
@ -7,6 +7,7 @@ Critical security updates are indicated by the :warning: icon.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Fix bugs
|
||||||
- Mastodon API implementation was ported from Iceshrimp, with added Firefish extensions including push notifications, post languages, schedule post support, and more. (#10880)
|
- Mastodon API implementation was ported from Iceshrimp, with added Firefish extensions including push notifications, post languages, schedule post support, and more. (#10880)
|
||||||
|
|
||||||
### Acknowledgement
|
### Acknowledgement
|
||||||
|
|
|
@ -374,7 +374,7 @@ cd ~/firefish
|
||||||
|
|
||||||
## Rotate logs
|
## Rotate logs
|
||||||
|
|
||||||
If the server runs long, the size of log files increases, filling up disk space. To prevent this, you should set up a log rotation (removing old logs automatically).
|
As the server runs longer and longer, the size of the log files increases, filling up the disk space. To prevent this, you should set up a log rotation (removing old logs automatically).
|
||||||
|
|
||||||
You can edit the `SystemMaxUse` value in the `[journal]` section of `/etc/systemd/journald.conf` to do it:
|
You can edit the `SystemMaxUse` value in the `[journal]` section of `/etc/systemd/journald.conf` to do it:
|
||||||
|
|
||||||
|
@ -402,13 +402,13 @@ pgroonga.log_level = error
|
||||||
You can check the `postgresql.conf` location by this command:
|
You can check the `postgresql.conf` location by this command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
psql --user postgres --command 'SHOW config_file'
|
sudo --user=postgres psql --command='SHOW config_file'
|
||||||
```
|
```
|
||||||
|
|
||||||
The PGroonga log file (`pgroonga.log`) is located under this directory:
|
The PGroonga log file (`pgroonga.log`) is located under this directory:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
psql --user postgres --command 'SHOW data_directory'
|
sudo --user=postgres psql --command='SHOW data_directory'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tune database configuration
|
## Tune database configuration
|
||||||
|
@ -431,9 +431,17 @@ Since this is not a dedicated database server, be sure to leave some memory spac
|
||||||
|
|
||||||
Once you have entered the appropriate values for your environment, click the "Generate" button to generate a configuration and replace the values in `postgresql.conf` with the suggested values.
|
Once you have entered the appropriate values for your environment, click the "Generate" button to generate a configuration and replace the values in `postgresql.conf` with the suggested values.
|
||||||
|
|
||||||
|
After that, you need to restart the PostgreSQL service.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo systemctl stop firefish
|
||||||
|
sudo systemctl restart postgresql
|
||||||
|
sudo systemctl start firefish
|
||||||
|
```
|
||||||
|
|
||||||
## VACUUM your database
|
## VACUUM your database
|
||||||
|
|
||||||
If the database runs long, "garbage" can degrade its performance or cause problems. To prevent this, you should execute the following commands regularly.
|
If the database runs long, accumulated "garbage" can degrade its performance or cause problems. To prevent this, you should `VACUUM` your database regularly.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl stop firefish
|
sudo systemctl stop firefish
|
||||||
|
|
|
@ -8,7 +8,9 @@ Please take a look at #10947.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
This is not related to the recent changes, but we have added a new section called "[Maintain the server](https://firefish.dev/firefish/firefish/-/blob/develop/docs/install.md#maintain-the-server)" in the installation guide. We suggest that you take a look at it.
|
### For all users
|
||||||
|
|
||||||
|
This is not related to the recent changes, but we have added a new section called "[Maintain the server](https://firefish.dev/firefish/firefish/-/blob/develop/docs/install.md#maintain-the-server)" in the installation guide. We suggest that you take a look at it. (and we welcome your docs contributions!)
|
||||||
|
|
||||||
### For systemd/pm2 users
|
### For systemd/pm2 users
|
||||||
|
|
||||||
|
|
|
@ -2137,3 +2137,15 @@ replies: Ответы
|
||||||
quotes: Цитаты
|
quotes: Цитаты
|
||||||
clickToShowPatterns: Нажмите, чтобы показать модуль шаблонов
|
clickToShowPatterns: Нажмите, чтобы показать модуль шаблонов
|
||||||
renotes: Репосты
|
renotes: Репосты
|
||||||
|
markLocalFilesNsfwByDefaultDescription: Независимо от данной настройки, пользователи
|
||||||
|
могут самостоятельно удалять метку NSFW. Не применяется на существующие файлы.
|
||||||
|
toEdit: Редактировать
|
||||||
|
attachedToNotes: Посты с этим файлом
|
||||||
|
showAttachedNotes: Показывать посты с этим файлом
|
||||||
|
strongPassword: Хороший пароль
|
||||||
|
toReply: Ответить
|
||||||
|
toPost: Выложить
|
||||||
|
sentFollowRequests: Отправленные запросы на подписку
|
||||||
|
toQuote: Цитировать
|
||||||
|
cannotEditVisibility: Вы не можете изменить видимость
|
||||||
|
noSentFollowRequests: Вы не отправляли никаких запросов на подписку
|
||||||
|
|
|
@ -53,7 +53,11 @@ function processMastoFile(fn: string, path: string, dir: string, uid: string) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (const attachment of note.object.attachment) {
|
for (const attachment of note.object.attachment) {
|
||||||
const url = attachment.url.replaceAll("..", "");
|
// The url in some Mastodon import files do not start with /media_attachments/.
|
||||||
|
// If this is not handled properly, these users not be able to import images in their posts.
|
||||||
|
const url = attachment.url
|
||||||
|
.replaceAll("..", "")
|
||||||
|
.replaceAll(/.*\/media_attachments\//g, "/media_attachments/");
|
||||||
if (url.indexOf("\0") !== -1) {
|
if (url.indexOf("\0") !== -1) {
|
||||||
logger.error(`Found Poison Null Bytes Attack: ${url}`);
|
logger.error(`Found Poison Null Bytes Attack: ${url}`);
|
||||||
reject();
|
reject();
|
||||||
|
|
|
@ -59,18 +59,27 @@ export async function importCkPost(
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME: What is this condition?
|
// If an import is completely successful at once, the order should not be out of order.
|
||||||
if (note != null && (note.fileIds?.length || 0) < files.length) {
|
// If it takes multiple imports to complete, the order is not guaranteed to be consistent.
|
||||||
|
if (note != null && files.length > 0) {
|
||||||
|
const addFiles: DriveFile[] = [];
|
||||||
|
for (const file of files) {
|
||||||
|
if (!note.fileIds.includes(file.id)) {
|
||||||
|
addFiles.push(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const update: Partial<Note> = {};
|
const update: Partial<Note> = {};
|
||||||
update.fileIds = files.map((x) => x.id);
|
update.fileIds = addFiles.map((x) => x.id);
|
||||||
|
|
||||||
if (update.fileIds != null) {
|
if (update.fileIds != null) {
|
||||||
await NoteFiles.delete({ noteId: note.id });
|
|
||||||
await NoteFiles.insert(
|
await NoteFiles.insert(
|
||||||
update.fileIds.map((fileId) => ({ noteId: note?.id, fileId })),
|
update.fileIds.map((fileId) => ({ noteId: note?.id, fileId })),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update.fileIds = note.fileIds.concat(update.fileIds);
|
||||||
|
|
||||||
await Notes.update(note.id, update);
|
await Notes.update(note.id, update);
|
||||||
await NoteEdits.insert({
|
await NoteEdits.insert({
|
||||||
id: genId(),
|
id: genId(),
|
||||||
|
|
|
@ -85,18 +85,27 @@ export async function importMastoPost(
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME: What is this condition?
|
// If an import is completely successful at once, the order should not be out of order.
|
||||||
if (note != null && (note.fileIds?.length || 0) < files.length) {
|
// If it takes multiple imports to complete, the order is not guaranteed to be consistent.
|
||||||
|
if (note != null && files.length > 0) {
|
||||||
|
const addFiles: DriveFile[] = [];
|
||||||
|
for (const file of files) {
|
||||||
|
if (!note.fileIds.includes(file.id)) {
|
||||||
|
addFiles.push(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const update: Partial<Note> = {};
|
const update: Partial<Note> = {};
|
||||||
update.fileIds = files.map((x) => x.id);
|
update.fileIds = addFiles.map((x) => x.id);
|
||||||
|
|
||||||
if (update.fileIds != null) {
|
if (update.fileIds != null) {
|
||||||
await NoteFiles.delete({ noteId: note.id });
|
|
||||||
await NoteFiles.insert(
|
await NoteFiles.insert(
|
||||||
update.fileIds.map((fileId) => ({ noteId: note?.id, fileId })),
|
update.fileIds.map((fileId) => ({ noteId: note?.id, fileId })),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update.fileIds = note.fileIds.concat(update.fileIds);
|
||||||
|
|
||||||
await Notes.update(note.id, update);
|
await Notes.update(note.id, update);
|
||||||
await NoteEdits.insert({
|
await NoteEdits.insert({
|
||||||
id: genId(),
|
id: genId(),
|
||||||
|
|
|
@ -69,6 +69,8 @@ function checkForSplash() {
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await initializeInstanceCache();
|
await initializeInstanceCache();
|
||||||
|
const instance = getInstanceInfo();
|
||||||
|
|
||||||
console.info(`Firefish v${version}`);
|
console.info(`Firefish v${version}`);
|
||||||
|
|
||||||
if (_DEV_) {
|
if (_DEV_) {
|
||||||
|
@ -178,7 +180,7 @@ function checkForSplash() {
|
||||||
}
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
localStorage.setItem("v", getInstanceInfo().version);
|
localStorage.setItem("v", instance.version);
|
||||||
|
|
||||||
// Init service worker
|
// Init service worker
|
||||||
initializeSw();
|
initializeSw();
|
||||||
|
@ -240,26 +242,20 @@ function checkForSplash() {
|
||||||
// テーマリビルドするため
|
// テーマリビルドするため
|
||||||
localStorage.removeItem("theme");
|
localStorage.removeItem("theme");
|
||||||
|
|
||||||
try {
|
if (
|
||||||
// 変なバージョン文字列来るとcompareVersionsでエラーになるため
|
lastVersion != null &&
|
||||||
// If a strange version string comes, an error will occur in compareVersions.
|
lastVersion < version &&
|
||||||
if (
|
defaultStore.state.showUpdates
|
||||||
lastVersion != null &&
|
) {
|
||||||
lastVersion < version &&
|
// ログインしてる場合だけ
|
||||||
defaultStore.state.showUpdates
|
if (me) {
|
||||||
) {
|
popup(
|
||||||
// ログインしてる場合だけ
|
defineAsyncComponent(() => import("@/components/MkUpdated.vue")),
|
||||||
if (me) {
|
{},
|
||||||
popup(
|
{},
|
||||||
defineAsyncComponent(() => import("@/components/MkUpdated.vue")),
|
"closed",
|
||||||
{},
|
);
|
||||||
{},
|
|
||||||
"closed",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +334,7 @@ function checkForSplash() {
|
||||||
};
|
};
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
const { defaultLightTheme, defaultDarkTheme } = getInstanceInfo();
|
const { defaultLightTheme, defaultDarkTheme } = instance;
|
||||||
|
|
||||||
if (defaultStore.state.themeInitial) {
|
if (defaultStore.state.themeInitial) {
|
||||||
if (defaultLightTheme != null)
|
if (defaultLightTheme != null)
|
||||||
|
|
Loading…
Reference in a new issue