From: Justin J. Novack Date: Wed, 19 Sep 2012 00:11:11 +0000 (-0400) Subject: Cleaned up files for 0.3 milestone. X-Git-Tag: v0.3.0~33^2 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/6c0d5be1b6ec69257b09b97ddfe0405eabe92459 Cleaned up files for 0.3 milestone. --- diff --git a/README.rst b/README.rst index d41d89b..e7e1625 100644 --- a/README.rst +++ b/README.rst @@ -20,9 +20,10 @@ Features - add new files - delete existing files - replace file with upload +- OpenID authentication - multiple files in one paste - syntax highlighting with GeSHi -- rST rendering +- rST and Markdown rendering - image upload + display - external tool support @@ -41,7 +42,7 @@ Installation ============ 1. Unzip the phorkie release file:: - $ tar xjvf phorkie-0.2.0.tar.bz2 + $ tar xjvf phorkie-0.3.0.tar.bz2 2. Create the git directories:: @@ -58,7 +59,7 @@ Installation Look at ``config.default.php`` for values that you may adjust. -5. Set your web server's document root to ``/path/to/phorkie-0.2.0/www/`` +5. Set your web server's document root to ``/path/to/phorkie/www/`` 6. Open phorkie in your web browser @@ -67,6 +68,10 @@ Dependencies ============ phorkie stands on the shoulders of giants. +- git v1.7.5 +- php v5.3.0 +- pear v1.9.2 + :: $ pear install versioncontrol_git-alpha @@ -86,16 +91,16 @@ phorkie stands on the shoulders of giants. $ pear channel-discover pear.michelf.ca $ pear install michelf/Markdown - + Note that this version of GeSHi is a bit outdated, but it's the fastest -way to install it. - +way to install it. If you install it manually be sure to update the +path in ``data/config.default.php``. ====== Search ====== -phorkie makes use of an Elasticsearch__ installation if you have one. +phorkie makes use of an Elasticsearch__ installation, if you have one. It is used to provide search capabilities and the list of recent pastes. @@ -137,7 +142,7 @@ Make git repositories clonable To make git repositories clonable, you need to install ``git-daemon`` (``git-daemon-run`` package on Debian/Ubuntu). -Now make the repositories available by symlinking the paste repository +Make the repositories available by symlinking the paste repository directory (``$GLOBALS['phorkie']['cfg']['repos']`` setting) into ``/var/cache/git``, e.g.:: @@ -147,9 +152,21 @@ Edit your ``config.php`` and set the ``$GLOBALS['phorkie']['cfg']['git']['public setting to ``git://$yourhostname/git/paste/``. The rest will be appended automatically. - You're on your own to setup writable repositories. +Protect your site with OpenID +============================= +You have the option of enabling OpenID authentication to help secure your +pastes on phorkie. Set the ``$GLOBALS['phorkie']['auth']`` values in the +``data/config.php`` file as desired. + +There are two different types of security you can apply. First, you can +restrict to one of three ``securityLevels``; completely open (``0``), protection +of write-enabled functions such as add, edit, etc. (``1``), and full site +protection (``2``). Additionally, you can restrict your site to ``listedUsersOnly``. +You will need to add the individual OpenIDs identity urls to the +``$GLOBALS['phorkie']['auth']['users']`` variable. + ================= Technical details @@ -157,7 +174,6 @@ Technical details TODO ==== -- OpenID-Login to get username+email as authorship information - filters (``xmllint --format``, ``rapper``) - document how to keep disk usage low (block size) - comments diff --git a/src/phorkie/File.php b/src/phorkie/File.php index f378f60..7f5b5b4 100644 --- a/src/phorkie/File.php +++ b/src/phorkie/File.php @@ -118,6 +118,9 @@ class File throw new Exception('Unknown type'); } + /** + * @return string Mime type of file + */ public function getMimeType() { $ext = $this->getExt(); diff --git a/src/phorkie/Repository.php b/src/phorkie/Repository.php index 43f2b23..4ac5ae7 100644 --- a/src/phorkie/Repository.php +++ b/src/phorkie/Repository.php @@ -104,7 +104,7 @@ class Repository $this->hash = $output; } - /** + /** * Populates $this->message * * @return void diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index 9119e06..b181b5a 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -130,7 +130,8 @@ class Repository_Post ->setOption('message', $commitmsg) ->setOption('author', $sessionData['name'].' <'.$sessionData['email'].'>') ->execute(); - //FIXME: git needs ref BEFORE add. ideally VersionControl_Git needs to be updated + //FIXME: git needs ref BEFORE add + //quick hack until http://pear.php.net/bugs/bug.php?id=19605 is fixed $vc->getCommand('notes --ref=identity add') ->setOption('force') ->setOption('message', "$notes") diff --git a/src/phorkie/SetupCheck.php b/src/phorkie/SetupCheck.php index b1107b5..24f7009 100644 --- a/src/phorkie/SetupCheck.php +++ b/src/phorkie/SetupCheck.php @@ -11,6 +11,7 @@ class SetupCheck 'pear.php.net/Pager' => 'Pager', 'pear.php.net/Services_Libravatar' => 'Services_Libravatar', 'zustellzentrum.cweiske.de/MIME_Type_PlainDetect' => 'MIME_Type_PlainDetect', + 'pear.michelf.ca/Markdown' => 'Markdown', ); protected $writableDirs; diff --git a/src/phorkie/Tool/Info.php b/src/phorkie/Tool/Info.php index c1c3c69..2e95a9f 100644 --- a/src/phorkie/Tool/Info.php +++ b/src/phorkie/Tool/Info.php @@ -10,16 +10,35 @@ class Tool_Info $this->class = $class; } + /** + * Format the tool path + * + * @param File $file + * + * @return string + */ public function getLink(File $file) { return $file->getLink('tool', $this->stripPrefix($this->class)); } + /** + * Clean namespace from class + * + * @return string + */ public function getTitle() { return $this->stripPrefix($this->class); } + /** + * Removes custom namespace prefix + * + * @param string $class Class of object + * + * @return string + */ protected function stripPrefix($class) { $prefix = '\\phorkie\\Tool_'; diff --git a/src/phorkie/Tools.php b/src/phorkie/Tools.php index e4aab63..9435dc0 100644 --- a/src/phorkie/Tools.php +++ b/src/phorkie/Tools.php @@ -4,6 +4,13 @@ namespace phorkie; class Tools { + /** + * Delete an entire directory structure + * + * @param string $path Path to delete + * + * @return bool + */ public static function recursiveDelete($path) { if (!is_dir($path) || is_link($path)) {