-
Notifications
You must be signed in to change notification settings - Fork 83
Move: support same-server domain migrations #1530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ecd491f to
b789d94
Compare
|
Sorry I overwrote your changes @obenland - but I changed the approach radically enough that that function doesn't exist anymore :) |
|
Some remaining tasks:
|
Could you share more on that? I would have expected no changes since followers will send new Follow requests to the new account. |
When we send the |
|
Ah, in the context of Move activities, only. I thought in general. Thank you! |
|
Also note that some concerns we're raising here probably also apply to I think we need to serve |
Updates blog user option to retain naming convention.
|
Tested this on WoA a bit, with little success. Primary domain changes happen there through direct SQL updates, bypassing the Maybe we should keep track of the current domain ourselves and use that to populate our |
|
I think I made a fair bit of progress today:
@pfefferle I'd love for you to test this on a WoA sites or something more real world than localhost and see what you find! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (14)
- .github/changelog/add-same-server-domain-move: Language not supported
- activitypub.php: Language not supported
- includes/class-activitypub.php: Language not supported
- includes/class-dispatcher.php: Language not supported
- includes/class-move.php: Language not supported
- includes/class-query.php: Language not supported
- includes/class-signature.php: Language not supported
- includes/collection/class-actors.php: Language not supported
- includes/functions.php: Language not supported
- includes/model/class-blog.php: Language not supported
- includes/model/class-user.php: Language not supported
- tests/includes/class-test-move.php: Language not supported
- tests/includes/model/class-test-blog.php: Language not supported
- tests/includes/model/class-test-user.php: Language not supported
| * | ||
| * @param bool $domain_moves_enabled Whether domain moves are enabled. | ||
| */ | ||
| $domain_moves_enabled = apply_filters( 'activitypub_enable_primary_domain_moves', false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@obenland I know that you are not a fan of constants, but this would be the third possibility to enable a feature, aside from advanced settings and constants.
I think we should have a certain level of consistency. I am not arguing for a constant her, maybe we should think about a Developer Preview or Beta Features section in the Advanced settings to enable beta features!?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be happy to deprecate feature constants in favor of filters or advanced settings
Even if `get_collection` is returning the correct result, it is very specific to the API endpoint and might change over time, so we should not rely on it here.
|
I think we should merge this PR! It is behind a feature flag, so it is not breaking something and with the functionality in the core plugin, it would allow us to more easily test it on WordPress.com or self hosted installations. It is a solid state we can improve on. |
* first pass from AI generation. Needs work * reign in the chaos * move logic into models * Move constructor to below properties * Update function name * Don't show `movedTo` on the same ID * DRY old domain handling * Add options to delete list on uninstall Updates blog user option to retain naming convention. * Register user option * Move actor saving inline * changelog * Remove all followers on `Move` to allow the new Actor to be re-followed * lint lol * Fix indent after merge * Combine conditional on host * Fix unit test * First pass at testing change_domain * Revert "lint lol" This reverts commit c50a441. * Revert "Remove all followers on `Move` to allow the new Actor to be re-followed" This reverts commit 1d8948f. * Encapsulate domain check * Remove unused defaults * Hook in with feature flag * Add filters and handle username in callback * Remove unused import * Add unit tests for old actors * Update reason for pre_update_option hook. * Instantiate old actors through filters * Remove unused import * use query instead of Http client * store check * simplify code * call action before sending an Activity to inboxes * check class attribute before generation an id * make old domain request setable * Account for old domain in two more places * Fix json creation on update_option_home * Fix tests * fix phpcs * use \WP_Error * Domain -> Host * global namespace * replace `get_collection` with `get_all` Even if `get_collection` is returning the correct result, it is very specific to the API endpoint and might change over time, so we should not rely on it here. --------- Co-authored-by: Konstantin Obenland <obenland@gmx.de> Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
* tag '5.7.0': (29 commits) Release 5.7.0 (Automattic#1574) Fix: Show error if site uses "Almost Pretty Permalink" structure (Automattic#1570) Admin: Add padding to extra fields nav links (Automattic#1569) Signature: Add compat for more key encodings (Automattic#1557) Reply block: Improve fallback embed (Automattic#1560) Add label for "Health Check" and "REST API" (Automattic#1571) change changelog items (Automattic#1572) Transformers: Allow setting properties to false. (Automattic#1567) Upgrades: Delete orphaned extra fields (Automattic#1566) Fix: Missing Actor in Outbox-Activities (Automattic#1564) Outbox: Properly handle username requests (Automattic#1559) Import: Load on admin_init (Automattic#1561) Move: support same-server domain migrations (Automattic#1530) Follow Me: add a button-only mode (Automattic#1133) Tests: Convert timestamp to int for comparison (Automattic#1556) Reply: Make Mastodon embeds work (Automattic#1555) Add: `Vary` header settings (Automattic#1552) Actors: Don't convert non-numeric strings to Blog user id (Automattic#1554) Add: Shared Inbox setting (Automattic#1553) Add: New Health checks (Automattic#1524) ...
Very much a WIP, utterly untested, but the general shape of things is there. There's no listener on the
homeoption yet, just working to have aMove::change_domainmethod that would ultimately connect to it, and the beginnings of serving the$fromActor distinctly from the$toActor.Fixes #1513
Proposed changes:
Other information:
Testing instructions:
targetproperty (new domain).Changelog entry
Changelog Entry Details
Significance
Type
Message
Support same-server domain migrations