mastodon_ynh
mastodon_ynh copied to clipboard
Host users, with different domain from server domain
Problem
- No problem but improvement : Add ability to host user with different domain from server domain
Solution
- Add well known host-meta file
- Add option to select users domain
PR Status
- [x] Code finished and ready to be reviewed/tested
- [x] install
- [x] upgrade
- [x] remove
- [x] restore
- [x] change_url
- [ ] The fix/enhancement were manually tested (if applicable)
- [x] 1rs install with master / host_domain: test.domain.tld
- [x] update to patch1
- [x] change url / host_domain: social.domain.tld / user_domain: XXXXXXXXXX
- [x] config userdomain / host_domain: XXXXXXXXXX / user_domain: social.domain.tld
- [x] config userdomain / host_domain: XXXXXXXXXX / user_domain: domain.tld
- [ ] remove app
- [ ] restore app
Automatic tests
!testme
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
maybe it should be improved before publish. i based my mod no https://docs.joinmastodon.org/dev/routes/ i did something like that : https://dallas.lu/en/use-your-primary-domain-as-an-mastodon-name but i didn't touch main domain webfinger configuration because i don't understand well the effect
as it tell on https://dallas.lu/en/use-your-primary-domain-as-an-mastodon-name fediverse servers like peertube which do not look for host-meta, should not work with main domain to subscribe to the video.
i don't find how to make peertube subscription working with something like this in HOSTDOMAIN config file:
location ~* /.well-known/webfinger {
add_header Access-Control-Allow-Origin __USERDOMAIN__;
}
it should allow HOSTDOMAIN to recieve crossSite request from __USERDOMAIN
error is :
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://domain.tld/.well-known/webfinger?resource=acct:[email protected]. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 301.
!testme
i don't understand how to mitigate the Cross-Origin error , i put
location ~* /.well-known/webfinger {
add_header Access-Control-Allow-Origin https://__USERDOMAIN__;
}
in /etc/nginx/conf.d/DOMAIN.d/mastodon.conf but peertube always return me a cors error
Maybe Access-Control-Allow-Origin https://__USERDOMAIN__ https://__DOMAIN__;
?
!testme
Appart script errors: i added parcial CORS mitigation add:header Access-Control-Allow-Origin * to USERDOMAIN nginx conf
with all that config (LOCAL_DOMAIN WEB_DOMAIN) it seems that i'm not able to follow from mastodon someone on an other service like peertube hosted on an other subdomain
!testme
!testme
except for a bug that that i don't understand (mastodon can not find own served peertube on subscription from peertube with a mastodon account) all is working for me. And testing restore and upgrade most of time fail due to lake of space. @yalh76 have you an idea how to solve this problem ?
!testme
!testme
@yalh76 !testme ;)
!testme
i would take back my work on this pr but mixed up with push and saw that i was working on master... are some one could help me to clean my pr and start back my workis it possible to revert my last forced-push action ?
formy information ; (To install Mastodon on mastodon.example.com in such a way it can serve @[email protected], set LOCAL_DOMAIN to example.com and WEB_DOMAIN to mastodon.example.com. This also requires additional configuration on the server hosting example.com to redirect or proxy requests to https://example.com/.well-known/webfinger to https://mastodon.example.com/.well-known/webfinger. For instance, with nginx, the configuration could look like the following:
location /.well-known/webfinger { add_header Access-Control-Allow-Origin '*'; return 301 https://mastodon.example.com$request_uri; } ) https://docs.joinmastodon.org/admin/config/#local_domain
Hi @ericgaspar you merged but it does noting. Some days ago I' be made a sync from source and all my modification were lost. I don't know how to go back. Maybe it should be better to make an other PR but I would recover my last job to take it as example as i did it a long time ago.