Show More
@@ -1,43 +1,44 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Copyright (C) 2013-2017 RhodeCode GmbH |
|
4 | 4 | # |
|
5 | 5 | # This program is free software: you can redistribute it and/or modify |
|
6 | 6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
7 | 7 | # (only), as published by the Free Software Foundation. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
|
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 | 16 | # |
|
17 | 17 | # This program is dual-licensed. If you wish to learn more about the |
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | |
|
22 | 22 | from rhodecode.lib.paster_commands import BasePasterCommand |
|
23 | 23 | |
|
24 | 24 | |
|
25 | 25 | class Command(BasePasterCommand): |
|
26 | 26 | """ |
|
27 | 27 | Start the celery worker |
|
28 | 28 | |
|
29 | 29 | Starts the celery worker that uses a paste.deploy configuration |
|
30 | 30 | file. |
|
31 | 31 | """ |
|
32 |
usage = 'CONFIG_FILE |
|
|
32 | usage = 'CONFIG_FILE' | |
|
33 | 33 | summary = __doc__.splitlines()[0] |
|
34 | 34 | description = "".join(__doc__.splitlines()[2:]) |
|
35 | 35 | |
|
36 | 36 | parser = BasePasterCommand.standard_parser(quiet=True) |
|
37 | 37 | |
|
38 | 38 | def update_parser(self): |
|
39 | 39 | pass |
|
40 | 40 | |
|
41 | 41 | def command(self): |
|
42 | 42 | cmd = 'celery worker --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file |
|
43 | raise Exception('This Command is deprecated please run: %s' % cmd) No newline at end of file | |
|
43 | raise Exception('This Command is deprecated please run: %s' % cmd) | |
|
44 |
@@ -1,145 +1,43 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Copyright (C) 2010-2017 RhodeCode GmbH |
|
4 | 4 | # |
|
5 | 5 | # This program is free software: you can redistribute it and/or modify |
|
6 | 6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
7 | 7 | # (only), as published by the Free Software Foundation. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
|
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 | 16 | # |
|
17 | 17 | # This program is dual-licensed. If you wish to learn more about the |
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | import os | |
|
22 | import sys | |
|
23 | from paste.script.appinstall import AbstractInstallCommand | |
|
24 | from paste.script.command import BadCommand | |
|
25 | from paste.deploy import appconfig | |
|
26 | 21 | |
|
27 | # fix rhodecode import | |
|
28 | from os.path import dirname as dn | |
|
29 | rc_path = dn(dn(dn(os.path.realpath(__file__)))) | |
|
30 | sys.path.append(rc_path) | |
|
22 | from rhodecode.lib.paster_commands import BasePasterCommand | |
|
31 | 23 | |
|
32 | 24 | |
|
33 |
class Command( |
|
|
34 | ||
|
35 | default_verbosity = 1 | |
|
36 | max_args = 1 | |
|
37 | min_args = 1 | |
|
38 | summary = "Setup an application, given a config file" | |
|
39 | usage = "CONFIG_FILE" | |
|
40 | group_name = "RhodeCode" | |
|
41 | ||
|
42 | description = """\ | |
|
43 | ||
|
44 | Setup RhodeCode according to its configuration file. This is | |
|
45 | the second part of a two-phase web application installation | |
|
46 | process (the first phase is prepare-app). The setup process | |
|
47 | consist of things like setting up databases, creating super user | |
|
25 | class Command(BasePasterCommand): | |
|
48 | 26 |
""" |
|
27 | Start the celery worker | |
|
49 | 28 |
|
|
50 | parser = AbstractInstallCommand.standard_parser( | |
|
51 | simulate=True, quiet=True, interactive=True) | |
|
52 | parser.add_option( | |
|
53 | '--user', | |
|
54 | action='store', | |
|
55 | dest='username', | |
|
56 | default=None, | |
|
57 | help='Admin Username') | |
|
58 | parser.add_option( | |
|
59 | '--email', | |
|
60 | action='store', | |
|
61 | dest='email', | |
|
62 | default=None, | |
|
63 | help='Admin Email') | |
|
64 | parser.add_option( | |
|
65 | '--password', | |
|
66 | action='store', | |
|
67 | dest='password', | |
|
68 | default=None, | |
|
69 | help='Admin password min 6 chars') | |
|
70 | parser.add_option( | |
|
71 | '--api-key', | |
|
72 | action='store', | |
|
73 | dest='api_key', | |
|
74 | help='Initial API key for the admin user') | |
|
75 | parser.add_option( | |
|
76 | '--repos', | |
|
77 | action='store', | |
|
78 | dest='repos_location', | |
|
79 | default=None, | |
|
80 | help='Absolute path to repositories location') | |
|
81 | parser.add_option( | |
|
82 | '--name', | |
|
83 | action='store', | |
|
84 | dest='section_name', | |
|
85 | default=None, | |
|
86 | help='The name of the section to set up (default: app:main)') | |
|
87 | parser.add_option( | |
|
88 | '--force-yes', | |
|
89 | action='store_true', | |
|
90 | dest='force_ask', | |
|
91 | default=None, | |
|
92 | help='Force yes to every question') | |
|
93 | parser.add_option( | |
|
94 | '--force-no', | |
|
95 | action='store_false', | |
|
96 | dest='force_ask', | |
|
97 | default=None, | |
|
98 | help='Force no to every question') | |
|
99 | parser.add_option( | |
|
100 | '--public-access', | |
|
101 | action='store_true', | |
|
102 | dest='public_access', | |
|
103 | default=None, | |
|
104 | help='Enable public access on this installation (default)') | |
|
105 | parser.add_option( | |
|
106 | '--no-public-access', | |
|
107 | action='store_false', | |
|
108 | dest='public_access', | |
|
109 | default=None, | |
|
110 | help='Disable public access on this installation ') | |
|
29 | Starts the celery worker that uses a paste.deploy configuration | |
|
30 | file. | |
|
31 | """ | |
|
32 | usage = 'CONFIG_FILE [celeryd options...]' | |
|
33 | summary = __doc__.splitlines()[0] | |
|
34 | description = "".join(__doc__.splitlines()[2:]) | |
|
35 | ||
|
36 | parser = BasePasterCommand.standard_parser(quiet=True) | |
|
37 | ||
|
38 | def update_parser(self): | |
|
39 | pass | |
|
111 | 40 | |
|
112 | 41 | def command(self): |
|
113 | config_spec = self.args[0] | |
|
114 | section = self.options.section_name | |
|
115 | if section is None: | |
|
116 | if '#' in config_spec: | |
|
117 | config_spec, section = config_spec.split('#', 1) | |
|
118 | else: | |
|
119 | section = 'main' | |
|
120 | if ':' not in section: | |
|
121 | plain_section = section | |
|
122 | section = 'app:' + section | |
|
123 | else: | |
|
124 | plain_section = section.split(':', 1)[0] | |
|
125 | if not config_spec.startswith('config:'): | |
|
126 | config_spec = 'config:' + config_spec | |
|
127 | if plain_section != 'main': | |
|
128 | config_spec += '#' + plain_section | |
|
129 | config_file = config_spec[len('config:'):].split('#', 1)[0] | |
|
130 | config_file = os.path.join(os.getcwd(), config_file) | |
|
131 | self.logging_file_config(config_file) | |
|
132 | conf = appconfig(config_spec, relative_to=os.getcwd()) | |
|
133 | ep_name = conf.context.entry_point_name | |
|
134 | ep_group = conf.context.protocol | |
|
135 | dist = conf.context.distribution | |
|
136 | if dist is None: | |
|
137 | raise BadCommand( | |
|
138 | "The section %r is not the application (probably a filter). " | |
|
139 | "You should add #section_name, where section_name is the " | |
|
140 | "section that configures your application" % plain_section) | |
|
141 | installer = self.get_installer(dist, ep_group, ep_name) | |
|
142 | installer.setup_config( | |
|
143 | self, config_file, section, self.sysconfig_install_vars(installer)) | |
|
144 | self.call_sysconfig_functions( | |
|
145 | 'post_setup_hook', installer, config_file) | |
|
42 | cmd = 'rc-setup-app %s' % self.path_to_ini_file | |
|
43 | raise Exception('This Command is deprecated please run: %s' % cmd) |
@@ -1,62 +1,63 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Copyright (C) 2010-2017 RhodeCode GmbH |
|
4 | 4 | # |
|
5 | 5 | # This program is free software: you can redistribute it and/or modify |
|
6 | 6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
7 | 7 | # (only), as published by the Free Software Foundation. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
|
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 | 16 | # |
|
17 | 17 | # This program is dual-licensed. If you wish to learn more about the |
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from rhodecode.lib.paster_commands import BasePasterCommand, Command |
|
24 | 24 | |
|
25 | 25 | log = logging.getLogger(__name__) |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | class UpgradeDb(BasePasterCommand): |
|
29 | 29 | """Command used for paster to upgrade our database to newer version |
|
30 | 30 | """ |
|
31 | 31 | |
|
32 | 32 | max_args = 1 |
|
33 | 33 | min_args = 1 |
|
34 | 34 | |
|
35 | 35 | usage = "CONFIG_FILE" |
|
36 | 36 | summary = "Upgrades current db to newer version" |
|
37 | 37 | group_name = "RhodeCode" |
|
38 | 38 | |
|
39 | 39 | parser = Command.standard_parser(verbose=True) |
|
40 | 40 | |
|
41 | 41 | def command(self): |
|
42 | 42 | from rhodecode.lib.rc_commands import upgrade_db |
|
43 | 43 | upgrade_db.command( |
|
44 | 44 | self.path_to_ini_file, self.options.__dict__.get('force_ask')) |
|
45 | 45 | |
|
46 | 46 | def update_parser(self): |
|
47 | 47 | self.parser.add_option('--sql', |
|
48 | 48 | action='store_true', |
|
49 | 49 | dest='just_sql', |
|
50 | 50 | help="Prints upgrade sql for further investigation", |
|
51 | 51 | default=False) |
|
52 | 52 | |
|
53 | 53 | self.parser.add_option('--force-yes', |
|
54 | 54 | action='store_true', |
|
55 | 55 | dest='force_ask', |
|
56 | 56 | default=None, |
|
57 | 57 | help='Force yes to every question') |
|
58 | 58 | self.parser.add_option('--force-no', |
|
59 | 59 | action='store_false', |
|
60 | 60 | dest='force_ask', |
|
61 | 61 | default=None, |
|
62 | help='Force no to every question') No newline at end of file | |
|
62 | help='Force no to every question') | |
|
63 |
@@ -1,184 +1,183 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Copyright (C) 2010-2017 RhodeCode GmbH |
|
4 | 4 | # |
|
5 | 5 | # This program is free software: you can redistribute it and/or modify |
|
6 | 6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
7 | 7 | # (only), as published by the Free Software Foundation. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
|
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 | 16 | # |
|
17 | 17 | # This program is dual-licensed. If you wish to learn more about the |
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | # Import early to make sure things are patched up properly |
|
22 | 22 | from setuptools import setup, find_packages |
|
23 | 23 | |
|
24 | 24 | import os |
|
25 | 25 | import sys |
|
26 | 26 | import pkgutil |
|
27 | 27 | import platform |
|
28 | 28 | |
|
29 | 29 | from pip.download import PipSession |
|
30 | 30 | from pip.req import parse_requirements |
|
31 | 31 | |
|
32 | 32 | from codecs import open |
|
33 | 33 | |
|
34 | 34 | |
|
35 | 35 | if sys.version_info < (2, 7): |
|
36 | 36 | raise Exception('RhodeCode requires Python 2.7 or later') |
|
37 | 37 | |
|
38 | 38 | here = os.path.abspath(os.path.dirname(__file__)) |
|
39 | 39 | |
|
40 | 40 | # defines current platform |
|
41 | 41 | __platform__ = platform.system() |
|
42 | 42 | __license__ = 'AGPLv3, and Commercial License' |
|
43 | 43 | __author__ = 'RhodeCode GmbH' |
|
44 | 44 | __url__ = 'https://code.rhodecode.com' |
|
45 | 45 | is_windows = __platform__ in ('Windows',) |
|
46 | 46 | |
|
47 | 47 | |
|
48 | 48 | def _get_requirements(req_filename, exclude=None, extras=None): |
|
49 | 49 | extras = extras or [] |
|
50 | 50 | exclude = exclude or [] |
|
51 | 51 | |
|
52 | 52 | try: |
|
53 | 53 | parsed = parse_requirements( |
|
54 | 54 | os.path.join(here, req_filename), session=PipSession()) |
|
55 | 55 | except TypeError: |
|
56 | 56 | # try pip < 6.0.0, that doesn't support session |
|
57 | 57 | parsed = parse_requirements(os.path.join(here, req_filename)) |
|
58 | 58 | |
|
59 | 59 | requirements = [] |
|
60 | 60 | for ir in parsed: |
|
61 | 61 | if ir.req and ir.name not in exclude: |
|
62 | 62 | requirements.append(str(ir.req)) |
|
63 | 63 | return requirements + extras |
|
64 | 64 | |
|
65 | 65 | |
|
66 | 66 | # requirements extract |
|
67 | 67 | setup_requirements = ['PasteScript', 'pytest-runner'] |
|
68 | 68 | install_requirements = _get_requirements( |
|
69 | 69 | 'requirements.txt', exclude=['setuptools', 'entrypoints']) |
|
70 | 70 | test_requirements = _get_requirements( |
|
71 | 71 | 'requirements_test.txt', extras=['configobj']) |
|
72 | 72 | |
|
73 | 73 | |
|
74 | 74 | def get_version(): |
|
75 | 75 | version = pkgutil.get_data('rhodecode', 'VERSION') |
|
76 | 76 | return version.strip() |
|
77 | 77 | |
|
78 | 78 | |
|
79 | 79 | # additional files that goes into package itself |
|
80 | 80 | package_data = { |
|
81 | 81 | '': ['*.txt', '*.rst'], |
|
82 | 82 | 'configs': ['*.ini'], |
|
83 | 83 | 'rhodecode': ['VERSION', 'i18n/*/LC_MESSAGES/*.mo', ], |
|
84 | 84 | } |
|
85 | 85 | |
|
86 | 86 | description = 'Source Code Management Platform' |
|
87 | 87 | keywords = ' '.join([ |
|
88 | 88 | 'rhodecode', 'mercurial', 'git', 'svn', |
|
89 | 89 | 'code review', |
|
90 | 90 | 'repo groups', 'ldap', 'repository management', 'hgweb', |
|
91 | 91 | 'hgwebdir', 'gitweb', 'serving hgweb', |
|
92 | 92 | ]) |
|
93 | 93 | |
|
94 | 94 | |
|
95 | 95 | # README/DESCRIPTION generation |
|
96 | 96 | readme_file = 'README.rst' |
|
97 | 97 | changelog_file = 'CHANGES.rst' |
|
98 | 98 | try: |
|
99 | 99 | long_description = open(readme_file).read() + '\n\n' + \ |
|
100 | 100 | open(changelog_file).read() |
|
101 | 101 | except IOError as err: |
|
102 | 102 | sys.stderr.write( |
|
103 | 103 | "[WARNING] Cannot find file specified as long_description (%s)\n " |
|
104 | 104 | "or changelog (%s) skipping that file" % (readme_file, changelog_file)) |
|
105 | 105 | long_description = description |
|
106 | 106 | |
|
107 | 107 | |
|
108 | 108 | setup( |
|
109 | 109 | name='rhodecode-enterprise-ce', |
|
110 | 110 | version=get_version(), |
|
111 | 111 | description=description, |
|
112 | 112 | long_description=long_description, |
|
113 | 113 | keywords=keywords, |
|
114 | 114 | license=__license__, |
|
115 | 115 | author=__author__, |
|
116 | 116 | author_email='marcin@rhodecode.com', |
|
117 | 117 | url=__url__, |
|
118 | 118 | setup_requires=setup_requirements, |
|
119 | 119 | install_requires=install_requirements, |
|
120 | 120 | tests_require=test_requirements, |
|
121 | 121 | zip_safe=False, |
|
122 | 122 | packages=find_packages(exclude=["docs", "tests*"]), |
|
123 | 123 | package_data=package_data, |
|
124 | 124 | include_package_data=True, |
|
125 | 125 | classifiers=[ |
|
126 | 126 | 'Development Status :: 6 - Mature', |
|
127 | 127 | 'Environment :: Web Environment', |
|
128 | 128 | 'Intended Audience :: Developers', |
|
129 | 129 | 'Operating System :: OS Independent', |
|
130 | 130 | 'Topic :: Software Development :: Version Control', |
|
131 | 131 | 'License :: OSI Approved :: Affero GNU General Public License v3 or later (AGPLv3+)', |
|
132 | 132 | 'Programming Language :: Python :: 2.7', |
|
133 | 133 | ], |
|
134 | 134 | message_extractors={ |
|
135 | 135 | 'rhodecode': [ |
|
136 | 136 | ('**.py', 'python', None), |
|
137 | 137 | ('**.js', 'javascript', None), |
|
138 | 138 | ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), |
|
139 | 139 | ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}), |
|
140 | 140 | ('public/**', 'ignore', None), |
|
141 | 141 | ] |
|
142 | 142 | }, |
|
143 | 143 | paster_plugins=['PasteScript'], |
|
144 | 144 | entry_points={ |
|
145 | 145 | 'enterprise.plugins1': [ |
|
146 | 146 | 'crowd=rhodecode.authentication.plugins.auth_crowd:plugin_factory', |
|
147 | 147 | 'headers=rhodecode.authentication.plugins.auth_headers:plugin_factory', |
|
148 | 148 | 'jasig_cas=rhodecode.authentication.plugins.auth_jasig_cas:plugin_factory', |
|
149 | 149 | 'ldap=rhodecode.authentication.plugins.auth_ldap:plugin_factory', |
|
150 | 150 | 'pam=rhodecode.authentication.plugins.auth_pam:plugin_factory', |
|
151 | 151 | 'rhodecode=rhodecode.authentication.plugins.auth_rhodecode:plugin_factory', |
|
152 | 152 | 'token=rhodecode.authentication.plugins.auth_token:plugin_factory', |
|
153 | 153 | ], |
|
154 | 154 | 'paste.app_factory': [ |
|
155 | 155 | 'main=rhodecode.config.middleware:make_pyramid_app', |
|
156 | 156 | ], |
|
157 | 157 | 'paste.global_paster_command': [ |
|
158 | 'setup-rhodecode=rhodecode.lib.paster_commands.setup_rhodecode:Command', | |
|
159 | 158 | 'ishell=rhodecode.lib.paster_commands.ishell:Command', |
|
160 | 159 | 'upgrade-db=rhodecode.lib.paster_commands.upgrade_db:UpgradeDb', |
|
161 | 160 | |
|
162 |
' |
|
|
161 | 'setup-rhodecode=rhodecode.lib.paster_commands.deprecated.setup_rhodecode:Command', | |
|
163 | 162 | 'celeryd=rhodecode.lib.paster_commands.deprecated.celeryd:Command', |
|
164 | 163 | ], |
|
165 | 164 | 'pyramid.pshell_runner': [ |
|
166 | 165 | 'ipython = rhodecode.lib.pyramid_shell:ipython_shell_runner', |
|
167 | 166 | ], |
|
168 | 167 | 'pytest11': [ |
|
169 | 168 | 'pylons=rhodecode.tests.pylons_plugin', |
|
170 | 169 | 'enterprise=rhodecode.tests.plugin', |
|
171 | 170 | ], |
|
172 | 171 | 'console_scripts': [ |
|
173 | 172 | 'rc-server=rhodecode.rcserver:main', |
|
174 | 173 | 'rc-setup-app=rhodecode.lib.rc_commands.setup_rc:main', |
|
175 | 174 | 'rc-upgrade-db=rhodecode.lib.rc_commands.upgrade_db:main', |
|
176 | 175 | 'rc-ishell=rhodecode.lib.rc_commands.ishell:main', |
|
177 | 176 | 'rc-ssh-wrapper=rhodecode.apps.ssh_support.lib.ssh_wrapper:main', |
|
178 | 177 | ], |
|
179 | 178 | 'beaker.backends': [ |
|
180 | 179 | 'memorylru_base=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerBase', |
|
181 | 180 | 'memorylru_debug=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerDebug' |
|
182 | 181 | ] |
|
183 | 182 | }, |
|
184 | 183 | ) |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now