Browse Source

well-known/webfinger: Add json for ActivityPub/Nautilus

Update host-meta as well

github.com/aaronpk/Nautilus
master
Chimo 2 years ago
parent
commit
f3179a0d81
No known key found for this signature in database GPG Key ID: B0C36EDD0BB35A9C
  1. 8
      static/.well-known/host-meta
  2. 13
      static/.well-known/webfinger
  3. 35
      static/.well-known/webfinger/chimo@chromic.org.xml
  4. 43
      static/.well-known/webfinger/index.php

8
static/.well-known/host-meta

@ -1,5 +1,5 @@
<?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">
<Link rel="lrdd" type="application/xrd+xml"
template="https://chromic.org/.well-known/webfinger?resource={uri}"/>
<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" type="application/xrd+xml" template="https://chromic.org/.well-known/chimo.json?resource={uri}"/>
</XRD>

13
static/.well-known/webfinger

@ -0,0 +1,13 @@
{
"aliases" : [
"https://ap.chromic.org/chimo"
],
"links" : [
{
"href" : "https://ap.chromic.org/chimo",
"rel" : "self",
"type" : "application/activity+json"
}
],
"subject" : "acct:chimo@ap.chromic.org"
}

35
static/.well-known/webfinger/chimo@chromic.org.xml

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>acct:chimo@chromic.org</Subject>
<Alias>acct:chimo@sn.chromic.org</Alias>
<Alias>https://sn.chromic.org/user/1</Alias>
<Link rel="http://webfinger.net/rel/profile-page"
type="text/html"
href="https://sn.chromic.org/user/1"/>
<Link rel="http://schemas.google.com/g/2010#updates-from"
type="application/atom+xml"
href="https://sn.chromic.org/api/statuses/user_timeline/1.atom"/>
<!-- Is this/was this ever supported?
<Link rel="http://microformats.org/profile/hcard"
type="text/html"
href="https://sn.chromic.org/hcard"/> -->
<Link rel="http://gmpg.org/xfn/11"
type="text/html"
href="https://sn.chromic.org/user/1"/>
<Link rel="describedby"
type="application/rdf+xml"
href="https://sn.chromic.org/username/foaf"/>
<Link rel="http://salmon-protocol.org/ns/salmon-replies"
href="https://sn.chromic.org/main/salmon/user/1"/>
<Link rel="http://salmon-protocol.org/ns/salmon-mention"
href="https://sn.chromic.org/main/salmon/user/1"/>
<Link rel="http://ostatus.org/schema/1.0/subscribe"
template="https://sn.chromic.org/main/ostatussub?profile={uri}"/>
</XRD>

43
static/.well-known/webfinger/index.php

@ -1,43 +0,0 @@
<?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/>.
*/
// basename should make sure we can't escape this directory
$u = basename($_GET['resource']);
if (!strpos($u, '@')) {
throw new Exception('Bad resource');
exit(1);
}
if (mb_strpos($u, 'acct:')===0) {
$u = substr($u, 5);
}
// Just to be a little bit safer, you know, with all the unicode stuff going on
$u = filter_var($u, FILTER_SANITIZE_EMAIL);
$f = $u . ".xml";
if (file_exists($f)) {
header('Content-Disposition: attachment; filename="'.urlencode($f).'"');
header('Content-type: application/xrd+xml');
echo file_get_contents($f);
}
Loading…
Cancel
Save