From a9220e4e0159e7361432bd6576f1d82c827de784 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 7 Aug 2023 23:48:58 -0600 Subject: [PATCH 1/9] Add Account Migrations --- app/Models/ProfileAlias.php | 17 ++++++++++ ...07_021252_create_profile_aliases_table.php | 32 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 app/Models/ProfileAlias.php create mode 100644 database/migrations/2023_08_07_021252_create_profile_aliases_table.php diff --git a/app/Models/ProfileAlias.php b/app/Models/ProfileAlias.php new file mode 100644 index 000000000..b7a3bdc9c --- /dev/null +++ b/app/Models/ProfileAlias.php @@ -0,0 +1,17 @@ +belongsTo(Profile::class); + } +} diff --git a/database/migrations/2023_08_07_021252_create_profile_aliases_table.php b/database/migrations/2023_08_07_021252_create_profile_aliases_table.php new file mode 100644 index 000000000..ed9ab6ada --- /dev/null +++ b/database/migrations/2023_08_07_021252_create_profile_aliases_table.php @@ -0,0 +1,32 @@ +id(); + $table->unsignedBigInteger('profile_id')->nullable()->index(); + $table->string('acct')->nullable(); + $table->string('uri')->nullable(); + $table->foreign('profile_id')->references('id')->on('profiles'); + $table->unique(['profile_id', 'acct'], 'profile_id_acct_unique'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('profile_aliases'); + } +}; From 3c60362648086f7b07cc3a33b1e90164fe29df02 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 7 Aug 2023 23:56:01 -0600 Subject: [PATCH 2/9] Add moved_to_profile_id migration --- ..._moved_to_profile_id_to_profiles_table.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2023_08_08_045430_add_moved_to_profile_id_to_profiles_table.php diff --git a/database/migrations/2023_08_08_045430_add_moved_to_profile_id_to_profiles_table.php b/database/migrations/2023_08_08_045430_add_moved_to_profile_id_to_profiles_table.php new file mode 100644 index 000000000..a13bb1705 --- /dev/null +++ b/database/migrations/2023_08_08_045430_add_moved_to_profile_id_to_profiles_table.php @@ -0,0 +1,28 @@ +unsignedBigInteger('moved_to_profile_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('profiles', function (Blueprint $table) { + $table->dropColumn('moved_to_profile_id'); + }); + } +}; From 3103af2fe494a2cd562aecff866e761d02e33dc4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 7 Aug 2023 23:58:02 -0600 Subject: [PATCH 3/9] Add Account Migration setting views --- .../views/settings/aliases/index.blade.php | 121 ++++++++++++++++++ resources/views/settings/home.blade.php | 8 ++ 2 files changed, 129 insertions(+) create mode 100644 resources/views/settings/aliases/index.blade.php diff --git a/resources/views/settings/aliases/index.blade.php b/resources/views/settings/aliases/index.blade.php new file mode 100644 index 000000000..af79f654d --- /dev/null +++ b/resources/views/settings/aliases/index.blade.php @@ -0,0 +1,121 @@ +@extends('layouts.app') + +@section('content') +@if (session('status')) +
+ {{ session('status') }} +
+@endif +@if ($errors->any()) +
+ @foreach($errors->all() as $error) +

{{ $error }}

+ @endforeach +
+@endif +@if (session('error')) +
+ {{ session('error') }} +
+@endif + +
+
+
+
+
+
+
+
+

Manage Aliases

+ + + + Back to Settings + +
+ +
+ +
+
+

If you want to move from another account to this one, you can create an alias here first.

+

This alias is needed before you can move your followers from the old account to this one. Don't worry, making this change is safe and can be undone. The process of moving the account starts from the old one.

+ +

Your followers will be migrated to your new account, and in some instances your posts too! For more information on Aliases and Account Migration, visit the Help Center.

+
+ +
+
+
+

Old Account

+

oldUsername@example.org

+
+ +
+

Old Account

+

oldUsername2@example.net

+
+ +
+

We support migration to and from Pixelfed, Mastodon and most other platforms that use the Mastodon Account Migration extension.

+
+ +
+
+
+
+ +
+
+
+
+
+ @csrf + +
+ +

Enter the username@domain of your old account

+ +
+ + +
+
+ +
+

Aliases

+
+ @if(count($aliases)) + @foreach($aliases as $alias) +
+
+ {{ $alias->acct }} +
+ +
+
+ @csrf + + + +
+
+
+ @endforeach + @else +
+

No aliases found!

+
+ @endif +
+
+
+
+
+
+
+ +@endsection diff --git a/resources/views/settings/home.blade.php b/resources/views/settings/home.blade.php index 2c02cdde9..97cffd5ec 100644 --- a/resources/views/settings/home.blade.php +++ b/resources/views/settings/home.blade.php @@ -87,6 +87,14 @@

Select up to 4 pronouns that will appear on your profile.

+ +
+ +
+ Manage account alias +

To move from another account to this one, first you need to create an alias.

+
+
@if(config_cache('pixelfed.enforce_account_limit'))

Storage Usage

From eab16e7fd8a3a6c2274c418adb4d863b09a87d06 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 7 Aug 2023 23:58:21 -0600 Subject: [PATCH 4/9] Add Help Center Documentation for Account Migration --- .../views/site/help/your-profile.blade.php | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/resources/views/site/help/your-profile.blade.php b/resources/views/site/help/your-profile.blade.php index 76f1e7ebd..22a105d33 100644 --- a/resources/views/site/help/your-profile.blade.php +++ b/resources/views/site/help/your-profile.blade.php @@ -141,6 +141,45 @@


+

Migration

+

+ +

+
+ To migrate your account successfully, your old account must be on a Pixelfed or Mastodon server, or one that supports the Mastodon Account Migration extension. +
+

Navigate to the Account Aliases page in the Settings to begin.

+
+
+

+

+ +

+
+ It can take a few hours to process post migration imports, please contact admins if it takes longer than 24 hours. +
+
+

+

+ +

+
+ Post migrations are officially supported on Pixelfed servers running v0.11.9+ and higher, and when enabled by server admins. +
+ It can take a few hours to process post migration imports, please contact admins if it takes longer than 24 hours. +
+
+

+

Delete Your Account