Changeset 338
- Timestamp:
- 05/03/08 09:55:04 (4 years ago)
- Location:
- cleverbox
- Files:
-
- 1 added
- 10 modified
-
branches/0.4/cleverbox/scripts/admin.py (modified) (19 diffs)
-
branches/0.4/debian/control (modified) (1 diff)
-
branches/0.4/debian/postinst (added)
-
branches/0.4/debian/rules (modified) (1 diff)
-
branches/0.4/docs/CHANGELOG (modified) (1 diff)
-
branches/0.4/setup.py (modified) (3 diffs)
-
trunk/cleverbox/model/project.py (modified) (13 diffs)
-
trunk/debian/control (modified) (1 diff)
-
trunk/debian/postinst (modified) (1 diff)
-
trunk/docs/CHANGELOG (modified) (1 diff)
-
trunk/setup.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cleverbox/branches/0.4/cleverbox/scripts/admin.py
r332 r338 69 69 self.envname = envname 70 70 self.prompt = "Cleverbox [%s] > " % self.envname 71 71 72 72 # Check if environment needs an upgrade 73 73 # - open VERSION … … 79 79 print "Please upgrade or downgrade your trac installation." 80 80 print 81 81 82 82 sys.exit(1) 83 83 84 84 env_version = open(os.path.join(self.envname, 'VERSION')).read().strip() 85 85 86 86 # - compare with self._version 87 87 # - if VERSION < self._version : 88 if parse_version(env_version) < parse_version(_version): 88 if parse_version(env_version) < parse_version(_version): 89 89 print "\nCleverbox environment needs to be upgraded. Please run :" 90 90 print " cleverbox-admin %s upgrade\n" % self.envname … … 93 93 # no VERSION file means user wants to create an environment 94 94 pass 95 95 96 96 if env is not None: 97 97 self.__env = env … … 185 185 # root user & group 186 186 # we keep the ssh_user notion for backward compatibility. 187 # this will have to disappear in a future release 187 # this will have to disappear in a future release 188 188 collected_infos['ssh_user'] = 0 189 189 collected_infos['ssh_group'] = 0 … … 191 191 # Host server domain name 192 192 collected_infos['domain'] = raw_input('Domain name > ').strip() 193 193 194 194 # Authentication backend password (if any) 195 195 collected_infos['authbackend_pass'] = raw_input('Authentication backend password (if any) []> ').strip() or '' … … 198 198 dcp = 'default' 199 199 collected_infos['default_profile'] = raw_input('Default configuration profile [%s]> ' % dcp).strip() or dcp 200 200 201 201 # Write ini file 202 202 self._config.add_section('general') … … 214 214 for directive, value in trac_infos.items() : 215 215 self._config.set('trac', directive, str(value)) 216 216 217 217 fh_config = open(os.path.join(self.envname, 'cleverbox.ini'), 'w+') 218 218 self._config.write(fh_config) … … 241 241 for filename in _defaults['profile_files']: 242 242 shutil.copy(collected_infos['assets_dir'] + '/' + filename, os.path.join(self.envname, 'profiles', 'default')) 243 243 244 244 245 245 print … … 251 251 def do_upgrade(self, line=None): 252 252 env_version = open(os.path.join(self.envname, 'VERSION')).read() 253 if parse_version(env_version) < parse_version(_version): 253 if parse_version(env_version) < parse_version(_version): 254 254 from cleverbox.upgrades import upgrades 255 255 i = 1 … … 261 261 break 262 262 i = i + 1 263 263 264 264 265 265 ## help … … 432 432 int(self.getConfig('ssh_user', 'general')), int(self.getConfig('apache_group', 'general')) ) 433 433 os.chmod( os.path.join(collected_infos['home_dir'], 'tmp'), 0775 ) 434 434 435 435 print " Fixed permissions in %s\n" % collected_infos['home_dir'] 436 436 … … 795 795 # -- Revoke all permissions in trac 796 796 self._project_trac_revoke_all_perms( collected_infos ) 797 797 798 798 # -- Trac initial permissions 799 799 self._project_trac_setperms( collected_infos ) … … 801 801 # -- Modifies Trac default conf 802 802 self._project_trac_defaultconf( collected_infos ) 803 803 804 804 # -- Fix perms 805 805 self._project_fix_perms( collected_infos ) … … 870 870 'var/svn', 871 871 infos['short_name'] ) 872 872 873 873 cmd_data = { 'env_path' : trac_env_path, 874 874 'title' : '"%s - %s - Trac"' % (infos['client'], infos['short_name']), … … 878 878 'trac_install_dir' : self.getConfig('lib_dir', 'trac')} 879 879 880 trac_cmd = ' /usr/bin/trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data881 880 trac_cmd = 'trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data 881 882 882 (stdin, stdout, stderr) = os.popen3( trac_cmd ) 883 883 … … 923 923 def _project_trac_revoke_all_perms(self, infos): 924 924 import trac.env 925 925 926 926 trac_env_path = os.path.join( self.getConfig('clients_root', 'general'), 927 927 infos['client'], 928 928 'var/trac', 929 929 infos['short_name'] ) 930 930 931 931 # Revoke all permissions 932 932 trac_env = trac.env.open_environment(trac_env_path) … … 935 935 db_cursor.execute('DELETE FROM permission') 936 936 trac_db.commit() 937 937 938 938 print " Revoked Trac default permissions\n" 939 939 … … 970 970 infos['short_name'], 971 971 'conf','trac.ini' ) 972 os.chmod( trac_ini_path, 0777 ) 972 os.chmod( trac_ini_path, 0777 ) 973 973 974 974 # Subversion repository … … 996 996 Overrides project's default trac.ini with values provided in configuration profile. 997 997 """ 998 998 999 999 # New defaults 1000 1000 tracdefaults_config = ConfigParser.SafeConfigParser() 1001 1001 tracdefaults_config.read(os.path.join(self.envname, 'profiles', infos['profile'], 'trac-defaults.ini')) 1002 1002 1003 1003 # Trac base config file 1004 1004 project_config_path = os.path.join(self.getConfig('clients_root', 'general'), infos['client'], 'var', 'trac', infos['short_name'], 'conf', 'trac.ini') -
cleverbox/branches/0.4/debian/control
r328 r338 2 2 Section: web 3 3 Priority: optional 4 Build-Depends: cdbs (>= 0.4.43), python-all-dev, python-support (>= 0.3), debhelper (>= 4.1.0) 4 Build-Depends: cdbs (>= 0.4.43), python-all-dev, python-support (>= 0.3), debhelper (>= 4.1.0), python-setuptools 5 5 Maintainer: Tristan Rivoallan <tristan@rivoallan.net> 6 6 Standards-Version: 3.7.2 7 7 8 Package: cleverbox 8 Package: cleverbox 9 9 Architecture: all 10 10 Depends: ${python:Depends}, subversion (>=1.4.2), trac (>=0.10), libapache2-mod-python (>=3.2.10), libapache2-svn (>=1.4.2), python-setuptools (>=0.6c3-3) 11 Conflicts: trac-0.10.3 12 Suggests: libapache2-mod-macro 13 Description: Trac and Subversion instances deployment shell 14 The cleverbox provides an interactive command line shell dedicated to the 11 Conflicts: trac-0.10.3 12 Suggests: libapache2-mod-macro 13 Description: Trac and Subversion instances deployment shell 14 The cleverbox provides an interactive command line shell dedicated to the 15 15 deployment and maintenance of trac and subversion instances. 16 It can handle multiple configuration profiles, enabling the deployment 17 of differently flavored type of projects : 16 It can handle multiple configuration profiles, enabling the deployment 17 of differently flavored type of projects : 18 18 trac configuration and permissions, apache configuration templates, etc. 19 Project's main objective is to make your life as simple as possible. 19 Project's main objective is to make your life as simple as possible. 20 20 Thus, it comes with easy installation, easy upgrades and a comprehensive 21 21 documentation. -
cleverbox/branches/0.4/debian/rules
r263 r338 10 10 # Project documentation is superceded by dedicated Debian docs 11 11 rm -r debian/cleverbox/usr/share/doc 12 13 binary-install/cleverbox::14 15 # Enable mandatory apache modules16 a2enmod dav_fs17 a2enmod dav_svn18 19 # Reload apache20 /etc/init.d/apache2 reload -
cleverbox/branches/0.4/docs/CHANGELOG
r330 r338 4 4 5 5 == Changelog == 6 === 2008-05-14 | 0.4.4-beta === 6 7 8 see http://www.clever-age.org/trac/milestone/cleverbox-0.4.4 for details. 9 10 ==== Fixes ==== 11 12 * fixed Cleverbox does not work if trac-admin script is in a non standard location (#48) 13 * fixed trac version dependency in setup.py 14 * debian packaging : binary-install actions should go in postinst file (#46) 15 * debian packaging : added `python-setuptools` to build dependencies 7 16 === 2008-02-29 | 0.4.3-beta === 8 17 -
cleverbox/branches/0.4/setup.py
r332 r338 22 22 23 23 setup( 24 24 25 25 # Project identity 26 26 name='Cleverbox', … … 32 32 url='http://www.clever-age.org/trac/wiki/cleverbox', 33 33 license='GPLv3', 34 34 35 35 # Files 36 36 packages=find_packages(), … … 39 39 ('/usr/share/doc/cleverbox', glob('docs/*')), 40 40 ('/usr/share/man/man1', glob('scripts/*.1'))], 41 41 42 42 # Dependencies 43 install_requires=['setuptools>=0.6b1', 'trac>=0.10.4' ]43 install_requires=['setuptools>=0.6b1', 'trac>=0.10.4', 'trac<=0.10.999'] 44 44 ) -
cleverbox/trunk/cleverbox/model/project.py
r267 r338 36 36 If "status" parameter has a value (either "enabled" or "disabled"), returned list is limited to project with this status. 37 37 """ 38 38 39 39 list_projects = [] 40 40 … … 72 72 if not exists(environment, client_name, project_name): 73 73 raise Exception, 'Client "%s" has no project "%s".' % (client_name, project_name) 74 74 75 75 try: 76 76 os.unlink(os.path.join(environment.get_path('projects-enabled'), '%s-%s' % (client_name, project_name))) … … 85 85 Enables project in environment. 86 86 """ 87 87 88 88 if not exists(environment, client_name, project_name): 89 89 raise Exception, 'Client "%s" has no project "%s"' % (client_name, project_name) 90 90 91 91 target = os.path.join(environment.get_path('projects-available'), 92 92 '%s-%s' % (client_name, project_name)) … … 104 104 Creates a new project for client in environment. 105 105 """ 106 106 107 107 # Merging for consistency 108 108 parameters['client'] = client_name … … 146 146 # -- Modifies Trac default conf 147 147 _trac_defaultconf(environment, parameters) 148 148 149 149 # -- Fix perms 150 150 _fix_perms(environment, parameters) … … 217 217 'trac_install_dir' : environment.config.get('trac', 'lib_dir')} 218 218 219 trac_cmd = ' /usr/bin/trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data219 trac_cmd = 'trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data 220 220 221 221 (stdin, stdout, stderr) = os.popen3( trac_cmd ) … … 239 239 perms_config = ConfigParser.SafeConfigParser() 240 240 perms_config.read(os.path.join(environment.path, 'profiles', infos['profile'], 'permissions.ini')) 241 241 242 242 # Grant permissions as defined in permissions.ini 243 243 for profile in perms_config.options('trac'): … … 253 253 'subject' : admin_login, 254 254 'perms' : 'TRAC_ADMIN'} ) 255 255 256 256 print " Trac initial permissions set (admin rights given to '%s')\n" % admin_login 257 257 258 258 def _trac_revoke_all_perms(environment, infos): 259 259 import trac.env 260 260 261 261 trac_env_path = os.path.join( environment.config.get('general', 'clients_root'), 262 262 infos['client'], 263 263 'var/trac', 264 264 infos['short_name'] ) 265 265 266 266 # Revoke all permissions 267 267 trac_env = trac.env.open_environment(trac_env_path) … … 270 270 db_cursor.execute('DELETE FROM permission') 271 271 trac_db.commit() 272 272 273 273 print " Revoked Trac default permissions\n" 274 274 … … 278 278 client_name = infos['client'] 279 279 project_name = infos['short_name'] 280 280 281 281 permissions = { 282 282 os.path.join(environment.get_path(), 'projects-available', client_name + '-' + project_name) : (0640, 'root', 'root'), … … 299 299 Overrides project's default trac.ini with values provided in configuration profile. 300 300 """ 301 301 302 302 # New defaults 303 303 tracdefaults_config = ConfigParser.SafeConfigParser() 304 304 tracdefaults_config.read(os.path.join(environment.path, 'profiles', infos['profile'], 'trac-defaults.ini')) 305 305 306 306 # Trac base config file 307 307 project_config_path = os.path.join(environment.config.get('general', 'clients_root'), infos['client'], 'var', 'trac', infos['short_name'], 'conf', 'trac.ini') … … 318 318 default_option = tracdefaults_config.get(section, option) 319 319 tracproject_config.set(section, option, default_option) 320 320 321 321 # Add cleverbox section 322 322 # The variables in this section can be used for string substitution across the file … … 326 326 'authbackend_pass' : environment.config.get('general', 'authbackend_pass'), 327 327 'trac_install_dir' : environment.config.get('trac', 'lib_dir'), 328 'domain_name' : environment.config.get('general', 'domain')} 328 'domain_name' : environment.config.get('general', 'domain')} 329 329 tracproject_config.add_section('cleverbox') 330 330 for (option, value) in cleverbox_options.items(): -
cleverbox/trunk/debian/control
r328 r338 2 2 Section: web 3 3 Priority: optional 4 Build-Depends: cdbs (>= 0.4.43), python-all-dev, python-support (>= 0.3), debhelper (>= 4.1.0) 4 Build-Depends: cdbs (>= 0.4.43), python-all-dev, python-support (>= 0.3), debhelper (>= 4.1.0), python-setuptools 5 5 Maintainer: Tristan Rivoallan <tristan@rivoallan.net> 6 Standards-Version: 3.7. 26 Standards-Version: 3.7.3 7 7 8 8 Package: cleverboxfuture 9 9 Architecture: all 10 10 Depends: ${python:Depends}, subversion (>=1.4.2), trac (>=0.10), libapache2-mod-python (>=3.2.10), libapache2-svn (>=1.4.2), python-setuptools (>=0.6c3-3) 11 Suggests: libapache2-mod-macro 11 Suggests: libapache2-mod-macro 12 12 Conflicts: cleverbox, trac-0.10.3 13 Description: Trac and Subversion instances deployment shell 14 The cleverbox provides an interactive command line shell dedicated to the 13 Description: Trac and Subversion instances deployment shell 14 The cleverbox provides an interactive command line shell dedicated to the 15 15 deployment and maintenance of trac and subversion instances. 16 It can handle multiple configuration profiles, enabling the deployment 17 of differently flavored type of projects : 16 It can handle multiple configuration profiles, enabling the deployment 17 of differently flavored type of projects : 18 18 trac configuration and permissions, apache configuration templates, etc. 19 Project's main objective is to make your life as simple as possible. 19 Project's main objective is to make your life as simple as possible. 20 20 Thus, it comes with easy installation, easy upgrades and a comprehensive 21 21 documentation. -
cleverbox/trunk/debian/postinst
r337 r338 26 26 27 27 # Reload apache 28 /etc/init.d/apache2 reload28 invoke-rc.d apache2 reload 29 29 ;; 30 30 -
cleverbox/trunk/docs/CHANGELOG
r330 r338 21 21 * Fixed trac.ini string substitution 22 22 * Enhanced documentation 23 24 === 2008-05-14 | 0.4.4-beta === 25 26 see http://www.clever-age.org/trac/milestone/cleverbox-0.4.4 for details. 27 28 ==== Fixes ==== 29 30 * fixed Cleverbox does not work if trac-admin script is in a non standard location (#48) 31 * fixed trac version dependency in setup.py 32 * debian packaging : binary-install actions should go in postinst file (#46) 33 * debian packaging : added `python-setuptools` to build dependencies 23 34 24 35 === 2008-02-29 | 0.4.3-beta === -
cleverbox/trunk/setup.py
r328 r338 18 18 """Cleverbox : Script for automating multiple trac instances deployment and maintenance. 19 19 20 The Cleverbox sits on top of Trac (http://trac.edgewall.org) and Subversion (http://subversion.tigris.org). 20 The Cleverbox sits on top of Trac (http://trac.edgewall.org) and Subversion (http://subversion.tigris.org). 21 21 It provides an interactive shell for deploying and maintaining instances of both projects. 22 22 """ … … 41 41 42 42 setup( 43 43 44 44 # Project identity 45 45 name='Cleverbox', … … 52 52 classifiers = filter(None, classifiers.split("\n")), 53 53 long_description = "\n".join(doclines[2:]), 54 54 55 55 # Files 56 56 packages=find_packages(), … … 58 58 data_files=[('/usr/share/cleverbox', glob('assets/*')), 59 59 ('/usr/share/doc/cleverbox', glob('docs/*')), 60 ('/usr/share/man/man1', glob('scripts/*.1'))],61 60 ('/usr/share/man/man1', glob('scripts/*.1'))], 61 62 62 # Dependencies 63 install_requires=['setuptools>=0.6b1', 'trac>=0.10.4' ]63 install_requires=['setuptools>=0.6b1', 'trac>=0.10.4', 'trac<=0.10.999'] 64 64 )
