{"id":13557117,"url":"https://github.com/cweiske/phorkie","last_synced_at":"2025-04-09T11:10:29.987Z","repository":{"id":2906829,"uuid":"3915445","full_name":"cweiske/phorkie","owner":"cweiske","description":"Self-hosted pastebin software written in PHP. Pastes are editable, forkable, may have multiple files and are stored in git repositories.","archived":false,"fork":false,"pushed_at":"2023-12-27T14:08:46.000Z","size":914,"stargazers_count":216,"open_issues_count":1,"forks_count":23,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-02T08:12:58.842Z","etag":null,"topics":["git","pastebin","php"],"latest_commit_sha":null,"homepage":"https://cweiske.de/phorkie.htm","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cweiske.png","metadata":{"files":{"readme":"README.rst","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-04-03T06:50:08.000Z","updated_at":"2024-03-27T02:47:24.000Z","dependencies_parsed_at":"2023-12-27T15:24:12.937Z","dependency_job_id":"574f21cd-e779-4078-b23d-2df44085ac5c","html_url":"https://github.com/cweiske/phorkie","commit_stats":{"total_commits":489,"total_committers":14,"mean_commits":34.92857142857143,"dds":"0.20040899795501022","last_synced_commit":"0bf21fac824008387412208dd6b0da08827efbed"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweiske%2Fphorkie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweiske%2Fphorkie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweiske%2Fphorkie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweiske%2Fphorkie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cweiske","download_url":"https://codeload.github.com/cweiske/phorkie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027407,"owners_count":21035594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","pastebin","php"],"created_at":"2024-08-01T12:04:10.683Z","updated_at":"2025-04-09T11:10:29.968Z","avatar_url":"https://github.com/cweiske.png","language":"PHP","funding_links":[],"categories":["PHP","git"],"sub_categories":[],"readme":"****************************\nphorkie - Git based pastebin\n****************************\nSelf-hosted pastebin software written in PHP.\nPastes are editable, may have multiple files and are stored in git repositories.\n\n`Homepage \u003chttps://cweiske.de/phorkie.htm\u003e`__\n| `Bug tracker \u003chttps://github.com/cweiske/phorkie/issues\u003e`__\n| `Git repository \u003chttps://git.cweiske.de/phorkie.git\u003e`__\n· `GitHub mirror \u003chttps://github.com/cweiske/phorkie/\u003e`__\n| `News \u003chttps://cweiske.de/phorkie-news.htm\u003e`__\n\n.. contents:: Table of Contents\n\n========\nFeatures\n========\n- every paste is a git repository\n\n  - repositories can be cloned\n  - clone url can be displayed\n  - remote pastes can be forked (rel=\"vcs-git\" and gist.github.com)\n  - single click forking of forks on different servers to your own\n- paste editing\n\n  - add new files\n  - delete existing files\n  - replace file with upload\n- embedding of pastes in your blog (via JavaScript or oEmbed)\n- multiple files in one paste\n  - option to edit single files in a multi-file paste\n- syntax highlighting with GeSHi\n- rST and Markdown rendering\n- image upload + display\n- OpenID authentication\n- external tool support\n\n  - xmllint\n  - php syntax check\n- history in the sidebar\n\n  - old files can be downloaded easily\n- search across pastes: description, file names and file content\n\n  - options: quoting, logical and, or, not, partial words\n- webhook support - get notified when pastes are created, edited or deleted\n- atom feed for new and updated pastes\n- notifies remote instances via linkbacks when a paste has been forked\n- text file detection for unknown file types\n\n\n========\nDownload\n========\nphorkie is released as self-contained ``.phar`` file that includes\nall dependencies, as well as a normal zip file.\n\n.. LATESTRELEASE\n\nSee `phorkie downloads page \u003chttp://cweiske.de/phorkie-download.htm\u003e`_\nfor all released versions.\n\n\n============\nInstallation\n============\n\n.phar\n=====\nDownload ``phorkie-0.8.1.phar`` and put it in your web server's document root\ndirectory.\n\nNo further setup needed.\n\n.. note:: Only valid if your webserver is configured to let\n   PHP handle ``.phar`` files.\n\n   Unfortunately, no Linux distribution has this activated by default.\n   You can do it yourself, though - see\n   `Enable .phar handling in your web server`__.\n\n.. warning:: PHP has some bugs in its .phar handling code (e.g. with FPM).\n\n   So currently, the ``.phar`` option is considered experimental.\n\n__ http://cweiske.de/tagebuch/phar-webserver.htm\n\n\nZip package\n===========\n1. Unzip the phorkie release file::\n\n   $ tar xjvf phorkie-0.8.1.tar.bz2\n\n2. Create the git directories::\n\n   $ mkdir -p www/repos/git www/repos/work\n   $ chmod og+w www/repos/git www/repos/work\n\n3. Install dependencies_\n\n4. Copy ``data/config.php.dist`` to ``data/config.php`` and adjust it\n   to your needs::\n\n   $ cp data/config.php.dist data/config.php\n   $ $EDITOR data/config.php\n\n   Look at ``config.default.php`` for values that you may adjust.\n\n5. Set your web server's document root to ``/path/to/phorkie/www/``\n   Alternatively, you can add a symlink to the ``www`` folder into your\n   web server's existing document root tree (being careful to keep\n   main phorkie folder outside the document root for security purposes)\n   and ensure you set the ``baseurl`` config option appropriately. You\n   must also set the ``RewriteBase`` in the ``.htaccess`` file or adjust\n   the nginx configuration accordingly.\n\n6. Open http://yourhost/setup in your web browser to see if everything\n   is working fine.\n\n7. Go to http://yourhost/\n\n8. If you like phorkie, send a mail to `cweiske+phorkie@cweiske.de`__\n\n__ mailto:cweiske+phorkie@cweiske.de\n\n\nDependencies\n============\nphorkie stands on the shoulders of giants.\n\nIt requires the following programs to be installed\non your machine:\n\n- Git v1.7.5 or later\n- PHP v8.0.0 or later\n\n  - with the ``mbstring`` extension\n- A dozen of libraries\n\nUse composer to install all dependencies::\n\n  $ composer install --no-dev\n\nNote that the ``.phar`` package already contains all dependencies.\n\n\n======\nSearch\n======\n\nphorkie makes use of an Elasticsearch__ installation, if you have one.\n\nIt is used to provide search capabilities and the list of recent pastes.\n\nElasticsearch version 2.0 is supported.\n\nYou have to install the `delete-by-query`__ plugin::\n\n    $ cd /usr/share/elasticsearch\n    $ bin/plugin install delete-by-query\n\n__ http://www.elasticsearch.org/\n__ https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html\n\n\nSetup\n=====\nEdit ``config.php``, setting the ``elasticsearch`` property to the HTTP URL\nof the index, e.g. ::\n\n  http://localhost:9200/phorkie/\n\nYou must use a search namespace with Elasticsearch such as ``phorkie/``.\nRun the index script to import all existing pastes into the index::\n\n  php scripts/index.php\n\nThat's all. Open phorkie in your browser, and you'll notice the search box\nin the top menu.\n\n\nReset\n=====\nIn case something really went wrong and you need to reset the search\nindex, run the following command::\n\n  $ curl -XDELETE http://localhost:9200/phorkie/\n  {\"ok\":true,\"acknowledged\"}\n\nPhorkie will automatically re-index everything when ``setupcheck`` is enabled\nin the configuration file.\n\nYou may also manually run the reindexing script with::\n\n  $ php scripts/index.php\n\n\n=====\nHowTo\n=====\n\nMake git repositories clonable\n==============================\n\nHTTP\n----\nBy default, the pastes are clonable via ``http`` as long as the ``repos/git/``\ndirectory is within the ``www/`` directory.\n\nNo further setup needed.\n\n\ngit-daemon\n----------\nYou may use ``git-daemon`` to provide public ``git://`` clone urls.\nInstall the ``git-daemon-run`` package on Debian/Ubuntu.\n\nMake the repositories available by symlinking the paste repository\ndirectory (``$GLOBALS['phorkie']['cfg']['repos']`` setting) into\n``/var/cache/git``, e.g.::\n\n  $ ln -s /home/user/www/paste/repos/git /var/cache/git/paste\n\nEdit your ``config.php`` and set the ``$GLOBALS['phorkie']['cfg']['git']['public']``\nsetting to ``git://$yourhostname/git/paste/``.\nThe rest will be appended automatically.\n\n\nYou're on your own to setup writable repositories.\n\n\nProtect your site with OpenID\n=============================\nYou have the option of enabling OpenID authentication to help secure your\npastes on phorkie.\nSet the ``$GLOBALS['phorkie']['auth']`` values in the\n``data/config.php`` file as desired.\n\nThere are two different types of security you can apply.\nFirst, you can restrict to one of three ``securityLevels``:\n\n- completely open (``0``)\n- protection of write-enabled functions such as add, edit, etc. (``1``)\n- full site protection (``2``)\n\nAdditionally, you can restrict your site to ``listedUsersOnly``.\nYou will need to add the individual OpenID urls to the\n``$GLOBALS['phorkie']['auth']['users']`` variable.\n\n\nGet information about paste editors\n===================================\nPhorkie stores the user's OpenID or IP address (when not logged in) when\na paste is edited.\nIt is possible to get this information for each single commit::\n\n    // IP / OpenID for the latest commit\n    $ git notes --ref=identity show\n    127.0.0.1\n\n    // show IP / OpenID for a given commit\n    $ git notes --ref=identity show 29f82a\n    http://cweiske.de/\n\n\nNotifications via webhooks\n==========================\nDepending on how you use phorkie, it might be nice to notify some other service\nwhen pastes are added or updated.\nPhorkie contains a simply mechanism to post data to a given URL which\nyou can then use as needed.\n\nThe data are json-encoded POSTed to the URLs contained in the\n``$GLOBALS['phorkie']['cfg']['webhooks']`` setting array, with\na MIME type of ``application/vnd.phorkie.webhook+json``::\n\n  {\n      'event': 'create',\n      'author': {\n          'name':'Anonymous',\n          'email': 'anonymous@phorkie',\n      },\n      'repository': {\n          'name': 'webhooktest',\n          'url': 'http://example.org/33',\n          'description': 'webhooktest',\n          'owner': {\n              'name': 'Anonymous',\n              'email': 'anonymous@phorkie',\n          }\n      }\n  }\n\nThe event may be ``create``, ``edit`` or ``delete``.\n\n\n=================\nTechnical details\n=================\n\n\nURLs\n====\n\n``/``\n  Index page.\n``/[0-9]+``\n  Display page for paste\n``/[0-9]+/edit``\n  Edit the paste\n``/[0-9]+/edit/(.+)``\n  Edit a single file of the paste\n``/[0-9]+/embed``\n  JavaScript code that embeds the whole paste in a HTML page\n``/[0-9]+/embed/(.+)``\n  JavaScript code that embeds a single file in a HTML page\n``/[0-9]+/raw/(.+)``\n  Display raw file contents\n``/[0-9]+/tool/[a-zA-Z]+/(.+)``\n  Run a tool on the given file\n``/[0-9]+/rev/[a-z0-9]+``\n  Show specific revision of the paste\n``/[0-9]+/delete``\n  Delete the paste\n``/[0-9]+/doap``\n  Show DOAP document for paste\n``/[0-9]+/fork``\n  Create a fork of the paste\n``/search?q=..(\u0026page=[0-9]+)?``\n  Search for term, with optional page\n``/list(/[0-9]+)?``\n  List all pastes, with optional page\n``/fork-remote``\n  Fork a remote URL\n``/help``\n  Show help page\n``/new``\n  Shows form for new paste\n``/login``\n  Login page for protecting site\n``/setup``\n  Check if everything is setup correctly and all dependencies are installed\n``/user``\n  Edit logged-in user information\n\n\nInternal directory layout\n=========================\n::\n\n  repos/\n    work/\n      1/ - work directory for paste #1\n      2/ - work directory for paste #2\n    git/\n      1.git/ - git repository for paste #1\n        description - Description for the repository\n      2.git/ - git repository for paste #2\n\nnginx rewrites\n==============\nIf you use nginx, place the following lines into your ``server`` block:\n\n::\n\n  if (!-e $request_uri) {\n    rewrite ^/([0-9]+)$ /display.php?id=$1;\n    rewrite ^/([0-9]+)/delete$ /delete.php?id=$1;\n    rewrite ^/([0-9]+)/delete/confirm$ /delete.php?id=$1\u0026confirm=1;\n    rewrite ^/([0-9]+)/doap$ /doap.php?id=$1;\n    rewrite ^/([0-9]+)/edit$ /edit.php?id=$1;\n    rewrite ^/([0-9]+)/edit/(.+)$ /edit.php?id=$1\u0026file=$2;\n    rewrite ^/([0-9]+)/embed$ /embed.php?id=$1;\n    rewrite ^/([0-9]+)/embed/(.+)$ /embed.php?id=$1\u0026file=$2;\n    rewrite ^/([0-9]+)/fork$ /fork.php?id=$1;\n    rewrite ^/([0-9]+)/raw/(.+)$ /raw.php?id=$1\u0026file=$2;\n    rewrite ^/([0-9]+)/rev/(.+)$ /revision.php?id=$1\u0026rev=$2;\n    rewrite ^/([0-9]+)/rev-raw/([^/]+)/(.+)$ /raw.php?id=$1\u0026rev=$2\u0026file=$3;\n    rewrite ^/([0-9]+)/tool/([^/]+)/(.+)$ /tool.php?id=$1\u0026tool=$2\u0026file=$3;\n\n    rewrite ^/fork-remote$ /fork-remote.php;\n    rewrite ^/help$ /help.php;\n    rewrite ^/new$ /new.php;\n\n    rewrite ^/feed/new$ /feed-new.php;\n    rewrite ^/feed/updated$ /feed-updated.php;\n\n    rewrite ^/list$ /list.php;\n    rewrite ^/list/([0-9]+)$ /list.php?page=$1;\n\n    rewrite ^/search$ /search.php;\n    rewrite ^/search/([0-9]+)$ /search.php?page=$1;\n\n    rewrite ^/login$ /login.php;\n    rewrite ^/setup$ /setup.php;\n    rewrite ^/user$ /user.php;\n  }\n\nLighttpd rewrites\n=================\n\n::\n\n    url.rewrite-once += (\n        \"^/([0-9]+)$\" =\u003e \"/display.php?id=$1\",\n        \"^/([0-9]+)/delete$\" =\u003e \"/delete.php?id=$1\",\n        \"^/([0-9]+)/delete/confirm\" =\u003e \"/delete.php?\u0026id=$1\u0026confirm=1\",\n        \"^/([0-9]+)/doap$\" =\u003e \"/doap.php?id=$1\",\n        \"^/([0-9]+)/edit$\" =\u003e \"/edit.php?id=$1\",\n        \"^/([0-9]+)/edit/(.+)\" =\u003e \"/edit.php?id=$1\u0026file=$2\",\n        \"^/([0-9]+)/embed$\" =\u003e \"/embed.php?id=$1\",\n        \"^/([0-9]+)/embed/(.+)$\" =\u003e \"/embed.php?id=$1\",\n        \"^/([0-9]+)/fork$\" =\u003e \"/fork.php?id=$1\",\n        \"^/([0-9]+)/raw/(.+)$\" =\u003e \"/raw.php?id=$1\u0026file=$2\",\n        \"^/([0-9]+)/rev/(.+)$\" =\u003e \"/revision.php?id=$1\u0026rev=$2\",\n        \"^/([0-9]+)/rev-raw/([^/]+)/(.+)$\" =\u003e \"/raw.php?id=$1\u0026rev=$2\u0026file=$3\",\n        \"^/([0-9]+)/tool/([^/]+)/(.+)$\" =\u003e \"/tool.php?id=$1\u0026tool=$2\u0026file=$3\",\n\n        \"^/fork-remote$\" =\u003e \"/fork-remote.php\",\n        \"^/help$\" =\u003e \"/help.php\",\n        \"^/new$\" =\u003e \"/new.php\",\n\n        \"^/feed/new$\" =\u003e \"/feed-new.php\",\n        \"^/feed/updated$\" =\u003e \"/feed-updated.php\",\n\n        \"^/list$\" =\u003e \"/list.php\",\n        \"^/list/([0-9]+)$\" =\u003e \"/list.php?page=$1\",\n\n        \"^/search$\" =\u003e \"/search.php\",\n        \"^/search/([0-9]+)$\" =\u003e \"/search.php?page=$1\",\n\n        \"^/login$\" =\u003e \"/login.php\",\n        \"^/setup$\" =\u003e \"/setup.php\",\n        \"^/user$\" =\u003e \"/user.php\"\n    )\n\n\n===========\nDevelopment\n===========\n\nReleasing a new version\n=======================\n\n#. Update ``ChangeLog``, ``NEWS.rst``, ``build.xml`` and ``README.rst``.\n#. Update local dependencies::\n\n    $ phing collectdeps\n#. Build ``.tar.bz2`` and ``.phar`` release files with::\n\n    $ phing zip\n    $ phing phar\n#. Test.\n#. Tag the release in git\n#. Run the script to update the homepage\n\n    $ cd /home/cweiske/Dev/html/cweiske.de\n    $ ./scripts/update-phorkie.sh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcweiske%2Fphorkie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcweiske%2Fphorkie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcweiske%2Fphorkie/lists"}