forked from GNUsocial/gnu-social
added some crude code to enable people to add support for webfinger to
their domains license: AGPLv3 or later.
This commit is contained in:
parent
762731d8ee
commit
66051a4799
57
socialfy-your-domain/README.txt
Normal file
57
socialfy-your-domain/README.txt
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
Initial simple way to Webfinger enable your domain -- needs PHP.
|
||||||
|
================================================================
|
||||||
|
|
||||||
|
Step 1
|
||||||
|
======
|
||||||
|
|
||||||
|
First, put the folders 'xrd' and 'dot-well-known' on your website, so
|
||||||
|
they load at:
|
||||||
|
|
||||||
|
http://yourname.com/xrd/
|
||||||
|
|
||||||
|
and
|
||||||
|
|
||||||
|
http://yourname.com/.well-known/
|
||||||
|
|
||||||
|
(Remember the . at the beginning of this one)
|
||||||
|
|
||||||
|
Step 2
|
||||||
|
======
|
||||||
|
|
||||||
|
Next, edit xrd/index.php and enter a secret in this line:
|
||||||
|
|
||||||
|
$s = "";
|
||||||
|
|
||||||
|
This can be anything you like...
|
||||||
|
|
||||||
|
$s = "johnny-five";
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
$s = "12345";
|
||||||
|
|
||||||
|
It really doesn't matter too much.
|
||||||
|
|
||||||
|
Step 3
|
||||||
|
======
|
||||||
|
|
||||||
|
For each user on your site, and this might only be you...
|
||||||
|
|
||||||
|
Make a copy of the example@example.com.xml file so that it's called...
|
||||||
|
|
||||||
|
yoursecretusername@domain.com.xml
|
||||||
|
|
||||||
|
So, if your secret is 'johnny5' and your name is ben and your
|
||||||
|
domain is titanictoycorp.biz, your file should be called
|
||||||
|
johnny5ben@titanictoycorp.biz.xml
|
||||||
|
|
||||||
|
Finally, edit the file to point at your account on your social
|
||||||
|
site. If you are the only user, then you probably don't need to worry
|
||||||
|
about user/1 as this will be you. For multi user sites, the user ID is
|
||||||
|
on the profile page.
|
||||||
|
|
||||||
|
Finally
|
||||||
|
=======
|
||||||
|
|
||||||
|
Using this method, though fiddly, you can now be @user@domain without
|
||||||
|
the need for any prefixes for subdomains, etc.
|
1
socialfy-your-domain/dot-well-known/host-meta
Normal file
1
socialfy-your-domain/dot-well-known/host-meta
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0"><hm:Host>example.com</hm:Host><Link rel="lrdd" template="http://example.com/xrd?uri={uri}"><Title>Resource Descriptor</Title></Link></XRD>
|
14
socialfy-your-domain/xrd/example@example.com
Normal file
14
socialfy-your-domain/xrd/example@example.com
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
|
||||||
|
<Subject>acct:example@example.com</Subject>
|
||||||
|
<Alias>acct:example@social.example.com</Alias>
|
||||||
|
<Alias>http://social.example.com/user/1</Alias>
|
||||||
|
<Link rel="http://webfinger.net/rel/profile-page" type="text/html" href="http://social.example.com/user/1"/>
|
||||||
|
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="http://social.example.com/api/statuses/user_timeline/1.atom"/>
|
||||||
|
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="http://social.example.com/hcard"/>
|
||||||
|
<Link rel="http://gmpg.org/xfn/11" type="text/html" href="http://social.example.com/user/1"/>
|
||||||
|
<Link rel="describedby" type="application/rdf+xml" href="http://social.example.com/foaf"/>
|
||||||
|
<Link rel="http://salmon-protocol.org/ns/salmon-replies" href="http://social.example.com/main/salmon/user/1"/>
|
||||||
|
<Link rel="http://salmon-protocol.org/ns/salmon-mention" href="http://social.example.com/main/salmon/user/1"/>
|
||||||
|
<Link rel="http://ostatus.org/schema/1.0/subscribe" template="http://social.example.com/main/ostatussub?profile={uri}"/>
|
||||||
|
</XRD>
|
41
socialfy-your-domain/xrd/index.php
Normal file
41
socialfy-your-domain/xrd/index.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GNU social
|
||||||
|
* Copyright (C) 2010, Free Software Foundation, Inc
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$s = "";
|
||||||
|
|
||||||
|
/* this should be a secret */
|
||||||
|
|
||||||
|
$u = $_GET['uri'];
|
||||||
|
|
||||||
|
$u = substr($u, 5);
|
||||||
|
|
||||||
|
$f = $s . $u . ".xml";
|
||||||
|
|
||||||
|
if (file_exists($f)) {
|
||||||
|
$fh = fopen($f, 'r');
|
||||||
|
$c = fread($fh, filesize($f));
|
||||||
|
fclose($fh);
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
echo $c;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user