New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
You are here: Foswiki>Tasks Web>Item14530 (10 Mar 2018, GeorgeClark)Edit Attach

Item14530: Add new config "RootDir" to unify configuartions of file system paths

Priority: Enhancement
Current State: Waiting for Release
Released In: 2.2.0
Target Release: minor
Applies To: Engine
Component: Configure, ConfigureBootstrap
Branches: Item14530 master
Reported By: WillLe
Waiting For:
Last Change By: GeorgeClark
I was very surprised to see all 7 system dirs (ScriptDir, TemplateDir, WorkingDir, ToolsDir, PubDir, LocalesDir, DataDir) are configured separately while normally they are all in the same root dir of the site. Then I reconsidered the rationale, and thought that there may be some situation (can anyone give one) that they need to be placed elsewhere out of the website's root dir. So I propose a new config parameter "RootDir" to have all other dirs set relative to this RootDir. Their relativity is only set up at bootstrap config, and the admin can later freely change them to whatever he/she wants.

So the default settings should be: XxxDir = $Foswiki::cfg{RootDir}/xxx, and RootDir is auto-detected (at bootstrap) to be the root dir of the website.

-- WillLe - 17 Nov 2017

I've submitted a pull request

-- WillLe - 17 Nov 2017

Hi, Thanks for the patch. We'll have to ponder this a bit. I believe that there were at one point some deployments that wanted certain directories outside of the normal root directory - cgi-bin and lib if I recall. lib being the most difficult to relocate, as we use lib to find all the other directories.

-- GeorgeClark - 21 Nov 2017

I merged your pull request into the Item14530 "Feature" branch based off of master, so that I could more easily do some testing.

You pointed out in the pull request:
On page configure > General settings > File system paths, the subdirs are sill shown in absolute path with a button "Reset to default value $Foswiki::cfg{RootDir}/xxx", but the actually values to be saved are in form "$Foswiki::cfg{RootDir}/xxx". To show the correct form on config page, the should be modified a little bit.

The issue here is that Configure/ sets the expanded paths during bootstrap in the processing of validating the paths by checking for critical files in each directory. That whole section of code would need an overhaul to work with the reference to the RootDir. Never mind. Indeed it's something in that needs fixing.

There is still something not quite right. The definitions in Foswiki.spec need to be uncommented. They are actually no longer bootstrapped. Only the RootDir is bootstrapped. I'll putter with this a bit more when I get some time.

-- GeorgeClark - 21 Nov 2017

I've submitted a pull request: to correct the values displayed on the bin/configure page.

-- WillLe - 26 Nov 2017

Merged into master.

-- GeorgeClark - 10 Mar 2018
Topic revision: r15 - 10 Mar 2018, GeorgeClark - This page was cached on 22 Mar 2018 - 15:46.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License