author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Mon, 25 May 2009 12:21:06 +0200 | |
changeset 1912 | 2b9432262240 |
parent 1682 | 36bd5cba09de |
child 1977 | 606923dff11b |
permissions | -rw-r--r-- |
0 | 1 |
"""cubicweb-ctl commands and command handlers specific to the server.serverconfig |
2 |
||
3 |
:organization: Logilab |
|
1016
26387b836099
use datetime instead of mx.DateTime
sylvain.thenault@logilab.fr
parents:
136
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
0 | 5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 |
""" |
|
7 |
__docformat__ = "restructuredtext en" |
|
8 |
||
1912
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
9 |
import sys |
0 | 10 |
import os |
11 |
||
12 |
from logilab.common.configuration import REQUIRED, Configuration, ini_format_section |
|
1132 | 13 |
from logilab.common.clcommands import register_commands, cmd_run, pop_arg |
0 | 14 |
|
15 |
from cubicweb import AuthenticationError, ExecutionError, ConfigurationError |
|
1132 | 16 |
from cubicweb.toolsutils import (Command, CommandHandler, confirm, |
17 |
restrict_perms_to_user) |
|
0 | 18 |
from cubicweb.server.serverconfig import ServerConfiguration |
19 |
||
20 |
||
21 |
# utility functions ########################################################### |
|
22 |
||
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
23 |
def source_cnx(source, dbname=None, special_privs=False, verbose=True): |
0 | 24 |
"""open and return a connection to the system database defined in the |
25 |
given server.serverconfig |
|
26 |
""" |
|
27 |
from getpass import getpass |
|
28 |
from logilab.common.db import get_connection |
|
29 |
dbhost = source['db-host'] |
|
30 |
if dbname is None: |
|
31 |
dbname = source['db-name'] |
|
32 |
driver = source['db-driver'] |
|
33 |
print '**** connecting to %s database %s@%s' % (driver, dbname, dbhost), |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
34 |
if not verbose or (not special_privs and source.get('db-user')): |
0 | 35 |
user = source['db-user'] |
36 |
print 'as', user |
|
37 |
if source.get('db-password'): |
|
38 |
password = source['db-password'] |
|
39 |
else: |
|
40 |
password = getpass('password: ') |
|
41 |
else: |
|
42 |
print |
|
43 |
if special_privs: |
|
44 |
print 'WARNING' |
|
45 |
print 'the user will need the following special access rights on the database:' |
|
46 |
print special_privs |
|
47 |
print |
|
48 |
default_user = source.get('db-user', os.environ.get('USER', '')) |
|
49 |
user = raw_input('user (%r by default): ' % default_user) |
|
50 |
user = user or default_user |
|
51 |
if user == source.get('db-user') and source.get('db-password'): |
|
52 |
password = source['db-password'] |
|
53 |
else: |
|
54 |
password = getpass('password: ') |
|
55 |
return get_connection(driver, dbhost, dbname, user, password=password, |
|
56 |
port=source.get('db-port')) |
|
57 |
||
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
58 |
def system_source_cnx(source, dbms_system_base=False, |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
59 |
special_privs='CREATE/DROP DATABASE', verbose=True): |
0 | 60 |
"""shortcut to get a connextion to the application system database |
61 |
defined in the given config. If <dbms_system_base> is True, |
|
62 |
connect to the dbms system database instead (for task such as |
|
63 |
create/drop the application database) |
|
64 |
""" |
|
65 |
if dbms_system_base: |
|
66 |
from logilab.common.adbh import get_adv_func_helper |
|
67 |
system_db = get_adv_func_helper(source['db-driver']).system_database() |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
68 |
return source_cnx(source, system_db, special_privs=special_privs, verbose=verbose) |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
69 |
return source_cnx(source, special_privs=special_privs, verbose=verbose) |
0 | 70 |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
71 |
def _db_sys_cnx(source, what, db=None, user=None, verbose=True): |
0 | 72 |
"""return a connection on the RDMS system table (to create/drop a user |
73 |
or a database |
|
74 |
""" |
|
75 |
from logilab.common.adbh import get_adv_func_helper |
|
76 |
special_privs = '' |
|
77 |
driver = source['db-driver'] |
|
78 |
helper = get_adv_func_helper(driver) |
|
79 |
if user is not None and helper.users_support: |
|
80 |
special_privs += '%s USER' % what |
|
81 |
if db is not None: |
|
82 |
special_privs += ' %s DATABASE' % what |
|
83 |
# connect on the dbms system base to create our base |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
84 |
cnx = system_source_cnx(source, True, special_privs=special_privs, verbose=verbose) |
0 | 85 |
# disable autocommit (isolation_level(1)) because DROP and |
86 |
# CREATE DATABASE can't be executed in a transaction |
|
87 |
try: |
|
88 |
cnx.set_isolation_level(0) |
|
89 |
except AttributeError: |
|
90 |
# set_isolation_level() is psycopg specific |
|
91 |
pass |
|
92 |
return cnx |
|
1469 | 93 |
|
0 | 94 |
def generate_sources_file(sourcesfile, sourcescfg, keys=None): |
95 |
"""serialize repository'sources configuration into a INI like file |
|
96 |
||
97 |
the `keys` parameter may be used to sort sections |
|
98 |
""" |
|
99 |
from cubicweb.server.sources import SOURCE_TYPES |
|
100 |
if keys is None: |
|
101 |
keys = sourcescfg.keys() |
|
102 |
else: |
|
103 |
for key in sourcescfg: |
|
104 |
if not key in keys: |
|
105 |
keys.append(key) |
|
106 |
stream = open(sourcesfile, 'w') |
|
107 |
for uri in keys: |
|
108 |
sconfig = sourcescfg[uri] |
|
109 |
if isinstance(sconfig, dict): |
|
110 |
# get a Configuration object |
|
111 |
_sconfig = Configuration(options=SOURCE_TYPES[sconfig['adapter']].options) |
|
112 |
for attr, val in sconfig.items(): |
|
1469 | 113 |
if attr == 'uri': |
0 | 114 |
continue |
115 |
if attr == 'adapter': |
|
116 |
_sconfig.adapter = val |
|
117 |
else: |
|
118 |
_sconfig.set_option(attr, val) |
|
119 |
sconfig = _sconfig |
|
120 |
optsbysect = list(sconfig.options_by_section()) |
|
121 |
assert len(optsbysect) == 1 |
|
122 |
ini_format_section(stream, uri, optsbysect[0][1]) |
|
123 |
if hasattr(sconfig, 'adapter'): |
|
124 |
print >> stream |
|
125 |
print >> stream, '# adapter for this source (YOU SHOULD NOT CHANGE THIS)' |
|
126 |
print >> stream, 'adapter=%s' % sconfig.adapter |
|
127 |
print >> stream |
|
128 |
||
129 |
def repo_cnx(config): |
|
130 |
"""return a in-memory repository and a db api connection it""" |
|
131 |
from cubicweb.dbapi import in_memory_cnx |
|
132 |
from cubicweb.server.utils import manager_userpasswd |
|
133 |
try: |
|
134 |
login = config.sources()['admin']['login'] |
|
135 |
pwd = config.sources()['admin']['password'] |
|
136 |
except KeyError: |
|
137 |
login, pwd = manager_userpasswd() |
|
138 |
while True: |
|
139 |
try: |
|
140 |
return in_memory_cnx(config, login, pwd) |
|
141 |
except AuthenticationError: |
|
142 |
print 'wrong user/password' |
|
1682
36bd5cba09de
must reset cubes before next authentication
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1469
diff
changeset
|
143 |
# reset cubes else we'll have an assertion error on next retry |
36bd5cba09de
must reset cubes before next authentication
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1469
diff
changeset
|
144 |
config._cubes = None |
0 | 145 |
login, pwd = manager_userpasswd() |
1469 | 146 |
|
0 | 147 |
# repository specific command handlers ######################################## |
148 |
||
149 |
class RepositoryCreateHandler(CommandHandler): |
|
150 |
cmdname = 'create' |
|
151 |
cfgname = 'repository' |
|
152 |
||
153 |
def bootstrap(self, cubes, inputlevel=0): |
|
154 |
"""create an application by copying files from the given cube and by |
|
155 |
asking information necessary to build required configuration files |
|
156 |
""" |
|
157 |
from cubicweb.server.sources import SOURCE_TYPES |
|
158 |
config = self.config |
|
159 |
print 'application\'s repository configuration' |
|
160 |
print '-' * 72 |
|
161 |
config.input_config('email', inputlevel) |
|
162 |
if config.pyro_enabled(): |
|
163 |
config.input_config('pyro-server', inputlevel) |
|
164 |
print |
|
165 |
print 'repository sources configuration' |
|
166 |
print '-' * 72 |
|
167 |
sourcesfile = config.sources_file() |
|
168 |
sconfig = Configuration(options=SOURCE_TYPES['native'].options) |
|
169 |
sconfig.adapter = 'native' |
|
170 |
sconfig.input_config(inputlevel=inputlevel) |
|
171 |
sourcescfg = {'system': sconfig} |
|
172 |
while raw_input('enter another source [y/N]: ').strip().lower() == 'y': |
|
173 |
sourcetype = raw_input('source type (%s): ' % ', '.join(SOURCE_TYPES.keys())) |
|
174 |
sconfig = Configuration(options=SOURCE_TYPES[sourcetype].options) |
|
175 |
sconfig.adapter = sourcetype |
|
176 |
sourceuri = raw_input('source uri: ').strip() |
|
177 |
assert not sourceuri in sourcescfg |
|
178 |
sconfig.input_config(inputlevel=inputlevel) |
|
179 |
sourcescfg[sourceuri] = sconfig |
|
180 |
# module names look like cubes.mycube.themodule |
|
181 |
sourcecube = SOURCE_TYPES[sourcetype].module.split('.', 2)[1] |
|
182 |
# if the source adapter is coming from an external component, ensure |
|
183 |
# it's specified in used cubes |
|
184 |
if sourcecube != 'cubicweb' and not sourcecube in cubes: |
|
185 |
cubes.append(sourcecube) |
|
186 |
sconfig = Configuration(options=USER_OPTIONS) |
|
187 |
sconfig.input_config(inputlevel=inputlevel) |
|
188 |
sourcescfg['admin'] = sconfig |
|
189 |
generate_sources_file(sourcesfile, sourcescfg, ['admin', 'system']) |
|
190 |
restrict_perms_to_user(sourcesfile) |
|
191 |
# remember selected cubes for later initialization of the database |
|
192 |
config.write_bootstrap_cubes_file(cubes) |
|
1469 | 193 |
|
0 | 194 |
def postcreate(self): |
195 |
if confirm('do you want to create repository\'s system database?'): |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
196 |
verbosity = (self.config.mode == 'installed') and 'y' or 'n' |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
197 |
cmd_run('db-create', self.config.appid, '--verbose=%s' % verbosity) |
0 | 198 |
else: |
199 |
print 'nevermind, you can do it later using the db-create command' |
|
1469 | 200 |
|
0 | 201 |
USER_OPTIONS = ( |
202 |
('login', {'type' : 'string', |
|
203 |
'default': REQUIRED, |
|
204 |
'help': "cubicweb manager account's login " |
|
205 |
'(this user will be created)', |
|
206 |
'inputlevel': 0, |
|
207 |
}), |
|
208 |
('password', {'type' : 'password', |
|
209 |
'help': "cubicweb manager account's password", |
|
210 |
'inputlevel': 0, |
|
211 |
}), |
|
212 |
) |
|
213 |
||
214 |
||
215 |
class RepositoryDeleteHandler(CommandHandler): |
|
216 |
cmdname = 'delete' |
|
217 |
cfgname = 'repository' |
|
218 |
||
219 |
def cleanup(self): |
|
220 |
"""remove application's configuration and database""" |
|
221 |
from logilab.common.adbh import get_adv_func_helper |
|
222 |
source = self.config.sources()['system'] |
|
223 |
dbname = source['db-name'] |
|
224 |
helper = get_adv_func_helper(source['db-driver']) |
|
225 |
if confirm('delete database %s ?' % dbname): |
|
226 |
user = source['db-user'] or None |
|
227 |
cnx = _db_sys_cnx(source, 'DROP DATABASE', user=user) |
|
228 |
cursor = cnx.cursor() |
|
229 |
try: |
|
230 |
cursor.execute('DROP DATABASE %s' % dbname) |
|
231 |
print 'database %s dropped' % dbname |
|
232 |
# XXX should check we are not connected as user |
|
233 |
if user and helper.users_support and \ |
|
234 |
confirm('delete user %s ?' % user, default_is_yes=False): |
|
235 |
cursor.execute('DROP USER %s' % user) |
|
236 |
print 'user %s dropped' % user |
|
237 |
cnx.commit() |
|
238 |
except: |
|
239 |
cnx.rollback() |
|
240 |
raise |
|
241 |
||
1469 | 242 |
|
0 | 243 |
class RepositoryStartHandler(CommandHandler): |
244 |
cmdname = 'start' |
|
245 |
cfgname = 'repository' |
|
246 |
||
247 |
def start_command(self, ctlconf, debug): |
|
248 |
command = ['cubicweb-ctl start-repository '] |
|
249 |
if debug: |
|
250 |
command.append('--debug') |
|
251 |
command.append(self.config.appid) |
|
252 |
return ' '.join(command) |
|
1469 | 253 |
|
0 | 254 |
|
255 |
class RepositoryStopHandler(CommandHandler): |
|
256 |
cmdname = 'stop' |
|
257 |
cfgname = 'repository' |
|
258 |
||
259 |
def poststop(self): |
|
260 |
"""if pyro is enabled, ensure the repository is correctly |
|
261 |
unregistered |
|
262 |
""" |
|
263 |
if self.config.pyro_enabled(): |
|
264 |
from cubicweb.server.repository import pyro_unregister |
|
265 |
pyro_unregister(self.config) |
|
1469 | 266 |
|
0 | 267 |
|
268 |
# repository specific commands ################################################ |
|
269 |
class CreateApplicationDBCommand(Command): |
|
270 |
"""Create the system database of an application (run after 'create'). |
|
1469 | 271 |
|
0 | 272 |
You will be prompted for a login / password to use to connect to |
273 |
the system database. The given user should have almost all rights |
|
274 |
on the database (ie a super user on the dbms allowed to create |
|
275 |
database, users, languages...). |
|
276 |
||
277 |
<application> |
|
278 |
the identifier of the application to initialize. |
|
279 |
""" |
|
280 |
name = 'db-create' |
|
281 |
arguments = '<application>' |
|
1469 | 282 |
|
0 | 283 |
options = ( |
284 |
("create-db", |
|
285 |
{'short': 'c', 'type': "yn", 'metavar': '<y or n>', |
|
286 |
'default': True, |
|
287 |
'help': 'create the database (yes by default)'}), |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
288 |
("verbose", |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
289 |
{'short': 'v', 'type' : 'yn', 'metavar': '<verbose>', |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
290 |
'default': 'n', |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
291 |
'help': 'verbose mode: will ask all possible configuration questions', |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
292 |
} |
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
293 |
), |
0 | 294 |
) |
295 |
def run(self, args): |
|
296 |
"""run the command with its specific arguments""" |
|
297 |
from logilab.common.adbh import get_adv_func_helper |
|
298 |
from indexer import get_indexer |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
299 |
verbose = self.get('verbose') |
0 | 300 |
appid = pop_arg(args, msg="No application specified !") |
301 |
config = ServerConfiguration.config_for(appid) |
|
302 |
create_db = self.config.create_db |
|
303 |
source = config.sources()['system'] |
|
304 |
driver = source['db-driver'] |
|
305 |
helper = get_adv_func_helper(driver) |
|
306 |
if create_db: |
|
307 |
# connect on the dbms system base to create our base |
|
136
ff51a18c66a3
ask less questions on instance creation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
308 |
dbcnx = _db_sys_cnx(source, 'CREATE DATABASE and / or USER', verbose=verbose) |
0 | 309 |
cursor = dbcnx.cursor() |
310 |
try: |
|
311 |
if helper.users_support: |
|
312 |
user = source['db-user'] |
|
313 |
if not helper.user_exists(cursor, user) and \ |
|
314 |
confirm('create db user %s ?' % user, default_is_yes=False): |
|
315 |
helper.create_user(source['db-user'], source['db-password']) |
|
316 |
print 'user %s created' % user |
|
317 |
dbname = source['db-name'] |
|
318 |
if dbname in helper.list_databases(cursor): |
|
319 |
if confirm('DB %s already exists -- do you want to drop it ?' % dbname): |
|
320 |
cursor.execute('DROP DATABASE %s' % dbname) |
|
321 |
else: |
|
322 |
return |
|
323 |
if dbcnx.logged_user != source['db-user']: |
|
324 |
helper.create_database(cursor, dbname, source['db-user'], |
|
325 |
source['db-encoding']) |
|
326 |
else: |
|
327 |
helper.create_database(cursor, dbname, |
|
328 |
encoding=source['db-encoding']) |
|
329 |
dbcnx.commit() |
|
330 |
print 'database %s created' % source['db-name'] |
|
331 |
except: |
|
332 |
dbcnx.rollback() |
|
333 |
raise |
|
1469 | 334 |
cnx = system_source_cnx(source, special_privs='LANGUAGE C', verbose=verbose) |
0 | 335 |
cursor = cnx.cursor() |
336 |
indexer = get_indexer(driver) |
|
337 |
indexer.init_extensions(cursor) |
|
1469 | 338 |
# postgres specific stuff |
0 | 339 |
if driver == 'postgres': |
340 |
# install plpythonu/plpgsql language if not installed by the cube |
|
341 |
for extlang in ('plpythonu', 'plpgsql'): |
|
342 |
helper.create_language(cursor, extlang) |
|
343 |
cursor.close() |
|
344 |
cnx.commit() |
|
345 |
print 'database for application %s created and necessary extensions installed' % appid |
|
346 |
print |
|
347 |
if confirm('do you want to initialize the system database?'): |
|
348 |
cmd_run('db-init', config.appid) |
|
349 |
else: |
|
350 |
print 'nevermind, you can do it later using the db-init command' |
|
351 |
||
1469 | 352 |
|
0 | 353 |
class InitApplicationCommand(Command): |
354 |
"""Initialize the system database of an application (run after 'db-create'). |
|
1469 | 355 |
|
0 | 356 |
You will be prompted for a login / password to use to connect to |
357 |
the system database. The given user should have the create tables, |
|
358 |
and grant permissions. |
|
359 |
||
360 |
<application> |
|
361 |
the identifier of the application to initialize. |
|
362 |
""" |
|
363 |
name = 'db-init' |
|
364 |
arguments = '<application>' |
|
1469 | 365 |
|
0 | 366 |
options = ( |
367 |
("drop", |
|
368 |
{'short': 'd', 'action': 'store_true', |
|
369 |
'default': False, |
|
370 |
'help': 'insert drop statements to remove previously existant \ |
|
371 |
tables, indexes... (no by default)'}), |
|
372 |
) |
|
373 |
||
374 |
def run(self, args): |
|
375 |
from cubicweb.server import init_repository |
|
376 |
appid = pop_arg(args, msg="No application specified !") |
|
377 |
config = ServerConfiguration.config_for(appid) |
|
378 |
init_repository(config, drop=self.config.drop) |
|
379 |
||
380 |
||
381 |
class GrantUserOnApplicationCommand(Command): |
|
382 |
"""Grant a database user on a repository system database. |
|
1469 | 383 |
|
0 | 384 |
<application> |
385 |
the identifier of the application |
|
386 |
<user> |
|
387 |
the database's user requiring grant access |
|
388 |
""" |
|
389 |
name = 'db-grant-user' |
|
390 |
arguments = '<application> <user>' |
|
391 |
||
392 |
options = ( |
|
393 |
("set-owner", |
|
1469 | 394 |
{'short': 'o', 'type' : "yn", 'metavar' : '<yes or no>', |
0 | 395 |
'default' : False, |
396 |
'help': 'Set the user as tables owner if yes (no by default).'} |
|
397 |
), |
|
398 |
) |
|
399 |
def run(self, args): |
|
400 |
"""run the command with its specific arguments""" |
|
401 |
from cubicweb.server.sqlutils import sqlexec, sqlgrants |
|
402 |
appid = pop_arg(args, 1, msg="No application specified !") |
|
403 |
user = pop_arg(args, msg="No user specified !") |
|
404 |
config = ServerConfiguration.config_for(appid) |
|
405 |
source = config.sources()['system'] |
|
406 |
set_owner = self.config.set_owner |
|
407 |
cnx = system_source_cnx(source, special_privs='GRANT') |
|
408 |
cursor = cnx.cursor() |
|
409 |
schema = config.load_schema() |
|
410 |
try: |
|
411 |
sqlexec(sqlgrants(schema, source['db-driver'], user, |
|
412 |
set_owner=set_owner), cursor) |
|
413 |
except Exception, ex: |
|
414 |
cnx.rollback() |
|
415 |
import traceback |
|
416 |
traceback.print_exc() |
|
417 |
print 'An error occured:', ex |
|
418 |
else: |
|
419 |
cnx.commit() |
|
420 |
print 'grants given to %s on application %s' % (appid, user) |
|
421 |
||
1912
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
422 |
class ResetAdminPasswordCommand(Command): |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
423 |
"""Reset the administrator password. |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
424 |
|
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
425 |
<application> |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
426 |
the identifier of the application |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
427 |
""" |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
428 |
name = 'reset-admin-pwd' |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
429 |
arguments = '<application>' |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
430 |
|
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
431 |
def run(self, args): |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
432 |
"""run the command with its specific arguments""" |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
433 |
from cubicweb.server.sqlutils import sqlexec, SQL_PREFIX |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
434 |
from cubicweb.server.utils import crypt_password, manager_userpasswd |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
435 |
appid = pop_arg(args, 1, msg="No application specified !") |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
436 |
config = ServerConfiguration.config_for(appid) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
437 |
sourcescfg = config.sources() |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
438 |
try: |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
439 |
adminlogin = sourcescfg['admin']['login'] |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
440 |
except KeyError: |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
441 |
print 'could not get cubicweb administrator login' |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
442 |
sys.exit(1) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
443 |
cnx = source_cnx(sourcescfg['system']) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
444 |
cursor = cnx.cursor() |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
445 |
_, passwd = manager_userpasswd(adminlogin, confirm=True, |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
446 |
passwdmsg='new password for %s' % adminlogin) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
447 |
try: |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
448 |
sqlexec("UPDATE %(sp)sCWUser SET %(sp)supassword='%(p)s' WHERE %(sp)slogin='%(l)s'" |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
449 |
% {'sp': SQL_PREFIX, |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
450 |
'p': crypt_password(passwd), 'l': adminlogin}, |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
451 |
cursor, withpb=False) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
452 |
sconfig = Configuration(options=USER_OPTIONS) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
453 |
sconfig['login'] = adminlogin |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
454 |
sconfig['password'] = passwd |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
455 |
sourcescfg['admin'] = sconfig |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
456 |
sourcesfile = config.sources_file() |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
457 |
generate_sources_file(sourcesfile, sourcescfg) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
458 |
restrict_perms_to_user(sourcesfile) |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
459 |
except Exception, ex: |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
460 |
cnx.rollback() |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
461 |
import traceback |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
462 |
traceback.print_exc() |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
463 |
print 'An error occured:', ex |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
464 |
else: |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
465 |
cnx.commit() |
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
466 |
print 'password reset, sources file regenerated' |
0 | 467 |
|
1469 | 468 |
|
0 | 469 |
class StartRepositoryCommand(Command): |
470 |
"""Start an CubicWeb RQL server for a given application. |
|
1469 | 471 |
|
0 | 472 |
The server will be accessible through pyro |
473 |
||
474 |
<application> |
|
475 |
the identifier of the application to initialize. |
|
476 |
""" |
|
477 |
name = 'start-repository' |
|
478 |
arguments = '<application>' |
|
1469 | 479 |
|
0 | 480 |
options = ( |
481 |
("debug", |
|
482 |
{'short': 'D', 'action' : 'store_true', |
|
483 |
'help': 'start server in debug mode.'}), |
|
484 |
) |
|
485 |
||
486 |
def run(self, args): |
|
487 |
from cubicweb.server.server import RepositoryServer |
|
488 |
appid = pop_arg(args, msg="No application specified !") |
|
489 |
config = ServerConfiguration.config_for(appid) |
|
490 |
debug = self.config.debug |
|
491 |
# create the server |
|
492 |
server = RepositoryServer(config, debug) |
|
493 |
# go ! (don't daemonize in debug mode) |
|
494 |
if not debug and server.daemonize(config['pid-file']) == -1: |
|
495 |
return |
|
496 |
uid = config['uid'] |
|
497 |
if uid is not None: |
|
498 |
try: |
|
499 |
uid = int(uid) |
|
500 |
except ValueError: |
|
501 |
from pwd import getpwnam |
|
502 |
uid = getpwnam(uid).pw_uid |
|
503 |
os.setuid(uid) |
|
504 |
server.install_sig_handlers() |
|
505 |
server.connect(config['host'], 0) |
|
506 |
server.run() |
|
507 |
||
508 |
||
509 |
def _remote_dump(host, appid, output, sudo=False): |
|
510 |
dmpcmd = 'cubicweb-ctl db-dump -o /tmp/%s.dump %s' % (appid, appid) |
|
511 |
if sudo: |
|
512 |
dmpcmd = 'sudo %s' % (dmpcmd) |
|
513 |
dmpcmd = 'ssh -t %s "%s"' % (host, dmpcmd) |
|
514 |
print dmpcmd |
|
515 |
if os.system(dmpcmd): |
|
516 |
raise ExecutionError('Error while dumping the database') |
|
517 |
if output is None: |
|
1016
26387b836099
use datetime instead of mx.DateTime
sylvain.thenault@logilab.fr
parents:
136
diff
changeset
|
518 |
from datetime import date |
26387b836099
use datetime instead of mx.DateTime
sylvain.thenault@logilab.fr
parents:
136
diff
changeset
|
519 |
date = date.today().strftime('%Y-%m-%d') |
0 | 520 |
output = '%s-%s.dump' % (appid, date) |
521 |
cmd = 'scp %s:/tmp/%s.dump %s' % (host, appid, output) |
|
522 |
print cmd |
|
523 |
if os.system(cmd): |
|
524 |
raise ExecutionError('Error while retrieving the dump') |
|
525 |
rmcmd = 'ssh -t %s "rm -f /tmp/%s.dump"' % (host, appid) |
|
526 |
print rmcmd |
|
1251
af40e615dc89
introduce a 'cw_' prefix on entity table and column names so we don't conflict with sql or DBMS specific keywords
sylvain.thenault@logilab.fr
parents:
136
diff
changeset
|
527 |
if os.system(rmcmd) and not confirm( |
af40e615dc89
introduce a 'cw_' prefix on entity table and column names so we don't conflict with sql or DBMS specific keywords
sylvain.thenault@logilab.fr
parents:
136
diff
changeset
|
528 |
'an error occured while deleting remote dump. Continue anyway?'): |
0 | 529 |
raise ExecutionError('Error while deleting remote dump') |
530 |
||
531 |
def _local_dump(appid, output): |
|
532 |
config = ServerConfiguration.config_for(appid) |
|
533 |
# schema=1 to avoid unnecessary schema loading |
|
534 |
mih = config.migration_handler(connect=False, schema=1) |
|
535 |
mih.backup_database(output, askconfirm=False) |
|
536 |
||
537 |
def _local_restore(appid, backupfile, drop): |
|
538 |
config = ServerConfiguration.config_for(appid) |
|
539 |
# schema=1 to avoid unnecessary schema loading |
|
540 |
mih = config.migration_handler(connect=False, schema=1) |
|
541 |
mih.restore_database(backupfile, drop) |
|
542 |
repo = mih.repo_connect() |
|
543 |
# version of the database |
|
544 |
dbversions = repo.get_versions() |
|
545 |
mih.shutdown() |
|
546 |
if not dbversions: |
|
547 |
print "bad or missing version information in the database, don't upgrade file system" |
|
548 |
return |
|
549 |
# version of installed software |
|
550 |
eversion = dbversions['cubicweb'] |
|
551 |
status = application_status(config, eversion, dbversions) |
|
552 |
# * database version > installed software |
|
553 |
if status == 'needsoftupgrade': |
|
554 |
print "database is using some earlier version than installed software!" |
|
555 |
print "please upgrade your software and then upgrade the instance" |
|
556 |
print "using command 'cubicweb-ctl upgrade %s'" % config.appid |
|
557 |
return |
|
558 |
# * database version < installed software, an upgrade will be necessary |
|
559 |
# anyway, just rewrite vc.conf and warn user he has to upgrade |
|
560 |
if status == 'needapplupgrade': |
|
561 |
print "database is using some older version than installed software." |
|
562 |
print "You'll have to upgrade the instance using command" |
|
563 |
print "'cubicweb-ctl upgrade %s'" % config.appid |
|
564 |
return |
|
565 |
# * database version = installed software, database version = instance fs version |
|
566 |
# ok! |
|
567 |
||
568 |
||
569 |
def application_status(config, cubicwebapplversion, vcconf): |
|
570 |
cubicwebversion = config.cubicweb_version() |
|
571 |
if cubicwebapplversion > cubicwebversion: |
|
572 |
return 'needsoftupgrade' |
|
573 |
if cubicwebapplversion < cubicwebversion: |
|
574 |
return 'needapplupgrade' |
|
575 |
for cube in config.cubes(): |
|
576 |
try: |
|
577 |
softversion = config.cube_version(cube) |
|
578 |
except ConfigurationError: |
|
579 |
print "no cube version information for %s, is the cube installed?" % cube |
|
580 |
continue |
|
581 |
try: |
|
582 |
applversion = vcconf[cube] |
|
583 |
except KeyError: |
|
584 |
print "no cube version information for %s in version configuration" % cube |
|
1469 | 585 |
continue |
0 | 586 |
if softversion == applversion: |
587 |
continue |
|
588 |
if softversion > applversion: |
|
589 |
return 'needsoftupgrade' |
|
590 |
elif softversion < applversion: |
|
591 |
return 'needapplupgrade' |
|
592 |
return None |
|
1469 | 593 |
|
0 | 594 |
|
595 |
class DBDumpCommand(Command): |
|
596 |
"""Backup the system database of an application. |
|
1469 | 597 |
|
0 | 598 |
<application> |
599 |
the identifier of the application to backup |
|
600 |
format [[user@]host:]appname |
|
601 |
""" |
|
602 |
name = 'db-dump' |
|
603 |
arguments = '<application>' |
|
604 |
||
605 |
options = ( |
|
606 |
("output", |
|
1469 | 607 |
{'short': 'o', 'type' : "string", 'metavar' : '<file>', |
0 | 608 |
'default' : None, |
609 |
'help': 'Specify the backup file where the backup will be stored.'} |
|
610 |
), |
|
611 |
('sudo', |
|
612 |
{'short': 's', 'action' : 'store_true', |
|
613 |
'default' : False, |
|
614 |
'help': 'Use sudo on the remote host.'} |
|
615 |
), |
|
616 |
) |
|
617 |
||
618 |
def run(self, args): |
|
619 |
appid = pop_arg(args, 1, msg="No application specified !") |
|
620 |
if ':' in appid: |
|
621 |
host, appid = appid.split(':') |
|
622 |
_remote_dump(host, appid, self.config.output, self.config.sudo) |
|
623 |
else: |
|
624 |
_local_dump(appid, self.config.output) |
|
625 |
||
626 |
||
627 |
class DBRestoreCommand(Command): |
|
628 |
"""Restore the system database of an application. |
|
1469 | 629 |
|
0 | 630 |
<application> |
631 |
the identifier of the application to restore |
|
632 |
""" |
|
633 |
name = 'db-restore' |
|
634 |
arguments = '<application> <backupfile>' |
|
635 |
||
636 |
options = ( |
|
637 |
("no-drop", |
|
1469 | 638 |
{'short': 'n', 'action' : 'store_true', |
0 | 639 |
'default' : False, |
640 |
'help': 'for some reason the database doesn\'t exist and so ' |
|
641 |
'should not be dropped.'} |
|
642 |
), |
|
643 |
) |
|
644 |
||
645 |
def run(self, args): |
|
646 |
appid = pop_arg(args, 1, msg="No application specified !") |
|
647 |
backupfile = pop_arg(args, msg="No backup file specified !") |
|
648 |
_local_restore(appid, backupfile, not self.config.no_drop) |
|
649 |
||
650 |
||
651 |
class DBCopyCommand(Command): |
|
652 |
"""Copy the system database of an application (backup and restore). |
|
1469 | 653 |
|
0 | 654 |
<src-application> |
655 |
the identifier of the application to backup |
|
656 |
format [[user@]host:]appname |
|
657 |
||
658 |
<dest-application> |
|
659 |
the identifier of the application to restore |
|
660 |
""" |
|
661 |
name = 'db-copy' |
|
662 |
arguments = '<src-application> <dest-application>' |
|
663 |
||
664 |
options = ( |
|
665 |
("no-drop", |
|
1469 | 666 |
{'short': 'n', 'action' : 'store_true', |
0 | 667 |
'default' : False, |
668 |
'help': 'For some reason the database doesn\'t exist and so ' |
|
669 |
'should not be dropped.'} |
|
670 |
), |
|
671 |
("keep-dump", |
|
672 |
{'short': 'k', 'action' : 'store_true', |
|
673 |
'default' : False, |
|
674 |
'help': 'Specify that the dump file should not be automatically removed.'} |
|
675 |
), |
|
676 |
('sudo', |
|
677 |
{'short': 's', 'action' : 'store_true', |
|
678 |
'default' : False, |
|
679 |
'help': 'Use sudo on the remote host.'} |
|
680 |
), |
|
681 |
) |
|
682 |
||
683 |
def run(self, args): |
|
684 |
import tempfile |
|
685 |
srcappid = pop_arg(args, 1, msg="No source application specified !") |
|
686 |
destappid = pop_arg(args, msg="No destination application specified !") |
|
687 |
output = tempfile.mktemp() |
|
688 |
if ':' in srcappid: |
|
689 |
host, srcappid = srcappid.split(':') |
|
690 |
_remote_dump(host, srcappid, output, self.config.sudo) |
|
691 |
else: |
|
692 |
_local_dump(srcappid, output) |
|
693 |
_local_restore(destappid, output, not self.config.no_drop) |
|
694 |
if self.config.keep_dump: |
|
695 |
print 'you can get the dump file at', output |
|
696 |
else: |
|
697 |
os.remove(output) |
|
698 |
||
1469 | 699 |
|
0 | 700 |
class CheckRepositoryCommand(Command): |
701 |
"""Check integrity of the system database of an application. |
|
1469 | 702 |
|
0 | 703 |
<application> |
704 |
the identifier of the application to check |
|
705 |
""" |
|
706 |
name = 'db-check' |
|
707 |
arguments = '<application>' |
|
708 |
||
709 |
options = ( |
|
710 |
("checks", |
|
1469 | 711 |
{'short': 'c', 'type' : "csv", 'metavar' : '<check list>', |
0 | 712 |
'default' : ('entities', 'relations', 'metadata', 'schema', 'text_index'), |
713 |
'help': 'Comma separated list of check to run. By default run all \ |
|
714 |
checks, i.e. entities, relations, text_index and metadata.'} |
|
715 |
), |
|
1469 | 716 |
|
0 | 717 |
("autofix", |
1469 | 718 |
{'short': 'a', 'type' : "yn", 'metavar' : '<yes or no>', |
0 | 719 |
'default' : False, |
720 |
'help': 'Automatically correct integrity problems if this option \ |
|
721 |
is set to "y" or "yes", else only display them'} |
|
722 |
), |
|
723 |
("reindex", |
|
1469 | 724 |
{'short': 'r', 'type' : "yn", 'metavar' : '<yes or no>', |
0 | 725 |
'default' : False, |
726 |
'help': 're-indexes the database for full text search if this \ |
|
727 |
option is set to "y" or "yes" (may be long for large database).'} |
|
728 |
), |
|
1469 | 729 |
|
0 | 730 |
) |
731 |
||
732 |
def run(self, args): |
|
733 |
from cubicweb.server.checkintegrity import check |
|
734 |
appid = pop_arg(args, 1, msg="No application specified !") |
|
735 |
config = ServerConfiguration.config_for(appid) |
|
736 |
repo, cnx = repo_cnx(config) |
|
737 |
check(repo, cnx, |
|
738 |
self.config.checks, self.config.reindex, self.config.autofix) |
|
739 |
||
740 |
||
741 |
class RebuildFTICommand(Command): |
|
742 |
"""Rebuild the full-text index of the system database of an application. |
|
1469 | 743 |
|
0 | 744 |
<application> |
745 |
the identifier of the application to rebuild |
|
746 |
""" |
|
747 |
name = 'db-rebuild-fti' |
|
748 |
arguments = '<application>' |
|
749 |
||
750 |
options = () |
|
751 |
||
752 |
def run(self, args): |
|
753 |
from cubicweb.server.checkintegrity import reindex_entities |
|
754 |
appid = pop_arg(args, 1, msg="No application specified !") |
|
755 |
config = ServerConfiguration.config_for(appid) |
|
756 |
repo, cnx = repo_cnx(config) |
|
757 |
session = repo._get_session(cnx.sessionid, setpool=True) |
|
758 |
reindex_entities(repo.schema, session) |
|
759 |
cnx.commit() |
|
760 |
||
1469 | 761 |
|
0 | 762 |
class SynchronizeApplicationSchemaCommand(Command): |
763 |
"""Synchronize persistent schema with cube schema. |
|
1469 | 764 |
|
0 | 765 |
Will synchronize common stuff between the cube schema and the |
766 |
actual persistent schema, but will not add/remove any entity or relation. |
|
767 |
||
768 |
<application> |
|
769 |
the identifier of the application to synchronize. |
|
770 |
""" |
|
771 |
name = 'schema-sync' |
|
772 |
arguments = '<application>' |
|
773 |
||
774 |
def run(self, args): |
|
775 |
appid = pop_arg(args, msg="No application specified !") |
|
776 |
config = ServerConfiguration.config_for(appid) |
|
777 |
mih = config.migration_handler() |
|
778 |
mih.cmd_synchronize_schema() |
|
779 |
||
780 |
||
1469 | 781 |
register_commands( (CreateApplicationDBCommand, |
0 | 782 |
InitApplicationCommand, |
783 |
GrantUserOnApplicationCommand, |
|
1912
2b9432262240
[server] provide a new reset-admin-pwd command
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1682
diff
changeset
|
784 |
ResetAdminPasswordCommand, |
0 | 785 |
StartRepositoryCommand, |
786 |
DBDumpCommand, |
|
787 |
DBRestoreCommand, |
|
788 |
DBCopyCommand, |
|
789 |
CheckRepositoryCommand, |
|
790 |
RebuildFTICommand, |
|
791 |
SynchronizeApplicationSchemaCommand, |
|
792 |
) ) |