├── public
├── favicon.ico
├── robots.txt
├── images
│ └── xkcd.png
├── .htaccess
└── index.php
├── certbot
└── .gitignore
├── lib
├── .htaccess
├── XRay
│ ├── MediaType.php
│ ├── Formats
│ │ ├── HTMLPurifier_AttrDef_HTML_Microformats2.php
│ │ ├── XKCD.php
│ │ ├── Hackernews.php
│ │ ├── Mf2Feed.php
│ │ └── XML.php
│ ├── HTTPSig.php
│ ├── Rels.php
│ └── PostType.php
├── helpers.php
└── XRay.php
├── views
├── .htaccess
├── layout.php
├── index.php
└── certbot.php
├── controllers
├── .htaccess
├── Main.php
├── Feeds.php
└── Rels.php
├── tests
├── data
│ ├── .editorconfig
│ ├── 404.response.txt
│ ├── private.example.com
│ │ ├── token-timeout
│ │ ├── token-notjson
│ │ ├── no-link-headers
│ │ ├── token-invalid
│ │ ├── token
│ │ ├── no-token-endpoint-one-link-header
│ │ ├── token-endpoint-timeout
│ │ ├── token-endpoint-notjson
│ │ ├── token-endpoint-bad-response
│ │ ├── token-endpoint
│ │ ├── no-token-endpoint-two-link-headers
│ │ ├── oauth2-token-endpoint
│ │ └── multiple-rels
│ ├── source.example.com
│ │ ├── deleted-empty
│ │ ├── name-no-content
│ │ ├── deleted-gone
│ │ ├── text-content-with-p-tags
│ │ ├── single-h-entry-has-no-permalink
│ │ ├── h-x-app
│ │ ├── target-test-only-bad-mf1
│ │ ├── deleted
│ │ ├── deleted-2
│ │ ├── h-entry-no-content
│ │ ├── h-entry-rsvp
│ │ ├── rel-alternate-fallback.json
│ │ ├── target-test-only-good-mf1
│ │ ├── no-h-entry
│ │ ├── h-entry-is-not-first
│ │ ├── html-content
│ │ ├── html5-tags
│ │ ├── link-is-img
│ │ ├── link-is-audio
│ │ ├── link-is-video
│ │ ├── target-test-link-outside-h-entry
│ │ ├── target-test-link-outside-valid-mf1
│ │ ├── basictest
│ │ ├── person-tag-is-h-card
│ │ ├── person-tag-is-url
│ │ ├── text-content
│ │ ├── content-with-distinct-name
│ │ ├── h-entry-with-h-card-before-it
│ │ ├── h-entry-with-h-card-sibling
│ │ ├── content-with-prefixed-name
│ │ ├── multiple-content-type
│ │ ├── article-with-featured-image
│ │ ├── h-entry-duplicate-categories
│ │ ├── multiple-urls-off-domain
│ │ ├── h-app
│ │ ├── has-syndication
│ │ ├── rel-alternate-priority
│ │ ├── rel-alternate-as2
│ │ ├── reply-is-url
│ │ ├── h-entry-strip-hashtag-from-categories
│ │ ├── h-entry-with-two-h-cards-before-it
│ │ ├── duplicate-like-of-urls
│ │ ├── rel-alternate-not-found
│ │ ├── multiple-h-entry-on-permalink
│ │ ├── rel-alternate-fallback
│ │ ├── duplicate-in-reply-to-urls
│ │ ├── rel-alternate-priority-mf2-as2
│ │ ├── h-entry-redirect-with-h-card-sibling
│ │ ├── reply-is-h-cite
│ │ ├── multiple-urls
│ │ ├── fragment-id
│ │ ├── checkin-url
│ │ ├── h-review-of-h-card
│ │ ├── bridgy-follow
│ │ ├── follow-of-h-card
│ │ ├── rel-alternate-priority.json
│ │ ├── h-review-of-product
│ │ ├── checkin
│ │ ├── hReview
│ │ ├── h-event-with-h-card-location
│ │ ├── h-event
│ │ ├── h-recipe
│ │ ├── h-event-text-description
│ │ ├── h-event-featured
│ │ ├── h-event-text-content
│ │ ├── bridgy-invitee
│ │ ├── bridgy-example
│ │ ├── quotation-of
│ │ └── bookmark-missing-content
│ ├── sanitize.example
│ │ ├── content-is-only-video
│ │ ├── photo-in-content-with-p-no-alt
│ │ ├── photo-in-content-no-p-with-alt
│ │ ├── photo-in-content-with-alt-no-text
│ │ ├── photo-in-content-no-p-with-url-photo
│ │ ├── photo-with-dupe-name-alt-2
│ │ ├── photo-relative
│ │ ├── photo-with-dupe-name-alt
│ │ ├── photo-in-content-relative
│ │ ├── photo-in-content
│ │ ├── photo-in-text-content
│ │ ├── html-escaping-in-text
│ │ ├── entry-with-p-tags
│ │ ├── html-escaping-in-html
│ │ ├── photo-in-content-empty-alt
│ │ ├── photo-in-content-with-alt
│ │ ├── entry-with-br-tags
│ │ ├── entry-with-unsafe-tags
│ │ ├── entry-with-img-no-implied-photo
│ │ ├── h-entry-with-email-author
│ │ ├── entry-with-mf2-classes
│ │ ├── entry-with-iframe-video
│ │ ├── entry-with-valid-tags
│ │ ├── h-entry-with-javascript-urls
│ │ └── cleverdevil
│ ├── redirect.example.com
│ │ ├── 0
│ │ ├── 1
│ │ ├── 2
│ │ ├── 3
│ │ ├── code-403
│ │ ├── code-401
│ │ └── code-418
│ ├── feed.example.com
│ │ ├── redirect-to-atom
│ │ ├── temporary-redirect
│ │ ├── permanent-redirect
│ │ ├── short-list-of-hentrys-with-h-card
│ │ ├── list-of-hentrys
│ │ ├── h-feed-author-is-feed
│ │ ├── permanent-redirect-target
│ │ ├── temporary-redirect-target
│ │ ├── h-feed-author-is-bad-feed
│ │ ├── html-with-atom-alternate
│ │ ├── top-level-h-feed
│ │ ├── h-card-with-child-h-entrys
│ │ ├── html-with-json-and-atom
│ │ ├── h-card-with-sibling-h-entrys
│ │ ├── list-of-hentrys-with-h-card
│ │ ├── h-feed-with-atom-alternate
│ │ ├── h-feed-with-rss-alternate
│ │ ├── h-feed-with-child-author
│ │ ├── h-card-with-child-h-feed
│ │ └── jsonfeed-top-level-author
│ ├── author.example.com
│ │ ├── h-entry-author-is-name
│ │ ├── h-entry-author-is-rel-link-to-h-card-with-rel-me
│ │ ├── h-entry-author-is-rel-link-to-h-card-with-url-uid
│ │ ├── h-feed-has-multiple-entries-with-different-authors
│ │ ├── author-name-is-0
│ │ ├── about-url-uid
│ │ ├── about-rel-me
│ │ ├── h-entry-author-is-url-to-h-card-with-no-url
│ │ ├── about-with-multiple-urls
│ │ ├── h-entry-author-is-url-to-h-card-with-multiple-links
│ │ ├── about-no-url
│ │ ├── about
│ │ ├── h-entry-has-h-card-author
│ │ ├── h-entry-author-is-rel-link-to-h-card-on-page
│ │ ├── h-feed-has-h-card-author
│ │ ├── h-entry-author-is-url-to-h-card-on-page
│ │ ├── h-entry-has-h-card-and-url-author
│ │ ├── h-feed-author
│ │ └── h-feed-author-bad
│ ├── hacker-news.firebaseio.com
│ │ ├── v0_item_27402392.json
│ │ ├── v0_item_14516538.json
│ │ └── v0_item_14516923.json
│ ├── activitystreams.example
│ │ ├── note.json
│ │ ├── article.json
│ │ ├── sensitive.json
│ │ ├── reply.json
│ │ ├── video.json
│ │ ├── photo.json
│ │ ├── aaronpk
│ │ ├── custom-emoji.json
│ │ ├── repost.json
│ │ ├── like.json
│ │ ├── Gargron
│ │ └── jamey
│ └── api.github.com
│ │ ├── users_sebsel
│ │ ├── users_aaronpk
│ │ ├── repos_aaronpk_XRay_issues_25
│ │ └── repos_idno_Known_pulls_1690
├── bootstrap.php
├── FetchTestDisabled.php
├── MediaTypeTest.php
└── HelpersTest.php
├── setup
├── login.png
├── challenge-form.png
├── challenge-saved.png
├── indieauth.com.png
├── appengine-enable-cert.png
├── appengine-project-settings.png
└── appengine-add-new-certificate.png
├── XRay-67d8fdd0bba3.json.enc
├── php.ini
├── .gitignore
├── .htaccess
├── CONTRIBUTING.md
├── phpunit.xml
├── config.template.php
├── config.production.php
├── index.php
├── app.yaml
├── test-password.php
├── create-password.php
├── release.sh
├── release-library.sh
├── .travis.yml
├── composer.production.json
├── LICENSE.txt
├── composer.json
├── .github
└── workflows
│ └── php.yml
└── TODO.md
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/certbot/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/lib/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/views/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/controllers/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow: /parse
3 |
--------------------------------------------------------------------------------
/tests/data/.editorconfig:
--------------------------------------------------------------------------------
1 | [*]
2 | end_of_line = crlf
3 |
--------------------------------------------------------------------------------
/setup/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/setup/login.png
--------------------------------------------------------------------------------
/public/images/xkcd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/public/images/xkcd.png
--------------------------------------------------------------------------------
/tests/data/404.response.txt:
--------------------------------------------------------------------------------
1 | HTTP/1.1 404 Not Found
2 |
3 | The page was not found.
4 |
--------------------------------------------------------------------------------
/setup/challenge-form.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/setup/challenge-form.png
--------------------------------------------------------------------------------
/setup/challenge-saved.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/setup/challenge-saved.png
--------------------------------------------------------------------------------
/setup/indieauth.com.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/setup/indieauth.com.png
--------------------------------------------------------------------------------
/XRay-67d8fdd0bba3.json.enc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/XRay-67d8fdd0bba3.json.enc
--------------------------------------------------------------------------------
/setup/appengine-enable-cert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/setup/appengine-enable-cert.png
--------------------------------------------------------------------------------
/php.ini:
--------------------------------------------------------------------------------
1 | google_app_engine.enable_functions = "php_sapi_name, libxml_disable_entity_loader"
2 | open_basedir = none
3 |
--------------------------------------------------------------------------------
/tests/data/private.example.com/token-timeout:
--------------------------------------------------------------------------------
1 | HTTP/1.1 400 Bad Request
2 | X-Test-Error: timeout
3 |
4 | .
5 |
--------------------------------------------------------------------------------
/setup/appengine-project-settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/setup/appengine-project-settings.png
--------------------------------------------------------------------------------
/setup/appengine-add-new-certificate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronpk/XRay/HEAD/setup/appengine-add-new-certificate.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | config.php
3 | vendor/
4 | php_errors.log
5 | XRay-*.json
6 | .gcloudignore
7 | .phpunit.result.cache
8 | .vscode
9 |
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 | RewriteCond %{REQUEST_FILENAME} !-f
3 | RewriteCond %{REQUEST_FILENAME} !-d
4 | RewriteRule . index.php [L]
5 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 | RewriteCond %{REQUEST_FILENAME} !-f
3 | RewriteCond %{REQUEST_FILENAME} !-d
4 | RewriteRule . index.php [L]
5 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | By contributing to this project, you agree to irrevocably release your contributions under the same licenses as this project. See README.md for more details.
2 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |

10 | 
This post has been deleted.
13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/data/feed.example.com/redirect-to-atom: -------------------------------------------------------------------------------- 1 | HTTP/1.1 301 Moved Permanently 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | Location: http://feed.example.com/atom 7 | 8 | 9 | 10 |
10 | Hello
World
Hello World
14 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/tests/data/source.example.com/target-test-only-bad-mf1:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: Apache
3 | Date: Wed, 09 Dec 2015 03:29:14 GMT
4 | Content-Type: text/html; charset=utf-8
5 | Connection: keep-alive
6 |
7 |
8 |
9 | This post has been deleted.
14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/data/source.example.com/deleted-2: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This post has been deleted.
14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/data/source.example.com/h-entry-no-content: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |Photo caption 
This page has a link to target.example.com and some formatted text but has no h-entry markup.
13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/data/redirect.example.com/0: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This is the final page.
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/data/sanitize.example/photo-relative: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |Test of relative URL resolution with an photo property
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/tests/data/source.example.com/h-entry-is-not-first:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: Apache
3 | Date: Wed, 09 Dec 2015 03:29:14 GMT
4 | Content-Type: text/html; charset=utf-8
5 | Connection: keep-alive
6 |
7 |
8 |
9 | Hello World
15 |
This page has a link to target.example.com and some formatted text.
13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/data/source.example.com/html5-tags: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |Hello World
14 |
This page has an img tag with the target URL.
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/tests/data/author.example.com/h-entry-author-is-name:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: Apache
3 | Date: Wed, 09 Dec 2015 03:29:14 GMT
4 | Content-Type: text/html; charset=utf-8
5 |
6 |
7 |
8 |
9 |
10 | Hello World
17 |Test of relative URL resolution with two
images
inside the content
This page has an audio tag with the target URL.
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/data/source.example.com/link-is-video: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This page has a video tag with the target URL.
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/data/source.example.com/target-test-link-outside-h-entry: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |hello world
14 |This is a photo post with an img tag inside the content. 
hello world
14 |This is a photo post with an img tag inside the content. 
This page has links to target.example.com and target2.example.com.
13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/data/sanitize.example/html-escaping-in-text: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This content has some HTML escaped entities such as & ampersand, " quote, escaped <code> HTML tags, an ümlaut, an @at sign.
13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/data/source.example.com/person-tag-is-h-card: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This is a multiline post separated by paragraph tags with no space between them.
This is how Mastodon formats HTML.
14 |This content has some HTML escaped entities such as & ampersand, " quote, escaped <code> HTML tags, an ümlaut, an @at sign.
13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/data/sanitize.example/photo-in-content-empty-alt: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This is a photo post with an img tag inside the content. 
This page has a link to target.example.com and some formatted text but is in a p-content element so is plaintext.
13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/data/sanitize.example/photo-in-content-with-alt: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This is a photo post with an img tag inside the content. 
Hello World
16 |Hello World
16 |Hello World
18 |This page has a link to target.example.com and some formatted text.
14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/data/author.example.com/author-name-is-0: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | 6 | 7 | 8 | 9 | 10 |
17 | 0
18 |
19 | Hello World
15 | permalink 16 |Hello World
14 | permalink 15 |This page has a link to target.example.com and some formatted text.
14 | 15 | 16 | -------------------------------------------------------------------------------- /test-password.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 |
17 | Author Full Name
18 |
19 | This page has a link to target.example.com and some formatted text but is in a p-content element so is plaintext.
14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/data/source.example.com/article-with-featured-image: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |
13 |
14 | This is a blog post.
16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/data/source.example.com/h-entry-duplicate-categories: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html; charset=utf-8 5 | Connection: keep-alive 6 | 7 | 8 | 9 |This page is an h-entry and has some duplicate categories #indieweb.
13 | 14 |
18 | Author Full Name
19 |
20 | Homebrew Website Club!
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/tests/data/source.example.com/h-app:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: Apache
3 | Date: Wed, 09 Dec 2015 03:29:14 GMT
4 | Content-Type: text/html; charset=utf-8
5 | Connection: keep-alive
6 |
7 |
8 |
9 |
15 | Quill
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/tests/data/sanitize.example/entry-with-unsafe-tags:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: Apache
3 | Date: Wed, 09 Dec 2015 03:29:14 GMT
4 | Content-Type: text/html; charset=utf-8
5 | Connection: keep-alive
6 |
7 |
8 |
9 | This content has a bunch of invalid tags but also some valid ones.
14 | 15 | 16 |Hello World
17 |This page has links to target.example.com and target2.example.com.
13 | syndicated post 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/data/source.example.com/rel-alternate-priority: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache 3 | Date: Wed, 09 Dec 2015 03:29:14 GMT 4 | Content-Type: text/html 5 | Connection: keep-alive 6 | 7 | 8 | 9 | 10 | 11 |This is the content in the HTML page
17 |