From 66051a4799d64288ba7a606e470b1cb663dca244 Mon Sep 17 00:00:00 2001 From: Matt Lee Date: Sat, 7 Aug 2010 14:29:24 -0400 Subject: added some crude code to enable people to add support for webfinger to their domains license: AGPLv3 or later. --- socialfy-your-domain/README.txt | 57 +++++++++++++++++++++++++++ socialfy-your-domain/dot-well-known/host-meta | 1 + socialfy-your-domain/xrd/example@example.com | 14 +++++++ socialfy-your-domain/xrd/index.php | 41 +++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 socialfy-your-domain/README.txt create mode 100644 socialfy-your-domain/dot-well-known/host-meta create mode 100644 socialfy-your-domain/xrd/example@example.com create mode 100644 socialfy-your-domain/xrd/index.php (limited to 'socialfy-your-domain') diff --git a/socialfy-your-domain/README.txt b/socialfy-your-domain/README.txt new file mode 100644 index 000000000..ead4380f2 --- /dev/null +++ b/socialfy-your-domain/README.txt @@ -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. diff --git a/socialfy-your-domain/dot-well-known/host-meta b/socialfy-your-domain/dot-well-known/host-meta new file mode 100644 index 000000000..e44591a4e --- /dev/null +++ b/socialfy-your-domain/dot-well-known/host-meta @@ -0,0 +1 @@ +example.comResource Descriptor \ No newline at end of file diff --git a/socialfy-your-domain/xrd/example@example.com b/socialfy-your-domain/xrd/example@example.com new file mode 100644 index 000000000..06987525b --- /dev/null +++ b/socialfy-your-domain/xrd/example@example.com @@ -0,0 +1,14 @@ + + + acct:example@example.com + acct:example@social.example.com + http://social.example.com/user/1 + + + + + + + + + diff --git a/socialfy-your-domain/xrd/index.php b/socialfy-your-domain/xrd/index.php new file mode 100644 index 000000000..25f1d8bf3 --- /dev/null +++ b/socialfy-your-domain/xrd/index.php @@ -0,0 +1,41 @@ +. + */ + + +$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; +} + + +?> \ No newline at end of file -- cgit v1.2.3-54-g00ecf