README.md in stoor-0.1.9 vs README.md in stoor-0.1.11

- old
+ new

@@ -7,17 +7,15 @@ data, because they will sign a HIPAA BAA.) Meanwhile, we'd like to authorize access by some means: we like GitHub Oauth, so that we can constrain access by GitHub Organization Team membership. ## Requirements -Ruby 1.9.2 or greater. +* Ruby 1.9.2 or greater. Unfortunately, Stoor will no longer work on Ruby 1.8.7, because `gollum-lib` now wants Nokogiri 1.6.0 ([see?](https://github.com/gollum/gollum-lib/commit/eeb0a4a036001c7621d173e7152b91ed02b21ed0#commitcomment-4170065)), and +1.8.7 isn't supported. That's too bad, because it was nice that this would work on the older system Ruby on a Mac. +* Persistent access to the filesystem (i.e., won't work on Heroku). +* An operating system other than Windows (because Gollum doesn't work on Windows, because [grit doesn't work on Windows . . .](https://github.com/gollum/gollum#system-requirements)). -An operating system other than Windows (because Gollum doesn't work on Windows, because grit doesn't work on Windows . . .). - -Unfortunately, Stoor will no longer work on Ruby 1.8.7, because `gollum-lib` now wants Nokogiri 1.6.0 ([see?](https://github.com/gollum/gollum-lib/commit/eeb0a4a036001c7621d173e7152b91ed02b21ed0#commitcomment-4170065)), and -1.8.7 isn't supported. That's too bad, because it was nice that this would work on the system Ruby on a Mac. - ## Setup gem install stoor (On occasion I have had to `rbenv rehash`.) @@ -44,10 +42,17 @@ mkdir mywiki cd mywiki git init . stoor +### Configuration via environment variables + +Stoor is configured via environment variables of the form `<name>_<some token>`. `<name>` is taken from the name +of the directory in which the application resides. If you clone the app or use it as a Gem, it will be: `STOOR` +If you clone into a directory with a different name (e.g., `stoor2`) it will be: `STOOR2`. This facilitates running +two instances of Stoor in the same process (see below regarding Apache). + ### Specify the Wiki repo location STOOR_WIKI_PATH=/Users/admin/wiki stoor The `STOOR_WIKI_PATH` environment variable provides for locating the wiki contents in a differet repo from the @@ -148,10 +153,50 @@ sudo apachectl -k restart Now browse your wiki at <http://wiki.local> +### Running two instances of Stoor in the same Apache + +You may want to run two instances of Stoor in the same Apache. For instance, they might both use the same Wiki path, +but one is set to be read-only, while the other allows edits. + +To do this, don't set the DocumentRoot to the Gem directory. Intead, clone the repo twice, once into a directory +such as `stoor1` the other into `stoor2`. Then configure +the two VirtualHosts with environment variables based on each directory. Something like this: + + <VirtualHost *:80> + SetEnv STOOR1_GITHUB_CLIENT_ID 780ec06a331b4f61a345 + SetEnv STOOR1_GITHUB_CLIENT_SECRET f1e5439aff166c34f707747120acbf66ef233fc2 + SetEnv STOOR1_GITHUB_EMAIL_DOMAIN 7fff.com + SetEnv STOOR1_DOMAIN wiki.local + SetEnv STOOR1_EXPIRE_AFTER 60 + SetEnv STOOR1_WIKI_PATH /Users/jgn/Dropbox/wiki + ServerName wiki.local + DocumentRoot "/Users/jgn/src/stoor1" + <Directory "/Users/jgn/src/stoor1"> + Allow from all + Options -MultiViews + </Directory> + </VirtualHost> + + <VirtualHost *:80> + SetEnv STOOR2_GITHUB_CLIENT_ID 780ec06a331b4f61a345 + SetEnv STOOR2_GITHUB_CLIENT_SECRET f1e5439aff166c34f707747120acbf66ef233fc2 + SetEnv STOOR2_GITHUB_EMAIL_DOMAIN 7fff.com + SetEnv STOOR2_DOMAIN wiki.local + SetEnv STOOR2_EXPIRE_AFTER 60 + SetEnv STOOR2_WIKI_PATH /Users/jgn/Dropbox/wiki + SetEnv STOOR2_READONLY y + ServerName wiki-readonly.local + DocumentRoot "/Users/jgn/src/stoor2" + <Directory "/Users/jgn/src/stoor2"> + Allow from all + Options -MultiViews + </Directory> + </VirtualHost> + ## Links in the Wiki A bit of advice: Use the MediaWiki format for links internal to your wiki. This style is recommended by GitHub (see <https://help.github.com/articles/how-do-i-add-links-to-my-wiki>). For example, if you have a secondary page called `foo.md`, and want a link that displays "This is my foo page", write @@ -175,9 +220,11 @@ * No support for changing the "base path." * No support for changing Gollum options - all the default options are taken ## Testing + +Ensure that you clone to a directory called `stoor`, because the ENV variables adopt the name of the home directory. To run the specs, create an application per "GitHub Authorization" above, and take note of the client id and client secret. Then set up Stoor so that you are running with GitHub authorization. Authorize.