Skip to content

feat: add localHost option to allow changing of federation host#17222

Open
kenshineto wants to merge 1 commit intomisskey-dev:developfrom
kenshineto:develop
Open

feat: add localHost option to allow changing of federation host#17222
kenshineto wants to merge 1 commit intomisskey-dev:developfrom
kenshineto:develop

Conversation

@kenshineto
Copy link
Copy Markdown

What

Add a userHost option in config that allows instances to use a seperate host for their user ids instead of using the host from the instance url.

For #17212

Why

This mirrors a feature that mastodon has with its LOCAL_URL and WEB_URL options. It allows instances to host their instances on any url without having to compromise their user ids. For example I am running this change on my instance social.freya.cat with all user ids @freya.cat.

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 6, 2026
@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR labels Mar 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

このPRによるapi.jsonの差分
差分はありません。
Get diff files from Workflow Page

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

Backend memory usage comparison

Before GC

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 329.23 MB 310.55 MB -18.67 MB -5.67%
VmHWM 329.23 MB 311.15 MB -18.07 MB -5.49%
VmSize 23123.45 MB 23104.70 MB -18.75 MB -0.08%
VmData 1392.72 MB 1375.50 MB -17.22 MB -1.23%

After GC

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 329.24 MB 310.56 MB -18.68 MB -5.67%
VmHWM 329.24 MB 311.16 MB -18.08 MB -5.49%
VmSize 23123.45 MB 23104.70 MB -18.75 MB -0.08%
VmData 1392.72 MB 1375.50 MB -17.22 MB -1.23%

After Request

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 329.69 MB 310.99 MB -18.69 MB -5.67%
VmHWM 329.69 MB 311.37 MB -18.31 MB -5.55%
VmSize 23123.53 MB 23104.86 MB -18.66 MB -0.08%
VmData 1392.81 MB 1375.59 MB -17.21 MB -1.23%

See workflow logs for details

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 32.60870% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.56%. Comparing base (78435dc) to head (e0f6535).
⚠️ Report is 222 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/accounts.ts 0.00% 9 Missing ⚠️
packages/frontend/src/preferences/manager.ts 0.00% 0 Missing and 6 partials ⚠️
packages/frontend/src/components/MkPostForm.vue 0.00% 1 Missing and 2 partials ⚠️
...kages/backend/src/server/WellKnownServerService.ts 0.00% 2 Missing ⚠️
packages/frontend/src/utility/get-note-menu.ts 0.00% 2 Missing ⚠️
packages/frontend/src/utility/get-user-menu.ts 0.00% 0 Missing and 2 partials ⚠️
...kages/backend/src/core/RemoteUserResolveService.ts 0.00% 1 Missing ⚠️
packages/backend/src/core/UtilityService.ts 66.66% 1 Missing ⚠️
packages/backend/src/server/ServerService.ts 0.00% 1 Missing ⚠️
packages/backend/src/server/web/FeedService.ts 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #17222       +/-   ##
============================================
+ Coverage    13.97%   63.56%   +49.59%     
============================================
  Files          237     1161      +924     
  Lines        11273   116254   +104981     
  Branches      3728     8365     +4637     
============================================
+ Hits          1575    73902    +72327     
- Misses        7578    40148    +32570     
- Partials      2120     2204       +84     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kenshineto
Copy link
Copy Markdown
Author

I use to have this setup where config.url was changed to webUrl, and localUrl was the option added. This ended up changing most of the files within the project, which was honestly too many. So this PR as its written now only modifies the places where userHost should be used instead.

I manually went though every use of url, host, and hostname and figured out (to by best judgement) which one should be used (url or userHost). Hopefully I got them all :)

@kenshineto kenshineto force-pushed the develop branch 2 times, most recently from ec29e21 to a730f59 Compare March 6, 2026 23:42
@kakkokari-gtyih kakkokari-gtyih linked an issue Mar 7, 2026 that may be closed by this pull request
1 task
@kenshineto kenshineto force-pushed the develop branch 2 times, most recently from b5e62b3 to 983f2a0 Compare March 7, 2026 20:12
@kenshineto kenshineto changed the title feat: add userHost option to allow instances to have seperate user ho… feat: add localHost option to allow changing of federation host Mar 7, 2026
@kenshineto kenshineto force-pushed the develop branch 2 times, most recently from 1fc6705 to 8f270a2 Compare March 7, 2026 23:16
@kenshineto
Copy link
Copy Markdown
Author

Renamed option form userHost to localHost since userHost is already used in misskey.

@kenshineto kenshineto force-pushed the develop branch 4 times, most recently from fb9f7f7 to cdb6e5f Compare March 10, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Development

Successfully merging this pull request may close these issues.

Seperate domains for web hosting and user unique identifiers

1 participant