[pmwiki-users] PmWiki work directory

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Wed Dec 20 08:08:18 CST 2006


This is be a long post... sorry.

Questions/choices:

* Is everything in the web tree, or is the installation split?
* Do files under uploads/ have to be in the web tree?
* Any recipes that need write access?
* Any recipes that need write access to files in the web tree?
   Eg. MimeTeX and the directory pub/cache/.
* Any recieps that need write access to files *not* in the web tree?

I won't adress all of them with this post - it's long as it is.
I'll look at the case with everything under the web tree (although I'd 
really prefer not doing that for my installations...)


To begin with, here's the current structure from a default installation of 
pmwiki with a single modified page (I've removed .gif, .txt and 
scripts/*.php as well as wiki pages):

---------------------------------------------------------------------------
$ tree -Ffa | grep -v '\(wikilib.d/[A-Z]\|scripts/.*php$\|\.gif$\|\.txt$\)'
.
|-- ./cookbook/
|   `-- ./cookbook/.htaccess
|-- ./docs/
|   |-- ./docs/.htaccess
|   `-- ./docs/sample-config.php
|-- ./local/
|   |-- ./local/.htaccess
|   `-- ./local/config.php
|-- ./pmwiki.php*
|-- ./pub/
|   |-- ./pub/css/
|   |-- ./pub/guiedit/
|   |   |-- ./pub/guiedit/README
|   |   |-- ./pub/guiedit/guiedit.js
|   `-- ./pub/skins/
|       |-- ./pub/skins/pmwiki/
|       |   |-- ./pub/skins/pmwiki/README
|       |   |-- ./pub/skins/pmwiki/pmwiki.css
|       |   `-- ./pub/skins/pmwiki/pmwiki.tmpl
|       `-- ./pub/skins/print/
|           |-- ./pub/skins/print/README
|           |-- ./pub/skins/print/print.css
|           |-- ./pub/skins/print/print.php
|           `-- ./pub/skins/print/print.tmpl
|-- ./scripts/
|   |-- ./scripts/.htaccess
|-- ./uploads/
|   `-- ./uploads/Main/
|       `-- ./uploads/Main/t.doc
|-- ./wiki.d/
|   |-- ./wiki.d/.flock
|   |-- ./wiki.d/.htaccess
|   |-- ./wiki.d/.lastmod
|   |-- ./wiki.d/.pageindex
|   |-- ./wiki.d/Main.Main
|   |-- ./wiki.d/Main.RecentChanges
|   `-- ./wiki.d/Site.AllRecentChanges
`-- ./wikilib.d/

14 directories, 195 files
---------------------------------------------------------------------------



The purpose of all the .htaccess files is to block browsers from the 
contents of those directories, or making sure that .php-files aren't 
executed. Ideally cookbook/, local/, wiki.d/ and possibly docs/ should be 
outside the web tree.

Strange... there is no .htaccess in wikilib.d/. Patrick?

Anyway, as we are talking about a directory for variable data, why not 
call it 'var/' rather than 'pmwiki.d/?

Here's a modified alternative for a default installation (with everything 
in the web tree and uploads/ under var/):

<web-tree>/pmwiki/
|-- ./cookbook/
|-- ./docs/
|-- ./local/
|-- ./pmwiki.php*
|-- ./pub/
|   |-- ./pub/css/
|   |-- ./pub/guiedit/
|   `-- ./pub/skins/
|-- ./scripts/
|-- ./var/					<--- New 
|   |-- ./wiki.d/				<--- Moved
|   |   |-- ./wiki.d/Main.Main
|   |   |-- ./wiki.d/Main.RecentChanges
|   |   `-- ./wiki.d/Site.AllRecentChanges
|   |-- ./work.d/				<--- Moved
|   |   |-- ./var/work.d/.flock
|   |   |-- ./var/work.d/.htaccess
|   |   |-- ./var/work.d/.lastmod
|   |   `-- ./var/work.d/.pageindex
|   `-- ./uploads/				<--- Moved
|       `-- Main/
|           `-- t.doc
`-- ./wikilib.d/




On Wed, 20 Dec 2006, Kathryn Andersen wrote:

> Please don't move uploads, it would probably break things.
> But putting work.d and wiki.d inside pmwiki.d would be fine, I think.

At the very least the location of uploads/ will be configurable. And the 
location of uploads/ in existing installations doesn't have to change. The 
way I see it, we are considering the structure for new installations.

There will likely be separate variables controlling the location of var/ 
and uploads/. Actually, isn't there alread a variable for uploads/?




What I see as a big advantage of keeping uploads/ in var/ is that the 
administrator only has to fiddle with the write permissions once. While I 
just did the installation to see it's original directory structure, I ran 
into this.  First I had to change the permissions for wiki.d/ to be 
created. Later on, in the middle of uploading a file I had to change the 
permissions again.

Btw, Patrick, it was very annoying to change the permissions the second 
time. Not so much because I had to do it, but because when I reloaded the 
page, I had start the uploading process all over (i.e. selecting file, 
choosing name of the target etc).

With uploads/ in var/ by default, at least this won't be a problem.



The drawback would then be that the URI for the uploaded files by default 
would be something like

 	pmwiki.org/wiki/var/uploads/<Group>/<File>

Hmm.. there is actually an alternative, although I don't really like it. 
What if <Group> was created directly in var/? It doesn't feel so good to 
me, but maybe it's an option. The URI would then become:

 	pmwiki.org/wiki/var/<Group>/<File>



The folder for uploads/ is a bit special since it in some installations 
must be in the web tree, and sometimes it doesn't. Maybe you want 
different directory structures for these cases.

As for special directories, another case is the directory pub/cache/ that 
is used by the recipe MimeTeX. The directory contains automatically 
generated images. I could imagine that a recipe for an image gallery does 
something similar if it automatically generated thumbnails.


Ok, this is enough... I'll break off here and see what others say.

cheers
/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-users mailing list