Back to index

moin  1.9.0~rc2
config.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 """
00003  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
00004  * Copyright (C) 2003-2009 Frederico Caldeira Knabben
00005  *
00006  * == BEGIN LICENSE ==
00007  *
00008  * Licensed under the terms of any of the following licenses at your
00009  * choice:
00010  *
00011  *  - GNU General Public License Version 2 or later (the "GPL")
00012  *    http://www.gnu.org/licenses/gpl.html
00013  *
00014  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
00015  *    http://www.gnu.org/licenses/lgpl.html
00016  *
00017  *  - Mozilla Public License Version 1.1 or later (the "MPL")
00018  *    http://www.mozilla.org/MPL/MPL-1.1.html
00019  *
00020  * == END LICENSE ==
00021  *
00022  * Configuration file for the File Manager Connector for Python
00023 """
00024 
00025 # INSTALLATION NOTE: You must set up your server environment accordingly to run
00026 # python scripts. This connector requires Python 2.4 or greater.
00027 #
00028 # Supported operation modes:
00029 #  * WSGI (recommended): You'll need apache + mod_python + modpython_gateway
00030 #                        or any web server capable of the WSGI python standard
00031 #  * Plain Old CGI:      Any server capable of running standard python scripts
00032 #                        (although mod_python is recommended for performance)
00033 #                        This was the previous connector version operation mode
00034 #
00035 # If you're using Apache web server, replace the htaccess.txt to to .htaccess,
00036 # and set the proper options and paths.
00037 # For WSGI and mod_python, you may need to download modpython_gateway from:
00038 # http://projects.amor.org/misc/svn/modpython_gateway.py and copy it in this
00039 # directory.
00040 
00041 
00042 # SECURITY: You must explicitly enable this "connector". (Set it to "True").
00043 # WARNING: don't just set "ConfigIsEnabled = True", you must be sure that only
00044 #             authenticated users can access this file or use some kind of session checking.
00045 Enabled = False
00046 
00047 # Path to user files relative to the document root.
00048 UserFilesPath = '/userfiles/'
00049 
00050 # Fill the following value it you prefer to specify the absolute path for the
00051 # user files directory. Useful if you are using a virtual directory, symbolic
00052 # link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
00053 # Attention: The above 'UserFilesPath' must point to the same directory.
00054 # WARNING: GetRootPath may not work in virtual or mod_python configurations, and
00055 # may not be thread safe. Use this configuration parameter instead.
00056 UserFilesAbsolutePath = ''
00057 
00058 # Due to security issues with Apache modules, it is recommended to leave the
00059 # following setting enabled.
00060 ForceSingleExtension = True
00061 
00062 # What the user can do with this connector
00063 ConfigAllowedCommands = [ 'QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder' ]
00064 
00065 # Allowed Resource Types
00066 ConfigAllowedTypes = ['File', 'Image', 'Flash', 'Media']
00067 
00068 # After file is uploaded, sometimes it is required to change its permissions
00069 # so that it was possible to access it at the later time.
00070 # If possible, it is recommended to set more restrictive permissions, like 0755.
00071 # Set to 0 to disable this feature.
00072 # Note: not needed on Windows-based servers.
00073 ChmodOnUpload = 0755
00074 
00075 # See comments above.
00076 # Used when creating folders that does not exist.
00077 ChmodOnFolderCreate = 0755
00078 
00079 # Do not touch this 3 lines, see "Configuration settings for each Resource Type"
00080 AllowedExtensions = {}; DeniedExtensions = {};
00081 FileTypesPath = {}; FileTypesAbsolutePath = {};
00082 QuickUploadPath = {}; QuickUploadAbsolutePath = {};
00083 
00084 #      Configuration settings for each Resource Type
00085 #
00086 #      - AllowedExtensions: the possible extensions that can be allowed.
00087 #             If it is empty then any file type can be uploaded.
00088 #      - DeniedExtensions: The extensions that won't be allowed.
00089 #             If it is empty then no restrictions are done here.
00090 #
00091 #      For a file to be uploaded it has to fulfill both the AllowedExtensions
00092 #      and DeniedExtensions (that's it: not being denied) conditions.
00093 #
00094 #      - FileTypesPath: the virtual folder relative to the document root where
00095 #             these resources will be located.
00096 #             Attention: It must start and end with a slash: '/'
00097 #
00098 #      - FileTypesAbsolutePath: the physical path to the above folder. It must be
00099 #             an absolute path.
00100 #             If it's an empty string then it will be autocalculated.
00101 #             Useful if you are using a virtual directory, symbolic link or alias.
00102 #             Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
00103 #             Attention: The above 'FileTypesPath' must point to the same directory.
00104 #             Attention: It must end with a slash: '/'
00105 #
00106 #
00107 #      - QuickUploadPath: the virtual folder relative to the document root where
00108 #             these resources will be uploaded using the Upload tab in the resources
00109 #             dialogs.
00110 #             Attention: It must start and end with a slash: '/'
00111 #
00112 #      - QuickUploadAbsolutePath: the physical path to the above folder. It must be
00113 #             an absolute path.
00114 #             If it's an empty string then it will be autocalculated.
00115 #             Useful if you are using a virtual directory, symbolic link or alias.
00116 #             Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
00117 #             Attention: The above 'QuickUploadPath' must point to the same directory.
00118 #             Attention: It must end with a slash: '/'
00119 
00120 AllowedExtensions['File']          = ['7z','aiff','asf','avi','bmp','csv','doc','fla','flv','gif','gz','gzip','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','ods','odt','pdf','png','ppt','pxd','qt','ram','rar','rm','rmi','rmvb','rtf','sdc','sitd','swf','sxc','sxw','tar','tgz','tif','tiff','txt','vsd','wav','wma','wmv','xls','xml','zip']
00121 DeniedExtensions['File']           = []
00122 FileTypesPath['File']                     = UserFilesPath + 'file/'
00123 FileTypesAbsolutePath['File']      = (not UserFilesAbsolutePath == '') and (UserFilesAbsolutePath + 'file/') or ''
00124 QuickUploadPath['File']                   = FileTypesPath['File']
00125 QuickUploadAbsolutePath['File']    = FileTypesAbsolutePath['File']
00126 
00127 AllowedExtensions['Image']         = ['bmp','gif','jpeg','jpg','png']
00128 DeniedExtensions['Image']          = []
00129 FileTypesPath['Image']                    = UserFilesPath + 'image/'
00130 FileTypesAbsolutePath['Image']     = (not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'image/' or ''
00131 QuickUploadPath['Image']           = FileTypesPath['Image']
00132 QuickUploadAbsolutePath['Image']= FileTypesAbsolutePath['Image']
00133 
00134 AllowedExtensions['Flash']         = ['swf','flv']
00135 DeniedExtensions['Flash']          = []
00136 FileTypesPath['Flash']                    = UserFilesPath + 'flash/'
00137 FileTypesAbsolutePath['Flash']     = ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'flash/' or ''
00138 QuickUploadPath['Flash']           = FileTypesPath['Flash']
00139 QuickUploadAbsolutePath['Flash']= FileTypesAbsolutePath['Flash']
00140 
00141 AllowedExtensions['Media']         = ['aiff','asf','avi','bmp','fla', 'flv','gif','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','png','qt','ram','rm','rmi','rmvb','swf','tif','tiff','wav','wma','wmv']
00142 DeniedExtensions['Media']          = []
00143 FileTypesPath['Media']                    = UserFilesPath + 'media/'
00144 FileTypesAbsolutePath['Media']     = ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'media/' or ''
00145 QuickUploadPath['Media']           = FileTypesPath['Media']
00146 QuickUploadAbsolutePath['Media']= FileTypesAbsolutePath['Media']