Edgewall Software
Modify

Opened 5 years ago

Last modified 15 months ago

#13247 new enhancement

Log warning if necessary environment directories are not writeable

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: general Version:
Severity: normal Keywords: environment
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The following directories need to be writable:

  • files
  • conf: only if web administration is used. A warning is already raised ("Warning: Error writing to trac.ini, make sure it is writable by the web server. Your changes have not been saved.), but it could still be useful to log at environment startup.

If file logging is used, log must be writable, but the following error is already raised:

Internal Server Error

TracError: IOError: [Errno 13] Permission denied: u'/Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.4/log/trac.log'

If SQLite is used, db must be writable, but an error is already raised/logged:

14:46:59 Trac[env] WARNING: Component <Component trac.db.api.DatabaseManager> failed with ConfigurationError: The user <code>rjollos</code> requires read _and_ write permissions to the database file <code>/Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.4/db/trac.db</code> and the directory it is located in.

We could log a warning in Environment.verify if the directories are not writable. Or we could have the associated module log the warning, such as trac.admin.web_ui for conf.

I'd also like to add some guidance to TracInstall or TracEnvironment on what files and directories need to be writable by the web server user. TracEnvironment says

The user under which the web server runs will require file system write permission to the environment directory and all the files inside.

However, that's not very precise. Write permissions aren't needed, and may be undesirable for security reasons, for the htdocs, plugins and templates directories.

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 5 years ago

Keywords: environment added
Milestone: 1.4.2
Owner: set to Ryan J Ollos
Status: newassigned

in reply to:  description comment:2 by Ryan J Ollos, 5 years ago

Replying to Ryan J Ollos:

However, that's not very precise. Write permissions aren't needed, and may be undesirable for security reasons, for the htdocs, plugins and templates directories.

plugins needs to be writable if uploading plugins through /admin/general/plugin. I've never considered that to work very well, maybe we should just remove the feature?

Considering check like in SO:2113511/121694 for logging warnings.

comment:3 by Ryan J Ollos, 5 years ago

Milestone: 1.4.2next-stable-1.4.x

comment:4 by Ryan J Ollos, 15 months ago

Owner: Ryan J Ollos removed
Status: assignednew

comment:5 by Ryan J Ollos, 15 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.