Bug 336560 - [server] Clean up configuration
Summary: [server] Clean up configuration
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2011-02-07 15:35 EST by John Arthorne CLA
Modified: 2011-09-01 11:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2011-02-07 15:35:42 EST
The configuration preference file could become one of the main ways for administrators to configure the orion server. The preference keys should be cleaned up and made consistent (we currently have "Auth-name" and "everyoneCanCreateUsers"). Also boolean preferences should be avoided where possible because they aren't as flexible. I suggest keys more like our conventions for system properties, e.g.,

orion.auth.name=Form
orion.auth.user.creation=Admin

The value of orion.auth.user.creation would be a comma-separated list of roles that are permitted to create user accounts (replacing everyoneCanCreateUsers).
Comment 1 John Arthorne CLA 2011-05-03 14:59:25 EDT
Related to this, we are steadily growing a set of system properties for configuring the server. So, we have some options set via the preference file, and others set via system properties. System properties are convenient for self-hosting in Eclipse desktop because they can be written straight in the launch configuration. However for a user setting up their own server it is painful because:

- Editing the eclipse.ini is painful on mac (buried inside executable)
- In a shared installation it will be read-only
- The eclipse.ini changes with every build so it is difficult to automate the process of configuring a server (can't just copy a standard eclipse.ini into the location)
- Not dynamic: A server restart is required to change settings, and if you manage to change settings at runtime they will be overwritten on next startup

Here are some system properties we have today:

org.eclipse.orion.server.core.allowedPathPrefixes
orion.storage.admin.default.password
org.eclipse.orion.server.core.projectsWorldReadable
org.eclipse.orion.server.hosting.virtualHosts
Comment 2 John Arthorne CLA 2011-05-11 08:58:26 EDT
I have some ideas on this. I will take it.
Comment 3 Boris Bokowski CLA 2011-05-16 20:43:31 EDT
Having to create a deep folder structure, and the preferences file yourself, is way too complicated. Command line arguments actually compare very favourably to that.
Comment 4 John Arthorne CLA 2011-05-18 16:26:39 EDT
I have done the following so far:

- Internally, we are still using preferences for all configuration properties. This gives us lots of flexibility in the future, such as being able to change properties on the fly, listen for configuration changes, etc. This will allow us to later have an "admin" web UI where these values can be configured while the server is running. For a single user we could launch this admin UI for free in a little SWT browser to enable server configuration.

- The concept of "server configuration file" remains, but now it is more flexible. The file can be anywhere, and can have any name. By default the server will look for a file called "orion.conf" in the current working directory when the server launches. The user/administrator can pick a different location via a system property.

- On startup we populate the "default" preference node with the values from this configuration file. This means if preferences are changed and saved at runtime (for example from an admin UI), they will override whatever values are defined in the server configuration file. This also means if you already have the old configuration file at .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.orion.server.configurator.prefs, those settings will still work.

- I have not yet changed most of the system properties, but I have done a pass over the existing preference keys to make the names more uniform (as I suggested above). 

- The server administration guide has been updated for all changes.

Still working on it...
Comment 5 John Arthorne CLA 2011-05-18 16:27:51 EDT
Also for self-hosters, I have updated the launch configuration to use the file web-ide.conf in the org.eclipse.orion.client.core bundle. This can be used to configure the server by those launching the server from within Eclipse.
Comment 6 Boris Bokowski CLA 2011-05-18 16:46:37 EDT
(In reply to comment #4)
> By default the
> server will look for a file called "orion.conf" in the current working
> directory when the server launches.

Sounds good - but note that on the Mac, the current working directory is deep down inside the Eclipse.app directory (not the directory containing Eclipse.app).
Comment 7 John Arthorne CLA 2011-05-19 09:14:04 EDT
(In reply to comment #6)
> Sounds good - but note that on the Mac, the current working directory is deep
> down inside the Eclipse.app directory (not the directory containing
> Eclipse.app).

What is the easiest solution you can think of for Mac users? With the current story you can specify a server configuration file location on the command line... is that simple enough? I would prefer a story like "drop the file here and start" but don't know where "here" should be on the mac.
Comment 8 Boris Bokowski CLA 2011-05-19 11:30:12 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > Sounds good - but note that on the Mac, the current working directory is deep
> > down inside the Eclipse.app directory (not the directory containing
> > Eclipse.app).
> 
> What is the easiest solution you can think of for Mac users? With the current
> story you can specify a server configuration file location on the command
> line... is that simple enough? I would prefer a story like "drop the file here
> and start" but don't know where "here" should be on the mac.

Not sure.. how about putting the orion.conf file in the "configuration" folder, which is in the same place for all platforms?

Also, at the same time of introducing the configuration file, it would probably be good to rename our executable to "orion" instead of "eclipse", and to rename "Eclipse.app" to "Orion.app".
Comment 9 John Arthorne CLA 2011-05-19 11:40:09 EDT
(In reply to comment #8)
> Also, at the same time of introducing the configuration file, it would probably
> be good to rename our executable to "orion" instead of "eclipse", and to rename
> "Eclipse.app" to "Orion.app".

I have entered bug 346484 for rebranding.
Comment 10 John Arthorne CLA 2011-05-19 16:21:23 EDT
> Not sure.. how about putting the orion.conf file in the "configuration" folder,
> which is in the same place for all platforms?

The configuration folder is really intended for bundles to write out configuration-related state, rather than a place users should mess with. I've opted instead to look in the workspace location. So, you have three options:

- orion.conf in current working directory
- orion.conf in eclipse/serverworkspace directory
- Any file of your choice as specified by a command line argument.
Comment 11 John Arthorne CLA 2011-05-19 16:34:05 EDT
I have now replaced all preferences and system properties with configuration file properties:

orion.file.layout
orion.auth.user.creation
orion.file.defaultSCM
orion.file.allowedPaths
orion.file.anonymous.read
orion.site.virtualHosts

These settings are all explained in the server admin guide:

http://wiki.eclipse.org/Orion/Server_admin_guide

or:

http://localhost:8080/topic/org.eclipse.orion.doc.isv/WikiDoc/Orion/Server_admin_guide/Configuring-the-server.html
Comment 12 John Arthorne CLA 2011-05-19 16:34:33 EDT
All released.