diff --git a/docs/changelog.md b/docs/changelog.md index 1ce975ee63..31b68c37c6 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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 diff --git a/docs/downgrade.sql b/docs/downgrade.sql index 245844c074..8a7769dcb9 100644 --- a/docs/downgrade.sql +++ b/docs/downgrade.sql @@ -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"; diff --git a/packages/backend/migration/1709251460718-change-default-configs.js b/packages/backend/migration/1709251460718-change-default-configs.js new file mode 100644 index 0000000000..8c50e482be --- /dev/null +++ b/packages/backend/migration/1709251460718-change-default-configs.js @@ -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`, + ); + } +} diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 1c3985efc1..a14967185f 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -42,7 +42,7 @@ export class Meta { public maintainerEmail: string | null; @Column("boolean", { - default: false, + default: true, }) public disableRegistration: boolean; diff --git a/packages/backend/src/models/entities/user-profile.ts b/packages/backend/src/models/entities/user-profile.ts index 7774ca5086..56887035ce 100644 --- a/packages/backend/src/models/entities/user-profile.ts +++ b/packages/backend/src/models/entities/user-profile.ts @@ -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; diff --git a/packages/client/src/pages/settings/preferences-backups.vue b/packages/client/src/pages/settings/preferences-backups.vue index 48961649c8..9e8efa478c 100644 --- a/packages/client/src/pages/settings/preferences-backups.vue +++ b/packages/client/src/pages/settings/preferences-backups.vue @@ -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"), }; }