Move all configuration files into user-editable folders
Most of the Plastic Server/Client configuration files reside in the installation folder of PlasticSCM (on both Windows and Macs). To change them you need superuser privileges. If you decide to reinstall/upgrade PlasticSCM these files get overwritten (e.g. when you install the Debian packages). So the settings should really go to a place where a normal user can edit them and where they will not get overwritten by an upgrade.
On Linux/Mac this is partially done for the client side with the .plastic4 folder inside the user's home, but things like the logging configuration or configuration for the CM tool still need to be done in the installation folder. Also the whole server configuration should get a dedicated folder (e.g. /etc/plasticscm on Linux, Library/ApplicationSupport on Macs, and some similar folder on Windows).
It seems the answer clarified the question and there’s no implementation to do.
-
Jan Thomä commented
I just tried to install and configure a PlasticSCM server on the mac and it seems it's stil trying to write files into non-writable directories. I got this exception when trying to set up a license token:
Unhandled Exception:
System.UnauthorizedAccessException: Access to the path "/Applications/PlasticSCMServer.app/Contents/MonoBundle/plasticd.token.lic" is denied.
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool,System.Text.Encoding)
at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
at System.IO.File.WriteAllText (System.String path, System.String contents) [0x00000] in <filename unknown>:0
at Codice.CM.Server.LicenseHelper.WriteLicenseToken (System.String token) [0x00000] in <filename unknown>:0
at aev.a (System.String A_0) [0x00000] in <filename unknown>:0
at aev.c (System.String[] A_0) [0x00000] in <filename unknown>:0
at aev.a (System.String[] A_0) [0x00000] in <filename unknown>:0You see it's still trying to write the license file into the application folder where it clearly doesn't belong.
-
Hi Jan,
It is also available on Windows with the AppData/Local/plastic4 directory. It is exactly the same concept.
Almost all config files (except the ones that are tied to the workspace) can be set on the install directory (to override the defaults), or the plastic4 directory.
The only files left by default on the install dir are the log config files. They "could" be changed for the client, but not for the server (you can't put server config on a user directory). I agree they could be placed under /etc to stick to Linux guidelines (while we won't do that for Windows, because autocontained directories that not pollute the entire filesystem are much better), but ... well, I don't think this is a major issues. Linux itself is broken in terms of packaging so I don't think the /etc thing will make such a big difference.
To summarize:
* We could read log config from .plastic4 if it doesn't exist in the client path. Fine.
* We could read server config files on Linux from /etc/plasticscm if they're not present on the install dir.And definitely the files shouldn't be overwritten but I think we already fixed that... I'll check