I've just released phorkie 0.4.0, which brings you single click remote forking as well as a bunch of other new features.
Single-click remote forking
Phorkie is a self-hosted pastebin tool, but the fun of pastes on gist.github.com comes from the fact that you can simply click the "fork" button on a paste to make it your own.
Version 0.4 makes forking pastes from another user's phorkie instance to your own server as easy as clicking on the "Fork to remote system" button.
Setup
At first you need to tell your browser that your phorkie instance is the target of web+fork actions:
- Visit a paste on your server
- Open the dropdown beside the "fork" button. Click "Help on remote forking".
- Click "Register web+fork protocol handler".
- Confirm the browser's registration question.
Fork a paste
Now that everything is setup, visit a paste on some other server, e.g. phar on nginx vs. apache.
Click "Fork to remote system".
Your own phorkie instance will show up with the message "Remote paste has been forked".
phorkie.phar
I spent a considerable amount of time making phorkie work from inside a .phar file.
The phar contains all dependencies, and phorkie does work without configuration now (sensible auto-configuration!). So theoretically all you need is to drop the .phar into your web server's document root, and phorkie simply works.
Unfortunately, this is not reality (for now).
-
No Linux distribution I know lets PHP handle .phar files. Accessing a .phar with your browser will show you the source code in most cases.
I've opened bug reports for Debian and Fedora for that issue.
-
Web-based .phar applications on FPM-fcgi do not work but will give you a redirection loop.
I made a patch that is included in PHP 5.6.0, 5.5.15 and 5.4.31, so unless you have one of this or a higher version, you're out of luck.
Remote fork display
Forking remote pastes is not fun when you don't see who forked, and from where you forked.
When forking a paste, your phorkie will talk to the remote system by sending a linkback (Webmention or Pingback)
The remote system then verifies the fork by checking your newly forked paste HTML page and adds it to the "Forks" list.
Get it
phorkie's .phar and .tar.bz2 release is available on it's homepage.
The source code can be found on my git server and github.
Happy forking!