chore: tweak user/server default configs

This commit is contained in:
naskya 2024-03-01 09:13:00 +09:00
parent 511e6c8317
commit d2ed7fcb70
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
6 changed files with 45 additions and 4 deletions

View file

@ -13,6 +13,11 @@ Critical security updates are indicated by the :warning: icon.
- Disable vibrations
- Don't show gaps between posts in timelines
- Show the instance ticker on local posts
- Change default user settings (existing users are not affected)
- Reject crawler indexing
- Set reaction history to public
- Change default server settings (existing servers are not affected)
- Disable new user registration
## v20240229

View file

@ -1,6 +1,7 @@
BEGIN;
DELETE FROM "migrations" WHERE name IN (
'ChangeDefaultConfigs1709251460718',
'AddReplyMuting1704851359889',
'FixNoteUrlIndex1709129810501',
'RemoveCharts1709047957489',
@ -11,6 +12,11 @@ DELETE FROM "migrations" WHERE name IN (
'RemoveNativeUtilsMigration1705877093218'
);
-- change-default-configs
ALTER TABLE "user_profile" ALTER COLUMN "noCrawle" SET DEFAULT false;
ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT false;
ALTER TABLE "meta" ALTER COLUMN "disableRegistration" SET DEFAULT false;
-- reply-muting
DROP TABLE "reply_muting";

View file

@ -0,0 +1,27 @@
export class ChangeDefaultConfigs1709251460718 {
name = "ChangeDefaultConfigs1709251460718";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ALTER COLUMN "disableRegistration" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "user_profile" ALTER COLUMN "noCrawle" SET DEFAULT true`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ALTER COLUMN "noCrawle" SET DEFAULT false`,
);
await queryRunner.query(
`ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT false`,
);
await queryRunner.query(
`ALTER TABLE "meta" ALTER COLUMN "disableRegistration" SET DEFAULT false`,
);
}
}

View file

@ -42,7 +42,7 @@ export class Meta {
public maintainerEmail: string | null;
@Column("boolean", {
default: false,
default: true,
})
public disableRegistration: boolean;

View file

@ -85,7 +85,7 @@ export class UserProfile {
public emailNotificationTypes: string[];
@Column("boolean", {
default: false,
default: true,
})
public publicReactions: boolean;
@ -156,7 +156,7 @@ export class UserProfile {
public autoAcceptFollowed: boolean;
@Column("boolean", {
default: false,
default: true,
comment: "Whether reject index by crawler.",
})
public noCrawle: boolean;

View file

@ -226,7 +226,10 @@ function getSettings(): Profile["settings"] {
hot,
cold,
fontSize: localStorage.getItem("fontSize"),
useSystemFont: localStorage.getItem("useSystemFont") as "t" | "f" | null,
useSystemFont: localStorage.getItem("useSystemFont") as
| "t"
| "f"
| null,
wallpaper: localStorage.getItem("wallpaper"),
};
}